From afbbdcb80296f4bc0da333785467435da28d0cd5 Mon Sep 17 00:00:00 2001 From: Afshan <33727827+AfshanKhan@users.noreply.github.com> Date: Thu, 11 Feb 2021 20:11:30 +0530 Subject: [PATCH] fix: calculate discount amount (#24511) --- erpnext/public/js/controllers/taxes_and_totals.js | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index 8281bd98e4a..b30db7cb1d8 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -24,6 +24,7 @@ erpnext.taxes_and_totals = erpnext.payments.extend({ if (item.discount_amount) { item.rate = flt((item.rate_with_margin) - (item.discount_amount), precision('rate', item)); + item.discount_percentage = 100 * flt(item.discount_amount) / flt(item.rate_with_margin); } },