diff --git a/assets/css/custom.css b/assets/css/custom.css
index f94e3c0..292703f 100644
--- a/assets/css/custom.css
+++ b/assets/css/custom.css
@@ -368,6 +368,8 @@ body {
line-height: 1.2;
background: #fff;
color: #000;
+ break-inside: avoid;
+ page-break-inside: avoid;
}
.thermal-receipt .center {
text-align: center;
diff --git a/index.php b/index.php
index 8751689..be639c7 100644
--- a/index.php
+++ b/index.php
@@ -3755,7 +3755,8 @@ $projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? 'Accounting System';
},
showReceipt(invId, discountAmount, loyaltyRedeemed, transactionNo) {
const container = document.getElementById('posReceiptContent');
- const customerName = document.getElementById('posCustomer').options[document.getElementById('posCustomer').selectedIndex].text;
+ const customerSelect = document.getElementById('posCustomer');
+ const customerName = (customerSelect && customerSelect.selectedIndex >= 0) ? customerSelect.options[customerSelect.selectedIndex].text : 'Walk-in Customer';
const paymentsHtml = this.payments.map(p => `
${p.method}
@@ -9212,7 +9213,7 @@ document.addEventListener('DOMContentLoaded', function() {
@media print {
.no-print, .sidebar, .topbar, .btn, .modal-header, .modal-footer, .d-print-none,
.modal-backdrop { display: none !important; }
- body { background: white !important; margin: 0 !important; padding: 0 !important; }
+ body { background: white !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
.main-content { margin: 0 !important; padding: 0 !important; background: white !important; }
/* Hide all modals by default */
@@ -9256,8 +9257,25 @@ document.addEventListener('DOMContentLoaded', function() {
.badge { border: 1px solid #000; color: #000 !important; }
/* Ensure the modal is the only thing visible ONLY when a modal is open */
- body.modal-open > *:not(.modal) { display: none !important; }
- body.modal-open .main-content { display: none !important; }
+ body.modal-open:not(.printing-receipt) > *:not(.modal):not(.swal2-container) { display: none !important; }
+ body.modal-open:not(.printing-receipt) .main-content { display: none !important; }
+
+ /* POS Receipt printing specific */
+ body.printing-receipt .modal { display: none !important; }
+ body.printing-receipt .modal-backdrop { display: none !important; }
+ body.printing-receipt #posPrintArea {
+ display: block !important;
+ visibility: visible !important;
+ position: absolute !important;
+ left: 0 !important;
+ top: 0 !important;
+ width: 100% !important;
+ z-index: 9999 !important;
+ background: white !important;
+ }
+ body.printing-receipt #posPrintArea * {
+ visibility: visible !important;
+ }
}
.invoice-logo { max-height: 80px; width: auto; }
.invoice-header { border-bottom: 2px solid #333; padding-bottom: 20px; }
diff --git a/post_debug.log b/post_debug.log
index afd936d..612293c 100644
--- a/post_debug.log
+++ b/post_debug.log
@@ -45,3 +45,4 @@
2026-02-19 05:18:29 - POST: {"open_register":"1","register_id":"1","opening_balance":"0"}
2026-02-19 05:18:39 - POST: {"action":"save_pos_transaction","customer_id":"","payments":"[{\"method\":\"cash\",\"amount\":0.595}]","total_amount":"0.595","discount_code_id":"","discount_amount":"0","loyalty_redeemed":"0","items":"[{\"id\":1,\"qty\":1,\"price\":0.3825},{\"id\":2,\"qty\":1,\"price\":0.2125}]"}
2026-02-19 05:18:51 - POST: {"open_register":"1","register_id":"1","opening_balance":"0"}
+2026-02-19 05:47:55 - POST: {"action":"save_pos_transaction","customer_id":"","payments":"[{\"method\":\"cash\",\"amount\":0.595}]","total_amount":"0.595","discount_code_id":"","discount_amount":"0","loyalty_redeemed":"0","items":"[{\"id\":1,\"qty\":1,\"price\":0.3825},{\"id\":2,\"qty\":1,\"price\":0.2125}]"}