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
}