Fixes in purchase register report (#12737)
This commit is contained in:
parent
2aba97bff1
commit
cae13bf048
@ -168,11 +168,11 @@ def get_tax_accounts(item_list, columns, company_currency,
|
|||||||
|
|
||||||
for d in item_list:
|
for d in item_list:
|
||||||
invoice_item_row.setdefault(d.parent, []).append(d)
|
invoice_item_row.setdefault(d.parent, []).append(d)
|
||||||
item_row_map.setdefault(d.parent, {}).setdefault(d.item_code, []).append(d)
|
item_row_map.setdefault(d.parent, {}).setdefault(d.item_code or d.item_name, []).append(d)
|
||||||
|
|
||||||
conditions = ""
|
conditions = ""
|
||||||
if doctype == "Purchase Invoice":
|
if doctype == "Purchase Invoice":
|
||||||
conditions = " and category in ('Total', 'Valuation and Total')"
|
conditions = " and category in ('Total', 'Valuation and Total') and base_tax_amount_after_discount_amount != 0"
|
||||||
|
|
||||||
tax_details = frappe.db.sql("""
|
tax_details = frappe.db.sql("""
|
||||||
select
|
select
|
||||||
|
@ -172,6 +172,7 @@ def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts):
|
|||||||
else sum(base_tax_amount_after_discount_amount) * -1 end as tax_amount
|
else sum(base_tax_amount_after_discount_amount) * -1 end as tax_amount
|
||||||
from `tabPurchase Taxes and Charges`
|
from `tabPurchase Taxes and Charges`
|
||||||
where parent in (%s) and category in ('Total', 'Valuation and Total')
|
where parent in (%s) and category in ('Total', 'Valuation and Total')
|
||||||
|
and base_tax_amount_after_discount_amount != 0
|
||||||
group by parent, account_head, add_deduct_tax
|
group by parent, account_head, add_deduct_tax
|
||||||
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user