mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-07 07:20:26 +00:00
fix: clear contribution table on reselection of sales person
This commit is contained in:
@@ -18,6 +18,11 @@ frappe.ui.form.on('Sales Commission', {
|
||||
}
|
||||
},
|
||||
|
||||
sales_person: function (frm) {
|
||||
frm.clear_table('contributions');
|
||||
frm.refresh();
|
||||
},
|
||||
|
||||
get_contributions: function (frm) {
|
||||
frm.clear_table("contributions");
|
||||
return frappe.call({
|
||||
|
||||
@@ -10,7 +10,7 @@ from frappe.utils import get_link_to_form
|
||||
class SalesCommission(Document):
|
||||
def validate(self):
|
||||
self.validate_from_to_dates()
|
||||
self.validate_amount()
|
||||
|
||||
self.validate_salary_component()
|
||||
self.calculate_total_contribution_and_total_commission_amount()
|
||||
|
||||
@@ -27,6 +27,7 @@ class SalesCommission(Document):
|
||||
frappe.throw(_("Please set {0} in {1}").format(frappe.bold("Salary Component for Sales Commission"), get_link_to_form("Payroll Settings", "Payroll Settings")))
|
||||
|
||||
def on_submit(self):
|
||||
self.validate_amount()
|
||||
self.db_set("status", "Unpaid")
|
||||
|
||||
@frappe.whitelist()
|
||||
|
||||
Reference in New Issue
Block a user