mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
fix: rate changing while making PR (negative discount) (#40539)
This commit is contained in:
@@ -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;
|
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_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);
|
item.discount_percentage = 100 * flt(item.discount_amount) / flt(item.rate_with_margin);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user