FIX_SI_ENHANCECMENT_AGESLAB

This commit is contained in:
velz 2024-06-04 09:08:39 +05:30
parent 00dd88a6eb
commit aa58354611

View File

@ -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 '<br>';
$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 '<br>';
$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
}