From d24f4d287382939d8a679c1c9444b116a2bf3e18 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 16:05:41 +0530 Subject: [PATCH] fix(client): Amount calculation for 0 qty debit notes (#34455) fix(client): Amount calculation for 0 qty debit notes (#34455) fix(client): Amount calculaton for 0 qty debit notes Co-authored-by: Anand Baburajan (cherry picked from commit ee6c107d588ca30e909d9add4a026755eda722de) Co-authored-by: Deepesh Garg --- erpnext/public/js/controllers/taxes_and_totals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index d1a55e6f424..8e57ebd3677 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -135,7 +135,7 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments { } else { // allow for '0' qty on Credit/Debit notes - let qty = item.qty || -1 + let qty = item.qty || me.frm.doc.is_debit_note ? 1 : -1; item.net_amount = item.amount = flt(item.rate * qty, precision("amount", item)); }