fix: Handle for custom field IFSC code in Bank remittance report. (#23905)

* fix: Handel for custom field IFSC code

* fix: changes_requested
This commit is contained in:
Anurag Mishra
2020-11-17 17:52:59 +05:30
committed by GitHub
parent 7aa60d1dea
commit 3271437314

View File

@@ -47,33 +47,39 @@ def execute(filters=None):
"fieldtype": "Int", "fieldtype": "Int",
"fieldname": "employee_account_no", "fieldname": "employee_account_no",
"width": 50 "width": 50
}, }
{ ]
if frappe.db.has_column('Employee', 'ifsc_code'):
columns.append({
"label": _("IFSC Code"), "label": _("IFSC Code"),
"fieldtype": "Data", "fieldtype": "Data",
"fieldname": "bank_code", "fieldname": "bank_code",
"width": 100 "width": 100
}, })
{
"label": _("Currency"), columns += [{
"fieldtype": "Data", "label": _("Currency"),
"fieldname": "currency", "fieldtype": "Data",
"width": 50 "fieldname": "currency",
}, "width": 50
{ },
"label": _("Net Salary Amount"), {
"fieldtype": "Currency", "label": _("Net Salary Amount"),
"options": "currency", "fieldtype": "Currency",
"fieldname": "amount", "options": "currency",
"width": 100 "fieldname": "amount",
} "width": 100
] }]
data = [] data = []
accounts = get_bank_accounts() accounts = get_bank_accounts()
payroll_entries = get_payroll_entries(accounts, filters) payroll_entries = get_payroll_entries(accounts, filters)
salary_slips = get_salary_slips(payroll_entries) 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: 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"]: if salary.bank_name and salary.bank_account_no and salary.debit_acc_no and salary.status in ["Submitted", "Paid"]: