[Fix] Issue, local variable 'leaves_encashed' referenced before assignment

This commit is contained in:
Rohit Waghchaure 2018-05-16 09:39:44 +05:30
parent 4671c53eb0
commit d3e84a6944

View File

@ -388,6 +388,7 @@ def get_leave_balance_on(employee, leave_type, date, allocation_records=None,
date = allocation.to_date
leaves_taken = get_leaves_for_period(employee, leave_type, allocation.from_date, date, status="Approved")
leaves_encashed = 0
if frappe.db.get_value("Leave Type", leave_type, 'allow_encashment') and consider_encshed_leaves:
leaves_encashed = flt(allocation.total_leaves_encashed)