Salary Component can be equal to zero

This commit is contained in:
Himanshu Warekar 2019-03-05 17:44:07 +05:30
parent a5f2962c16
commit 219b9f4150

View File

@ -11,8 +11,8 @@ from frappe.utils import getdate, date_diff
class AdditionalSalary(Document):
def validate(self):
self.validate_dates()
if self.amount <= 0:
frappe.throw(_("Amount should be greater than zero."))
if self.amount < 0:
frappe.throw(_("Amount should not be less than zero."))
def validate_dates(self):
date_of_joining, relieving_date = frappe.db.get_value("Employee", self.employee,