fix(pos): dedupe ticket header and force white print background

This commit is contained in:
Deploy
2026-08-25 22:39:05 +02:00
parent 129584d738
commit b6adf681d1
12 changed files with 28 additions and 22 deletions

View File

@@ -62,13 +62,8 @@ export default function ReceiptModal({
<div className="mx-auto w-full max-w-xl rounded-2xl bg-white p-6 shadow-2xl print:max-w-none print:rounded-none print:p-0 print:shadow-none">
{/* Ticket content - only this gets printed */}
<div ref={articleRef} className="ticket-print-area">
<article className="space-y-4 text-sm text-gray-900">
<article className="space-y-4 bg-white text-sm text-gray-900 print:bg-white">
<header className="border-b border-dashed border-gray-400 pb-4 text-center">
{/* Timestamp */}
<div className="flex justify-between items-center mb-2 text-xs text-gray-500">
<span>Ticket #{receipt.receiptNumber}</span>
<span>{new Date(receipt.issuedAt).toLocaleString('es-ES', { dateStyle: 'short', timeStyle: 'short' })}</span>
</div>
{/* Logo */}
<div className="mb-3 flex justify-center">
<img
@@ -238,6 +233,13 @@ export default function ReceiptModal({
{/* Print-only styles */}
<style>{`
@media print {
@page {
background: #ffffff;
}
html,
body {
background: #ffffff !important;
}
body * {
visibility: hidden;
}
@@ -250,6 +252,10 @@ export default function ReceiptModal({
left: 0;
top: 0;
width: 100%;
background: #ffffff !important;
color: #111827;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
}
}
`}</style>