Merge pull request #16460 from nabinhait/pricing-rule-issue
fix: Enforce pricing rule based on rate on server side
This commit is contained in:
commit
d2e2ca31ac
@ -248,7 +248,6 @@ class AccountsController(TransactionBase):
|
|||||||
if self.get("is_subcontracted"):
|
if self.get("is_subcontracted"):
|
||||||
args["is_subcontracted"] = self.is_subcontracted
|
args["is_subcontracted"] = self.is_subcontracted
|
||||||
ret = get_item_details(args)
|
ret = get_item_details(args)
|
||||||
|
|
||||||
for fieldname, value in ret.items():
|
for fieldname, value in ret.items():
|
||||||
if item.meta.get_field(fieldname) and value is not None:
|
if item.meta.get_field(fieldname) and value is not None:
|
||||||
if (item.get(fieldname) is None or fieldname in force_item_fields):
|
if (item.get(fieldname) is None or fieldname in force_item_fields):
|
||||||
@ -267,9 +266,10 @@ class AccountsController(TransactionBase):
|
|||||||
|
|
||||||
if ret.get("pricing_rule"):
|
if ret.get("pricing_rule"):
|
||||||
# if user changed the discount percentage then set user's discount percentage ?
|
# if user changed the discount percentage then set user's discount percentage ?
|
||||||
|
item.set("pricing_rule", ret.get("pricing_rule"))
|
||||||
item.set("discount_percentage", ret.get("discount_percentage"))
|
item.set("discount_percentage", ret.get("discount_percentage"))
|
||||||
if ret.get("pricing_rule_for") == "Price":
|
if ret.get("pricing_rule_for") == "Rate":
|
||||||
item.set("pricing_list_rate", ret.get("pricing_list_rate"))
|
item.set("price_list_rate", ret.get("price_list_rate"))
|
||||||
|
|
||||||
if item.price_list_rate:
|
if item.price_list_rate:
|
||||||
item.rate = flt(item.price_list_rate *
|
item.rate = flt(item.price_list_rate *
|
||||||
|
Loading…
Reference in New Issue
Block a user