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",
"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"
}

View File

@ -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",

View File

@ -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):