diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py index bb70ac9607..a332bc425c 100644 --- a/erpnext/config/selling.py +++ b/erpnext/config/selling.py @@ -245,7 +245,7 @@ def get_data(): { "type": "report", "is_query_report": True, - "name": "Quotation Trend", + "name": "Quotation Trends", "doctype": "Quotation" }, { diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 4567dd7005..3af82903a6 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -12,7 +12,8 @@ import json class AccountsController(TransactionBase): def validate(self): - self.set_missing_values(for_validate=True) + if self._action != "update_after_submit": + self.set_missing_values(for_validate=True) self.validate_date_with_fiscal_year() if self.meta.get_field("currency"): self.calculate_taxes_and_totals() diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py index 2c3483c311..7ef91007be 100644 --- a/erpnext/controllers/trends.py +++ b/erpnext/controllers/trends.py @@ -10,9 +10,9 @@ def get_columns(filters, trans): validate_filters(filters) # get conditions for based_on filter cond - based_on_details = based_wise_colums_query(filters.get("based_on"), trans) + based_on_details = based_wise_columns_query(filters.get("based_on"), trans) # get conditions for periodic filter cond - period_cols, period_select = period_wise_colums_query(filters, trans) + period_cols, period_select = period_wise_columns_query(filters, trans) # get conditions for grouping filter cond group_by_cols = group_wise_column(filters.get("group_by")) @@ -115,7 +115,7 @@ def get_data(filters, conditions): def get_mon(dt): return getdate(dt).strftime("%b") -def period_wise_colums_query(filters, trans): +def period_wise_columns_query(filters, trans): query_details = '' pwc = [] bet_dates = get_period_date_ranges(filters.get("period"), filters.get("fiscal_year")) @@ -132,9 +132,9 @@ def period_wise_colums_query(filters, trans): else: pwc = [filters.get("fiscal_year") + " (Qty):Float:120", filters.get("fiscal_year") + " (Amt):Currency:120"] - query_details = " SUM(t2.qty), SUM(t1.grand_total)," + query_details = " SUM(t2.qty), SUM(t2.base_amount)," - query_details += 'SUM(t2.qty), SUM(t1.grand_total)' + query_details += 'SUM(t2.qty), SUM(t2.base_amount)' return pwc, query_details def get_period_wise_columns(bet_dates, period, pwc): @@ -147,7 +147,7 @@ def get_period_wise_columns(bet_dates, period, pwc): def get_period_wise_query(bet_dates, trans_date, query_details): query_details += """SUM(IF(t1.%(trans_date)s BETWEEN '%(sd)s' AND '%(ed)s', t2.qty, NULL)), - SUM(IF(t1.%(trans_date)s BETWEEN '%(sd)s' AND '%(ed)s', t1.grand_total, NULL)), + SUM(IF(t1.%(trans_date)s BETWEEN '%(sd)s' AND '%(ed)s', t2.base_amount, NULL)), """ % {"trans_date": trans_date, "sd": bet_dates[0],"ed": bet_dates[1]} return query_details @@ -191,7 +191,7 @@ def get_period_month_ranges(period, fiscal_year): return period_month_ranges -def based_wise_colums_query(based_on, trans): +def based_wise_columns_query(based_on, trans): based_on_details = {} # based_on_cols, based_on_select, based_on_group_by, addl_tables diff --git a/erpnext/public/js/purchase_trends_filters.js b/erpnext/public/js/purchase_trends_filters.js index 168b9ad660..d60b915f48 100644 --- a/erpnext/public/js/purchase_trends_filters.js +++ b/erpnext/public/js/purchase_trends_filters.js @@ -21,7 +21,7 @@ var get_filters = function(){ "fieldname":"group_by", "label": __("Group By"), "fieldtype": "Select", - "options": ["Item", "Supplier"].join("\n"), + "options": ["", "Item", "Supplier"].join("\n"), "default": "" }, { @@ -39,4 +39,4 @@ var get_filters = function(){ "default": frappe.defaults.get_user_default("company") }, ]; -} \ No newline at end of file +} diff --git a/erpnext/public/js/sales_trends_filters.js b/erpnext/public/js/sales_trends_filters.js index a1254c1af0..89c269e339 100644 --- a/erpnext/public/js/sales_trends_filters.js +++ b/erpnext/public/js/sales_trends_filters.js @@ -21,7 +21,7 @@ var get_filters = function(){ "fieldname":"group_by", "label": __("Group By"), "fieldtype": "Select", - "options": ["Item", "Customer"].join("\n"), + "options": ["", "Item", "Customer"].join("\n"), "default": "" }, { @@ -37,6 +37,6 @@ var get_filters = function(){ "fieldtype": "Link", "options": "Company", "default": frappe.defaults.get_user_default("company") - }, + }, ]; -} \ No newline at end of file +}