mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
Merge pull request #23131 from Anurag810/leave_application_form_dashboard_fixes
fix: Form dashboard showing wrong balance
This commit is contained in:
@@ -433,6 +433,8 @@ def get_leave_details(employee, date):
|
|||||||
'from_date': ('<=', date),
|
'from_date': ('<=', date),
|
||||||
'to_date': ('>=', date),
|
'to_date': ('>=', date),
|
||||||
'leave_type': allocation.leave_type,
|
'leave_type': allocation.leave_type,
|
||||||
|
'employee': employee,
|
||||||
|
'docstatus': 1
|
||||||
}, 'SUM(total_leaves_allocated)') or 0
|
}, 'SUM(total_leaves_allocated)') or 0
|
||||||
|
|
||||||
remaining_leaves = get_leave_balance_on(employee, d, date, to_date = allocation.to_date,
|
remaining_leaves = get_leave_balance_on(employee, d, date, to_date = allocation.to_date,
|
||||||
@@ -597,7 +599,7 @@ def get_leave_entries(employee, leave_type, from_date, to_date):
|
|||||||
is_carry_forward, is_expired
|
is_carry_forward, is_expired
|
||||||
FROM `tabLeave Ledger Entry`
|
FROM `tabLeave Ledger Entry`
|
||||||
WHERE employee=%(employee)s AND leave_type=%(leave_type)s
|
WHERE employee=%(employee)s AND leave_type=%(leave_type)s
|
||||||
AND docstatus=1
|
AND docstatus=1
|
||||||
AND (leaves<0
|
AND (leaves<0
|
||||||
OR is_expired=1)
|
OR is_expired=1)
|
||||||
AND (from_date between %(from_date)s AND %(to_date)s
|
AND (from_date between %(from_date)s AND %(to_date)s
|
||||||
@@ -790,4 +792,4 @@ def get_leave_approver(employee):
|
|||||||
leave_approver = frappe.db.get_value('Department Approver', {'parent': department,
|
leave_approver = frappe.db.get_value('Department Approver', {'parent': department,
|
||||||
'parentfield': 'leave_approvers', 'idx': 1}, 'approver')
|
'parentfield': 'leave_approvers', 'idx': 1}, 'approver')
|
||||||
|
|
||||||
return leave_approver
|
return leave_approver
|
||||||
|
|||||||
Reference in New Issue
Block a user