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

This commit is contained in:
Mangesh-Khairnar
2019-07-27 10:04:18 +05:30
committed by Anurag Mishra
parent 4b963be8c4
commit 95058eac21

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
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):
self.create_salary_slips()