fix: Handle for custom field IFSC code in Bank remittance report. (#23905)
* fix: Handel for custom field IFSC code
* fix: changes_requested
diff --git a/erpnext/payroll/report/bank_remittance/bank_remittance.py b/erpnext/payroll/report/bank_remittance/bank_remittance.py
index 4b052bf..500543c 100644
--- a/erpnext/payroll/report/bank_remittance/bank_remittance.py
+++ b/erpnext/payroll/report/bank_remittance/bank_remittance.py
@@ -47,33 +47,39 @@
"fieldtype": "Int",
"fieldname": "employee_account_no",
"width": 50
- },
- {
+ }
+ ]
+
+ if frappe.db.has_column('Employee', 'ifsc_code'):
+ columns.append({
"label": _("IFSC Code"),
"fieldtype": "Data",
"fieldname": "bank_code",
"width": 100
- },
- {
- "label": _("Currency"),
- "fieldtype": "Data",
- "fieldname": "currency",
- "width": 50
- },
- {
- "label": _("Net Salary Amount"),
- "fieldtype": "Currency",
- "options": "currency",
- "fieldname": "amount",
- "width": 100
- }
- ]
+ })
+
+ columns += [{
+ "label": _("Currency"),
+ "fieldtype": "Data",
+ "fieldname": "currency",
+ "width": 50
+ },
+ {
+ "label": _("Net Salary Amount"),
+ "fieldtype": "Currency",
+ "options": "currency",
+ "fieldname": "amount",
+ "width": 100
+ }]
+
data = []
accounts = get_bank_accounts()
payroll_entries = get_payroll_entries(accounts, filters)
salary_slips = get_salary_slips(payroll_entries)
- get_emp_bank_ifsc_code(salary_slips)
+
+ if frappe.db.has_column('Employee', 'ifsc_code'):
+ get_emp_bank_ifsc_code(salary_slips)
for salary in salary_slips:
if salary.bank_name and salary.bank_account_no and salary.debit_acc_no and salary.status in ["Submitted", "Paid"]: