diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js index 320e1cab7c..e7b0ca530c 100644 --- a/erpnext/accounts/doctype/account/account.js +++ b/erpnext/accounts/doctype/account/account.js @@ -79,8 +79,8 @@ frappe.ui.form.on('Account', { frm.add_custom_button(__('General Ledger'), function () { frappe.route_options = { "account": frm.doc.name, - "from_date": frappe.sys_defaults.year_start_date, - "to_date": frappe.sys_defaults.year_end_date, + "from_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + "to_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], "company": frm.doc.company }; frappe.set_route("query-report", "General Ledger"); diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index d537adfcbf..0d74b125ee 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -194,8 +194,8 @@ frappe.treeview_settings["Account"] = { click: function(node, btn) { frappe.route_options = { "account": node.label, - "from_date": frappe.sys_defaults.year_start_date, - "to_date": frappe.sys_defaults.year_end_date, + "from_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + "to_date": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], "company": frappe.treeview_settings['Account'].treeview.page.fields_dict.company.get_value() }; frappe.set_route("query-report", "General Ledger"); diff --git a/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js b/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js index 1da35cd95b..0bcdd53438 100644 --- a/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js +++ b/erpnext/accounts/report/asset_depreciations_and_balances/asset_depreciations_and_balances.js @@ -15,14 +15,14 @@ frappe.query_reports["Asset Depreciations and Balances"] = { "fieldname":"from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], "reqd": 1 }, { "fieldname":"to_date", "label": __("To Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_end_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], "reqd": 1 }, { diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js index f0b6c6b20a..081b9b0a12 100644 --- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js +++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js @@ -7,7 +7,7 @@ frappe.query_reports["Bank Clearance Summary"] = { "fieldname":"from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], "width": "80" }, { 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 5955c2e0fc..15aa265b56 100644 --- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js +++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js @@ -8,7 +8,7 @@ frappe.query_reports["Budget Variance Report"] = { 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 }, { @@ -16,7 +16,7 @@ frappe.query_reports["Budget Variance Report"] = { 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/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js index fc712fb5a7..06f84afe28 100644 --- a/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js +++ b/erpnext/accounts/report/dimension_wise_accounts_balance_report/dimension_wise_accounts_balance_report.js @@ -38,14 +38,14 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { "fieldname": "from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], "reqd": 1 }, { "fieldname": "to_date", "label": __("To Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_end_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], "reqd": 1 }, { diff --git a/erpnext/accounts/report/gross_profit/gross_profit.js b/erpnext/accounts/report/gross_profit/gross_profit.js index 53921dc66e..0bd84eba9e 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.js +++ b/erpnext/accounts/report/gross_profit/gross_profit.js @@ -15,14 +15,14 @@ frappe.query_reports["Gross Profit"] = { "fieldname": "from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], "reqd": 1 }, { "fieldname": "to_date", "label": __("To Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_end_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], "reqd": 1 }, { diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js index 2343eaa846..a762ec80eb 100644 --- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js +++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js @@ -15,7 +15,7 @@ frappe.query_reports["Payment Period Based On Invoice Date"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_start_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { fieldname:"to_date", diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js index 27b29baa40..da3eafccb0 100644 --- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js +++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js @@ -66,13 +66,13 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { "fieldname": "from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { "fieldname": "to_date", "label": __("To Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_end_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], }, { "fieldname": "show_zero_values", diff --git a/erpnext/accounts/report/trial_balance/trial_balance.js b/erpnext/accounts/report/trial_balance/trial_balance.js index e45c3adcb6..6b78ba282e 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.js +++ b/erpnext/accounts/report/trial_balance/trial_balance.js @@ -37,13 +37,13 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() { "fieldname": "from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { "fieldname": "to_date", "label": __("To Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_end_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], }, { "fieldname": "cost_center", diff --git a/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js b/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js index 0f7578cdc1..c51c1bdf0c 100644 --- a/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js +++ b/erpnext/accounts/report/trial_balance_for_party/trial_balance_for_party.js @@ -36,13 +36,13 @@ frappe.query_reports["Trial Balance for Party"] = { "fieldname": "from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { "fieldname": "to_date", "label": __("To Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_end_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], }, { "fieldname":"party_type", diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.js b/erpnext/buying/report/procurement_tracker/procurement_tracker.js index 416655d6bc..3bcc219ca0 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.js +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.js @@ -27,13 +27,13 @@ frappe.query_reports["Procurement Tracker"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_start_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { fieldname:"to_date", label: __("To Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_end_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], }, ] } diff --git a/erpnext/buying/report/purchase_analytics/purchase_analytics.js b/erpnext/buying/report/purchase_analytics/purchase_analytics.js index a0faa6869a..80ed987558 100644 --- a/erpnext/buying/report/purchase_analytics/purchase_analytics.js +++ b/erpnext/buying/report/purchase_analytics/purchase_analytics.js @@ -35,14 +35,14 @@ frappe.query_reports["Purchase Analytics"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_start_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], reqd: 1 }, { fieldname:"to_date", label: __("To Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_end_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], reqd: 1 }, { diff --git a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js index f29c2c64e1..44e8089763 100644 --- a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js +++ b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js @@ -6,13 +6,13 @@ frappe.query_reports["Campaign Efficiency"] = { "fieldname": "from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { "fieldname": "to_date", "label": __("To Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_end_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], } ] }; diff --git a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js index bbfd6ac9ff..f0eff6b81d 100644 --- a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js +++ b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js @@ -6,12 +6,12 @@ "fieldname": "from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { "fieldname": "to_date", "label": __("To Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_end_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], } ]}; diff --git a/erpnext/manufacturing/report/job_card_summary/job_card_summary.js b/erpnext/manufacturing/report/job_card_summary/job_card_summary.js index f005a8a4c2..650721fda8 100644 --- a/erpnext/manufacturing/report/job_card_summary/job_card_summary.js +++ b/erpnext/manufacturing/report/job_card_summary/job_card_summary.js @@ -37,14 +37,14 @@ frappe.query_reports["Job Card Summary"] = { label: __("From Posting Date"), fieldname:"from_date", fieldtype: "Date", - default: frappe.defaults.get_user_default("year_start_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], reqd: 1 }, { label: __("To Posting Date"), fieldname:"to_date", fieldtype: "Date", - default: frappe.defaults.get_user_default("year_end_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], reqd: 1, }, { diff --git a/erpnext/manufacturing/report/production_analytics/production_analytics.js b/erpnext/manufacturing/report/production_analytics/production_analytics.js index 72f06edf85..586297bc6d 100644 --- a/erpnext/manufacturing/report/production_analytics/production_analytics.js +++ b/erpnext/manufacturing/report/production_analytics/production_analytics.js @@ -16,14 +16,14 @@ frappe.query_reports["Production Analytics"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_start_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], reqd: 1 }, { fieldname:"to_date", label: __("To Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_end_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], reqd: 1 }, { diff --git a/erpnext/public/js/purchase_trends_filters.js b/erpnext/public/js/purchase_trends_filters.js index c786a8674e..77f1d2b496 100644 --- a/erpnext/public/js/purchase_trends_filters.js +++ b/erpnext/public/js/purchase_trends_filters.js @@ -28,7 +28,7 @@ erpnext.get_purchase_trends_filters = function() { "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":"period_based_on", diff --git a/erpnext/public/js/sales_trends_filters.js b/erpnext/public/js/sales_trends_filters.js index b9c4dca913..b73747a604 100644 --- a/erpnext/public/js/sales_trends_filters.js +++ b/erpnext/public/js/sales_trends_filters.js @@ -48,7 +48,7 @@ erpnext.get_sales_trends_filters = function() { "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":"company", diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index 06e39aacc7..10e8431e34 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -400,7 +400,7 @@ $.extend(erpnext.utils, { }); }, - get_fiscal_year: function(date) { + get_fiscal_year: function(date, with_dates) { if(!date) { date = frappe.datetime.get_today(); } @@ -414,7 +414,10 @@ $.extend(erpnext.utils, { async: false, callback: function(r) { if (r.message) { - fiscal_year = r.message[0]; + if (with_dates) + fiscal_year = r.message; + else + fiscal_year = r.message[0]; } } }); diff --git a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js index 1b931e12de..b81d415813 100644 --- a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js +++ b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.js @@ -23,14 +23,14 @@ frappe.query_reports["Customer Acquisition and Loyalty"] = { "fieldname":"from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], "reqd": 1 }, { "fieldname":"to_date", "label": __("To Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_end_date"), + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], "reqd": 1 } ], diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.js b/erpnext/selling/report/sales_analytics/sales_analytics.js index ace16f4f41..8bc4030f09 100644 --- a/erpnext/selling/report/sales_analytics/sales_analytics.js +++ b/erpnext/selling/report/sales_analytics/sales_analytics.js @@ -35,14 +35,14 @@ frappe.query_reports["Sales Analytics"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_start_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], reqd: 1 }, { fieldname:"to_date", label: __("To Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_end_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], 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 83934fb359..93aad54fa0 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_commission_summary/sales_person_commission_summary.js b/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js index 306ef6fffd..931d66d937 100644 --- a/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js +++ b/erpnext/selling/report/sales_person_commission_summary/sales_person_commission_summary.js @@ -22,7 +22,7 @@ frappe.query_reports["Sales Person Commission Summary"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_start_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { fieldname:"to_date", 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 9414ad6a8f..8ee86dcb05 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/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js index e269f02d0c..beb853eb60 100644 --- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js +++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.js @@ -20,7 +20,7 @@ frappe.query_reports["Sales Person-wise Transaction Summary"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", - default: frappe.defaults.get_user_default("year_start_date"), + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { fieldname:"to_date", 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 12bb49fd18..50ac4da445 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", diff --git a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js index 48a72a2bfe..e21ab0d887 100644 --- a/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js +++ b/erpnext/stock/report/batch_item_expiry_status/batch_item_expiry_status.js @@ -8,7 +8,7 @@ frappe.query_reports["Batch Item Expiry Status"] = { "label": __("From Date"), "fieldtype": "Date", "width": "80", - "default": frappe.sys_defaults.year_start_date, + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], "reqd": 1, }, { diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js index 74b5a5ae36..f793477d0e 100644 --- a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js +++ b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.js @@ -16,7 +16,7 @@ frappe.query_reports["Batch-Wise Balance History"] = { "label": __("From Date"), "fieldtype": "Date", "width": "80", - "default": frappe.sys_defaults.year_start_date, + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], "reqd": 1 }, { diff --git a/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js b/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js index 6325cc85c4..4c327d8323 100644 --- a/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js +++ b/erpnext/stock/report/incorrect_serial_no_valuation/incorrect_serial_no_valuation.js @@ -22,14 +22,14 @@ frappe.query_reports["Incorrect Serial No Valuation"] = { fieldtype: 'Date', fieldname: 'from_date', reqd: 1, - default: frappe.defaults.get_user_default("year_start_date") + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { label: __('To Date'), fieldtype: 'Date', fieldname: 'to_date', reqd: 1, - default: frappe.defaults.get_user_default("year_end_date") + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], } ] }; diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js index 173aad6d5a..889ab5c21e 100644 --- a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js +++ b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.js @@ -7,7 +7,7 @@ frappe.query_reports["Itemwise Recommended Reorder Level"] = { "fieldname":"from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.sys_defaults.year_start_date + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], }, { "fieldname":"to_date",