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.

This commit is contained in:
Amritanshu Agrawal 2021-07-04 08:21:24 +05:30
parent 997e8e2dd0
commit 38ccaa167c

View File

@ -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: