From f5dee777ddd94dbccc7fbb20a385c76b95c822c6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 2 Aug 2017 19:08:24 +0530 Subject: [PATCH] minor fix in applying pricing rule --- erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index a701024baf..57f9f832d0 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -285,8 +285,9 @@ def get_pricing_rules(args): def filter_pricing_rules(args, pricing_rules): # filter for qty - stock_qty = args.get('qty') * args.get('conversion_factor', 1) if pricing_rules: + stock_qty = flt(args.get('qty')) * args.get('conversion_factor', 1) + pricing_rules = filter(lambda x: (flt(stock_qty)>=flt(x.min_qty) and (flt(stock_qty)<=x.max_qty if x.max_qty else True)), pricing_rules)