fix: rate change on changing of the qty (backport #40241) (#40242)

fix: rate change on changing of the qty (#40241)

(cherry picked from commit e7d707797a)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-03-02 16:49:40 +05:30
committed by GitHub
parent 793fdf9562
commit b937c4be4f

View File

@@ -22,7 +22,7 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
item_rate = flt(item.rate_with_margin , precision("rate", item));
if (item.discount_percentage) {
if (item.discount_percentage && !item.discount_amount) {
item.discount_amount = flt(item.rate_with_margin) * flt(item.discount_percentage) / 100;
}