From aa58354611f603cb3da6e050fe016ccacaa5a0a8 Mon Sep 17 00:00:00 2001 From: velz Date: Tue, 4 Jun 2024 09:08:39 +0530 Subject: [PATCH] FIX_SI_ENHANCECMENT_AGESLAB --- app/Helpers/excel_util_helper.php | 40 ++++++++++++++++++------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php index 07794f45..200ada56 100644 --- a/app/Helpers/excel_util_helper.php +++ b/app/Helpers/excel_util_helper.php @@ -199,35 +199,43 @@ if(!function_exists('check_si')) if(!$is_si_found && $slab_value['si'] == $received_si) //match si amount { + // echo 'found'; $is_si_found = true; } // check age slab - if($row[3] != null && DateTime::createFromFormat('d-M-Y', $row[3]) !== false)// dob + if(in_array(strtoupper($row['current_action']), ['I','A','DA'])) { - $dob = change_date_format($row[3],'d-M-Y','Y-m-d'); - // echo $row[3].' - '.$dob;echo '
'; - $currentDateTime = new DateTime();//die(); - $passedDateTime = new DateTime($dob); - $interval = $currentDateTime->diff($passedDateTime); - if(!$is_age_slab_found) + if($row[3] != null && DateTime::createFromFormat('d-M-Y', $row[3]) !== false)// dob { - if(isset($slab_value['age_from']) && isset($slab_value['age_to'])) + $dob = change_date_format($row[3],'d-M-Y','Y-m-d'); + // echo $row[3].' - '.$dob;echo '
'; + $currentDateTime = new DateTime();//die(); + $passedDateTime = new DateTime($dob); + $interval = $currentDateTime->diff($passedDateTime); + if(!$is_age_slab_found) { - if($slab_value['age_from'] !== null && $slab_value['age_to'] !== null && $slab_value['age_from'] <= $interval->y && $slab_value['age_to'] >= $interval->y && $slab_value['si'] == $received_si) + if(isset($slab_value['age_from']) && isset($slab_value['age_to'])) { - $is_age_slab_found = true;// send true if age slab found + if($slab_value['age_from'] !== null && $slab_value['age_to'] !== null && $slab_value['age_from'] <= $interval->y && $slab_value['age_to'] >= $interval->y && $slab_value['si'] == $received_si) + { + $is_age_slab_found = true;// send true if age slab found + } } + else + { + $is_age_slab_found = true;// send true if age conditin is not applicable + } + } - else - { - $is_age_slab_found = true;// send true if age conditin is not applicable - } - } + } + else + { + $is_age_slab_found = true;// send true if age conditin is not applicable }//end of check age slab - } + }// end of for loop }