Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
618863f057
@ -1776,6 +1776,24 @@ class LeadsController extends BaseController
|
|||||||
|
|
||||||
// dd($rfq_data, $lead_id, $type, $propsal_and_insurer);
|
// dd($rfq_data, $lead_id, $type, $propsal_and_insurer);
|
||||||
// print_r($propsal_and_insurer); die;
|
// print_r($propsal_and_insurer); die;
|
||||||
|
// print_r($is_placement); die;
|
||||||
|
|
||||||
|
$data = json_decode($rfq_data['json'], true);
|
||||||
|
$sheetName = 'Worksheet';
|
||||||
|
if ($type == 2) {
|
||||||
|
$sheetName = 'QCR';
|
||||||
|
// $propsal_and_insurer = "Proposal 1-ICICIPRU-ICICI001";
|
||||||
|
$data = $this->convertJsonForQCR($data, $type);
|
||||||
|
if ($propsal_and_insurer !== null) {
|
||||||
|
list($proposal_key, $insurer_key) = explode('-', $propsal_and_insurer, 2);
|
||||||
|
$data = $this->transformProposelData($data, $proposal_key, $insurer_key);
|
||||||
|
$is_placement = true;
|
||||||
|
$sheetName = 'Placement';
|
||||||
|
}
|
||||||
|
} else if ($type == 1) {
|
||||||
|
$sheetName = 'RFQ';
|
||||||
|
$data = $this->convertJsonForQCR($data, $type);
|
||||||
|
} // dd($data);
|
||||||
|
|
||||||
if ($rfq_data['lead_type'] == 1) {
|
if ($rfq_data['lead_type'] == 1) {
|
||||||
|
|
||||||
@ -1808,36 +1826,71 @@ class LeadsController extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (in_array($rfq_data['policy_type_id'], [2, 3, 4, 5])) {
|
if (in_array($rfq_data['policy_type_id'], [2, 3, 4, 5])) {
|
||||||
$lead_data = [
|
if($is_placement == true){
|
||||||
|
$lead_data = [
|
||||||
|
|
||||||
'Insured' => $rfq_data['client_name'],
|
'Insured' => $rfq_data['client_name'],
|
||||||
'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? "",
|
'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? "",
|
||||||
|
|
||||||
// 'No of Employees at Inception' => $rfq_data['incept_emp_count'],
|
// 'No of Employees at Inception' => $rfq_data['incept_emp_count'],
|
||||||
// 'No of Dependents at Inception' => $rfq_data['incept_dept_count'],
|
// 'No of Dependents at Inception' => $rfq_data['incept_dept_count'],
|
||||||
// 'Total Lives at Inception ' => $rfq_data['incept_no_of_lives'],
|
// 'Total Lives at Inception ' => $rfq_data['incept_no_of_lives'],
|
||||||
|
|
||||||
// 'No of Employees at Expiry' => $rfq_data['exp_emp_count'],
|
// 'No of Employees at Expiry' => $rfq_data['exp_emp_count'],
|
||||||
// 'No of Dependents at Expiry' => $rfq_data['exp_dept_count'],
|
// 'No of Dependents at Expiry' => $rfq_data['exp_dept_count'],
|
||||||
// 'Total Lives at Expiry ' => $rfq_data['exp_no_of_lives'],
|
// 'Total Lives at Expiry ' => $rfq_data['exp_no_of_lives'],
|
||||||
|
|
||||||
'No of Employees at Renewal' => $rfq_data['renewal_emp_count'],
|
'No of Employees at Renewal' => $rfq_data['renewal_emp_count'],
|
||||||
'No of Dependents at Renewal' => $rfq_data['renewal_dept_count'],
|
'No of Dependents at Renewal' => $rfq_data['renewal_dept_count'],
|
||||||
'Total Lives at Renewal ' => $rfq_data['renewal_no_of_lives'],
|
'Total Lives at Renewal ' => $rfq_data['renewal_no_of_lives'],
|
||||||
|
|
||||||
'Period of Insurance ' => !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",
|
'Period of Insurance ' => !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",
|
||||||
'Insurer' => $rfq_data['insurer_name'] ?? " - ",
|
'Insurer' => $rfq_data['insurer_name'] ?? " - ",
|
||||||
'TPA' => $rfq_data['tpa_name'] ?? " - ",
|
'TPA' => $rfq_data['tpa_name'] ?? " - ",
|
||||||
|
|
||||||
// 'Policy Run Days' => $rfq_data['policy_run_days'],
|
// 'Policy Run Days' => $rfq_data['policy_run_days'],
|
||||||
// 'Inception Premium' => formatIndianCurrency($rfq_data['premium_at_inception']),
|
// 'Inception Premium' => formatIndianCurrency($rfq_data['premium_at_inception']),
|
||||||
// 'Premium as on (' . date('d-m-Y', strtotime($rfq_data['incurred_claims_date'])) . ')' => formatIndianCurrency($rfq_data['premium_date']),
|
// 'Premium as on (' . date('d-m-Y', strtotime($rfq_data['incurred_claims_date'])) . ')' => formatIndianCurrency($rfq_data['premium_date']),
|
||||||
// 'Earned Premium' => formatIndianCurrency(intval($rfq_data['earned_premium'])),
|
// 'Earned Premium' => formatIndianCurrency(intval($rfq_data['earned_premium'])),
|
||||||
// 'Incurred Claims as on (' . date('d-m-Y', strtotime($rfq_data['incurred_claims_date'])) . ')' => formatIndianCurrency($rfq_data['incurred_claims']),
|
// 'Incurred Claims as on (' . date('d-m-Y', strtotime($rfq_data['incurred_claims_date'])) . ')' => formatIndianCurrency($rfq_data['incurred_claims']),
|
||||||
// 'Annualised Claims' => formatIndianCurrency(intval($rfq_data['annualised_claims'])),
|
// 'Annualised Claims' => formatIndianCurrency(intval($rfq_data['annualised_claims'])),
|
||||||
// 'Incurred Claims Ratio' => $rfq_data['incurred_claims_ratio'] . " %",
|
// 'Incurred Claims Ratio' => $rfq_data['incurred_claims_ratio'] . " %",
|
||||||
// 'Earned Claims Ratio' => $rfq_data['earned_claims_ratio'] . " %",
|
// 'Earned Claims Ratio' => $rfq_data['earned_claims_ratio'] . " %",
|
||||||
];
|
];
|
||||||
|
}else{
|
||||||
|
$lead_data = [
|
||||||
|
'Insured' => $rfq_data['client_name'],
|
||||||
|
'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? "",
|
||||||
|
|
||||||
|
'No of Employees at Inception' => $is_placement ? '-' : $rfq_data['incept_emp_count'],
|
||||||
|
'No of Dependents at Inception' => $is_placement ? '-' : $rfq_data['incept_dept_count'],
|
||||||
|
'Total Lives at Inception ' => $is_placement ? '-' : $rfq_data['incept_no_of_lives'],
|
||||||
|
|
||||||
|
'No of Employees at Expiry' => $is_placement ? '-' : $rfq_data['exp_emp_count'],
|
||||||
|
'No of Dependents at Expiry' => $is_placement ? '-' : $rfq_data['exp_dept_count'],
|
||||||
|
'Total Lives at Expiry ' => $is_placement ? '-' : $rfq_data['exp_no_of_lives'],
|
||||||
|
|
||||||
|
'No of Employees at Renewal' => $rfq_data['renewal_emp_count'],
|
||||||
|
'No of Dependents at Renewal' => $rfq_data['renewal_dept_count'],
|
||||||
|
'Total Lives at Renewal ' => $rfq_data['renewal_no_of_lives'],
|
||||||
|
|
||||||
|
'Period of Insurance ' => !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",
|
||||||
|
|
||||||
|
'Insurer' => $rfq_data['insurer_name'] ?? " - ",
|
||||||
|
'TPA' => $rfq_data['tpa_name'] ?? " - ",
|
||||||
|
|
||||||
|
'Policy Run Days' => $is_placement ? '-' : $rfq_data['policy_run_days'],
|
||||||
|
'Inception Premium' => $is_placement ? '-' : formatIndianCurrency($rfq_data['premium_at_inception']),
|
||||||
|
'Premium as on (' . date('d-m-Y', strtotime($rfq_data['incurred_claims_date'])) . ')' => $is_placement ? '-' : formatIndianCurrency($rfq_data['premium_date']),
|
||||||
|
'Earned Premium' => $is_placement ? '-' : formatIndianCurrency(intval($rfq_data['earned_premium'])),
|
||||||
|
'Incurred Claims as on (' . date('d-m-Y', strtotime($rfq_data['incurred_claims_date'])) . ')' => $is_placement ? '-' : formatIndianCurrency($rfq_data['incurred_claims']),
|
||||||
|
'Annualised Claims' => $is_placement ? '-' : formatIndianCurrency(intval($rfq_data['annualised_claims'])),
|
||||||
|
'Incurred Claims Ratio' => $is_placement ? '-' : $rfq_data['incurred_claims_ratio'] . " %",
|
||||||
|
'Earned Claims Ratio' => $is_placement ? '-' : $rfq_data['earned_claims_ratio'] . " %",
|
||||||
|
];
|
||||||
|
}
|
||||||
} else if (in_array($rfq_data['policy_type_id'], [1, 6, 7])) {
|
} else if (in_array($rfq_data['policy_type_id'], [1, 6, 7])) {
|
||||||
|
|
||||||
$lead_data = [
|
$lead_data = [
|
||||||
@ -1857,27 +1910,8 @@ class LeadsController extends BaseController
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// print_r($lead_data); die;
|
||||||
|
|
||||||
$data = json_decode($rfq_data['json'], true);
|
|
||||||
// dd($data);
|
|
||||||
|
|
||||||
$sheetName = 'Worksheet';
|
|
||||||
if ($type == 2) {
|
|
||||||
$sheetName = 'QCR';
|
|
||||||
// $propsal_and_insurer = "Proposal 1-ICICIPRU-ICICI001";
|
|
||||||
$data = $this->convertJsonForQCR($data, $type);
|
|
||||||
if ($propsal_and_insurer !== null) {
|
|
||||||
list($proposal_key, $insurer_key) = explode('-', $propsal_and_insurer, 2);
|
|
||||||
$data = $this->transformProposelData($data, $proposal_key, $insurer_key);
|
|
||||||
$is_placement = true;
|
|
||||||
$sheetName = 'Placement';
|
|
||||||
}
|
|
||||||
} else if ($type == 1) {
|
|
||||||
$sheetName = 'RFQ';
|
|
||||||
$data = $this->convertJsonForQCR($data, $type);
|
|
||||||
// dd($data);
|
|
||||||
}
|
|
||||||
// dd($data);
|
|
||||||
|
|
||||||
$spreadsheet = new Spreadsheet();
|
$spreadsheet = new Spreadsheet();
|
||||||
$sheet = $spreadsheet->getActiveSheet();
|
$sheet = $spreadsheet->getActiveSheet();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user