From e2295b4e2fad0fdfb1afefa66b4e63d924c1434a Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Mon, 20 Jun 2022 18:52:40 +0200 Subject: [PATCH] fix: apply price list rate --- erpnext/public/js/controllers/transaction.js | 50 ++++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 01f72adf34..1f86718990 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -1483,48 +1483,46 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe } _set_values_for_item_list(children) { - var me = this; - var items_rule_dict = {}; + const items_rule_dict = {}; - for(var i=0, l=children.length; i 0) { - me.apply_product_discount(d); + if (child.free_item_data.length > 0) { + this.apply_product_discount(child); } - if (d.apply_rule_on_other_items) { - items_rule_dict[d.name] = d; + if (child.apply_rule_on_other_items) { + items_rule_dict[child.name] = child; } } - me.frm.refresh_field('items'); - me.apply_rule_on_other_items(items_rule_dict); - - me.calculate_taxes_and_totals(); + this.apply_rule_on_other_items(items_rule_dict); + this.calculate_taxes_and_totals(); } apply_rule_on_other_items(args) {