[fix] Taxes in itemised purchase register (#10494)

This commit is contained in:
Nabin Hait 2017-08-22 15:30:45 +05:30 committed by Makarand Bauskar
parent 8f4e1712ba
commit 28d8557905
2 changed files with 5 additions and 4 deletions

View File

@ -18,7 +18,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
aii_account_map = get_aii_accounts()
if item_list:
itemised_tax, tax_columns = get_tax_accounts(item_list, columns,
tax_doctype="Purchase Taxes and Charges")
doctype="Purchase Invoice", tax_doctype="Purchase Taxes and Charges")
columns.append({
"fieldname": "currency",

View File

@ -139,7 +139,7 @@ def get_delivery_notes_against_sales_order(item_list):
return so_dn_map
def get_tax_accounts(item_list, columns, tax_doctype="Sales Taxes and Charges"):
def get_tax_accounts(item_list, columns, doctype="Sales Invoice", tax_doctype="Sales Taxes and Charges"):
import json
item_row_map = {}
tax_columns = []
@ -155,11 +155,12 @@ def get_tax_accounts(item_list, columns, tax_doctype="Sales Taxes and Charges"):
charge_type, base_tax_amount_after_discount_amount
from `tab%s`
where
parenttype = 'Sales Invoice' and docstatus = 1
parenttype = %s and docstatus = 1
and (description is not null and description != '')
and parent in (%s)
order by description
""" % (tax_doctype, ', '.join(['%s']*len(invoice_item_row))), tuple(invoice_item_row.keys()))
""" % (tax_doctype, '%s', ', '.join(['%s']*len(invoice_item_row))),
tuple([doctype] + invoice_item_row.keys()))
for parent, description, item_wise_tax_detail, charge_type, tax_amount in tax_details:
if description not in tax_columns and tax_amount: