CHANGE_SENDMAILNOTIFICATION_FOR_PREMIUM_SUMMERY : RV
This commit is contained in:
parent
fb2e149ea7
commit
5a5c29e886
@ -239,22 +239,22 @@ class sendMailNotification
|
||||
$premium = '';
|
||||
$gst_forself = '';
|
||||
|
||||
// if(checkFamilyFloaters($policy_premium_data, $client_policy_data, $inner_item)){
|
||||
|
||||
if($policy_premium_data['premium_type'] == 2){
|
||||
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
|
||||
}else{
|
||||
if ($inner_item['relationship'] == 'Self') {
|
||||
$payable_employee_array['si_amount'] = $inner_item['basic_cover_si'];
|
||||
$payable_employee_array['self_premium'] = $inner_item['rata_premimum'];
|
||||
$payable_employee_array['self_gst'] = $inner_item['gst'];
|
||||
}
|
||||
empty($inner_item['basic_cover_si']) ? $si = 0 : $si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
|
||||
if($policy_premium_data['premium_type'] == 2){
|
||||
$si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
|
||||
}else{
|
||||
if ($inner_item['relationship'] == 'Self') {
|
||||
$payable_employee_array['si_amount'] = $inner_item['basic_cover_si'];
|
||||
$payable_employee_array['self_premium'] = $inner_item['rata_premimum'];
|
||||
$payable_employee_array['self_gst'] = $inner_item['gst'];
|
||||
}
|
||||
empty($inner_item['basic_cover_si']) ? $si = 0 : $si = '₹ ' .format_indian_number($inner_item['basic_cover_si']);
|
||||
}
|
||||
|
||||
// Premium summery for show and hide the Additional premium data
|
||||
if($client_policy_data['is_premium_summery'] == 1){
|
||||
$premium = '₹ ' .format_indian_number(round($inner_item['rata_premimum']));
|
||||
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
|
||||
// }
|
||||
$gst_forself = '₹ ' .format_indian_number(round($inner_item['gst']));
|
||||
}
|
||||
|
||||
$temp_data .= '<tr>';
|
||||
$temp_data .= '<td>' . $inner_item['name'] . ($inner_item['relationship'] == 'Self' ? ' (' . $inner_item['emp_code'] . ')' : '') . '</td>';
|
||||
@ -268,7 +268,7 @@ class sendMailNotification
|
||||
|
||||
if ($si != 0 && count($item) != 1 && $is_si_set == 0) {
|
||||
|
||||
$temp_data .= '<td rowspan=' . $rowspan . '>' . $si . '</td>';
|
||||
$temp_data .= '<td style="vertical-align: middle !important;" rowspan=' . $rowspan . '>' . $si . '</td>';
|
||||
$is_si_set = 1;
|
||||
|
||||
} else {
|
||||
@ -284,7 +284,7 @@ class sendMailNotification
|
||||
}
|
||||
|
||||
// Only Display SI Topup and Dependent Addon
|
||||
if ($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) {
|
||||
if (($inner_item['is_addon'] == 2 || $inner_item['is_addon'] == 3) && $client_policy_data['is_premium_summery'] == 1) {
|
||||
$temp_data .= '<td>' . $premium . '</td>';
|
||||
$temp_data .= '<td>' . $gst_forself . '</td>';
|
||||
}
|
||||
@ -316,7 +316,7 @@ class sendMailNotification
|
||||
$table_content .= '<th>Sum Insured</th>';
|
||||
|
||||
// Only Display SI Topup and Dependent Addon
|
||||
if ($is_addon == 2 || $is_addon == 3) {
|
||||
if (($is_addon == 2 || $is_addon == 3) && $client_policy_data['is_premium_summery'] == 1) {
|
||||
$table_content .= '<th>Premium</th>';
|
||||
$table_content .= '<th>GST</th>';
|
||||
}
|
||||
@ -328,7 +328,7 @@ class sendMailNotification
|
||||
$table_content .= '<tbody style="text-align: center;">' . $temp_data . '</tbody>';
|
||||
$table_content .= '</table></div>';
|
||||
|
||||
if ($is_addon == 2 || $is_addon == 3) {
|
||||
if (($is_addon == 2 || $is_addon == 3) && $client_policy_data['is_premium_summery'] == 1) {
|
||||
$addon_list_array = [
|
||||
'policy_name' => $policy_name_for_policy_type,
|
||||
'addtional_premium' => round($addtional_premium),
|
||||
@ -345,7 +345,7 @@ class sendMailNotification
|
||||
// dd($payable_employee_array);
|
||||
// dd(count($payable_employee_array['emp_data']));
|
||||
|
||||
if(isset($payable_employee_array['emp_data']) && count($payable_employee_array['emp_data']) > 0){
|
||||
if(isset($payable_employee_array['emp_data']) && count($payable_employee_array['emp_data']) > 0 && $client_policy_data['is_premium_summery'] == 1){
|
||||
|
||||
$table_content .= '<div style="text-align: left; font-size: 12px;"><div style="text-align:left;"><h4>Policy Type :';
|
||||
$temp_data = '';
|
||||
@ -401,30 +401,35 @@ class sendMailNotification
|
||||
|
||||
// dd($si);
|
||||
|
||||
if($policy_premium_data['premium_type'] == 2){
|
||||
// Premium summery for show and hide the Additional premium data
|
||||
if($client_policy_data['is_premium_summery'] == 1){
|
||||
if($policy_premium_data['premium_type'] == 2){
|
||||
|
||||
$temp_data .= '<td>' . $si . '</td>';
|
||||
$temp_data .= '<td>' . $premium . '</td>';
|
||||
$temp_data .= '<td>' . $gst_forself . '</td>';
|
||||
$temp_data .= '<td>' . $si . '</td>';
|
||||
$temp_data .= '<td>' . $premium . '</td>';
|
||||
$temp_data .= '<td>' . $gst_forself . '</td>';
|
||||
|
||||
}else{
|
||||
|
||||
if($policy_premium_data['premium_type'] == 1){
|
||||
|
||||
$temp_data .= (($si != 0 && count($item) != 1) ? ('<td rowspan='.$rowspan.'>' . $si . '</td>') : ($si == 0 ? "" : '<td>' . $si . '</td>') );
|
||||
$temp_data .= (($premium != 0 && count($item) != 1) ? ('<td rowspan='.$rowspan.'>' . $premium . '</td>') : ($premium == 0 ? "" : '<td>' . $premium . '</td>') );
|
||||
$temp_data .= (($gst_forself != 0 && count($item) != 1) ? ('<td rowspan='.$rowspan.'>' . $gst_forself . '</td>') : ($gst_forself == 0 ? "" : '<td>' . $gst_forself . '</td>') );
|
||||
|
||||
}else{
|
||||
|
||||
$temp_data .= (($si != 0 && count($item) != 1) ? ('<td rowspan='.$rowspan.'>' . $si . '</td>') : ($si == 0 ? "" : '<td>' . $si . '</td>') );
|
||||
$temp_data .= '<td>' . $premium . '</td>';
|
||||
$temp_data .= '<td>' . $gst_forself . '</td>';
|
||||
}
|
||||
if($policy_premium_data['premium_type'] == 1){
|
||||
|
||||
$self_si_amount = 0;
|
||||
$self_premium = 0;
|
||||
$self_gst = 0;
|
||||
$temp_data .= (($si != 0 && count($item) != 1) ? ('<td style="vertical-align: middle !important;" rowspan='.$rowspan.'>' . $si . '</td>') : ($si == 0 ? "" : '<td>' . $si . '</td>') );
|
||||
$temp_data .= (($premium != 0 && count($item) != 1) ? ('<td style="vertical-align: middle !important;" rowspan='.$rowspan.'>' . $premium . '</td>') : ($premium == 0 ? "" : '<td>' . $premium . '</td>') );
|
||||
$temp_data .= (($gst_forself != 0 && count($item) != 1) ? ('<td style="vertical-align: middle !important;" rowspan='.$rowspan.'>' . $gst_forself . '</td>') : ($gst_forself == 0 ? "" : '<td>' . $gst_forself . '</td>') );
|
||||
|
||||
}else{
|
||||
|
||||
$temp_data .= (($si != 0 && count($item) != 1) ? ('<td style="vertical-align: middle !important;" rowspan='.$rowspan.'>' . $si . '</td>') : ($si == 0 ? "" : '<td>' . $si . '</td>') );
|
||||
$temp_data .= '<td>' . $premium . '</td>';
|
||||
$temp_data .= '<td>' . $gst_forself . '</td>';
|
||||
}
|
||||
|
||||
$self_si_amount = 0;
|
||||
$self_premium = 0;
|
||||
$self_gst = 0;
|
||||
}
|
||||
}else{
|
||||
$temp_data .= '<td>' . $si . '</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -451,8 +456,12 @@ class sendMailNotification
|
||||
$table_content .= '<th>Relation</th>';
|
||||
$table_content .= '<th style="width:15%">Date Of Birth</th>';
|
||||
$table_content .= '<th>Sum Insured</th>';
|
||||
$table_content .= '<th>Premium</th>';
|
||||
$table_content .= '<th>GST</th>';
|
||||
|
||||
// Premium summery for show and hide the Additional premium data
|
||||
if($client_policy_data['is_premium_summery'] == 1){
|
||||
$table_content .= '<th>Premium</th>';
|
||||
$table_content .= '<th>GST</th>';
|
||||
}
|
||||
|
||||
$table_content .= '</tr>';
|
||||
$table_content .= '</thead>';
|
||||
@ -461,13 +470,15 @@ class sendMailNotification
|
||||
$table_content .= '<tbody style="text-align: center;">' . $temp_data . '</tbody>';
|
||||
$table_content .= '</table></div>';
|
||||
|
||||
|
||||
$addon_list_array = [
|
||||
'policy_name' => $policy_name_for_policy_type . '( Payable By Employee )',
|
||||
'addtional_premium' => round($addtional_premium),
|
||||
'gst' => round($gst)
|
||||
];
|
||||
$Addon_list[] = $addon_list_array;
|
||||
// Premium summery for show and hide the Additional premium data
|
||||
if($client_policy_data['is_premium_summery'] == 1){
|
||||
$addon_list_array = [
|
||||
'policy_name' => $policy_name_for_policy_type . '( Payable By Employee )',
|
||||
'addtional_premium' => round($addtional_premium),
|
||||
'gst' => round($gst)
|
||||
];
|
||||
$Addon_list[] = $addon_list_array;
|
||||
}
|
||||
|
||||
|
||||
$temp_data = '';
|
||||
@ -525,10 +536,7 @@ class sendMailNotification
|
||||
|
||||
// print_r($mail_content); die;
|
||||
|
||||
// $mail = "aadhavanvalli@gmail.com";
|
||||
// if (isset($mail) && !empty($mail)) {
|
||||
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common];
|
||||
// }
|
||||
$wholeData[] = ['mail' => $mail, 'subject' => $subject,'message'=> $mail_content, 'bcc'=> $client_data['common_mails'], 'reply_to' => $client_data['reply_to'], 'common' => $common];
|
||||
|
||||
return $wholeData;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user