feat(Payroll): compute Year to Date for Salary Slip components

This commit is contained in:
Rucha Mahabal
2021-01-14 00:40:58 +05:30
committed by Deepesh Garg
parent ca966601a2
commit 10c069588f
2 changed files with 14 additions and 5 deletions

View File

@@ -9,6 +9,7 @@
"abbr",
"column_break_3",
"amount",
"year_to_date",
"section_break_5",
"additional_salary",
"statistical_component",
@@ -226,11 +227,19 @@
{
"fieldname": "column_break_24",
"fieldtype": "Column Break"
},
{
"description": "Total amount spent on this salary component from the beginning of the year (payroll or fiscal) to the current payroll date.",
"fieldname": "year_to_date",
"fieldtype": "Currency",
"label": "Year To Date",
"options": "currency",
"read_only": 1
}
],
"istable": 1,
"links": [],
"modified": "2020-11-25 13:12:41.081106",
"modified": "2021-01-13 17:33:19.184195",
"modified_by": "Administrator",
"module": "Payroll",
"name": "Salary Detail",

View File

@@ -138,11 +138,11 @@ frappe.ui.form.on("Salary Slip", {
},
change_grid_labels: function(frm) {
frm.set_currency_labels(["amount", "default_amount", "additional_amount", "tax_on_flexible_benefit",
"tax_on_additional_salary"], frm.doc.currency, "earnings");
let fields = ["amount", "year_to_date", "default_amount", "additional_amount", "tax_on_flexible_benefit",
"tax_on_additional_salary"];
frm.set_currency_labels(["amount", "default_amount", "additional_amount", "tax_on_flexible_benefit",
"tax_on_additional_salary"], frm.doc.currency, "deductions");
frm.set_currency_labels(fields, frm.doc.currency, "earnings");
frm.set_currency_labels(fields, frm.doc.currency, "deductions");
},
refresh: function(frm) {