Skip to content

Commit 8e12bda

Browse files
committed
refactor: better label for entity type
1 parent 7630c01 commit 8e12bda

2 files changed

Lines changed: 20 additions & 10 deletions

File tree

erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def get_columns(filters):
205205
pan = "pan" if frappe.db.has_column(filters.party_type, "pan") else "tax_id"
206206
columns = [
207207
{
208-
"label": _("Section Code"),
208+
"label": _("Tax Withholding Category"),
209209
"options": "Tax Withholding Category",
210210
"fieldname": "tax_withholding_category",
211211
"fieldtype": "Link",
@@ -236,7 +236,12 @@ def get_columns(filters):
236236

237237
columns.extend(
238238
[
239-
{"label": _("Entity Type"), "fieldname": "party_entity_type", "fieldtype": "Data", "width": 100},
239+
{
240+
"label": _(f"{filters.get('party_type', 'Party')} Type"),
241+
"fieldname": "party_entity_type",
242+
"fieldtype": "Data",
243+
"width": 100,
244+
},
240245
]
241246
)
242247
if filters.party_type == "Supplier":

erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ def group_by_party_and_category(data, filters):
6363
},
6464
)
6565

66-
party_category_wise_map.get((row.get("party"), row.get("tax_withholding_category")))["total_amount"] += row.get(
67-
"total_amount", 0.0
68-
)
66+
party_category_wise_map.get((row.get("party"), row.get("tax_withholding_category")))[
67+
"total_amount"
68+
] += row.get("total_amount", 0.0)
6969

70-
party_category_wise_map.get((row.get("party"), row.get("tax_withholding_category")))["tax_amount"] += row.get(
71-
"tax_amount", 0.0
72-
)
70+
party_category_wise_map.get((row.get("party"), row.get("tax_withholding_category")))[
71+
"tax_amount"
72+
] += row.get("tax_amount", 0.0)
7373

7474
final_result = get_final_result(party_category_wise_map)
7575

@@ -110,13 +110,18 @@ def get_columns(filters):
110110
columns.extend(
111111
[
112112
{
113-
"label": _("Section Code"),
113+
"label": _("Tax Withholding Category"),
114114
"options": "Tax Withholding Category",
115115
"fieldname": "tax_withholding_category",
116116
"fieldtype": "Link",
117117
"width": 180,
118118
},
119-
{"label": _("Entity Type"), "fieldname": "party_entity_type", "fieldtype": "Data", "width": 180},
119+
{
120+
"label": _(f"{filters.get('party_type', 'Party')} Type"),
121+
"fieldname": "party_entity_type",
122+
"fieldtype": "Data",
123+
"width": 180,
124+
},
120125
{
121126
"label": _("TDS Rate %") if filters.get("party_type") == "Supplier" else _("TCS Rate %"),
122127
"fieldname": "rate",

0 commit comments

Comments
 (0)