Skip to content

Commit

Permalink
fix: rate changing while making PR (negative discount) (backport #40539
Browse files Browse the repository at this point in the history
…) (#40540)

fix: rate changing while making PR (negative discount) (#40539)

(cherry picked from commit 8136954)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
  • Loading branch information
mergify[bot] and rohitwaghchaure authored Mar 19, 2024
1 parent 05436df commit 0bdda12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/public/js/controllers/taxes_and_totals.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
item.discount_amount = flt(item.rate_with_margin) * flt(item.discount_percentage) / 100;
}

if (item.discount_amount) {
if (item.discount_amount > 0) {
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);
}
Expand Down

0 comments on commit 0bdda12

Please sign in to comment.