From 382f5eb1b1d8c7987443d92194c86b61e5db2159 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 22 Aug 2017 19:06:21 +0530 Subject: [PATCH] Run sales/purchase register for one month by default (#10493) --- .../item_wise_purchase_register/item_wise_purchase_register.js | 2 +- .../report/item_wise_sales_register/item_wise_sales_register.js | 2 +- erpnext/accounts/report/purchase_register/purchase_register.js | 2 +- erpnext/accounts/report/sales_register/sales_register.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js index 8d33524abb..46ed9dab39 100644 --- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js +++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js @@ -7,7 +7,7 @@ frappe.query_reports["Item-wise Purchase Register"] = { "fieldname":"from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1), "width": "80" }, { diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js index 65cec518fe..b57a7fce9d 100644 --- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js +++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js @@ -7,7 +7,7 @@ frappe.query_reports["Item-wise Sales Register"] = frappe.query_reports["Sales R "fieldname":"from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_default("year_start_date"), + "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1), "width": "80" }, { diff --git a/erpnext/accounts/report/purchase_register/purchase_register.js b/erpnext/accounts/report/purchase_register/purchase_register.js index cd795310da..42b35c2a99 100644 --- a/erpnext/accounts/report/purchase_register/purchase_register.js +++ b/erpnext/accounts/report/purchase_register/purchase_register.js @@ -7,7 +7,7 @@ frappe.query_reports["Purchase Register"] = { "fieldname":"from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_user_default("year_start_date"), + "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1), "width": "80" }, { diff --git a/erpnext/accounts/report/sales_register/sales_register.js b/erpnext/accounts/report/sales_register/sales_register.js index 2ac4ae8b2a..0495976cf1 100644 --- a/erpnext/accounts/report/sales_register/sales_register.js +++ b/erpnext/accounts/report/sales_register/sales_register.js @@ -7,7 +7,7 @@ frappe.query_reports["Sales Register"] = { "fieldname":"from_date", "label": __("From Date"), "fieldtype": "Date", - "default": frappe.defaults.get_default("year_start_date"), + "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1), "width": "80" }, {