Skip to content

Commit

Permalink
fix: validate the item code when updating the other item's price rule
Browse files Browse the repository at this point in the history
(cherry picked from commit 45de180)
  • Loading branch information
Bhavan23 authored and mergify[bot] committed Sep 9, 2024
1 parent 60b81a2 commit 8f4dc80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe

if (data && data.apply_rule_on_other_items && JSON.parse(data.apply_rule_on_other_items)) {
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]) && d.item_code === data.item_code) {
for(var k in data) {
if (data.pricing_rule_for == "Discount Percentage" && data.apply_rule_on_other_items && k == "discount_amount") {
continue;
Expand Down

0 comments on commit 8f4dc80

Please sign in to comment.