receipt print fix

This commit is contained in:
2026-03-10 22:25:09 -03:00
parent b2418d8c7e
commit 72f6e0c822
2 changed files with 54 additions and 9 deletions

View File

@@ -16,6 +16,50 @@
-moz-appearance: textfield;
appearance: textfield;
}
@media print {
body * {
visibility: hidden;
}
#receipt-print-zone, #receipt-print-zone * {
visibility: visible;
}
#receipt-print-zone {
position: absolute;
left: 0;
top: 0;
width: 58mm;
padding: 0;
margin: 0;
display: block !important;
font-family: 'Courier New', Courier, monospace;
font-size: 10px;
color: #000;
}
.container-fluid, .main, body {
margin: 0 !important;
padding: 0 !important;
background: #fff !important;
}
}
.receipt-table {
width: 100%;
border-collapse: collapse;
font-family: monospace;
font-size: 12px;
}
.receipt-header {
text-align: center;
margin-bottom: 10px;
border-bottom: 1px dashed #000;
padding-bottom: 5px;
}
</style>
{% endblock %}
@@ -734,20 +778,21 @@
cart.forEach(item => {
const qtyStr = item.unit === 'kg' ? item.qty.toFixed(3) : item.qty;
tbody.innerHTML += `
<tr>
<td>${qtyStr}</td>
<td style="padding-left: 5px; padding-right: 5px; word-break: break-word;">${item.name}</td>
<td style="text-align: right;">${clp.format(item.subtotal)}</td>
</tr>
`;
<tr>
<td>${qtyStr}</td>
<td style="padding-left: 5px; padding-right: 5px; word-break: break-word;">${item.name}</td>
<td style="text-align: right;">${clp.format(item.subtotal)}</td>
</tr>
`;
});
document.getElementById('receipt-ticket-id').innerText = saleId || "N/A";
document.getElementById('receipt-total-print').innerText = clp.format(total);
document.getElementById('receipt-date').innerText = new Date().toLocaleString('es-CL');
// No hacks, just print
window.print();
setTimeout(() => {
window.print();
}, 250);
}
function openCustomProductModal() {

View File

@@ -1,7 +1,7 @@
<nav class="navbar navbar-expand-md sticky-top px-3 mb-3">
<span class="navbar-brand">
SekiPOS
<small class="text-muted fw-normal" style="font-size:0.65rem;">v1.6</small>
<small class="text-muted fw-normal" style="font-size:0.65rem;">v1.8</small>
</span>
<div class="ms-3 gap-2 d-flex">