mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
Merge branch 'develop' of https://github.com/meatechsupport/erpnext into meatechsupport-develop
This commit is contained in:
@@ -238,10 +238,15 @@ def get_total_leave_days(leave_app):
|
|||||||
ret = {'total_leave_days' : 0.5}
|
ret = {'total_leave_days' : 0.5}
|
||||||
if not leave_app.half_day:
|
if not leave_app.half_day:
|
||||||
tot_days = date_diff(leave_app.to_date, leave_app.from_date) + 1
|
tot_days = date_diff(leave_app.to_date, leave_app.from_date) + 1
|
||||||
holidays = leave_app.get_holidays()
|
if frappe.db.get_value("Leave Type", self.leave_type, "include_holiday"):
|
||||||
ret = {
|
holidays = leave_app.get_holidays()
|
||||||
'total_leave_days' : flt(tot_days)-flt(holidays)
|
ret = {
|
||||||
}
|
'total_leave_days' : flt(tot_days)-flt(holidays)
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
ret = {
|
||||||
|
'total_leave_days' : flt(tot_days)
|
||||||
|
}
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
|
|||||||
@@ -59,6 +59,12 @@
|
|||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Allow Negative Balance",
|
"label": "Allow Negative Balance",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "include_holiday",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Include holidays within leaves as leaves",
|
||||||
|
"permlevel": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "icon-flag",
|
"icon": "icon-flag",
|
||||||
|
|||||||
Reference in New Issue
Block a user