Merge pull request #14063 from rohitwaghchaure/leaves_encashed_code_cleanup

[Fix] Issue, local variable 'leaves_encashed' referenced before assignment
This commit is contained in:
rohitwaghchaure 2018-05-16 09:41:00 +05:30 committed by GitHub
commit b749acf3fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)