Merge pull request #41956 from ruthra-kumar/discount_on_other_item

fix: incorrect discount on other item
This commit is contained in:
ruthra kumar
2024-06-21 15:51:17 +05:30
committed by GitHub

View File

@@ -1743,6 +1743,10 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
me.frm.doc.items.forEach(d => {
if (in_list(JSON.parse(data.apply_rule_on_other_items), d[data.apply_rule_on])) {
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')) {
frappe.model.set_value(d.doctype, d.name, k, data[k]);
}