Fixed include holiday logic in leave calculation
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index d1ec4b1..228f2bd 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -239,14 +239,15 @@
if not leave_app.half_day:
tot_days = date_diff(leave_app.to_date, leave_app.from_date) + 1
if frappe.db.get_value("Leave Type", leave_app.leave_type, "include_holiday"):
+ ret = {
+ 'total_leave_days' : flt(tot_days)
+ }
+ else:
holidays = leave_app.get_holidays()
ret = {
'total_leave_days' : flt(tot_days)-flt(holidays)
}
- else:
- ret = {
- 'total_leave_days' : flt(tot_days)
- }
+
return ret
@frappe.whitelist()