From 5a5449c60c68d58d8901952633920432fa1fe7bb Mon Sep 17 00:00:00 2001 From: Sagar Vora <16315650+sagarvora@users.noreply.github.com> Date: Fri, 6 Jun 2025 11:35:30 +0530 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20calculate=20discount=20percent?= =?UTF-8?q?age=20if=20discount=20amount=20is=20specified=20(#=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit bb474f4f42aa6c5385a63df31c9d9af14238fad8. (cherry picked from commit 27dc0f5b7076f0dfdc19074f2d86c032e6bae83b) --- erpnext/controllers/taxes_and_totals.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index c47f04b71f1..5543129d323 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -13,7 +13,6 @@ from frappe.utils.deprecations import deprecated import erpnext from erpnext.accounts.doctype.journal_entry.journal_entry import get_exchange_rate from erpnext.accounts.doctype.pricing_rule.utils import get_applied_pricing_rules -from erpnext.accounts.utils import get_currency_precision from erpnext.controllers.accounts_controller import ( validate_conversion_rate, validate_inclusive_tax, @@ -675,16 +674,7 @@ class calculate_taxes_and_totals: tax.item_wise_tax_detail = json.dumps(tax.item_wise_tax_detail, separators=(",", ":")) def set_discount_amount(self): - if self.doc.discount_amount: - self.doc.additional_discount_percentage = flt( - flt( - self.doc.discount_amount / flt(self.doc.get(scrub(self.doc.apply_discount_on))), - get_currency_precision(), - ) - * 100, - self.doc.precision("additional_discount_percentage"), - ) - elif self.doc.additional_discount_percentage: + if self.doc.additional_discount_percentage: self.doc.discount_amount = flt( flt(self.doc.get(scrub(self.doc.apply_discount_on))) * self.doc.additional_discount_percentage