fix(payroll-entry): show make bank entry button (#18497)

* fix(payroll-entry): show make bank entry button when manually submitting salary slip

* Update payroll_entry.py
This commit is contained in:
Mangesh-Khairnar 2019-08-05 10:21:19 +05:30 committed by Nabin Hait
parent f9fb92ebb0
commit 31c5c1e562

View File

@ -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 or self.salary_slips_submitted:
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()