diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js index f26d1f82797..bc33dbaf4e0 100644 --- a/erpnext/accounts/doctype/account/account.js +++ b/erpnext/accounts/doctype/account/account.js @@ -103,6 +103,7 @@ frappe.ui.form.on("Account", { __("View") ); +<<<<<<< HEAD frm.add_custom_button( __("Convert to Group"), function () { @@ -116,6 +117,29 @@ frappe.ui.form.on("Account", { }, __("Actions") ); +======= + } else if (cint(frm.doc.is_group) == 0 + && frappe.boot.user.can_read.indexOf("GL Entry") !== -1) { + frm.add_custom_button(__('General Ledger'), function () { + frappe.route_options = { + "account": frm.doc.name, + "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"); + }, __('View')); + + frm.add_custom_button(__('Convert to Group'), function () { + return frappe.call({ + doc: frm.doc, + method: 'convert_ledger_to_group', + callback: function() { + frm.refresh(); + } + }); + }, __('Actions')); +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) } }, diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index e0bfa6e902a..051e9795661 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -278,11 +278,18 @@ frappe.treeview_settings["Account"] = { label: __("View Ledger"), click: function (node, btn) { frappe.route_options = { +<<<<<<< HEAD account: node.label, from_date: frappe.sys_defaults.year_start_date, to_date: frappe.sys_defaults.year_end_date, company: frappe.treeview_settings["Account"].treeview.page.fields_dict.company.get_value(), +======= + "account": node.label, + "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() +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }; 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 88ec0881585..25df2616218 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 @@ -12,6 +12,7 @@ frappe.query_reports["Asset Depreciations and Balances"] = { reqd: 1, }, { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", @@ -24,6 +25,20 @@ frappe.query_reports["Asset Depreciations and Balances"] = { fieldtype: "Date", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], reqd: 1, +======= + "fieldname":"from_date", + "label": __("From Date"), + "fieldtype": "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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], + "reqd": 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "asset_category", 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 e8ae2a1dabe..82787f96225 100644 --- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js +++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js @@ -4,11 +4,19 @@ frappe.query_reports["Bank Clearance Summary"] = { filters: [ { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], width: "80", +======= + "fieldname":"from_date", + "label": __("From Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + "width": "80" +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_date", 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 83bd48c71f3..997ae04ec7e 100644 --- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.js +++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.js @@ -44,7 +44,11 @@ function get_filters() { fieldtype: "Link", options: "Fiscal Year", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), +<<<<<<< HEAD reqd: 1, +======= + reqd: 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_fiscal_year", @@ -52,7 +56,11 @@ function get_filters() { fieldtype: "Link", options: "Fiscal Year", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), +<<<<<<< HEAD reqd: 1, +======= + reqd: 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "period", 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 149b258248c..11563f9d25b 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 @@ -35,6 +35,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function () { }, }, { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", @@ -47,6 +48,20 @@ frappe.require("assets/erpnext/js/financial_statements.js", function () { fieldtype: "Date", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], reqd: 1, +======= + "fieldname": "from_date", + "label": __("From Date"), + "fieldtype": "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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], + "reqd": 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "finance_book", diff --git a/erpnext/accounts/report/gross_profit/gross_profit.js b/erpnext/accounts/report/gross_profit/gross_profit.js index 64a9838f54b..0d1bf6f8b29 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.js +++ b/erpnext/accounts/report/gross_profit/gross_profit.js @@ -12,6 +12,7 @@ frappe.query_reports["Gross Profit"] = { reqd: 1, }, { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", @@ -24,6 +25,20 @@ frappe.query_reports["Gross Profit"] = { fieldtype: "Date", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], reqd: 1, +======= + "fieldname": "from_date", + "label": __("From Date"), + "fieldtype": "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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], + "reqd": 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "sales_invoice", 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 528246cd370..2c469009d69 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,11 @@ frappe.query_reports["Payment Period Based On Invoice Date"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_date", diff --git a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js index 816adfaf916..febcb4e3c91 100644 --- a/erpnext/accounts/report/profitability_analysis/profitability_analysis.js +++ b/erpnext/accounts/report/profitability_analysis/profitability_analysis.js @@ -56,6 +56,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function () { }, }, { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", @@ -66,6 +67,18 @@ frappe.require("assets/erpnext/js/financial_statements.js", function () { label: __("To Date"), fieldtype: "Date", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], +======= + "fieldname": "from_date", + "label": __("From Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + }, + { + "fieldname": "to_date", + "label": __("To Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { 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 7337fd477e7..874afad9087 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.js +++ b/erpnext/accounts/report/trial_balance/trial_balance.js @@ -34,6 +34,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function () { }, }, { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", @@ -44,6 +45,18 @@ frappe.require("assets/erpnext/js/financial_statements.js", function () { label: __("To Date"), fieldtype: "Date", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], +======= + "fieldname": "from_date", + "label": __("From Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + }, + { + "fieldname": "to_date", + "label": __("To Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { 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 50578d314e3..00641e385b4 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 @@ -33,6 +33,7 @@ frappe.query_reports["Trial Balance for Party"] = { }, }, { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", @@ -43,6 +44,18 @@ frappe.query_reports["Trial Balance for Party"] = { label: __("To Date"), fieldtype: "Date", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], +======= + "fieldname": "from_date", + "label": __("From Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + }, + { + "fieldname": "to_date", + "label": __("To Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "party_type", diff --git a/erpnext/buying/report/procurement_tracker/procurement_tracker.js b/erpnext/buying/report/procurement_tracker/procurement_tracker.js index df8dc9c6902..919edd9f71c 100644 --- a/erpnext/buying/report/procurement_tracker/procurement_tracker.js +++ b/erpnext/buying/report/procurement_tracker/procurement_tracker.js @@ -27,13 +27,21 @@ frappe.query_reports["Procurement Tracker"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_date", label: __("To Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, ], }; diff --git a/erpnext/buying/report/purchase_analytics/purchase_analytics.js b/erpnext/buying/report/purchase_analytics/purchase_analytics.js index 7de965a4586..207e12c5339 100644 --- a/erpnext/buying/report/purchase_analytics/purchase_analytics.js +++ b/erpnext/buying/report/purchase_analytics/purchase_analytics.js @@ -35,15 +35,25 @@ frappe.query_reports["Purchase Analytics"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], reqd: 1, +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + reqd: 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_date", label: __("To Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], reqd: 1, +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], + reqd: 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "company", diff --git a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js index a1e51f0654d..ba35bde8e31 100644 --- a/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js +++ b/erpnext/crm/report/campaign_efficiency/campaign_efficiency.js @@ -3,6 +3,7 @@ frappe.query_reports["Campaign Efficiency"] = { filters: [ { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", @@ -15,4 +16,18 @@ frappe.query_reports["Campaign Efficiency"] = { default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], }, ], +======= + "fieldname": "from_date", + "label": __("From Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + }, + { + "fieldname": "to_date", + "label": __("To Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], + } + ] +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }; 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 bd64641dcc2..bc300902436 100644 --- a/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js +++ b/erpnext/crm/report/lead_owner_efficiency/lead_owner_efficiency.js @@ -1,5 +1,6 @@ // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt +<<<<<<< HEAD frappe.query_reports["Lead Owner Efficiency"] = { filters: [ { @@ -16,3 +17,20 @@ frappe.query_reports["Lead Owner Efficiency"] = { }, ], }; +======= + frappe.query_reports["Lead Owner Efficiency"] = { + "filters": [ + { + "fieldname": "from_date", + "label": __("From Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + }, + { + "fieldname": "to_date", + "label": __("To Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], + } + ]}; +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) 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 aac687c1413..0c7f211babc 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,23 @@ frappe.query_reports["Job Card Summary"] = { label: __("From Posting Date"), fieldname: "from_date", fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], reqd: 1, +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + reqd: 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { label: __("To Posting Date"), fieldname: "to_date", fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) reqd: 1, }, { diff --git a/erpnext/manufacturing/report/production_analytics/production_analytics.js b/erpnext/manufacturing/report/production_analytics/production_analytics.js index da8e4926a45..36b2d8ebf22 100644 --- a/erpnext/manufacturing/report/production_analytics/production_analytics.js +++ b/erpnext/manufacturing/report/production_analytics/production_analytics.js @@ -16,15 +16,25 @@ frappe.query_reports["Production Analytics"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], reqd: 1, +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + reqd: 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_date", label: __("To Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], reqd: 1, +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], + reqd: 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "range", diff --git a/erpnext/public/js/purchase_trends_filters.js b/erpnext/public/js/purchase_trends_filters.js index 14ffaf82162..2ac37343c39 100644 --- a/erpnext/public/js/purchase_trends_filters.js +++ b/erpnext/public/js/purchase_trends_filters.js @@ -24,11 +24,19 @@ erpnext.get_purchase_trends_filters = function () { default: "Monthly", }, { +<<<<<<< HEAD fieldname: "fiscal_year", label: __("Fiscal Year"), fieldtype: "Link", options: "Fiscal Year", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), +======= + "fieldname":"fiscal_year", + "label": __("Fiscal Year"), + "fieldtype": "Link", + "options":'Fiscal Year', + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()) +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "period_based_on", diff --git a/erpnext/public/js/sales_trends_filters.js b/erpnext/public/js/sales_trends_filters.js index 85daa01ff67..e7e930dfa3d 100644 --- a/erpnext/public/js/sales_trends_filters.js +++ b/erpnext/public/js/sales_trends_filters.js @@ -40,11 +40,19 @@ erpnext.get_sales_trends_filters = function () { default: "", }, { +<<<<<<< HEAD fieldname: "fiscal_year", label: __("Fiscal Year"), fieldtype: "Link", options: "Fiscal Year", default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), +======= + "fieldname":"fiscal_year", + "label": __("Fiscal Year"), + "fieldtype": "Link", + "options":'Fiscal Year', + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "company", diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index 4d886d47f4e..03270197c4d 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -397,11 +397,48 @@ $.extend(erpnext.utils, { } }, +<<<<<<< HEAD get_fiscal_year: function (date, with_dates = false, boolean = false) { if (!frappe.boot.setup_complete) { return; } if (!date) { +======= + pick_serial_and_batch_bundle(frm, cdt, cdn, type_of_transaction, warehouse_field) { + let item_row = frappe.get_doc(cdt, cdn); + item_row.type_of_transaction = type_of_transaction; + + frappe.db.get_value("Item", item_row.item_code, ["has_batch_no", "has_serial_no"]) + .then((r) => { + item_row.has_batch_no = r.message.has_batch_no; + item_row.has_serial_no = r.message.has_serial_no; + + frappe.require("assets/erpnext/js/utils/serial_no_batch_selector.js", function() { + new erpnext.SerialBatchPackageSelector(frm, item_row, (r) => { + if (r) { + let update_values = { + "serial_and_batch_bundle": r.name, + "qty": Math.abs(r.total_qty) + } + + if (!warehouse_field) { + warehouse_field = "warehouse"; + } + + if (r.warehouse) { + update_values[warehouse_field] = r.warehouse; + } + + frappe.model.set_value(item_row.doctype, item_row.name, update_values); + } + }); + }); + }); + }, + + get_fiscal_year: function(date, with_dates) { + if(!date) { +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) date = frappe.datetime.get_today(); } @@ -415,8 +452,15 @@ $.extend(erpnext.utils, { async: false, callback: function (r) { if (r.message) { +<<<<<<< HEAD if (with_dates) fiscal_year = r.message; else fiscal_year = r.message[0]; +======= + if (with_dates) + fiscal_year = r.message; + else + fiscal_year = r.message[0]; +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) } }, }); 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 745550b57c6..66654beb4f5 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 @@ -20,6 +20,7 @@ frappe.query_reports["Customer Acquisition and Loyalty"] = { reqd: 1, }, { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", @@ -33,6 +34,21 @@ frappe.query_reports["Customer Acquisition and Loyalty"] = { default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], reqd: 1, }, +======= + "fieldname":"from_date", + "label": __("From Date"), + "fieldtype": "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": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], + "reqd": 1 + } +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) ], formatter: function (value, row, column, data, default_formatter) { value = default_formatter(value, row, column, data); diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.js b/erpnext/selling/report/sales_analytics/sales_analytics.js index 0f87923949f..c92ed2cf2cc 100644 --- a/erpnext/selling/report/sales_analytics/sales_analytics.js +++ b/erpnext/selling/report/sales_analytics/sales_analytics.js @@ -43,15 +43,25 @@ frappe.query_reports["Sales Analytics"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], reqd: 1, +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + reqd: 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_date", label: __("To Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], reqd: 1, +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], + reqd: 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "company", 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 6740083c8d4..75d598189d6 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,11 @@ frappe.query_reports["Sales Partner Target Variance based on Item Group"] = { label: __("Fiscal Year"), fieldtype: "Link", options: "Fiscal Year", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()) +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { 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 7944453a1b0..442f0d8ea08 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 @@ -21,7 +21,11 @@ frappe.query_reports["Sales Person Commission Summary"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_date", 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 828e9e74f23..df747375fcf 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,11 @@ frappe.query_reports["Sales Person-wise Transaction Summary"] = { fieldname: "from_date", label: __("From Date"), fieldtype: "Date", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { 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 bebe1ab16e5..24d4c251bd7 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,11 @@ frappe.query_reports["Territory Target Variance Based On Item Group"] = { label: __("Fiscal Year"), fieldtype: "Link", options: "Fiscal Year", +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()), +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today()) +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { 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 a15b69b112a..b7c8ae1456e 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 @@ -4,12 +4,21 @@ frappe.query_reports["Batch Item Expiry Status"] = { filters: [ { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", width: "80", default: frappe.sys_defaults.year_start_date, reqd: 1, +======= + "fieldname":"from_date", + "label": __("From Date"), + "fieldtype": "Date", + "width": "80", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + "reqd": 1, +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_date", 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 401ebe43028..8e3e8c668fd 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 @@ -12,12 +12,21 @@ frappe.query_reports["Batch-Wise Balance History"] = { reqd: 1, }, { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", width: "80", default: frappe.sys_defaults.year_start_date, reqd: 1, +======= + "fieldname":"from_date", + "label": __("From Date"), + "fieldtype": "Date", + "width": "80", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], + "reqd": 1 +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_date", 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 cde502ad738..81b488e71ca 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,24 @@ frappe.query_reports["Incorrect Serial No Valuation"] = { fieldtype: "Date", fieldname: "from_date", reqd: 1, +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { label: __("To Date"), fieldtype: "Date", fieldname: "to_date", reqd: 1, +<<<<<<< HEAD default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], }, ], +======= + default: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[2], + } + ] +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }; 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 3b12dab939a..18c3ffcc819 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 @@ -4,10 +4,17 @@ frappe.query_reports["Itemwise Recommended Reorder Level"] = { filters: [ { +<<<<<<< HEAD fieldname: "from_date", label: __("From Date"), fieldtype: "Date", default: frappe.sys_defaults.year_start_date, +======= + "fieldname":"from_date", + "label": __("From Date"), + "fieldtype": "Date", + "default": erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), with_dates=true)[1], +>>>>>>> 4496a6760e (fix: Default year start and end dates in reports) }, { fieldname: "to_date",