From c7ef8dda79c0df5434c5c115d003ead344b1868a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 29 May 2015 17:31:51 +0530 Subject: [PATCH] [fix] Pricing Rule based on qty --- erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index 0ed4433a1d..70d6fb9c14 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -205,9 +205,9 @@ def get_pricing_rules(args): def filter_pricing_rules(args, pricing_rules): # filter for qty - if pricing_rules and args.get("qty"): - pricing_rules = filter(lambda x: (args.qty>=flt(x.min_qty) - and (args.qty<=x.max_qty if x.max_qty else True)), pricing_rules) + if pricing_rules: + pricing_rules = filter(lambda x: (flt(args.get("qty"))>=flt(x.min_qty) + and (flt(args.get("qty"))<=x.max_qty if x.max_qty else True)), pricing_rules) # find pricing rule with highest priority if pricing_rules: