diff --git a/index.php b/index.php
index 749119f..46b4f3a 100644
--- a/index.php
+++ b/index.php
@@ -3751,6 +3751,7 @@ document.addEventListener('DOMContentLoaded', function() {
});
}
+ const companySettings = = json_encode($data['settings']) ?>;
const invoiceType = '= in_array($page, ["sales", "quotations"]) ? "sale" : ($page === "purchases" ? "purchase" : "") ?>';
initInvoiceForm('productSearchInput', 'searchSuggestions', 'invoiceItemsTableBody', 'grandTotal', 'subtotal', 'totalVat');
initInvoiceForm('editProductSearchInput', 'editSearchSuggestions', 'editInvoiceItemsTableBody', 'edit_grandTotal', 'edit_subtotal', 'edit_totalVat');
@@ -3818,21 +3819,54 @@ document.addEventListener('DOMContentLoaded', function() {
`;
});
+ // Company Logo and Header Construction
+ const logoUrl = companySettings.company_logo || '';
+ const logoImg = logoUrl ? `` : '';
+ const companyName = companySettings.company_name || 'Accounting System';
+ const companyAddress = (companySettings.company_address || '').replace(/\n/g, '
');
+ const companyVat = companySettings.vat_number ? `
VAT: ${companySettings.vat_number}
` : ''; + const companyPhone = companySettings.company_phone ? `Tel: ${companySettings.company_phone}
` : ''; + + // Quotation Header Construction + const quotDate = data.quotation_date; + const quotValid = data.valid_until || 'N/A'; + const quotNo = 'QUO-' + data.id.toString().padStart(5, '0'); + const customerName = data.customer_name || 'Walk-in Customer'; + const statusBadge = `${data.status.toUpperCase()}`; + content.innerHTML = `No: QUO-${data.id.toString().padStart(5, '0')}
-Date: ${data.quotation_date}
-Valid Until: ${data.valid_until || 'N/A'}
-Status: ${data.status.toUpperCase()}
+${companyAddress}
+ ${companyVat} + ${companyPhone} +No: ${quotNo}
+Date: ${quotDate}
+Valid Until: ${quotValid}
+| # | @@ -3859,10 +3893,11 @@ document.addEventListener('DOMContentLoaded', function() {
|---|
Terms & Conditions:
+Terms & Conditions:
Generated by ${companyName}
+