feat: added year filters
This commit is contained in:
parent
5e16ca0326
commit
d0d9b53361
@ -11,8 +11,8 @@ erpnext.salary_slip_deductions_report_filters = {
|
|||||||
default: frappe.defaults.get_user_default("Company"),
|
default: frappe.defaults.get_user_default("Company"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldname: "period",
|
fieldname: "month",
|
||||||
label: __("Period"),
|
label: __("Month"),
|
||||||
fieldtype: "Select",
|
fieldtype: "Select",
|
||||||
reqd: 1 ,
|
reqd: 1 ,
|
||||||
options: [
|
options: [
|
||||||
@ -31,6 +31,12 @@ erpnext.salary_slip_deductions_report_filters = {
|
|||||||
],
|
],
|
||||||
default: frappe.datetime.str_to_obj(frappe.datetime.get_today()).getMonth() + 1
|
default: frappe.datetime.str_to_obj(frappe.datetime.get_today()).getMonth() + 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldname:"year",
|
||||||
|
label: __("Year"),
|
||||||
|
fieldtype: "Select",
|
||||||
|
reqd: 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldname: "department",
|
fieldname: "department",
|
||||||
label: __("Department"),
|
label: __("Department"),
|
||||||
@ -43,5 +49,18 @@ erpnext.salary_slip_deductions_report_filters = {
|
|||||||
fieldtype: "Link",
|
fieldtype: "Link",
|
||||||
options: "Branch",
|
options: "Branch",
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
|
||||||
|
"onload": function() {
|
||||||
|
return frappe.call({
|
||||||
|
method: "erpnext.regional.report.provident_fund_deductions.provident_fund_deductions.get_years",
|
||||||
|
callback: function(r) {
|
||||||
|
var year_filter = frappe.query_report.get_filter('year');
|
||||||
|
year_filter.df.options = r.message;
|
||||||
|
year_filter.df.default = r.message.split("\n")[0];
|
||||||
|
year_filter.refresh();
|
||||||
|
year_filter.set_input(year_filter.df.default);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user