Merge branch 'hot-fix-leave-application'
This commit is contained in:
commit
aabc634afd
@ -1,2 +1,2 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
__version__ = '6.27.3'
|
__version__ = '6.27.4'
|
||||||
|
@ -7,7 +7,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd."
|
|||||||
app_description = """ERP made simple"""
|
app_description = """ERP made simple"""
|
||||||
app_icon = "icon-th"
|
app_icon = "icon-th"
|
||||||
app_color = "#e74c3c"
|
app_color = "#e74c3c"
|
||||||
app_version = "6.27.3"
|
app_version = "6.27.4"
|
||||||
app_email = "info@erpnext.com"
|
app_email = "info@erpnext.com"
|
||||||
app_license = "GNU General Public License (v3)"
|
app_license = "GNU General Public License (v3)"
|
||||||
source_link = "https://github.com/frappe/erpnext"
|
source_link = "https://github.com/frappe/erpnext"
|
||||||
|
@ -229,14 +229,13 @@ def get_employees_who_are_born_today():
|
|||||||
and status = 'Active'""", {"date": today()}, as_dict=True)
|
and status = 'Active'""", {"date": today()}, as_dict=True)
|
||||||
|
|
||||||
def get_holiday_list_for_employee(employee, raise_exception=True):
|
def get_holiday_list_for_employee(employee, raise_exception=True):
|
||||||
employee = frappe.db.get_value("Employee", employee, ["holiday_list", "company"], as_dict=True)
|
holiday_list, company = frappe.db.get_value("Employee", employee, ["holiday_list", "company"])
|
||||||
holiday_list = employee.holiday_list
|
|
||||||
|
|
||||||
if not holiday_list:
|
if not holiday_list:
|
||||||
holiday_list = frappe.db.get_value("Company", employee.company, "default_holiday_list")
|
holiday_list = frappe.db.get_value("Company", company, "default_holiday_list")
|
||||||
|
|
||||||
if not holiday_list and raise_exception:
|
if not holiday_list and raise_exception:
|
||||||
frappe.throw(_("Please set a Holiday List for either the Employee or the Company"))
|
frappe.throw(_('Please set a default Holiday List for Employee {0} or Company {0}').format(employee, company))
|
||||||
|
|
||||||
return holiday_list
|
return holiday_list
|
||||||
|
|
||||||
|
@ -335,16 +335,14 @@ def get_leave_allocation_records(date, employee=None):
|
|||||||
|
|
||||||
|
|
||||||
def get_holidays(employee, from_date, to_date):
|
def get_holidays(employee, from_date, to_date):
|
||||||
tot_hol = frappe.db.sql("""select count(*) from `tabHoliday` h1, `tabHoliday List` h2, `tabEmployee` e1
|
'''get holidays between two dates for the given employee'''
|
||||||
where e1.name = %s and h1.parent = h2.name and e1.holiday_list = h2.name
|
holiday_list = get_holiday_list_for_employee(employee)
|
||||||
and h1.holiday_date between %s and %s""", (employee, from_date, to_date))[0][0]
|
|
||||||
|
|
||||||
if not tot_hol:
|
holidays = frappe.db.sql("""select count(distinct holiday_date) from `tabHoliday` h1, `tabHoliday List` h2
|
||||||
tot_hol = frappe.db.sql("""select count(distinct holiday_date) from `tabHoliday` h1, `tabHoliday List` h2
|
where h1.parent = h2.name and h1.holiday_date between %s and %s
|
||||||
where h1.parent = h2.name and h1.holiday_date between %s and %s
|
and h2.name = %s""", (from_date, to_date, holiday_list))[0][0]
|
||||||
and h2.is_default = 1""", (from_date, to_date))[0][0]
|
|
||||||
|
|
||||||
return tot_hol
|
return holidays
|
||||||
|
|
||||||
def is_lwp(leave_type):
|
def is_lwp(leave_type):
|
||||||
lwp = frappe.db.sql("select is_lwp from `tabLeave Type` where name = %s", leave_type)
|
lwp = frappe.db.sql("select is_lwp from `tabLeave Type` where name = %s", leave_type)
|
||||||
|
2
setup.py
2
setup.py
@ -1,7 +1,7 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
from pip.req import parse_requirements
|
from pip.req import parse_requirements
|
||||||
|
|
||||||
version = "6.27.3"
|
version = "6.27.4"
|
||||||
requirements = parse_requirements("requirements.txt", session="")
|
requirements = parse_requirements("requirements.txt", session="")
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user