fix: suggestion threshold label and rule was not working for other items with min and max amount

This commit is contained in:
Rohit Waghchaure
2022-09-16 15:23:10 +05:30
parent 72d5366e96
commit f5bd3fa952
6 changed files with 125 additions and 40 deletions

View File

@@ -567,6 +567,11 @@ class AccountsController(TransactionBase):
# if user changed the discount percentage then set user's discount percentage ?
if pricing_rule_args.get("price_or_product_discount") == "Price":
item.set("pricing_rules", pricing_rule_args.get("pricing_rules"))
if pricing_rule_args.get("apply_rule_on_other_items"):
other_items = json.loads(pricing_rule_args.get("apply_rule_on_other_items"))
if other_items and item.item_code not in other_items:
return
item.set("discount_percentage", pricing_rule_args.get("discount_percentage"))
item.set("discount_amount", pricing_rule_args.get("discount_amount"))
if pricing_rule_args.get("pricing_rule_for") == "Rate":