From 9db7f7b033c5045ab54f0158e45e956aab945655 Mon Sep 17 00:00:00 2001 From: Nicolas Pereira <41456803+hqnicolas@users.noreply.github.com> Date: Wed, 28 Aug 2024 05:48:55 -0300 Subject: [PATCH] fix: default fiscal year in report v14 (#42960) * loads the fiscal year from the calendar year * loads the fiscal year from the calendar year * loads the fiscal year from the calendar year * loads the fiscal year from the calendar year * fix: default fiscal year in report v14 * fix: default fiscal year in report v14 --prettier --------- Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com> --- .../report/budget_variance_report/budget_variance_report.js | 4 ++-- .../sales_partner_target_variance_based_on_item_group.js | 2 +- .../sales_person_target_variance_based_on_item_group.js | 2 +- .../territory_target_variance_based_on_item_group.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js index 156ae8f2f2a..83bd48c71f3 100644 --- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js +++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js @@ -43,7 +43,7 @@ function get_filters() { label: __("From Fiscal Year"), fieldtype: "Link", options: "Fiscal Year", - default: frappe.sys_defaults.fiscal_year, + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), reqd: 1, }, { @@ -51,7 +51,7 @@ function get_filters() { label: __("To Fiscal Year"), fieldtype: "Link", options: "Fiscal Year", - default: frappe.sys_defaults.fiscal_year, + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), reqd: 1, }, { diff --git a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js index f8c950763e1..6740083c8d4 100644 --- a/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js +++ b/erpnext/selling/report/sales_partner_target_variance_based_on_item_group/sales_partner_target_variance_based_on_item_group.js @@ -16,7 +16,7 @@ frappe.query_reports["Sales Partner Target Variance based on Item Group"] = { label: __("Fiscal Year"), fieldtype: "Link", options: "Fiscal Year", - default: frappe.sys_defaults.fiscal_year, + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), }, { fieldname: "doctype", diff --git a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js index b3497085fb7..4d38f490333 100644 --- a/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js +++ b/erpnext/selling/report/sales_person_target_variance_based_on_item_group/sales_person_target_variance_based_on_item_group.js @@ -16,7 +16,7 @@ frappe.query_reports["Sales Person Target Variance Based On Item Group"] = { label: __("Fiscal Year"), fieldtype: "Link", options: "Fiscal Year", - default: frappe.sys_defaults.fiscal_year, + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), }, { fieldname: "doctype", diff --git a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js index 988fb86ff6c..bebe1ab16e5 100644 --- a/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js +++ b/erpnext/selling/report/territory_target_variance_based_on_item_group/territory_target_variance_based_on_item_group.js @@ -16,7 +16,7 @@ frappe.query_reports["Territory Target Variance Based On Item Group"] = { label: __("Fiscal Year"), fieldtype: "Link", options: "Fiscal Year", - default: frappe.sys_defaults.fiscal_year, + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), }, { fieldname: "doctype",