Merge pull request #24842 from resilient-tech/allow-duplicate-additional
fix(payroll): allow duplicate additional salaries
This commit is contained in:
commit
23b6294f5c
@ -9,17 +9,10 @@ from frappe import _, bold
|
|||||||
from frappe.utils import getdate, date_diff, comma_and, formatdate
|
from frappe.utils import getdate, date_diff, comma_and, formatdate
|
||||||
|
|
||||||
class AdditionalSalary(Document):
|
class AdditionalSalary(Document):
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
if self.ref_doctype == "Employee Advance" and self.ref_docname:
|
if self.ref_doctype == "Employee Advance" and self.ref_docname:
|
||||||
frappe.db.set_value("Employee Advance", self.ref_docname, "return_amount", self.amount)
|
frappe.db.set_value("Employee Advance", self.ref_docname, "return_amount", self.amount)
|
||||||
|
|
||||||
def before_insert(self):
|
|
||||||
if frappe.db.exists("Additional Salary", {"employee": self.employee, "salary_component": self.salary_component,
|
|
||||||
"amount": self.amount, "payroll_date": self.payroll_date, "company": self.company, "docstatus": 1}):
|
|
||||||
|
|
||||||
frappe.throw(_("Additional Salary Component Exists."))
|
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_dates()
|
self.validate_dates()
|
||||||
self.validate_salary_structure()
|
self.validate_salary_structure()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user