add logo to reciept

This commit is contained in:
Flatlogic Bot 2026-03-15 03:18:03 +00:00
parent 6ff90fea7b
commit 22ba99cda2
3 changed files with 13 additions and 3 deletions

View File

@ -434,7 +434,7 @@ function printThermalReceipt() {
const loyaltyHtml = data.loyaltyRedeemed ? `<div style="color: #d63384; font-weight: bold; margin: 5px 0; text-align: center;">* Loyalty Reward Applied *</div>` : '';
const logoHtml = COMPANY_SETTINGS.logo_url ? `<img src="${BASE_URL}${COMPANY_SETTINGS.logo_url}" style="max-height: 80px; max-width: 150px; margin-bottom: 10px;">` : '';
const logoHtml = COMPANY_SETTINGS.logo_url ? `<div style="text-align: center; margin-bottom: 10px;"><img src="${BASE_URL}${COMPANY_SETTINGS.logo_url}" style="max-height: 80px; max-width: 150px; filter: grayscale(100%);" alt="Logo"></div>` : '';
const vatRate = COMPANY_SETTINGS.vat_rate || 0;
const html = `

View File

@ -900,7 +900,10 @@ document.addEventListener('DOMContentLoaded', () => {
const loyaltyHtml = data.loyaltyRedeemed ? `<div style="color: #d63384; font-weight: bold; margin: 5px 0; text-align: center;">* Loyalty Reward Applied *</div>` : '';
// We skip logo in receipt for absolute speed unless it's already cached.
const logoHtml = '';
let logoHtml = '';
if (settings.logo_url) {
logoHtml = `<div style="text-align: center; margin-bottom: 10px;"><img src="${BASE_URL}${settings.logo_url}" style="max-height: 80px; max-width: 150px; filter: grayscale(100%);" alt="Logo"></div>`;
}
const vatRate = settings.vat_rate || 0;

View File

@ -25,6 +25,13 @@ try {
} else {
date_default_timezone_set('UTC');
}
// Synchronize MySQL connection timezone offset with PHP
try {
db()->exec("SET time_zone = '" . date('P') . "'");
} catch (Exception $e) {
// Silently ignore if MySQL doesn't accept the timezone setting
}
} catch (Exception $e) {
date_default_timezone_set('UTC');
}
}