Merge branch 'hotfix'

This commit is contained in:
mbauskar 2017-08-23 13:06:43 +05:30
commit 2d2b12c800
4 changed files with 23 additions and 19 deletions

View File

@ -4,7 +4,7 @@ import inspect
import frappe
from erpnext.hooks import regional_overrides
__version__ = '8.9.0'
__version__ = '8.9.1'
def get_default_company(user=None):
'''Get default company for user'''

View File

@ -125,14 +125,15 @@ def get_purchase_receipts_against_purchase_order(item_list):
po_pr_map = frappe._dict()
po_item_rows = list(set([d.po_detail for d in item_list]))
purchase_receipts = frappe.db.sql("""
select parent, purchase_order_item
from `tabPurchase Receipt Item`
where docstatus=1 and purchase_order_item in (%s)
group by purchase_order_item, parent
""" % (', '.join(['%s']*len(po_item_rows))), tuple(po_item_rows), as_dict=1)
if po_item_rows:
purchase_receipts = frappe.db.sql("""
select parent, purchase_order_item
from `tabPurchase Receipt Item`
where docstatus=1 and purchase_order_item in (%s)
group by purchase_order_item, parent
""" % (', '.join(['%s']*len(po_item_rows))), tuple(po_item_rows), as_dict=1)
for pr in purchase_receipts:
po_pr_map.setdefault(pr.po_detail, []).append(pr.parent)
for pr in purchase_receipts:
po_pr_map.setdefault(pr.po_detail, []).append(pr.parent)
return po_pr_map

View File

@ -127,15 +127,16 @@ def get_delivery_notes_against_sales_order(item_list):
so_dn_map = frappe._dict()
so_item_rows = list(set([d.so_detail for d in item_list]))
delivery_notes = frappe.db.sql("""
select parent, so_detail
from `tabDelivery Note Item`
where docstatus=1 and so_detail in (%s)
group by so_detail, parent
""" % (', '.join(['%s']*len(so_item_rows))), tuple(so_item_rows), as_dict=1)
if so_item_rows:
delivery_notes = frappe.db.sql("""
select parent, so_detail
from `tabDelivery Note Item`
where docstatus=1 and so_detail in (%s)
group by so_detail, parent
""" % (', '.join(['%s']*len(so_item_rows))), tuple(so_item_rows), as_dict=1)
for dn in delivery_notes:
so_dn_map.setdefault(dn.so_detail, []).append(dn.parent)
for dn in delivery_notes:
so_dn_map.setdefault(dn.so_detail, []).append(dn.parent)
return so_dn_map

View File

@ -13,7 +13,8 @@ def execute(filters=None):
dict(fieldtype='Data', label='Invoice Type', width=120),
dict(fieldtype='Data', label='Export Type', width=120),
dict(fieldtype='Data', label='E-Commerce GSTIN', width=130),
dict(fieldtype='Data', label='HSN Code', width=120)
dict(fieldtype='Data', label='HSN Code', width=120),
dict(fieldtype='Data', label='Supplier Invoice No', width=120)
], additional_query_columns=[
'supplier_gstin',
'company_gstin',
@ -21,5 +22,6 @@ def execute(filters=None):
'invoice_type',
'export_type',
'ecommerce_gstin',
'gst_hsn_code'
'gst_hsn_code',
'bill_no'
])