mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-14 17:33:09 +00:00
fix: Consider only Approved leave applications in LWP, Employee Benefit calculations
- do not allow submitting leave applications with 'Cancelled' status
This commit is contained in:
@@ -216,6 +216,7 @@ def calculate_lwp(employee, start_date, holidays, working_days):
|
||||
where t2.name = t1.leave_type
|
||||
and t2.is_lwp = 1
|
||||
and t1.docstatus = 1
|
||||
and t1.status = 'Approved'
|
||||
and t1.employee = %(employee)s
|
||||
and CASE WHEN t2.include_holiday != 1 THEN %(dt)s not in ('{0}') and %(dt)s between from_date and to_date
|
||||
WHEN t2.include_holiday THEN %(dt)s between from_date and to_date
|
||||
|
||||
@@ -477,6 +477,7 @@ class SalarySlip(TransactionBase):
|
||||
WHERE t2.name = t1.leave_type
|
||||
AND (t2.is_lwp = 1 or t2.is_ppl = 1)
|
||||
AND t1.docstatus = 1
|
||||
AND t1.status = 'Approved'
|
||||
AND t1.employee = %(employee)s
|
||||
AND ifnull(t1.salary_slip, '') = ''
|
||||
AND CASE
|
||||
|
||||
Reference in New Issue
Block a user