fix(payroll-entry): show make bank entry button when manually submitting salary slip (#18499)
This commit is contained in:
committed by
Anurag Mishra
parent
4b963be8c4
commit
95058eac21
@@ -12,6 +12,16 @@ from erpnext.accounts.utils import get_fiscal_year
|
|||||||
from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee
|
from erpnext.hr.doctype.employee.employee import get_holiday_list_for_employee
|
||||||
|
|
||||||
class PayrollEntry(Document):
|
class PayrollEntry(Document):
|
||||||
|
def onload(self):
|
||||||
|
if not self.docstatus==1:
|
||||||
|
return
|
||||||
|
|
||||||
|
# check if salary slips were manually submitted
|
||||||
|
entries = frappe.db.count("Salary Slip", {'payroll_entry': self.name, 'docstatus': 1}, ['name'])
|
||||||
|
if cint(entries) == len(self.employees) and not self.salary_slips_submitted:
|
||||||
|
self.db_set("salary_slips_submitted", 1)
|
||||||
|
self.reload()
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
self.create_salary_slips()
|
self.create_salary_slips()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user