Merge branch 'hotfix'
This commit is contained in:
commit
f38d6d9c44
@ -5,7 +5,7 @@ import frappe
|
|||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
from frappe.utils import getdate
|
from frappe.utils import getdate
|
||||||
|
|
||||||
__version__ = '10.1.41'
|
__version__ = '10.1.42'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
@ -9,7 +9,7 @@ from frappe.utils import flt,cstr
|
|||||||
from erpnext.accounts.report.financial_statements import get_period_list
|
from erpnext.accounts.report.financial_statements import get_period_list
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
columns, data = [], []
|
columns, data, chart = [], [], []
|
||||||
if filters.get('fiscal_year'):
|
if filters.get('fiscal_year'):
|
||||||
company = erpnext.get_default_company()
|
company = erpnext.get_default_company()
|
||||||
period_list = get_period_list(filters.get('fiscal_year'), filters.get('fiscal_year'),"Monthly", company)
|
period_list = get_period_list(filters.get('fiscal_year'), filters.get('fiscal_year'),"Monthly", company)
|
||||||
|
@ -298,7 +298,7 @@ class Project(Document):
|
|||||||
dt_name = frappe.db.get_value('Task', {"subject": dt, "project": self.name })
|
dt_name = frappe.db.get_value('Task', {"subject": dt, "project": self.name })
|
||||||
task_doc.append('depends_on', {"task": dt_name})
|
task_doc.append('depends_on', {"task": dt_name})
|
||||||
|
|
||||||
task_doc.update_db()
|
task_doc.db_update()
|
||||||
|
|
||||||
def get_timeline_data(doctype, name):
|
def get_timeline_data(doctype, name):
|
||||||
'''Return timeline for attendance'''
|
'''Return timeline for attendance'''
|
||||||
|
@ -59,5 +59,11 @@ frappe.query_reports["Sales Person-wise Transaction Summary"] = {
|
|||||||
fieldtype: "Link",
|
fieldtype: "Link",
|
||||||
options: "Territory",
|
options: "Territory",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldname:"show_return_entries",
|
||||||
|
label: __("Show Return Entries"),
|
||||||
|
fieldtype: "Check",
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -15,7 +15,7 @@ def execute(filters=None):
|
|||||||
data = []
|
data = []
|
||||||
|
|
||||||
for d in entries:
|
for d in entries:
|
||||||
if d.stock_qty > 0:
|
if d.stock_qty > 0 or filters.get('show_return_entries', 0):
|
||||||
data.append([
|
data.append([
|
||||||
d.name, d.customer, d.territory, d.posting_date, d.item_code,
|
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"),
|
item_details.get(d.item_code, {}).get("item_group"), item_details.get(d.item_code, {}).get("brand"),
|
||||||
|
@ -417,8 +417,9 @@ class EmailDigest(Document):
|
|||||||
value, count, billed_value, delivered_value = frappe.db.sql("""select ifnull(sum(grand_total),0), count(*),
|
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}`
|
ifnull(sum(grand_total*per_billed/100),0), ifnull(sum(grand_total*{0}/100),0) from `tab{1}`
|
||||||
where (transaction_date <= %(to_date)s)
|
where (transaction_date <= %(to_date)s)
|
||||||
and status not in ('Closed','Cancelled', 'Completed') """.format(getfield, doc_type),
|
and status not in ('Closed','Cancelled', 'Completed')
|
||||||
{"to_date": self.future_to_date})[0]
|
and company = %(company)s """.format(getfield, doc_type),
|
||||||
|
{"to_date": self.future_to_date, "company": self.company})[0]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"label": self.meta.get_label(fieldname),
|
"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`
|
value, count = frappe.db.sql("""select ifnull(sum(grand_total),0), count(*) from `tabQuotation`
|
||||||
where (transaction_date <= %(to_date)s)
|
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`
|
last_value = frappe.db.sql("""select ifnull(sum(grand_total),0) from `tabQuotation`
|
||||||
where (transaction_date <= %(to_date)s)
|
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 {
|
return {
|
||||||
"label": self.meta.get_label(fieldname),
|
"label": self.meta.get_label(fieldname),
|
||||||
@ -462,8 +465,9 @@ class EmailDigest(Document):
|
|||||||
def get_total_on(self, doc_type, from_date, to_date):
|
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}`
|
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),
|
where (transaction_date between %(from_date)s and %(to_date)s) and company=%(company)s
|
||||||
{"from_date": from_date, "to_date": to_date})[0]
|
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):
|
def get_from_to_date(self):
|
||||||
today = now_datetime().date()
|
today = now_datetime().date()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user