From 5c1c474e930e4cb88ec4e3d4ec6df5a34919ee15 Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Thu, 10 Jul 2025 16:05:56 +0000 Subject: [PATCH] Fix: Product Sale Report was not showing "H H " and also printing was an issue. --- barker/barker/printing/product_sale_report.py | 10 +++++----- barker/barker/routers/reports/product_sale_report.py | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/barker/barker/printing/product_sale_report.py b/barker/barker/printing/product_sale_report.py index 39efa00..adb1dc6 100644 --- a/barker/barker/printing/product_sale_report.py +++ b/barker/barker/printing/product_sale_report.py @@ -48,11 +48,11 @@ def design_product_sale_report(report: ProductSaleReport) -> str: s += ( f"\n\r{item.name: ^42.42}" f"\n\r" - + (f"{item['kot']: >7.2f} " if item["kot"] else " ") - + (f"{item['regularBill']: >7.2f} " if item["regularBill"] else " ") - + (f"{item['noCharge']: >7.2f} " if item["noCharge"] else " ") - + (f"{item['staff']: >7.2f} " if item["staff"] else " ") - + (f"{item['void']: >7.2f}" if item["void"] else " ") + + (f"{item['KOT']: >7.2f} " if item["KOT"] else " ") + + (f"{item['REGULAR_BILL']: >7.2f} " if item["REGULAR_BILL"] else " ") + + (f"{item['NO_CHARGE']: >7.2f} " if item["NO_CHARGE"] else " ") + + (f"{item['STAFF']: >7.2f} " if item["STAFF"] else " ") + + (f"{item['VOID']: >7.2f}" if item["VOID"] else " ") ) s += "\n\r" + "=" * 42 return s diff --git a/barker/barker/routers/reports/product_sale_report.py b/barker/barker/routers/reports/product_sale_report.py index 6afbee1..120188f 100644 --- a/barker/barker/routers/reports/product_sale_report.py +++ b/barker/barker/routers/reports/product_sale_report.py @@ -101,7 +101,9 @@ def product_sale_report( if old: old[type_] = old[type_] + quantity else: - item = ProductSaleReportItem(product_version_id=product_version_id, name=name, is_happy_hour=hh) + item = ProductSaleReportItem( + product_version_id=product_version_id, name=f"{'H H ' if hh else ''}{name}", is_happy_hour=hh + ) item[type_] = quantity info.append(item) return info