From e9affd97acb54fd48934dde410d97f49864fc846 Mon Sep 17 00:00:00 2001 From: Vijaya Raghavan Date: Tue, 24 Sep 2019 17:04:32 +0530 Subject: [PATCH] LWP for half day in multi day leave --- 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 6d25c06393..dc11a0109b 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -255,7 +255,7 @@ class SalarySlip(TransactionBase): for d in range(working_days): dt = add_days(cstr(getdate(self.start_date)), d) leave = frappe.db.sql(""" - select t1.name, t1.half_day + select t1.name, case when t1.half_day_date = %(dt)s or t1.to_date = t1.from_date then t1.half_day else 0 end half_day from `tabLeave Application` t1, `tabLeave Type` t2 where t2.name = t1.leave_type and t2.is_lwp = 1