Skip to content

[BUG] Bank Statement Import Issue: Incorrect Header Row and Header Mismatch for FNB Gold Business Account. #16

@ReginaldGouws

Description

@ReginaldGouws

Current Behavior

Description:

The bank statement import does not work correctly when importing statements from a Gold Business Account at First National Bank (FNB). The issue arises due to two key mismatches:

Header Row Position:

Expected headers appear on the 3rd row in the code.
In my bank statement file, the headers are on row 7.

Header Differences:

Expected headers:
expected_headers = [
"Date",
"SERVICE FEE",
"Amount",
"DESCRIPTION",
"REFERENCE",
"Balance",
"CHEQUE NUMBER",
None,
]
Actual headers from my bank statement:
Date Amount Balance Description
Missing fields: "SERVICE FEE", "REFERENCE", "CHEQUE NUMBER".
Case difference: "DESCRIPTION" (expected) vs. "Description" (actual).

Actual Behavior:

The import fails due to the mismatch in the row position and header names.

Steps To Reproduce

Steps to Reproduce:

Upload an FNB Gold Business Account bank statement file.
Attempt to import the file.
Observe that the system fails to recognize the headers and does not process the file correctly.

Expected Behavior

Expected Behavior:

The system should detect headers dynamically, even if they appear on a different row.
It should allow flexibility in header names (e.g., "Description" vs. "DESCRIPTION").
Import should proceed without failing due to missing columns that do not apply to all account types.

Anything else?

Proposed Solution:

Allow configuration for which row contains headers instead of assuming row 3.
Implement case-insensitive header matching.
Add an option to map headers dynamically for different bank account types.

Additional Information:

Bank Account Type: Gold Business Account, First National Bank (FNB)
Bank Statement Format: CSV

Environment and Versions

Installed Apps
South Africa Customisations: v0.1.7 (version-15)

ERPNext: v15.50.0 (version-15)

Frappe Framework: v15.54.1 (version-15)

Frappe HR: v16.0.0-dev (develop)

Payments: v0.0.1 (develop)

Webshop: v0.0.1 (develop)

WooCommerce Fusion: v1.10.3 (version-15)

Operating System

Other

What browsers are you seeing the problem on?

Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions