From ce2aa7a1010a5ff7cccc5a717d83eea6a60ae9cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Mon, 22 Dec 2025 15:14:13 +0100 Subject: [PATCH] fix: improve print layout and exclude paid bills MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Force white background on print preview page regardless of color scheme - Exclude paid bills from print view - Add proper spacing for printed barcodes - Remove legacy barcodeImage support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- app/lib/actions/printActions.ts | 10 ++++------ app/ui/PrintPreview.tsx | 8 +++++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/lib/actions/printActions.ts b/app/lib/actions/printActions.ts index 7c8c04f..300043e 100644 --- a/app/lib/actions/printActions.ts +++ b/app/lib/actions/printActions.ts @@ -45,7 +45,8 @@ export const fetchBarcodeDataForPrint = withUser(async (user: AuthenticatedUser, bills: 1, barcodeImage: 1, hub3aText: 1, - payedAmount: 1 + payedAmount: 1, + paid: 1 } }) .toArray(); @@ -55,11 +56,8 @@ export const fetchBarcodeDataForPrint = withUser(async (user: AuthenticatedUser, for (const location of locations) { for (const bill of location.bills) { - // Only include bills that have barcode images - if ( ( bill.hub3aText && bill.hub3aText.trim() !== "") || - // LEGACY SUPPORT ... untill all bills have been migrated - (bill.barcodeImage && bill.barcodeImage.trim() !== "") - ) { + // Only include bills that have barcode images and are NOT PAID + if ( ( bill.hub3aText && bill.hub3aText.trim() !== "" && !bill.paid) ) { printData.push({ locationName: location.name, billName: bill.name, diff --git a/app/ui/PrintPreview.tsx b/app/ui/PrintPreview.tsx index 27ca889..11c731f 100644 --- a/app/ui/PrintPreview.tsx +++ b/app/ui/PrintPreview.tsx @@ -24,6 +24,12 @@ export const PrintPreview: React.FC = ({ data, year, month, t return ( <> {/* Print-specific CSS styles */} +