Minor fixes
This commit is contained in:
parent
1b1b3a8fd6
commit
80142af9b8
@ -126,18 +126,18 @@
|
|||||||
"options": "Supplier Type",
|
"options": "Supplier Type",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "max_qty",
|
|
||||||
"fieldtype": "Float",
|
|
||||||
"label": "Max Qty",
|
|
||||||
"permlevel": 0
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "min_qty",
|
"fieldname": "min_qty",
|
||||||
"fieldtype": "Float",
|
"fieldtype": "Float",
|
||||||
"label": "Min Qty",
|
"label": "Min Qty",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "max_qty",
|
||||||
|
"fieldtype": "Float",
|
||||||
|
"label": "Max Qty",
|
||||||
|
"permlevel": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "col_break1",
|
"fieldname": "col_break1",
|
||||||
"fieldtype": "Column Break",
|
"fieldtype": "Column Break",
|
||||||
@ -235,7 +235,7 @@
|
|||||||
"icon": "icon-gift",
|
"icon": "icon-gift",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"modified": "2014-06-19 15:00:09.962572",
|
"modified": "2014-06-20 19:36:22.502381",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Pricing Rule",
|
"name": "Pricing Rule",
|
||||||
@ -244,8 +244,8 @@
|
|||||||
{
|
{
|
||||||
"create": 1,
|
"create": 1,
|
||||||
"delete": 1,
|
"delete": 1,
|
||||||
"export": 0,
|
"export": 1,
|
||||||
"import": 0,
|
"import": 1,
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 1,
|
"report": 1,
|
||||||
@ -290,7 +290,6 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 1,
|
"report": 1,
|
||||||
"restrict": 1,
|
|
||||||
"role": "System Manager",
|
"role": "System Manager",
|
||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@ class PricingRule(Document):
|
|||||||
if self.price_or_discount == "Discount Percentage" and self.item_code:
|
if self.price_or_discount == "Discount Percentage" and self.item_code:
|
||||||
max_discount = frappe.db.get_value("Item", self.item_code, "max_discount")
|
max_discount = frappe.db.get_value("Item", self.item_code, "max_discount")
|
||||||
if max_discount and flt(self.discount_percentage) > flt(max_discount):
|
if max_discount and flt(self.discount_percentage) > flt(max_discount):
|
||||||
throw(_("Max discount allowed for item: {0} is {1}%".format(self.item_code, max_discount)))
|
throw(_("Max discount allowed for item: {0} is {1}%").format(self.item_code, max_discount))
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------
|
||||||
@ -141,7 +141,8 @@ def get_pricing_rule_for_item(args):
|
|||||||
item_details.pricing_rule = pricing_rule.name
|
item_details.pricing_rule = pricing_rule.name
|
||||||
if pricing_rule.price_or_discount == "Price":
|
if pricing_rule.price_or_discount == "Price":
|
||||||
item_details.update({
|
item_details.update({
|
||||||
"price_list_rate": pricing_rule.price*flt(args.plc_conversion_rate)/flt(args.conversion_rate),
|
"price_list_rate": pricing_rule.price/flt(args.conversion_rate) \
|
||||||
|
if args.conversion_rate else 0.0,
|
||||||
"discount_percentage": 0.0
|
"discount_percentage": 0.0
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
@ -167,10 +168,10 @@ def get_pricing_rules(args):
|
|||||||
|
|
||||||
conditions = ""
|
conditions = ""
|
||||||
for field in ["company", "customer", "supplier", "supplier_type", "campaign", "sales_partner"]:
|
for field in ["company", "customer", "supplier", "supplier_type", "campaign", "sales_partner"]:
|
||||||
if args.get(field):
|
if args.get(field):
|
||||||
conditions += " and ifnull("+field+", '') in (%("+field+")s, '')"
|
conditions += " and ifnull("+field+", '') in (%("+field+")s, '')"
|
||||||
else:
|
else:
|
||||||
conditions += " and ifnull("+field+", '') = ''"
|
conditions += " and ifnull("+field+", '') = ''"
|
||||||
|
|
||||||
for parenttype in ["Customer Group", "Territory"]:
|
for parenttype in ["Customer Group", "Territory"]:
|
||||||
group_condition = _get_tree_conditions(parenttype)
|
group_condition = _get_tree_conditions(parenttype)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user