mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 19:29:10 +00:00
feat: settings for Overtime
This commit is contained in:
@@ -2,6 +2,16 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('HR Settings', {
|
frappe.ui.form.on('HR Settings', {
|
||||||
|
|
||||||
|
refresh: function(frm) {
|
||||||
|
frm.set_query('overtime_salary_component', function() {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
type: "Earning"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
restrict_backdated_leave_application: function(frm) {
|
restrict_backdated_leave_application: function(frm) {
|
||||||
frm.toggle_reqd("role_allowed_to_create_backdated_leave_application", frm.doc.restrict_backdated_leave_application);
|
frm.toggle_reqd("role_allowed_to_create_backdated_leave_application", frm.doc.restrict_backdated_leave_application);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,12 @@
|
|||||||
"email_salary_slip_to_employee",
|
"email_salary_slip_to_employee",
|
||||||
"encrypt_salary_slips_in_emails",
|
"encrypt_salary_slips_in_emails",
|
||||||
"show_leave_balances_in_salary_slip",
|
"show_leave_balances_in_salary_slip",
|
||||||
"password_policy"
|
"password_policy",
|
||||||
|
"section_break_12",
|
||||||
|
"overtime_based_on",
|
||||||
|
"overtime_salary_component",
|
||||||
|
"column_break_14",
|
||||||
|
"fetch_standard_working_hours_from_shift_type"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -91,13 +96,41 @@
|
|||||||
"fieldname": "show_leave_balances_in_salary_slip",
|
"fieldname": "show_leave_balances_in_salary_slip",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Show Leave Balances in Salary Slip"
|
"label": "Show Leave Balances in Salary Slip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "overtime_salary_component",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Overtime Salary Component",
|
||||||
|
"options": "Salary Component"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_12",
|
||||||
|
"fieldtype": "Section Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"description": "If unchecked, Standard Working Hours as defined in HR Settings will be taken into consideration.",
|
||||||
|
"fieldname": "fetch_standard_working_hours_from_shift_type",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Fetch Standard Working Hours from Shift Type"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_14",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "Attendance",
|
||||||
|
"fieldname": "overtime_based_on",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"label": "Calculate Overtime Hours Based On",
|
||||||
|
"options": "Attendance\nTimesheet"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-cog",
|
"icon": "fa fa-cog",
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-03-03 17:49:59.579723",
|
"modified": "2021-05-10 12:56:08.161319",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Payroll",
|
"module": "Payroll",
|
||||||
"name": "Payroll Settings",
|
"name": "Payroll Settings",
|
||||||
|
|||||||
@@ -64,6 +64,12 @@ def set_default_settings(args):
|
|||||||
hr_settings.leave_status_notification_template = _("Leave Status Notification")
|
hr_settings.leave_status_notification_template = _("Leave Status Notification")
|
||||||
hr_settings.save()
|
hr_settings.save()
|
||||||
|
|
||||||
|
|
||||||
|
payroll_settings = frappe.get_doc("Payroll Settings")
|
||||||
|
payroll_settings.overtime_based_on = "Attendance"
|
||||||
|
Payroll_settings.overtime_salary_component = _("Overtime Allowance")
|
||||||
|
payroll_settings.save()
|
||||||
|
|
||||||
def set_no_copy_fields_in_variant_settings():
|
def set_no_copy_fields_in_variant_settings():
|
||||||
# set no copy fields of an item doctype to item variant settings
|
# set no copy fields of an item doctype to item variant settings
|
||||||
doc = frappe.get_doc('Item Variant Settings')
|
doc = frappe.get_doc('Item Variant Settings')
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ def install(country=None):
|
|||||||
{'doctype': 'Salary Component', 'salary_component': _('Income Tax'), 'description': _('Income Tax'), 'type': 'Deduction', 'is_income_tax_component': 1},
|
{'doctype': 'Salary Component', 'salary_component': _('Income Tax'), 'description': _('Income Tax'), 'type': 'Deduction', 'is_income_tax_component': 1},
|
||||||
{'doctype': 'Salary Component', 'salary_component': _('Basic'), 'description': _('Basic'), 'type': 'Earning'},
|
{'doctype': 'Salary Component', 'salary_component': _('Basic'), 'description': _('Basic'), 'type': 'Earning'},
|
||||||
{'doctype': 'Salary Component', 'salary_component': _('Arrear'), 'description': _('Arrear'), 'type': 'Earning'},
|
{'doctype': 'Salary Component', 'salary_component': _('Arrear'), 'description': _('Arrear'), 'type': 'Earning'},
|
||||||
|
{'doctype': 'Salary Component', 'salary_component': _('Overtime Allowance'), 'description': _('Overtime Allowance'), 'type': 'Earning'},
|
||||||
{'doctype': 'Salary Component', 'salary_component': _('Leave Encashment'), 'description': _('Leave Encashment'), 'type': 'Earning'},
|
{'doctype': 'Salary Component', 'salary_component': _('Leave Encashment'), 'description': _('Leave Encashment'), 'type': 'Earning'},
|
||||||
|
|
||||||
|
|
||||||
@@ -286,6 +287,7 @@ def set_more_defaults():
|
|||||||
update_selling_defaults()
|
update_selling_defaults()
|
||||||
update_buying_defaults()
|
update_buying_defaults()
|
||||||
update_hr_defaults()
|
update_hr_defaults()
|
||||||
|
update_payroll_defaults()
|
||||||
add_uom_data()
|
add_uom_data()
|
||||||
update_item_variant_settings()
|
update_item_variant_settings()
|
||||||
|
|
||||||
@@ -315,6 +317,13 @@ def update_hr_defaults():
|
|||||||
hr_settings.leave_status_notification_template = _("Leave Status Notification")
|
hr_settings.leave_status_notification_template = _("Leave Status Notification")
|
||||||
hr_settings.save()
|
hr_settings.save()
|
||||||
|
|
||||||
|
def update_payroll_defaults():
|
||||||
|
payroll_settings = frappe.get_doc("Payroll Settings")
|
||||||
|
payroll_settings.overtime_based_on = "Attendance"
|
||||||
|
Payroll_settings.overtime_salary_component = _("Overtime Allowance")
|
||||||
|
payroll_settings.save()
|
||||||
|
|
||||||
|
|
||||||
def update_item_variant_settings():
|
def update_item_variant_settings():
|
||||||
# set no copy fields of an item doctype to item variant settings
|
# set no copy fields of an item doctype to item variant settings
|
||||||
doc = frappe.get_doc('Item Variant Settings')
|
doc = frappe.get_doc('Item Variant Settings')
|
||||||
|
|||||||
Reference in New Issue
Block a user