fix: Update year_to_date and month_to_date field labels to show company currency

This commit is contained in:
Ganga Manoj 2020-12-21 23:46:02 +05:30
parent ddd9fe49fc
commit c36cab81f2
2 changed files with 21 additions and 5 deletions

View File

@ -125,15 +125,15 @@ frappe.ui.form.on("Salary Slip", {
change_form_labels: function(frm, company_currency) { change_form_labels: function(frm, company_currency) {
frm.set_currency_labels(["base_hour_rate", "base_gross_pay", "base_total_deduction", frm.set_currency_labels(["base_hour_rate", "base_gross_pay", "base_total_deduction",
"base_net_pay", "base_rounded_total", "base_total_in_words"], "base_net_pay", "base_rounded_total", "base_total_in_words", "base_year_to_date", "base_month_to_date"],
company_currency); company_currency);
frm.set_currency_labels(["hour_rate", "gross_pay", "total_deduction", "net_pay", "rounded_total", "total_in_words"], frm.set_currency_labels(["hour_rate", "gross_pay", "total_deduction", "net_pay", "rounded_total", "total_in_words", "year_to_date", "month_to_date"],
frm.doc.currency); frm.doc.currency);
// toggle fields // toggle fields
frm.toggle_display(["exchange_rate", "base_hour_rate", "base_gross_pay", "base_total_deduction", frm.toggle_display(["exchange_rate", "base_hour_rate", "base_gross_pay", "base_total_deduction",
"base_net_pay", "base_rounded_total", "base_total_in_words"], "base_net_pay", "base_rounded_total", "base_total_in_words", "base_year_to_date", "base_month_to_date"],
frm.doc.currency != company_currency); frm.doc.currency != company_currency);
}, },

View File

@ -70,10 +70,12 @@
"net_pay", "net_pay",
"base_net_pay", "base_net_pay",
"year_to_date", "year_to_date",
"base_year_to_date",
"column_break_53", "column_break_53",
"rounded_total", "rounded_total",
"base_rounded_total", "base_rounded_total",
"month_to_date", "month_to_date",
"base_month_to_date",
"section_break_55", "section_break_55",
"total_in_words", "total_in_words",
"column_break_69", "column_break_69",
@ -584,12 +586,26 @@
{ {
"fieldname": "year_to_date", "fieldname": "year_to_date",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Year To Date",
"options": "currency",
"read_only": 1
},
{
"fieldname": "month_to_date",
"fieldtype": "Currency",
"label": "Month To Date",
"options": "currency",
"read_only": 1
},
{
"fieldname": "base_year_to_date",
"fieldtype": "Currency",
"label": "Year To Date(Company Currency)", "label": "Year To Date(Company Currency)",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
"read_only": 1 "read_only": 1
}, },
{ {
"fieldname": "month_to_date", "fieldname": "base_month_to_date",
"fieldtype": "Currency", "fieldtype": "Currency",
"label": "Month To Date(Company Currency)", "label": "Month To Date(Company Currency)",
"options": "Company:company:default_currency", "options": "Company:company:default_currency",
@ -600,7 +616,7 @@
"idx": 9, "idx": 9,
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2020-12-18 23:57:41.042954", "modified": "2020-12-21 23:43:44.959840",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Payroll", "module": "Payroll",
"name": "Salary Slip", "name": "Salary Slip",