Merge pull request #32238 from rohitwaghchaure/fix-pricing-rules-issues

fix: suggestion threshold label and rule was not working for other item with min and max amount
This commit is contained in:
rohitwaghchaure
2022-09-17 12:11:24 +05:30
committed by GitHub
6 changed files with 125 additions and 40 deletions

View File

@@ -572,6 +572,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":