diff --git a/app/Controllers/LeadsController.php b/app/Controllers/LeadsController.php index 56f7f1d0..2c90ed53 100644 --- a/app/Controllers/LeadsController.php +++ b/app/Controllers/LeadsController.php @@ -440,6 +440,9 @@ class LeadsController extends BaseController 'earned_claims_ratio' => $data['earned_claims_ratio'][$index] ?? 0, 'total_si_at_incept' => $data['total_si_at_incept'][$index] ?? 0, 'total_si_at_renewal' => $data['total_si_at_renewal'][$index] ?? 0, + + 'total_lives_at_incept' => $data['total_lives_at_incept'][$index] ?? 0, + 'premium_at_incept' => $data['premium_at_incept'][$index] ?? 0, 'fin_years_claims' => $last_3_years_claims, // 'file_name' => $file_name, @@ -1319,6 +1322,10 @@ class LeadsController extends BaseController } else if (in_array($rfq_data['policy_type_id'], [1, 6, 7])) { $lead_data = [ 'Insured' => $rfq_data['client_name'], + 'No of Employees at Inception' => $rfq_data['incept_emp_count'], + 'Total Lives at Inception' => $rfq_data['total_lives_at_incept'], + 'Total Sum Insured at Inception' => $rfq_data['total_si_at_incept'], + 'Premium at inception' => $rfq_data['premium_at_incept'], 'No of Employees at Renewal' => $rfq_data['renewal_emp_count'], 'Total Sum Insured at Renewal ' => $rfq_data['total_si_at_renewal'], 'Policy Period' => !empty($rfq_data['policy_start_date']) && !empty($rfq_data['policy_end_date']) ? date('d-m-Y', strtotime($rfq_data['policy_start_date'])) . ' to ' . date('d-m-Y', strtotime($rfq_data['policy_end_date'])) : "To be decided", @@ -2273,6 +2280,31 @@ class LeadsController extends BaseController $from_mail = "bs@nhanceindia.in"; } + if ($recipient_type === 'placement') { + + $lead_data = $this->leadsModel->find($lead_id); + + $data = []; + + if (!empty($params['policy_start_date'])) { + $converted_start = change_date_format($params['policy_start_date']); // converts to Y-m-d + if ($converted_start !== $lead_data['policy_start_date']) { + $data['policy_start_date'] = $converted_start; + } + } + + if (!empty($params['policy_end_date'])) { + $converted_end = change_date_format($params['policy_end_date']); // converts to Y-m-d + if ($converted_end !== $lead_data['policy_end_date']) { + $data['policy_end_date'] = $converted_end; + } + } + + if (!empty($data)) { + $this->leadsModel->update($lead_id, $data); + } + } + $result_data = []; // dd($recipient_mail); if ($recipient_type == 'insurer' && (!is_array($recipient_mail) || count($recipient_mail) == 0)) { diff --git a/app/Models/LeadsModel.php b/app/Models/LeadsModel.php index 6b5264e8..4a8498ef 100644 --- a/app/Models/LeadsModel.php +++ b/app/Models/LeadsModel.php @@ -97,7 +97,10 @@ class LeadsModel extends Model 'is_installment', 'no_of_installment', 'is_policy_created', - 'claim_history' + 'claim_history', + + 'total_lives_at_incept', + 'premium_at_incept', ]; diff --git a/app/Views/rfq/gpa.php b/app/Views/rfq/gpa.php index bcdf05ed..f02f24a6 100644 --- a/app/Views/rfq/gpa.php +++ b/app/Views/rfq/gpa.php @@ -8,8 +8,18 @@