mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-10 22:06:52 +00:00
fix: Form dashboard showing wrong balance
This commit is contained in:
@@ -433,6 +433,7 @@ def get_leave_details(employee, date):
|
||||
'from_date': ('<=', date),
|
||||
'to_date': ('>=', date),
|
||||
'leave_type': allocation.leave_type,
|
||||
'employee': employee
|
||||
}, 'SUM(total_leaves_allocated)') or 0
|
||||
|
||||
remaining_leaves = get_leave_balance_on(employee, d, date, to_date = allocation.to_date,
|
||||
@@ -597,7 +598,7 @@ def get_leave_entries(employee, leave_type, from_date, to_date):
|
||||
is_carry_forward, is_expired
|
||||
FROM `tabLeave Ledger Entry`
|
||||
WHERE employee=%(employee)s AND leave_type=%(leave_type)s
|
||||
AND docstatus=1
|
||||
AND docstatus=1
|
||||
AND (leaves<0
|
||||
OR is_expired=1)
|
||||
AND (from_date between %(from_date)s AND %(to_date)s
|
||||
|
||||
Reference in New Issue
Block a user