FIX_LOGO_ALIGN,POLICY_REG_ALERT

This commit is contained in:
Srinivas-Saravanan 2025-06-09 11:16:10 +05:30
parent 4937ae7b1d
commit 4e89c4b4a9
3 changed files with 42 additions and 13 deletions

View File

@ -3440,19 +3440,17 @@ class LeadsController extends BaseController
// dd($columnLetterForImage);
// Set column width to fit the image properly
$sheet->getColumnDimension($columnLetterForImage)->setWidth(20); // Adjust as needed
$sheet->getColumnDimension($columnLetterForImage)->setWidth(40); // Adjust as needed
$sheet->getRowDimension($rowNumber)->setRowHeight(40); // Adjust as needed
$drawing = new Drawing();
$path = ROOTPATH . "public/assets/images/Nhance-Logo-Final.png"; // Use FCPATH for server path
$drawing->setPath($path);
$drawing->setCoordinates("{$columnLetterForImage}{$rowNumber}"); // Set position in column C
$drawing->setHeight(35); // Adjust image height
// Center align the image in the cell
$drawing->setOffsetX(50); // Adjust horizontal offset
$drawing->setOffsetY(5); // Adjust vertical offset
$drawing->setWorksheet($sheet);
// Apply center alignment to the cell
$sheet->getStyle("{$columnLetterForImage}{$rowNumber}")->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER);
@ -3924,6 +3922,26 @@ class LeadsController extends BaseController
]);
}
$columnWidth = $sheet->getColumnDimension("C")->getWidth(); // e.g., 20
$cellPixelWidth = $columnWidth * 7; // Approximate conversion (1 unit ≈ 7 pixels)
$imagePixelWidth = 250; // Approximate width of your image (in pixels)
$offsetX = max(0, ($cellPixelWidth - $imagePixelWidth) / 2);
$offsetX = $offsetX + 97;
if ($length >= 4) {
$offsetX = 50;
}
// dd($offsetX, $cellPixelWidth, $imagePixelWidth);
$drawing->setOffsetX($offsetX); // Dynamically center
$drawing->setOffsetY(10); // Dynamically center
$drawing->setWorksheet($sheet);
$sheet->getStyle('C1')->getAlignment()
->setHorizontal(Alignment::HORIZONTAL_CENTER)
->setVertical(Alignment::VERTICAL_CENTER);
if (!empty($rfq_data['fin_years_claims']) && $claim_history == 1) {
$claim_details = json_decode($rfq_data['fin_years_claims'], true) ?? [];

View File

@ -744,23 +744,23 @@
<div class = "row">
<div class="form-group col-md-4 multi_location_company">
<label for="building_${increment2}">Building</label>
<input type="number" id="building_${increment2}" name="building[]" class="form-control multi_location_company " />
<input type="text" id="building_${increment2}" name="building[]" class="form-control multi_location_company" onkeypress="return onlyNumbers(event)" />
</div>
<div class="form-group col-md-4 multi_location_company ">
<label for="content_${increment2}">Content</label>
<input type="number" id="content_${increment2}" name="content[]" class="form-control multi_location_company " />
<input type="text" id="content_${increment2}" name="content[]" class="form-control multi_location_company" onkeypress="return onlyNumbers(event)" />
</div>
<div class="form-group col-md-4 multi_location_company ">
<label for="furniture_${increment2}">Furniture/Office Equipment</label>
<input type="number" id="furniture_${increment2}" name="furniture[]" class="form-control multi_location_company " />
<input type="text" id="furniture_${increment2}" name="furniture[]" class="form-control multi_location_company" onkeypress="return onlyNumbers(event)" />
</div>
<div class="form-group col-md-4 multi_location_company ">
<label for="plantAndMachinery_${increment2}">Plant and Machinery</label>
<input type="number" id="plantAndMachinery_${increment2}" name="plant_and_machinery[]" class="form-control multi_location_company " />
<input type="text" id="plantAndMachinery_${increment2}" name="plant_and_machinery[]" class="form-control multi_location_company" onkeypress="return onlyNumbers(event)" />
</div>
<div class="form-group col-md-4 multi_location_company">
<label for="electricalFittings_${increment2}">Electrical Fittings</label>
<input type="number" id="electricalFittings_${increment2}" name="electrical_fittings[]" class="form-control multi_location_company "/>
<input type="text" id="electricalFittings_${increment2}" name="electrical_fittings[]" class="form-control multi_location_company" onkeypress="return onlyNumbers(event)"/>
</div>
</div>
<br>
@ -769,15 +769,15 @@
<div class = "row">
<div class="form-group col-md-4 multi_location_company">
<label for="stockInProcess_${increment2}">Stock In Process</label>
<input type="number" id="stockInProcess_${increment2}" name="stock_in_process[]" class="form-control multi_location_company" />
<input type="text" id="stockInProcess_${increment2}" name="stock_in_process[]" class="form-control multi_location_company" onkeypress="return onlyNumbers(event)" />
</div>
<div class="form-group col-md-4 multi_location_company">
<label for="rawMaterial_${increment2}">Raw Material</label>
<input type="number" id="rawMaterial_${increment2}" name="raw_material[]" class="form-control multi_location_company" />
<input type="text" id="rawMaterial_${increment2}" name="raw_material[]" class="form-control multi_location_company" onkeypress="return onlyNumbers(event)" />
</div>
<div class="form-group col-md-4 multi_location_company">
<label for="finishedStock_${increment2}">Stock</label>
<input type="number" id="finishedStock_${increment2}" name="finished_stock[]" class="form-control multi_location_company"/>
<input type="text" id="finishedStock_${increment2}" name="finished_stock[]" class="form-control multi_location_company" onkeypress="return onlyNumbers(event)"/>
</div>
</div>
<hr>
@ -1229,6 +1229,7 @@
changeTerrorism(Number($("#policySI").val()));
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
saveRFQ();
// console.log("Updated policy data in localStorage:", existingData);
}
@ -1659,4 +1660,10 @@
// }
// });
// }
function onlyNumbers(event) {
var charcode;
charcode = event.which || event.keyCode;
if (charcode >= 48 && charcode <= 57 || charcode == 46) return true;
return false;
}
</script>

View File

@ -2408,6 +2408,10 @@
// alert(policy.quote_asked[0]);
// var policySI = policies[]
policySI = rfq_count == 0 && !tdChanged ? policy.quote_asked[0] : (changedNewSI) != "" && changedNewSI != 0? changedNewSI : policy.quote_asked[0];
if (policySI == "-" || policySI == 0){
toastr.warning("Please Enter the Sum Insured in the RFQ First","Warning");
return;
}
console.log("policy si",policySI,"rfq ount ",rfq_count,"tdchanged ",tdChanged,"changedNewSI",changedNewSI);
$("#policyName").val(policyName);
$("#policySI").val(policySI);