mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
Retirement Age option in HR Settings
This commit is contained in:
@@ -186,7 +186,12 @@ def get_retirement_date(date_of_birth=None):
|
|||||||
ret = {}
|
ret = {}
|
||||||
if date_of_birth:
|
if date_of_birth:
|
||||||
try:
|
try:
|
||||||
dt = getdate(date_of_birth) + datetime.timedelta(21915)
|
retirement_age = frappe.db.get_single_value("HR Settings", "retirement_age")
|
||||||
|
if retirement_age:
|
||||||
|
dt = getdate(date_of_birth) + datetime.timedelta(int(retirement_age)*365.2425)
|
||||||
|
else:
|
||||||
|
dt = getdate(date_of_birth) + datetime.timedelta(21914.55)
|
||||||
|
|
||||||
ret = {'date_of_retirement': dt.strftime('%Y-%m-%d')}
|
ret = {'date_of_retirement': dt.strftime('%Y-%m-%d')}
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# invalid date
|
# invalid date
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
"allow_import": 0,
|
"allow_import": 0,
|
||||||
"allow_rename": 0,
|
"allow_rename": 0,
|
||||||
|
"beta": 0,
|
||||||
"creation": "2013-08-02 13:45:23",
|
"creation": "2013-08-02 13:45:23",
|
||||||
"custom": 0,
|
"custom": 0,
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
@@ -32,6 +33,33 @@
|
|||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"allow_on_submit": 0,
|
||||||
|
"bold": 0,
|
||||||
|
"collapsible": 0,
|
||||||
|
"default": "",
|
||||||
|
"description": "Enter retirement age in years",
|
||||||
|
"fieldname": "retirement_age",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"hidden": 0,
|
||||||
|
"ignore_user_permissions": 0,
|
||||||
|
"ignore_xss_filter": 0,
|
||||||
|
"in_filter": 0,
|
||||||
|
"in_list_view": 0,
|
||||||
|
"label": "Retirement Age",
|
||||||
|
"length": 0,
|
||||||
|
"no_copy": 0,
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": "",
|
||||||
|
"print_hide": 0,
|
||||||
|
"print_hide_if_no_value": 0,
|
||||||
|
"read_only": 0,
|
||||||
|
"report_hide": 0,
|
||||||
|
"reqd": 0,
|
||||||
|
"search_index": 0,
|
||||||
|
"set_only_once": 0,
|
||||||
|
"unique": 0
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"allow_on_submit": 0,
|
"allow_on_submit": 0,
|
||||||
"bold": 0,
|
"bold": 0,
|
||||||
@@ -165,13 +193,14 @@
|
|||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "icon-cog",
|
"icon": "icon-cog",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
"in_dialog": 0,
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2016-04-26 05:54:32.501880",
|
"modified": "2016-06-25 17:43:06.643469",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "HR Settings",
|
"name": "HR Settings",
|
||||||
@@ -191,6 +220,8 @@
|
|||||||
"print": 1,
|
"print": 1,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"report": 0,
|
"report": 0,
|
||||||
|
"restrict": 0,
|
||||||
|
"restricted": 0,
|
||||||
"role": "System Manager",
|
"role": "System Manager",
|
||||||
"set_user_permissions": 0,
|
"set_user_permissions": 0,
|
||||||
"share": 1,
|
"share": 1,
|
||||||
@@ -198,7 +229,9 @@
|
|||||||
"write": 1
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"quick_entry": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"read_only_onload": 0,
|
"read_only_onload": 0,
|
||||||
"sort_order": "ASC"
|
"sort_order": "ASC",
|
||||||
|
"track_seen": 0
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user