From a93867de1912a225a6b6851efc1301ffec6ff924 Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Fri, 22 Apr 2022 16:28:14 +0530 Subject: [PATCH] feat: add CTC fields in Employee master and Promotion --- erpnext/hr/doctype/employee/employee.json | 18 ++++++++- .../employee_promotion.json | 39 ++++++++++++++++++- .../employee_promotion/employee_promotion.py | 4 ++ 3 files changed, 59 insertions(+), 2 deletions(-) diff --git a/erpnext/hr/doctype/employee/employee.json b/erpnext/hr/doctype/employee/employee.json index d592a9c79e..e3358bf81f 100644 --- a/erpnext/hr/doctype/employee/employee.json +++ b/erpnext/hr/doctype/employee/employee.json @@ -62,6 +62,8 @@ "holiday_list", "default_shift", "salary_information", + "salary_currency", + "ctc", "salary_mode", "payroll_cost_center", "column_break_52", @@ -807,17 +809,30 @@ "fieldtype": "Link", "label": "Shift Request Approver", "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", "idx": 24, "image_field": "image", "links": [], - "modified": "2021-06-17 11:31:37.730760", + "modified": "2022-04-22 16:21:55.811983", "modified_by": "Administrator", "module": "HR", "name": "Employee", "name_case": "Title Case", + "naming_rule": "By \"Naming Series\" field", "owner": "Administrator", "permissions": [ { @@ -859,5 +874,6 @@ "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", + "states": [], "title_field": "employee_name" } \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_promotion/employee_promotion.json b/erpnext/hr/doctype/employee_promotion/employee_promotion.json index 65f53b219a..64be96bd95 100644 --- a/erpnext/hr/doctype/employee_promotion/employee_promotion.json +++ b/erpnext/hr/doctype/employee_promotion/employee_promotion.json @@ -9,11 +9,16 @@ "employee", "employee_name", "department", + "salary_currency", "column_break_3", "promotion_date", "company", "details_section", "promotion_details", + "salary_details_section", + "current_ctc", + "column_break_12", + "revised_ctc", "amended_from" ], "fields": [ @@ -77,11 +82,43 @@ "options": "Employee Promotion", "print_hide": 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, "links": [], - "modified": "2022-04-09 12:24:07.667237", + "modified": "2022-04-22 16:26:46.933791", "modified_by": "Administrator", "module": "HR", "name": "Employee Promotion", diff --git a/erpnext/hr/doctype/employee_promotion/employee_promotion.py b/erpnext/hr/doctype/employee_promotion/employee_promotion.py index d77c1dddfd..f3d27d0832 100644 --- a/erpnext/hr/doctype/employee_promotion/employee_promotion.py +++ b/erpnext/hr/doctype/employee_promotion/employee_promotion.py @@ -26,6 +26,10 @@ class EmployeePromotion(Document): employee = update_employee_work_history( employee, self.promotion_details, date=self.promotion_date ) + + if self.revised_ctc: + employee.ctc = self.revised_ctc + employee.save() def on_cancel(self):