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);
|
||||
} // dd($data);
|
||||
|
||||
$lead_data = [];
|
||||
if ($rfq_data['lead_type'] == 1) {
|
||||
|
||||
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'] ?? " - ",
|
||||
'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 {
|
||||
@ -2239,6 +2246,11 @@ class LeadsController extends BaseController
|
||||
// 'TPA' => $rfq_data['tpa_name'] ?? " - ",
|
||||
// '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;
|
||||
@ -2274,39 +2286,43 @@ class LeadsController extends BaseController
|
||||
$maxWidthA = 0;
|
||||
$maxWidthB = 0;
|
||||
|
||||
foreach ($lead_data as $key => $value) {
|
||||
// dd($lead_data);
|
||||
|
||||
// Merge A:B for key and C:D for value
|
||||
$mergeRangeKey = "A{$rowNumber}:B{$rowNumber}";
|
||||
// $mergeRangeValue = "C{$rowNumber}";
|
||||
$sheet->mergeCells($mergeRangeKey);
|
||||
// $sheet->mergeCells($mergeRangeValue);
|
||||
if(! empty($lead_data)) {
|
||||
foreach ($lead_data as $key => $value) {
|
||||
|
||||
// Set values in merged cells
|
||||
$sheet->setCellValue("A{$rowNumber}", $key);
|
||||
$sheet->setCellValue("C{$rowNumber}", $value);
|
||||
// Merge A:B for key and C:D for value
|
||||
$mergeRangeKey = "A{$rowNumber}:B{$rowNumber}";
|
||||
// $mergeRangeValue = "C{$rowNumber}";
|
||||
$sheet->mergeCells($mergeRangeKey);
|
||||
// $sheet->mergeCells($mergeRangeValue);
|
||||
|
||||
// // Apply styles for alignment and bold text in A:B
|
||||
// $sheet->getStyle($mergeRangeKey)->applyFromArray([
|
||||
// 'font' => ['bold' => true],
|
||||
// 'alignment' => [
|
||||
// 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
|
||||
// 'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
|
||||
// ],
|
||||
// ]);
|
||||
// Set values in merged cells
|
||||
$sheet->setCellValue("A{$rowNumber}", $key);
|
||||
$sheet->setCellValue("C{$rowNumber}", $value);
|
||||
|
||||
// Apply bold style to B column if the key is "Insured"
|
||||
if ($key == "Insured") {
|
||||
$sheet->getStyle("C{$rowNumber}")->applyFromArray([
|
||||
'font' => ['bold' => true],
|
||||
]);
|
||||
// // Apply styles for alignment and bold text in A:B
|
||||
// $sheet->getStyle($mergeRangeKey)->applyFromArray([
|
||||
// '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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user