From 1283f6308d528f1168fa95c819b9da4fe87f8294 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 18 Jul 2017 18:20:29 +0530 Subject: [PATCH] [fix] company graph based on base currency --- erpnext/projects/doctype/task/test_task.js | 24 ++++++++++++++++++++++ erpnext/setup/doctype/company/company.py | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 erpnext/projects/doctype/task/test_task.js diff --git a/erpnext/projects/doctype/task/test_task.js b/erpnext/projects/doctype/task/test_task.js new file mode 100644 index 0000000000..8a1a5bf682 --- /dev/null +++ b/erpnext/projects/doctype/task/test_task.js @@ -0,0 +1,24 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Task", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(2); + + frappe.run_serially([ + // insert a new Task + () => frappe.tests.make('Task', [ + // values to be set + {subject: 'new task'} + ]), + () => { + assert.equal(cur_frm.doc.status, 'Open'); + assert.equal(cur_frm.doc.priority, 'Low'); + }, + () => done() + ]); + +}); diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index c8a0507e8e..28f3a56cb0 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -340,7 +340,7 @@ def update_company_monthly_sales(company): from frappe.utils.goal import get_monthly_results import json filter_str = "company = '{0}' and status != 'Draft'".format(frappe.db.escape(company)) - month_to_value_dict = get_monthly_results("Sales Invoice", "grand_total", "posting_date", filter_str, "sum") + month_to_value_dict = get_monthly_results("Sales Invoice", "base_grand_total", "posting_date", filter_str, "sum") frappe.db.sql((''' update tabCompany set sales_monthly_history = %s where name=%s