fix: track status for pending leaves

This commit is contained in:
Mangesh-Khairnar 2019-06-19 13:00:52 +05:30
parent 1db0fc91a5
commit 12a2b21465
3 changed files with 5 additions and 5 deletions

View File

@ -4,9 +4,8 @@
// render // render
frappe.listview_settings['Leave Allocation'] = { frappe.listview_settings['Leave Allocation'] = {
get_indicator: function(doc) { get_indicator: function(doc) {
if(doc.status==="Expired") { if(doc.status==="Expired") {
return [__("Expired"), "darkgrey", "status, =, Expired"]; return [__("Expired"), "darkgrey", "status, =, Expired"];
} }
}, },
right_column: "grand_total"
}; };

View File

@ -496,6 +496,7 @@ def get_pending_leaves_for_period(employee, leave_type, from_date, to_date):
"leave_type": leave_type, "leave_type": leave_type,
"from_date": ("<=", from_date), "from_date": ("<=", from_date),
"to_date": (">=", to_date), "to_date": (">=", to_date),
"status": "Open"
}, fieldname=['SUM(total_leave_days)']) or flt(0) }, fieldname=['SUM(total_leave_days)']) or flt(0)
def get_remaining_leaves(allocation, leaves_taken, date, expiry): def get_remaining_leaves(allocation, leaves_taken, date, expiry):

View File

@ -89,5 +89,5 @@ def get_leave_encashment_records():
encashment_date encashment_date
FROM `tabLeave Encashment` FROM `tabLeave Encashment`
WHERE WHERE
AND docstatus=1 docstatus=1
""", as_dict=1) """, as_dict=1)