From 446c2b0e91dab07a0315a08380474736af3c1be8 Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Thu, 17 Aug 2017 12:39:35 +0530 Subject: [PATCH] [hotfix] fixes for https://github.com/frappe/erpnext/issues/9782 calculate leave without pay before subtracting holidays (#10355) --- erpnext/hr/doctype/salary_slip/salary_slip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 1d17613381..356104e69c 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -231,12 +231,12 @@ class SalarySlip(TransactionBase): holidays = self.get_holidays_for_employee(self.start_date, self.end_date) working_days = date_diff(self.end_date, self.start_date) + 1 + actual_lwp = self.calculate_lwp(holidays, working_days) if not cint(frappe.db.get_value("HR Settings", None, "include_holidays_in_total_working_days")): working_days -= len(holidays) if working_days < 0: frappe.throw(_("There are more holidays than working days this month.")) - actual_lwp = self.calculate_lwp(holidays, working_days) if not lwp: lwp = actual_lwp elif lwp != actual_lwp: