From f669245a18a6b877ccb428a8023dc2b4ad9021ba Mon Sep 17 00:00:00 2001 From: MOHANKUMAR T <31698165+mohan-13@users.noreply.github.com> Date: Wed, 14 Feb 2024 10:08:19 +0530 Subject: [PATCH] BAH-3578 | Fix. Variable reference which causes failure of quotation creation (#49) --- bahmni_sale/models/sale_order.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bahmni_sale/models/sale_order.py b/bahmni_sale/models/sale_order.py index ff217d9..284be4d 100644 --- a/bahmni_sale/models/sale_order.py +++ b/bahmni_sale/models/sale_order.py @@ -32,10 +32,10 @@ def _compute_amounts(self): amount_tax += line.price_tax amount_total = amount_untaxed + amount_tax - if self.discount_percentage: - tot_discount = amount_total * self.discount_percentage / 100 + if order.discount_percentage: + tot_discount = amount_total * order.discount_percentage / 100 else: - tot_discount = self.discount + tot_discount = order.discount if order.chargeable_amount > 0.0: discount = amount_total - order.chargeable_amount