mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-15 01:43:10 +00:00
fix: pricing rule not working for production discount
This commit is contained in:
@@ -319,8 +319,8 @@ class AccountsController(TransactionBase):
|
||||
if item.get('discount_amount'):
|
||||
item.rate = item.price_list_rate - item.discount_amount
|
||||
|
||||
elif pricing_rule_args.get('free_item'):
|
||||
apply_pricing_rule_for_free_items(self, pricing_rule_args)
|
||||
elif pricing_rule_args.get('free_item_data'):
|
||||
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):
|
||||
|
||||
@@ -735,10 +735,6 @@ class BuyingController(StockController):
|
||||
if not self.get("items"):
|
||||
return
|
||||
|
||||
earliest_schedule_date = min([d.schedule_date for d in self.get("items")])
|
||||
if earliest_schedule_date:
|
||||
self.schedule_date = earliest_schedule_date
|
||||
|
||||
if self.schedule_date:
|
||||
for d in self.get('items'):
|
||||
if not d.schedule_date:
|
||||
@@ -750,6 +746,10 @@ class BuyingController(StockController):
|
||||
else:
|
||||
frappe.throw(_("Please enter Reqd by Date"))
|
||||
|
||||
earliest_schedule_date = min([d.schedule_date for d in self.get("items")])
|
||||
if earliest_schedule_date:
|
||||
self.schedule_date = earliest_schedule_date
|
||||
|
||||
def validate_items(self):
|
||||
# validate items to see if they have is_purchase_item or is_subcontracted_item enabled
|
||||
if self.doctype=="Material Request": return
|
||||
|
||||
Reference in New Issue
Block a user