fix(hot): Pricing Rule encoding fixed

This commit is contained in:
Rushabh Mehta
2020-08-25 11:59:57 +05:30
parent f6b4eb27ab
commit ff5d19609f
3 changed files with 13 additions and 11 deletions

View File

@@ -325,7 +325,7 @@ class AccountsController(TransactionBase):
apply_pricing_rule_for_free_items(self, pricing_rule_args.get('free_item_data'))
elif pricing_rule_args.get("validate_applied_rule"):
for pricing_rule in get_applied_pricing_rules(item):
for pricing_rule in get_applied_pricing_rules(item.get('pricing_rules')):
pricing_rule_doc = frappe.get_cached_doc("Pricing Rule", pricing_rule)
for field in ['discount_percentage', 'discount_amount', 'rate']:
if item.get(field) < pricing_rule_doc.get(field):