mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 21:52:21 +01:00
fix: incorrect discount on other item
When discount is applied on other item, don't update `discount_amount`
as the amount is calculated for current item
(cherry picked from commit 654764e398)
This commit is contained in:
@@ -1733,6 +1733,10 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
me.frm.doc.items.forEach(d => {
|
me.frm.doc.items.forEach(d => {
|
||||||
if (in_list(JSON.parse(data.apply_rule_on_other_items), d[data.apply_rule_on])) {
|
if (in_list(JSON.parse(data.apply_rule_on_other_items), d[data.apply_rule_on])) {
|
||||||
for(var k in data) {
|
for(var k in data) {
|
||||||
|
if (data.pricing_rule_for == "Discount Percentage" && data.apply_rule_on_other_items && k == "discount_amount") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (in_list(fields, k) && data[k] && (data.price_or_product_discount === 'Price' || k === 'pricing_rules')) {
|
if (in_list(fields, k) && data[k] && (data.price_or_product_discount === 'Price' || k === 'pricing_rules')) {
|
||||||
frappe.model.set_value(d.doctype, d.name, k, data[k]);
|
frappe.model.set_value(d.doctype, d.name, k, data[k]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user