fix: wrap logo/QR Drawing in try-catch, use $logoPath var, add cURL fallback for QR download
This commit is contained in:
@@ -171,14 +171,18 @@ $summarySheet->getStyle("A1")->applyFromArray([
|
|||||||
$summarySheet->getRowDimension(1)->setRowHeight(45);
|
$summarySheet->getRowDimension(1)->setRowHeight(45);
|
||||||
|
|
||||||
// --- Add Logo ---
|
// --- Add Logo ---
|
||||||
$logoSummary = new Drawing();
|
try {
|
||||||
$logoSummary->setName('Musadaq Logo');
|
if (file_exists($logoPath)) {
|
||||||
$logoSummary->setPath(ROOT_PATH . '/public/assets/img/logo.jpg');
|
$logoSummary = new Drawing();
|
||||||
$logoSummary->setHeight(38);
|
$logoSummary->setName('Musadaq Logo');
|
||||||
$logoSummary->setCoordinates('A1');
|
$logoSummary->setPath($logoPath);
|
||||||
$logoSummary->setOffsetX(15);
|
$logoSummary->setHeight(38);
|
||||||
$logoSummary->setOffsetY(5);
|
$logoSummary->setCoordinates('A1');
|
||||||
$logoSummary->setWorksheet($summarySheet);
|
$logoSummary->setOffsetX(15);
|
||||||
|
$logoSummary->setOffsetY(5);
|
||||||
|
$logoSummary->setWorksheet($summarySheet);
|
||||||
|
}
|
||||||
|
} catch(\Exception $e) { error_log('Logo Summary Error: ' . $e->getMessage()); }
|
||||||
|
|
||||||
// --- Add Clickable Website Link ---
|
// --- Add Clickable Website Link ---
|
||||||
$summarySheet->setCellValue("J1", 'musadaq.intaleqapp.com');
|
$summarySheet->setCellValue("J1", 'musadaq.intaleqapp.com');
|
||||||
@@ -329,14 +333,18 @@ foreach ($invoices as $invIdx => $inv) {
|
|||||||
$sheet->getRowDimension($invRow)->setRowHeight(45);
|
$sheet->getRowDimension($invRow)->setRowHeight(45);
|
||||||
|
|
||||||
// --- Add Logo ---
|
// --- Add Logo ---
|
||||||
$logoInv = new Drawing();
|
try {
|
||||||
$logoInv->setName('Musadaq Logo');
|
if (file_exists($logoPath)) {
|
||||||
$logoInv->setPath(ROOT_PATH . '/public/assets/img/logo.jpg');
|
$logoInv = new Drawing();
|
||||||
$logoInv->setHeight(38);
|
$logoInv->setName('Musadaq Logo');
|
||||||
$logoInv->setCoordinates('A' . $invRow);
|
$logoInv->setPath($logoPath);
|
||||||
$logoInv->setOffsetX(15);
|
$logoInv->setHeight(38);
|
||||||
$logoInv->setOffsetY(5);
|
$logoInv->setCoordinates('A' . $invRow);
|
||||||
$logoInv->setWorksheet($sheet);
|
$logoInv->setOffsetX(15);
|
||||||
|
$logoInv->setOffsetY(5);
|
||||||
|
$logoInv->setWorksheet($sheet);
|
||||||
|
}
|
||||||
|
} catch(\Exception $e) { error_log('Logo Invoice Error: ' . $e->getMessage()); }
|
||||||
|
|
||||||
// --- Add Clickable Website Link ---
|
// --- Add Clickable Website Link ---
|
||||||
$sheet->setCellValue("I" . $invRow, 'musadaq.intaleqapp.com');
|
$sheet->setCellValue("I" . $invRow, 'musadaq.intaleqapp.com');
|
||||||
|
|||||||
Reference in New Issue
Block a user