From f74010d379dc006eb1483650a02b5527f312dcd9 Mon Sep 17 00:00:00 2001 From: KanchanChauhan Date: Thu, 11 May 2017 11:42:35 +0530 Subject: [PATCH] Calculations based on working and payment days should be made if salary structure exists (#8770) --- erpnext/hr/doctype/salary_slip/salary_slip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index c7bbe65a47a..e18fc27e671 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -327,10 +327,10 @@ class SalarySlip(TransactionBase): relieving_date = getdate(self.end_date) if not joining_date: - frappe.throw(_("Please set the Date Of Joining for employee {0}").format(frappe.bold(employee.employee))) + frappe.throw(_("Please set the Date Of Joining for employee {0}").format(frappe.bold(self.employee_name))) for d in self.get(component_type): - if ((cint(d.depends_on_lwp) == 1 and not self.salary_slip_based_on_timesheet) or\ + if self.salary_structure and ((cint(d.depends_on_lwp) == 1 and not self.salary_slip_based_on_timesheet) or\ getdate(self.start_date) < joining_date or getdate(self.end_date) > relieving_date): d.amount = rounded((flt(d.default_amount) * flt(self.payment_days)