mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
fix: calculated discount percentage (#24510)
* fix: calculated discount percentage * fix: slider Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
@@ -26,6 +26,7 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
|||||||
|
|
||||||
if (item.discount_amount) {
|
if (item.discount_amount) {
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
frappe.model.set_value(item.doctype, item.name, "rate", item_rate);
|
frappe.model.set_value(item.doctype, item.name, "rate", item_rate);
|
||||||
|
|||||||
Reference in New Issue
Block a user