feat: add CTC fields in Employee master and Promotion

This commit is contained in:
Rucha Mahabal 2022-04-22 16:28:14 +05:30
parent c3dc5d5ce7
commit a93867de19
3 changed files with 59 additions and 2 deletions

View File

@ -62,6 +62,8 @@
"holiday_list", "holiday_list",
"default_shift", "default_shift",
"salary_information", "salary_information",
"salary_currency",
"ctc",
"salary_mode", "salary_mode",
"payroll_cost_center", "payroll_cost_center",
"column_break_52", "column_break_52",
@ -807,17 +809,30 @@
"fieldtype": "Link", "fieldtype": "Link",
"label": "Shift Request Approver", "label": "Shift Request Approver",
"options": "User" "options": "User"
},
{
"fieldname": "salary_currency",
"fieldtype": "Link",
"label": "Salary Currency",
"options": "Currency"
},
{
"fieldname": "ctc",
"fieldtype": "Currency",
"label": "Cost to Company (CTC)",
"options": "salary_currency"
} }
], ],
"icon": "fa fa-user", "icon": "fa fa-user",
"idx": 24, "idx": 24,
"image_field": "image", "image_field": "image",
"links": [], "links": [],
"modified": "2021-06-17 11:31:37.730760", "modified": "2022-04-22 16:21:55.811983",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee", "name": "Employee",
"name_case": "Title Case", "name_case": "Title Case",
"naming_rule": "By \"Naming Series\" field",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
@ -859,5 +874,6 @@
"show_name_in_global_search": 1, "show_name_in_global_search": 1,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"states": [],
"title_field": "employee_name" "title_field": "employee_name"
} }

View File

@ -9,11 +9,16 @@
"employee", "employee",
"employee_name", "employee_name",
"department", "department",
"salary_currency",
"column_break_3", "column_break_3",
"promotion_date", "promotion_date",
"company", "company",
"details_section", "details_section",
"promotion_details", "promotion_details",
"salary_details_section",
"current_ctc",
"column_break_12",
"revised_ctc",
"amended_from" "amended_from"
], ],
"fields": [ "fields": [
@ -77,11 +82,43 @@
"options": "Employee Promotion", "options": "Employee Promotion",
"print_hide": 1, "print_hide": 1,
"read_only": 1 "read_only": 1
},
{
"fieldname": "salary_details_section",
"fieldtype": "Section Break",
"label": "Salary Details"
},
{
"fieldname": "column_break_12",
"fieldtype": "Column Break"
},
{
"fetch_from": "employee.salary_currency",
"fieldname": "salary_currency",
"fieldtype": "Link",
"label": "Salary Currency",
"options": "Currency",
"read_only": 1
},
{
"fetch_from": "employee.ctc",
"fetch_if_empty": 1,
"fieldname": "current_ctc",
"fieldtype": "Currency",
"label": "Current CTC",
"options": "salary_currency"
},
{
"depends_on": "current_ctc",
"fieldname": "revised_ctc",
"fieldtype": "Currency",
"label": "Revised CTC",
"options": "salary_currency"
} }
], ],
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2022-04-09 12:24:07.667237", "modified": "2022-04-22 16:26:46.933791",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee Promotion", "name": "Employee Promotion",

View File

@ -26,6 +26,10 @@ class EmployeePromotion(Document):
employee = update_employee_work_history( employee = update_employee_work_history(
employee, self.promotion_details, date=self.promotion_date employee, self.promotion_details, date=self.promotion_date
) )
if self.revised_ctc:
employee.ctc = self.revised_ctc
employee.save() employee.save()
def on_cancel(self): def on_cancel(self):