fix: Recalculate sales commission on item update
(cherry picked from commit f76da50b7e)
This commit is contained in:
@@ -139,7 +139,7 @@ class SellingController(StockController):
|
||||
self.in_words = money_in_words(amount, self.currency)
|
||||
|
||||
def calculate_commission(self):
|
||||
if not self.meta.get_field("commission_rate") or self.docstatus.is_submitted():
|
||||
if not self.meta.get_field("commission_rate"):
|
||||
return
|
||||
|
||||
self.round_floats_in(self, ("amount_eligible_for_commission", "commission_rate"))
|
||||
|
||||
@@ -1529,6 +1529,7 @@
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 1,
|
||||
"fieldname": "amount_eligible_for_commission",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Amount Eligible for Commission",
|
||||
@@ -1644,7 +1645,7 @@
|
||||
"idx": 105,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2024-03-20 16:04:43.627183",
|
||||
"modified": "2024-03-29 16:27:41.539613",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Selling",
|
||||
"name": "Sales Order",
|
||||
|
||||
@@ -517,6 +517,8 @@ class SalesOrder(SellingController):
|
||||
pass
|
||||
|
||||
def on_update_after_submit(self):
|
||||
self.calculate_commission()
|
||||
self.calculate_contribution()
|
||||
self.check_credit_limit()
|
||||
|
||||
def before_update_after_submit(self):
|
||||
|
||||
Reference in New Issue
Block a user