From b5028ada52e544dfca9cc3ac8ad88a4e7b59d354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Wed, 15 Oct 2025 13:36:41 +0200 Subject: [PATCH] fix: update QR code print layout to show payedAmount instead of yearMonth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove billYear and billMonth from second column, add payedAmount as last value. - Update PrintBarcodeData interface to replace yearMonth with payedAmount - Modify fetchBarcodeDataForPrint to include bill.payedAmount - Update PrintPreview display to show payedAmount (formatted from cents) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/lib/actions/printActions.ts | 6 +++--- app/ui/PrintPreview.tsx | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/lib/actions/printActions.ts b/app/lib/actions/printActions.ts index 4007e71..45616b2 100644 --- a/app/lib/actions/printActions.ts +++ b/app/lib/actions/printActions.ts @@ -10,7 +10,7 @@ export interface PrintBarcodeData { locationName: string; billName: string; barcodeImage: string; - yearMonth: string; + payedAmount?: number | null; } /** @@ -38,7 +38,7 @@ export const fetchBarcodeDataForPrint = withUser(async (user: AuthenticatedUser, // Extract and flatten barcode data const printData: PrintBarcodeData[] = []; - + for (const location of locations) { for (const bill of location.bills) { if (bill.barcodeImage && bill.barcodeImage.trim() !== "") { @@ -46,7 +46,7 @@ export const fetchBarcodeDataForPrint = withUser(async (user: AuthenticatedUser, locationName: location.name, billName: bill.name, barcodeImage: bill.barcodeImage, - yearMonth: yearMonth + payedAmount: bill.payedAmount }); } } diff --git a/app/ui/PrintPreview.tsx b/app/ui/PrintPreview.tsx index 55a9576..903ff7e 100644 --- a/app/ui/PrintPreview.tsx +++ b/app/ui/PrintPreview.tsx @@ -117,15 +117,17 @@ export const PrintPreview: React.FC = ({ data, year, month, t
-
- 📅 {item.yearMonth} -
🏠 {item.locationName}
📋 {item.billName}
+ {item.payedAmount && ( +
+ 💰 {(item.payedAmount / 100).toFixed(2)} +
+ )}