Merge branch 'hotfix'
diff --git a/erpnext/__init__.py b/erpnext/__init__.py
index 75e7361..4bc1d06 100644
--- a/erpnext/__init__.py
+++ b/erpnext/__init__.py
@@ -5,7 +5,7 @@
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'''
diff --git a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
index 93ea11c..2886546 100644
--- a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
+++ b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
@@ -9,7 +9,7 @@
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)
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index 1f4bd00..3cb9101 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -298,7 +298,7 @@
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'''
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 90244ce..67051c8 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 @@
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 19b6774..ae2cf8c 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 @@
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"),
diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py
index 0cab383..dc9917a 100644
--- a/erpnext/setup/doctype/email_digest/email_digest.py
+++ b/erpnext/setup/doctype/email_digest/email_digest.py
@@ -417,8 +417,9 @@
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 @@
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 @@
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()