mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-12 11:25:09 +00:00
fix: refactor GL entry mapping to include voucher type
This commit is contained in:
@@ -46,13 +46,12 @@ def get_result(filters, tds_accounts, tax_category_map, net_total_map):
|
|||||||
precision = get_currency_precision()
|
precision = get_currency_precision()
|
||||||
|
|
||||||
entries = {}
|
entries = {}
|
||||||
for name, details in gle_map.items():
|
for (voucher_type, name), details in gle_map.items():
|
||||||
for entry in details:
|
for entry in details:
|
||||||
tax_amount, total_amount, grand_total, base_total, base_tax_withholding_net_total = 0, 0, 0, 0, 0
|
tax_amount, total_amount, grand_total, base_total, base_tax_withholding_net_total = 0, 0, 0, 0, 0
|
||||||
tax_withholding_category, rate = None, None
|
tax_withholding_category, rate = None, None
|
||||||
bill_no, bill_date = "", ""
|
bill_no, bill_date = "", ""
|
||||||
posting_date = entry.posting_date
|
posting_date = entry.posting_date
|
||||||
voucher_type = entry.voucher_type
|
|
||||||
|
|
||||||
values = net_total_map.get((voucher_type, name))
|
values = net_total_map.get((voucher_type, name))
|
||||||
party = values.party if values else (entry.party or entry.against)
|
party = values.party if values else (entry.party or entry.against)
|
||||||
@@ -197,7 +196,7 @@ def get_gle_map(net_total_map):
|
|||||||
|
|
||||||
gle_map = {}
|
gle_map = {}
|
||||||
for d in rows:
|
for d in rows:
|
||||||
gle_map.setdefault(d.voucher_no, []).append(d)
|
gle_map.setdefault((d.voucher_type, d.voucher_no), []).append(d)
|
||||||
|
|
||||||
return gle_map
|
return gle_map
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user