Skip to content

Commit 2c08519

Browse files
fix: incorrect IFSC codes in bank remittance report (backport #1538) (#1583)
* fix: faulty ifsc codes in bank remittance report * refactor(payroll): bank remittance report * refactor: format bank_remittance.py (cherry picked from commit 2b3904a) Co-authored-by: Viny Selopal <[email protected]>
1 parent 92331aa commit 2c08519

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

hrms/payroll/report/bank_remittance/bank_remittance.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ def execute(filters=None):
2222
"hidden": 1,
2323
"width": 200,
2424
},
25-
{"label": _("Payment Date"), "fieldtype": "Data", "fieldname": "payment_date", "width": 100},
25+
{
26+
"label": _("Payment Date"),
27+
"fieldtype": "Data",
28+
"fieldname": "payment_date",
29+
"width": 100,
30+
},
2631
{
2732
"label": _("Employee Name"),
2833
"fieldtype": "Link",
@@ -146,12 +151,10 @@ def get_emp_bank_ifsc_code(salary_slips):
146151
emp_names = [d.employee for d in salary_slips]
147152
ifsc_codes = get_all("Employee", [("name", "IN", emp_names)], ["ifsc_code", "name"])
148153

149-
ifsc_codes_map = {}
150-
for code in ifsc_codes:
151-
ifsc_codes_map[code.name] = code
154+
ifsc_codes_map = {code.name: code.ifsc_code for code in ifsc_codes}
152155

153156
for slip in salary_slips:
154-
slip["ifsc_code"] = ifsc_codes_map[code.name]["ifsc_code"]
157+
slip["ifsc_code"] = ifsc_codes_map[slip.employee]
155158

156159
return salary_slips
157160

0 commit comments

Comments
 (0)