mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-07 07:20:26 +00:00
Merge pull request #28017 from frappe/mergify/bp/version-12-hotfix/pr-27728
fix: Employee Leave Balance report should only consider ledgers of transaction type Leave Allocation (backport #27728)
This commit is contained in:
@@ -124,11 +124,12 @@ def get_allocated_and_expired_leaves(records, from_date, to_date):
|
||||
def get_leave_ledger_entries(from_date, to_date, employee, leave_type):
|
||||
records= frappe.db.sql("""
|
||||
SELECT
|
||||
employee, leave_type, from_date, to_date, leaves, transaction_name, transaction_type
|
||||
is_carry_forward, is_expired
|
||||
employee, leave_type, from_date, to_date, leaves, transaction_name,
|
||||
transaction_type, is_carry_forward, is_expired
|
||||
FROM `tabLeave Ledger Entry`
|
||||
WHERE employee=%(employee)s AND leave_type=%(leave_type)s
|
||||
AND docstatus=1
|
||||
AND transaction_type = 'Leave Allocation'
|
||||
AND (from_date between %(from_date)s AND %(to_date)s
|
||||
OR to_date between %(from_date)s AND %(to_date)s
|
||||
OR (from_date < %(from_date)s AND to_date > %(to_date)s))
|
||||
|
||||
Reference in New Issue
Block a user