FIX_RFQ_PLACEMENT_NOT_SENT_ISSUE
This commit is contained in:
parent
3717c788f8
commit
38e218f585
@ -2126,6 +2126,7 @@ class LeadsController extends BaseController
|
|||||||
$data = $this->convertJsonForQCR($data, $type);
|
$data = $this->convertJsonForQCR($data, $type);
|
||||||
} // dd($data);
|
} // dd($data);
|
||||||
|
|
||||||
|
$lead_data = [];
|
||||||
if ($rfq_data['lead_type'] == 1) {
|
if ($rfq_data['lead_type'] == 1) {
|
||||||
|
|
||||||
if (in_array($rfq_data['policy_type_id'], [2, 3, 4, 5])) {
|
if (in_array($rfq_data['policy_type_id'], [2, 3, 4, 5])) {
|
||||||
@ -2152,6 +2153,12 @@ class LeadsController extends BaseController
|
|||||||
// 'TPA' => $rfq_data['tpa_name'] ?? " - ",
|
// 'TPA' => $rfq_data['tpa_name'] ?? " - ",
|
||||||
'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? "",
|
'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? "",
|
||||||
];
|
];
|
||||||
|
}else {
|
||||||
|
|
||||||
|
$lead_data = [
|
||||||
|
'Insured' => $rfq_data['client_name'],
|
||||||
|
'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? ""
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -2239,6 +2246,11 @@ class LeadsController extends BaseController
|
|||||||
// 'TPA' => $rfq_data['tpa_name'] ?? " - ",
|
// 'TPA' => $rfq_data['tpa_name'] ?? " - ",
|
||||||
// 'Total Lives at Inception' => $rfq_data['total_lives_at_incept'],
|
// 'Total Lives at Inception' => $rfq_data['total_lives_at_incept'],
|
||||||
];
|
];
|
||||||
|
} else {
|
||||||
|
$lead_data = [
|
||||||
|
'Insured' => $rfq_data['client_name'],
|
||||||
|
'Policy Type' => $this->leadType[$rfq_data['lead_type']] ?? ""
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// print_r($lead_data); die;
|
// print_r($lead_data); die;
|
||||||
@ -2274,39 +2286,43 @@ class LeadsController extends BaseController
|
|||||||
$maxWidthA = 0;
|
$maxWidthA = 0;
|
||||||
$maxWidthB = 0;
|
$maxWidthB = 0;
|
||||||
|
|
||||||
foreach ($lead_data as $key => $value) {
|
// dd($lead_data);
|
||||||
|
|
||||||
// Merge A:B for key and C:D for value
|
if(! empty($lead_data)) {
|
||||||
$mergeRangeKey = "A{$rowNumber}:B{$rowNumber}";
|
foreach ($lead_data as $key => $value) {
|
||||||
// $mergeRangeValue = "C{$rowNumber}";
|
|
||||||
$sheet->mergeCells($mergeRangeKey);
|
|
||||||
// $sheet->mergeCells($mergeRangeValue);
|
|
||||||
|
|
||||||
// Set values in merged cells
|
// Merge A:B for key and C:D for value
|
||||||
$sheet->setCellValue("A{$rowNumber}", $key);
|
$mergeRangeKey = "A{$rowNumber}:B{$rowNumber}";
|
||||||
$sheet->setCellValue("C{$rowNumber}", $value);
|
// $mergeRangeValue = "C{$rowNumber}";
|
||||||
|
$sheet->mergeCells($mergeRangeKey);
|
||||||
|
// $sheet->mergeCells($mergeRangeValue);
|
||||||
|
|
||||||
// // Apply styles for alignment and bold text in A:B
|
// Set values in merged cells
|
||||||
// $sheet->getStyle($mergeRangeKey)->applyFromArray([
|
$sheet->setCellValue("A{$rowNumber}", $key);
|
||||||
// 'font' => ['bold' => true],
|
$sheet->setCellValue("C{$rowNumber}", $value);
|
||||||
// 'alignment' => [
|
|
||||||
// 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
|
|
||||||
// 'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
|
|
||||||
// ],
|
|
||||||
// ]);
|
|
||||||
|
|
||||||
// Apply bold style to B column if the key is "Insured"
|
// // Apply styles for alignment and bold text in A:B
|
||||||
if ($key == "Insured") {
|
// $sheet->getStyle($mergeRangeKey)->applyFromArray([
|
||||||
$sheet->getStyle("C{$rowNumber}")->applyFromArray([
|
// 'font' => ['bold' => true],
|
||||||
'font' => ['bold' => true],
|
// 'alignment' => [
|
||||||
]);
|
// 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
|
||||||
|
// 'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
|
||||||
|
// ],
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
// Apply bold style to B column if the key is "Insured"
|
||||||
|
if ($key == "Insured") {
|
||||||
|
$sheet->getStyle("C{$rowNumber}")->applyFromArray([
|
||||||
|
'font' => ['bold' => true],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Track max width needed for columns
|
||||||
|
$maxWidthA = max($maxWidthA, mb_strlen($key));
|
||||||
|
$maxWidthB = max($maxWidthB, mb_strlen($value));
|
||||||
|
|
||||||
|
$rowNumber++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Track max width needed for columns
|
|
||||||
$maxWidthA = max($maxWidthA, mb_strlen($key));
|
|
||||||
$maxWidthB = max($maxWidthB, mb_strlen($value));
|
|
||||||
|
|
||||||
$rowNumber++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set column width based on max content length (adjusted for padding)
|
// Set column width based on max content length (adjusted for padding)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user