fix: move Company filter at the start

This commit is contained in:
khushi8112
2026-06-03 02:14:14 +05:30
parent bdf0136fc5
commit c34eeee096

View File

@@ -38,6 +38,14 @@ function get_filters() {
let budget_against_options = get_dimensions(); let budget_against_options = get_dimensions();
let filters = [ let filters = [
{
fieldname: "company",
label: __("Company"),
fieldtype: "Link",
options: "Company",
default: frappe.defaults.get_user_default("Company"),
reqd: 1,
},
{ {
fieldname: "from_fiscal_year", fieldname: "from_fiscal_year",
label: __("From Fiscal Year"), label: __("From Fiscal Year"),
@@ -67,14 +75,6 @@ function get_filters() {
default: "Yearly", default: "Yearly",
reqd: 1, reqd: 1,
}, },
{
fieldname: "company",
label: __("Company"),
fieldtype: "Link",
options: "Company",
default: frappe.defaults.get_user_default("Company"),
reqd: 1,
},
{ {
fieldname: "budget_against", fieldname: "budget_against",
label: __("Budget Against"), label: __("Budget Against"),
@@ -98,7 +98,7 @@ function get_filters() {
let budget_against = frappe.query_report.get_filter_value("budget_against"); let budget_against = frappe.query_report.get_filter_value("budget_against");
let company = frappe.query_report.get_filter_value("company"); let company = frappe.query_report.get_filter_value("company");
if (!budget_against) return; if (!budget_against) return;
// Branch does not have company field
const filters = budget_against !== "Branch" && company ? { company: company } : {}; const filters = budget_against !== "Branch" && company ? { company: company } : {};
return frappe.db.get_link_options(budget_against, txt, filters); return frappe.db.get_link_options(budget_against, txt, filters);