From 38ccaa167cfc3996becfbd7b3ca8ab372f78eeb0 Mon Sep 17 00:00:00 2001 From: tanshu Date: Sun, 4 Jul 2021 08:21:24 +0530 Subject: [PATCH] Fix: If there were products with differing discounts in the final bill, the printed bill would show the wrong amount when it summed up the products. It would apply the discount rate of the first instance of the product too all of it. --- barker/barker/printing/bill.py | 1 + 1 file changed, 1 insertion(+) diff --git a/barker/barker/printing/bill.py b/barker/barker/printing/bill.py index 541ffd8..da5e6ed 100644 --- a/barker/barker/printing/bill.py +++ b/barker/barker/printing/bill.py @@ -40,6 +40,7 @@ def print_bill(voucher_id: uuid.UUID, db: Session): key = ( i.product_id, i.is_happy_hour, + i.discount, frozenset(m.modifier_id for m in i.modifiers if m.modifier.show_in_bill), ) if key in items_dict: