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)} +
+ )}