mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 03:03:50 +00:00
fix(tax withholding details): avoid voucher duplication
(cherry picked from commit 8837016243)
This commit is contained in:
@@ -45,6 +45,7 @@ def get_result(filters, tds_docs, tds_accounts, tax_category_map, journal_entry_
|
|||||||
gle_map = get_gle_map(tds_docs)
|
gle_map = get_gle_map(tds_docs)
|
||||||
|
|
||||||
out = []
|
out = []
|
||||||
|
entries = {}
|
||||||
for name, details in gle_map.items():
|
for name, details in gle_map.items():
|
||||||
for entry in details:
|
for entry in details:
|
||||||
tax_amount, total_amount, grand_total, base_total = 0, 0, 0, 0
|
tax_amount, total_amount, grand_total, base_total = 0, 0, 0, 0
|
||||||
@@ -119,8 +120,13 @@ def get_result(filters, tds_docs, tds_accounts, tax_category_map, journal_entry_
|
|||||||
"supplier_invoice_date": bill_date,
|
"supplier_invoice_date": bill_date,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
out.append(row)
|
|
||||||
|
|
||||||
|
key = entry.voucher_no
|
||||||
|
if key in entries:
|
||||||
|
entries[key]["tax_amount"] += tax_amount
|
||||||
|
else:
|
||||||
|
entries[key] = row
|
||||||
|
out = list(entries.values())
|
||||||
out.sort(key=lambda x: (x["section_code"], x["transaction_date"]))
|
out.sort(key=lambda x: (x["section_code"], x["transaction_date"]))
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
|||||||
Reference in New Issue
Block a user