fix: make column names more general

This commit is contained in:
Gursheen Anand 2023-07-21 15:55:31 +05:30
parent dd37f6cbd6
commit ec80dc6f09

View File

@ -39,7 +39,7 @@ def get_result(
out = [] out = []
for name, details in gle_map.items(): for name, details in gle_map.items():
tax_deducted, total_amount_credited = 0, 0 tax_amount, total_amount = 0, 0
tax_withholding_category = tax_category_map.get(name) tax_withholding_category = tax_category_map.get(name)
rate = tax_rate_map.get(tax_withholding_category) rate = tax_rate_map.get(tax_withholding_category)
@ -58,14 +58,14 @@ def get_result(
rate = tax_rate_map.get(tax_withholding_category) rate = tax_rate_map.get(tax_withholding_category)
if entry.account in tds_accounts: if entry.account in tds_accounts:
tax_deducted += entry.credit - entry.debit tax_amount += entry.credit - entry.debit
if invoice_net_total_map.get(name): if invoice_net_total_map.get(name):
total_amount_credited = invoice_net_total_map.get(name) total_amount = invoice_net_total_map.get(name)
else: else:
total_amount_credited += entry.credit total_amount += entry.credit
if tax_deducted: if tax_amount:
if party_map.get(party, {}).get("party_type") == "Supplier": if party_map.get(party, {}).get("party_type") == "Supplier":
party_name = "supplier_name" party_name = "supplier_name"
party_type = "supplier_type" party_type = "supplier_type"
@ -90,8 +90,8 @@ def get_result(
"section_code": tax_withholding_category, "section_code": tax_withholding_category,
"entity_type": party_map.get(party, {}).get(party_type), "entity_type": party_map.get(party, {}).get(party_type),
"rate": rate, "rate": rate,
"total_amount_credited": total_amount_credited, "total_amount": total_amount,
"tax_deducted": tax_deducted, "tax_amount": tax_amount,
"transaction_date": posting_date, "transaction_date": posting_date,
"transaction_type": voucher_type, "transaction_type": voucher_type,
"ref_no": name, "ref_no": name,
@ -179,14 +179,14 @@ def get_columns(filters):
{"label": _("Entity Type"), "fieldname": "entity_type", "fieldtype": "Data", "width": 180}, {"label": _("Entity Type"), "fieldname": "entity_type", "fieldtype": "Data", "width": 180},
{"label": _("Rate %"), "fieldname": "rate", "fieldtype": "Percent", "width": 90}, {"label": _("Rate %"), "fieldname": "rate", "fieldtype": "Percent", "width": 90},
{ {
"label": _("Total Amount Credited"), "label": _("Total Amount"),
"fieldname": "total_amount_credited", "fieldname": "total_amount",
"fieldtype": "Float", "fieldtype": "Float",
"width": 90, "width": 90,
}, },
{ {
"label": _("Amount of Tax Deducted"), "label": _("Tax Amount"),
"fieldname": "tax_deducted", "fieldname": "tax_amount",
"fieldtype": "Float", "fieldtype": "Float",
"width": 90, "width": 90,
}, },