mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-28 17:34:47 +00:00
[fix] [minor] item-wose tax in item-wise sales register
This commit is contained in:
@@ -81,12 +81,12 @@ def get_tax_accounts(item_list, columns):
|
|||||||
if account_head not in tax_accounts:
|
if account_head not in tax_accounts:
|
||||||
tax_accounts.append(account_head)
|
tax_accounts.append(account_head)
|
||||||
|
|
||||||
invoice = item_tax.setdefault(parent, {})
|
|
||||||
if item_wise_tax_detail:
|
if item_wise_tax_detail:
|
||||||
try:
|
try:
|
||||||
item_wise_tax_detail = json.loads(item_wise_tax_detail)
|
item_wise_tax_detail = json.loads(item_wise_tax_detail)
|
||||||
for item, tax_amount in item_wise_tax_detail.items():
|
for item, tax_amount in item_wise_tax_detail.items():
|
||||||
invoice.setdefault(item, {})[account_head] = flt(tax_amount)
|
item_tax.setdefault(parent, {}).setdefault(item, {})[account_head] = \
|
||||||
|
flt(tax_amount[1])
|
||||||
|
|
||||||
except ValueError:
|
except ValueError:
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -71,19 +71,19 @@ def get_tax_accounts(item_list, columns):
|
|||||||
tax_details = webnotes.conn.sql("""select parent, account_head, item_wise_tax_detail
|
tax_details = webnotes.conn.sql("""select parent, account_head, item_wise_tax_detail
|
||||||
from `tabSales Taxes and Charges` where parenttype = 'Sales Invoice'
|
from `tabSales Taxes and Charges` where parenttype = 'Sales Invoice'
|
||||||
and docstatus = 1 and ifnull(account_head, '') != ''
|
and docstatus = 1 and ifnull(account_head, '') != ''
|
||||||
and parent in (%s)""" % ', '.join(['%s']*len(item_list)), tuple([item.parent for item in item_list]))
|
and parent in (%s)""" % ', '.join(['%s']*len(item_list)),
|
||||||
|
tuple([item.parent for item in item_list]))
|
||||||
|
|
||||||
for parent, account_head, item_wise_tax_detail in tax_details:
|
for parent, account_head, item_wise_tax_detail in tax_details:
|
||||||
if account_head not in tax_accounts:
|
if account_head not in tax_accounts:
|
||||||
tax_accounts.append(account_head)
|
tax_accounts.append(account_head)
|
||||||
|
|
||||||
invoice = item_tax.setdefault(parent, {})
|
|
||||||
if item_wise_tax_detail:
|
if item_wise_tax_detail:
|
||||||
try:
|
try:
|
||||||
item_wise_tax_detail = json.loads(item_wise_tax_detail)
|
item_wise_tax_detail = json.loads(item_wise_tax_detail)
|
||||||
for item, tax_amount in item_wise_tax_detail.items():
|
for item, tax_amount in item_wise_tax_detail.items():
|
||||||
invoice.setdefault(item, {})[account_head] = flt(tax_amount)
|
item_tax.setdefault(parent, {}).setdefault(item, {})[account_head] = \
|
||||||
|
flt(tax_amount[1])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user