Employee Benefit Application - refactor validation
This commit is contained in:
parent
9d5d328a4f
commit
c5629efe0e
@ -12,13 +12,11 @@ from frappe.desk.reportview import get_match_cond
|
|||||||
|
|
||||||
class EmployeeBenefitApplication(Document):
|
class EmployeeBenefitApplication(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
self.validate_duplicate_on_payroll_period()
|
||||||
if self.max_benefits <= 0:
|
if self.max_benefits <= 0:
|
||||||
frappe.throw(_("Employee {0} has no maximum benefit amount").format(self.employee))
|
frappe.throw(_("Employee {0} has no maximum benefit amount").format(self.employee))
|
||||||
self.validate_max_benefit_for_component()
|
self.validate_max_benefit_for_component()
|
||||||
|
|
||||||
def before_submit(self):
|
|
||||||
self.validate_duplicate_on_payroll_period()
|
|
||||||
|
|
||||||
def validate_max_benefit_for_component(self):
|
def validate_max_benefit_for_component(self):
|
||||||
if self.employee_benefits:
|
if self.employee_benefits:
|
||||||
max_benefit_amount = 0
|
max_benefit_amount = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user