fix: track status for pending leaves
diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation_list.js b/erpnext/hr/doctype/leave_allocation/leave_allocation_list.js
index 946b4f8..3ea0e24 100644
--- a/erpnext/hr/doctype/leave_allocation/leave_allocation_list.js
+++ b/erpnext/hr/doctype/leave_allocation/leave_allocation_list.js
@@ -4,9 +4,8 @@
 // render
 frappe.listview_settings['Leave Allocation'] = {
 	get_indicator: function(doc) {
-        if(doc.status==="Expired") {
-            return [__("Expired"), "darkgrey", "status, =, Expired"];
-        }
+		if(doc.status==="Expired") {
+			return [__("Expired"), "darkgrey", "status, =, Expired"];
+		}
 	},
-	right_column: "grand_total"
 };
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index f87f7d5..d08c9ed 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -496,6 +496,7 @@
 			"leave_type": leave_type,
 			"from_date": ("<=", from_date),
 			"to_date": (">=", to_date),
+			"status": "Open"
 		}, fieldname=['SUM(total_leave_days)']) or flt(0)
 
 def get_remaining_leaves(allocation, leaves_taken, date, expiry):
diff --git a/erpnext/patches/v12_0/generate_leave_ledger_entries.py b/erpnext/patches/v12_0/generate_leave_ledger_entries.py
index 5b71c16..ffb2e3f 100644
--- a/erpnext/patches/v12_0/generate_leave_ledger_entries.py
+++ b/erpnext/patches/v12_0/generate_leave_ledger_entries.py
@@ -89,5 +89,5 @@
                 encashment_date
             FROM `tabLeave Encashment`
             WHERE
-                AND docstatus=1
+                docstatus=1
         """, as_dict=1)
\ No newline at end of file