Salary slip - additional salary - deductions (#14476)

This commit is contained in:
Jamsheer 2018-06-13 11:36:44 +05:30 committed by Nabin Hait
parent 32c984cd3c
commit f6d7b5d0c8
5 changed files with 43 additions and 6 deletions

View File

@ -6,7 +6,6 @@ frappe.ui.form.on('Additional Salary', {
frm.set_query("salary_component", function() {
return {
filters: {
type: "earning",
is_additional_component: true
}
};

View File

@ -179,6 +179,40 @@
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_from": "salary_component.type",
"fieldname": "type",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Type",
"length": 0,
"no_copy": 0,
"options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
@ -383,7 +417,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-05-30 11:44:06.422122",
"modified": "2018-06-12 12:05:16.337082",
"modified_by": "Administrator",
"module": "HR",
"name": "Additional Salary",
@ -438,4 +472,4 @@
"title_field": "employee",
"track_changes": 1,
"track_seen": 0
}
}

View File

@ -66,6 +66,7 @@ def get_additional_salary_component(employee, start_date, end_date):
struct_row['do_not_include_in_total'] = salary_component.do_not_include_in_total
additional_components_dict['amount'] = amount
additional_components_dict['struct_row'] = struct_row
additional_components_dict['type'] = salary_component.type
additional_components_array.append(additional_components_dict)
if len(additional_components_array) > 0:

View File

@ -118,7 +118,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.type == \"Earning\"",
"depends_on": "",
"fieldname": "is_additional_component",
"fieldtype": "Check",
"hidden": 0,
@ -1002,7 +1002,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-06-12 14:52:28.688391",
"modified": "2018-06-12 12:09:14.420657",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Component",

View File

@ -75,7 +75,10 @@ class SalarySlip(TransactionBase):
for additional_component in additional_components:
additional_component = frappe._dict(additional_component)
amount = additional_component.amount + self.get_amount_from_exisiting_component(frappe._dict(additional_component.struct_row).salary_component)
self.update_component_row(frappe._dict(additional_component.struct_row), amount, "earnings")
key = "earnings"
if additional_component.type == "Deduction":
key = "deductions"
self.update_component_row(frappe._dict(additional_component.struct_row), amount, key)
def add_employee_flexi_benefits(self, struct_row):
if frappe.db.get_value("Salary Component", struct_row.salary_component, "is_pro_rata_applicable") == 1: