From 6be8bea934d2899d49013f2d9425b86c8fb24408 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Sun, 8 Jul 2018 19:25:13 +0530 Subject: [PATCH 1/5] Provision to view return entries in Sales Person-wise Transaction Summary (#14830) --- .../sales_person_wise_transaction_summary.js | 6 ++++++ .../sales_person_wise_transaction_summary.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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 90244ce9f6..67051c8b5e 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 @@ -59,5 +59,11 @@ frappe.query_reports["Sales Person-wise Transaction Summary"] = { fieldtype: "Link", options: "Territory", }, + { + fieldname:"show_return_entries", + label: __("Show Return Entries"), + fieldtype: "Check", + default: 0, + }, ] } \ No newline at end of file diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py index 19b6774ce9..ae2cf8c550 100644 --- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py +++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py @@ -15,7 +15,7 @@ def execute(filters=None): data = [] for d in entries: - if d.stock_qty > 0: + if d.stock_qty > 0 or filters.get('show_return_entries', 0): data.append([ d.name, d.customer, d.territory, d.posting_date, d.item_code, item_details.get(d.item_code, {}).get("item_group"), item_details.get(d.item_code, {}).get("brand"), From 8179bcbabd14467a48a9b207367b38d9aefd454b Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 9 Jul 2018 09:29:40 +0530 Subject: [PATCH 2/5] [Fix] Code cleanup (#14843) --- erpnext/hr/report/vehicle_expenses/vehicle_expenses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py index 93ea11c640..2886546c3a 100644 --- a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py +++ b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py @@ -9,7 +9,7 @@ from frappe.utils import flt,cstr from erpnext.accounts.report.financial_statements import get_period_list def execute(filters=None): - columns, data = [], [] + columns, data, chart = [], [], [] if filters.get('fiscal_year'): company = erpnext.get_default_company() period_list = get_period_list(filters.get('fiscal_year'), filters.get('fiscal_year'),"Monthly", company) From 83ad646af427da761525c8fa235433dbcd263d15 Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 9 Jul 2018 12:11:50 +0530 Subject: [PATCH 3/5] Filter out pending orders based on company --- .../setup/doctype/email_digest/email_digest.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 0cab383176..dc9917a368 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -417,8 +417,9 @@ class EmailDigest(Document): value, count, billed_value, delivered_value = frappe.db.sql("""select ifnull(sum(grand_total),0), count(*), ifnull(sum(grand_total*per_billed/100),0), ifnull(sum(grand_total*{0}/100),0) from `tab{1}` where (transaction_date <= %(to_date)s) - and status not in ('Closed','Cancelled', 'Completed') """.format(getfield, doc_type), - {"to_date": self.future_to_date})[0] + and status not in ('Closed','Cancelled', 'Completed') + and company = %(company)s """.format(getfield, doc_type), + {"to_date": self.future_to_date, "company": self.company})[0] return { "label": self.meta.get_label(fieldname), @@ -432,11 +433,13 @@ class EmailDigest(Document): value, count = frappe.db.sql("""select ifnull(sum(grand_total),0), count(*) from `tabQuotation` where (transaction_date <= %(to_date)s) - and status not in ('Ordered','Cancelled', 'Lost') """,{"to_date": self.future_to_date})[0] + and company = %(company)s + and status not in ('Ordered','Cancelled', 'Lost') """,{"to_date": self.future_to_date, "company": self.company})[0] last_value = frappe.db.sql("""select ifnull(sum(grand_total),0) from `tabQuotation` where (transaction_date <= %(to_date)s) - and status not in ('Ordered','Cancelled', 'Lost') """,{"to_date": self.past_to_date})[0][0] + and company = %(company)s + and status not in ('Ordered','Cancelled', 'Lost') """,{"to_date": self.past_to_date, "company": self.company})[0][0] return { "label": self.meta.get_label(fieldname), @@ -462,8 +465,9 @@ class EmailDigest(Document): def get_total_on(self, doc_type, from_date, to_date): return frappe.db.sql("""select ifnull(sum(grand_total),0), count(*) from `tab{0}` - where (transaction_date between %(from_date)s and %(to_date)s) and status not in ('Cancelled')""".format(doc_type), - {"from_date": from_date, "to_date": to_date})[0] + where (transaction_date between %(from_date)s and %(to_date)s) and company=%(company)s + and status not in ('Cancelled')""".format(doc_type), + {"from_date": from_date, "to_date": to_date, "company": self.company})[0] def get_from_to_date(self): today = now_datetime().date() From 720b06495cfe7f10f2769d3b1d9bb21f5c9034db Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 9 Jul 2018 13:57:16 +0530 Subject: [PATCH 4/5] [Fix] Not able to save project (#14848) --- erpnext/projects/doctype/project/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 1f4bd005c6..3cb91018b6 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -298,7 +298,7 @@ class Project(Document): dt_name = frappe.db.get_value('Task', {"subject": dt, "project": self.name }) task_doc.append('depends_on', {"task": dt_name}) - task_doc.update_db() + task_doc.db_update() def get_timeline_data(doctype, name): '''Return timeline for attendance''' From 07bb1811afa048c9cc8a8002e0331540354a16e5 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Mon, 9 Jul 2018 16:23:50 +0600 Subject: [PATCH 5/5] bumped to version 10.1.42 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 75e7361b38..4bc1d06874 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.1.41' +__version__ = '10.1.42' def get_default_company(user=None): '''Get default company for user'''