Skip to content

Commit

Permalink
fix: rate changing while making PR (negative discount) (#40539)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure authored Mar 19, 2024
1 parent a64c2ec commit 8136954
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 8136954

Please sign in to comment.