receipt print fix
This commit is contained in:
@@ -16,6 +16,50 @@
|
|||||||
-moz-appearance: textfield;
|
-moz-appearance: textfield;
|
||||||
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>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
@@ -734,20 +778,21 @@
|
|||||||
cart.forEach(item => {
|
cart.forEach(item => {
|
||||||
const qtyStr = item.unit === 'kg' ? item.qty.toFixed(3) : item.qty;
|
const qtyStr = item.unit === 'kg' ? item.qty.toFixed(3) : item.qty;
|
||||||
tbody.innerHTML += `
|
tbody.innerHTML += `
|
||||||
<tr>
|
<tr>
|
||||||
<td>${qtyStr}</td>
|
<td>${qtyStr}</td>
|
||||||
<td style="padding-left: 5px; padding-right: 5px; word-break: break-word;">${item.name}</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>
|
<td style="text-align: right;">${clp.format(item.subtotal)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('receipt-ticket-id').innerText = saleId || "N/A";
|
document.getElementById('receipt-ticket-id').innerText = saleId || "N/A";
|
||||||
document.getElementById('receipt-total-print').innerText = clp.format(total);
|
document.getElementById('receipt-total-print').innerText = clp.format(total);
|
||||||
document.getElementById('receipt-date').innerText = new Date().toLocaleString('es-CL');
|
document.getElementById('receipt-date').innerText = new Date().toLocaleString('es-CL');
|
||||||
|
|
||||||
// No hacks, just print
|
setTimeout(() => {
|
||||||
window.print();
|
window.print();
|
||||||
|
}, 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
function openCustomProductModal() {
|
function openCustomProductModal() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<nav class="navbar navbar-expand-md sticky-top px-3 mb-3">
|
<nav class="navbar navbar-expand-md sticky-top px-3 mb-3">
|
||||||
<span class="navbar-brand">
|
<span class="navbar-brand">
|
||||||
SekiPOS
|
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>
|
</span>
|
||||||
|
|
||||||
<div class="ms-3 gap-2 d-flex">
|
<div class="ms-3 gap-2 d-flex">
|
||||||
|
|||||||
Reference in New Issue
Block a user