[fix] [minor] add customer_name/supplier_name in sales/purchase register

This commit is contained in:
Nabin Hait
2013-07-12 17:50:34 +05:30
parent c81236770f
commit 8faa90fb20
4 changed files with 15 additions and 17 deletions

View File

@@ -42,7 +42,7 @@ def execute(filters=None):
purchase_receipt = list(set(invoice_po_pr_map.get(inv.name, {}).get("purchase_receipt", [])))
project_name = list(set(invoice_po_pr_map.get(inv.name, {}).get("project_name", [])))
row = [inv.name, inv.posting_date, inv.supplier, inv.credit_to,
row = [inv.name, inv.posting_date, inv.supplier_name, inv.credit_to,
account_map.get(inv.credit_to), ", ".join(project_name), inv.bill_no, inv.bill_date,
inv.remarks, ", ".join(purchase_order), ", ".join(purchase_receipt)]
@@ -68,7 +68,7 @@ def execute(filters=None):
def get_columns(invoice_list):
"""return columns based on filters"""
columns = [
"Invoice:Link/Purchase Invoice:120", "Posting Date:Date:80", "Supplier:Link/Supplier:120",
"Invoice:Link/Purchase Invoice:120", "Posting Date:Date:80", "Supplier::120",
"Supplier Account:Link/Account:120", "Account Group:LInk/Account:120",
"Project:Link/Project:80", "Bill No::120", "Bill Date:Date:80", "Remarks::150",
"Purchase Order:Link/Purchase Order:100", "Purchase Receipt:Link/Purchase Receipt:100"
@@ -118,9 +118,8 @@ def get_conditions(filters):
def get_invoices(filters):
conditions = get_conditions(filters)
return webnotes.conn.sql("""select name, posting_date, credit_to,
supplier, bill_no, bill_date, remarks, net_total,
total_tax, grand_total, outstanding_amount
return webnotes.conn.sql("""select name, posting_date, credit_to, supplier, supplier_name,
bill_no, bill_date, remarks, net_total, total_tax, grand_total, outstanding_amount
from `tabPurchase Invoice` where docstatus = 1 %s
order by posting_date desc, name desc""" % conditions, filters, as_dict=1)