fix: linting issues
This commit is contained in:
@@ -22,8 +22,7 @@ class SalesCommission(Document):
|
|||||||
frappe.throw(_("Total Commission Amount should be greater than 0"))
|
frappe.throw(_("Total Commission Amount should be greater than 0"))
|
||||||
|
|
||||||
def validate_salary_component(self):
|
def validate_salary_component(self):
|
||||||
if self.pay_via_salary and not frappe.db.get_single_value(
|
if self.pay_via_salary and not frappe.db.get_single_value("Payroll Settings", "salary_component_for_sales_commission"):
|
||||||
"Payroll Settings", "salary_component_for_sales_commission"):
|
|
||||||
frappe.throw(_("Please set {0} in {1}").format(frappe.bold("Salary Component for Sales Commission"), get_link_to_form("Payroll Settings", "Payroll Settings")))
|
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):
|
def on_submit(self):
|
||||||
@@ -121,12 +120,12 @@ class SalesCommission(Document):
|
|||||||
|
|
||||||
def add_references(self, doc):
|
def add_references(self, doc):
|
||||||
reference = {
|
reference = {
|
||||||
'reference_doctype': 'Sales Commission',
|
'reference_doctype': 'Sales Commission',
|
||||||
'reference_name': self.name,
|
'reference_name': self.name,
|
||||||
'due_date': self.to_date,
|
'due_date': self.to_date,
|
||||||
'total_amount': self.total_commission_amount,
|
'total_amount': self.total_commission_amount,
|
||||||
'outstanding_amount': self.total_commission_amount,
|
'outstanding_amount': self.total_commission_amount,
|
||||||
'allocated_amount': self.total_commission_amount,
|
'allocated_amount': self.total_commission_amount,
|
||||||
}
|
}
|
||||||
doc.append("references", reference)
|
doc.append("references", reference)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
frappe.listview_settings['Sales Commission'] = {
|
frappe.listview_settings['Sales Commission'] = {
|
||||||
add_fields: ["total_commission_amount", "status"],
|
add_fields: ["total_commission_amount", "status"],
|
||||||
get_indicator: function (doc) {
|
get_indicator: function (doc) {
|
||||||
if (doc.status == "Paid") {
|
if (doc.status == "Paid") {
|
||||||
return [__(doc.status), "green", "status,=," + doc.status];
|
return [__(doc.status), "green", "status,=," + doc.status];
|
||||||
} else {
|
} else {
|
||||||
return [__(doc.status), "red", "status,=," + doc.status];
|
return [__(doc.status), "red", "status,=," + doc.status];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
Reference in New Issue
Block a user