Out-of-the-box importers for the big-5 UK bank statement formats, plus a generic CSV exporter for the Payment Journal (Supplier / Sort Code / Account / Amount / Date).

  • Current version: v0.2.0.6
  • AL prefix: UKBAN
  • Object range: 79500-79599
  • Business Central: 26.0.0.0
  • Publisher: Amplio Solutions Ltd

AMP UK Bank Statement Importer & Smart Reconciliation

Out-of-the-box importers for the big-five UK bank formats plus a learning rule engine for auto-matching to the standard Business Central reconciliation flow.
  • Publisher: Amplio Solutions
  • Object prefix: AMP
  • Object ID range: 80100..80199
  • Target: BC application 26.0.0.0 / platform 26.0.0.0 (runtime 13.0, country GB)
  • Version: 0.1.0.0 (MVP scaffold)

What this does

  1. Adds an importer for each of Lloyds, Barclays, HSBC, NatWest and Santander. CSV is bank-specific; OFX (.ofx / .qfx) is shared because the standard covers all five.
  2. Tags each Bank Account with its provider so the user never has to pick a format on import.
  3. Runs a rule-driven Match Rule Engine after every import that writes Match Suggestions to the standard Bank Acc. Reconciliation and Payment Reconciliation Journal pages.
  4. Provides a "Learn This Match" action that promotes a manually-applied line into a new rule, so the next statement auto-suggests it.

The rule engine is deliberately simple: regex / amount tolerance / vendor or customer hint, with a confidence score and a small bonus for rules that have been accepted often. No ML, no external service.


Folder layout

07-UK-Bank-Statement-Importer/
├── app.json
├── README.md
├── .gitignore
├── .editorconfig
├── .vscode/
│   └── launch.json                 # local Docker sandbox + cloud sandbox
├── permissions/
│   └── AMPUKBankImporter.PermissionSet.al
└── src/
    ├── Codeunits/
    │   ├── AMPBankImportMgt.Codeunit.al      # dispatcher
    │   ├── AMPCsvReader.Codeunit.al          # shared CSV / date / decimal helpers
    │   ├── AMPLloydsImporter.Codeunit.al
    │   ├── AMPBarclaysImporter.Codeunit.al
    │   ├── AMPHSBCImporter.Codeunit.al
    │   ├── AMPNatWestImporter.Codeunit.al
    │   ├── AMPSantanderImporter.Codeunit.al
    │   ├── AMPOFXParser.Codeunit.al          # shared OFX 1.x + 2.x parser
    │   └── AMPMatchRuleEngine.Codeunit.al
    ├── Enums/
    │   ├── AMPBankProvider.Enum.al
    │   └── AMPMatchRuleType.Enum.al
    ├── Pages/
    │   ├── AMPBankImportSetup.Page.al
    │   ├── AMPBankMatchRules.Page.al
    │   ├── AMPBankMatchRuleCard.Page.al
    │   ├── AMPBankMatchSuggestions.Page.al   # ListPart, used in page extensions
    │   └── AMPBankStmtImportLogs.Page.al
    ├── PageExtensions/
    │   ├── AMPBankAccReconExt.PageExt.al        # extends 379
    │   └── AMPPaymentReconJrnlExt.PageExt.al    # extends 1290
    ├── TableExtensions/
    │   └── AMPBankAccountExt.TableExt.al        # extends 270
    └── Tables/
        ├── AMPBankImportSetup.Table.al          # singleton setup
        ├── AMPBankMatchRule.Table.al
        ├── AMPBankMatchSuggestion.Table.al
        └── AMPBankStmtImportLog.Table.al

Object ID map

Type ID Object
Table 80100 AMP Bank Import Setup
Table 80101 AMP Bank Match Rule
Table 80102 AMP Bank Match Suggestion
Table 80103 AMP Bank Stmt Import Log
TableExt 80110 AMP Bank Account Ext (extends 270)
Page 80100 AMP Bank Import Setup (Card, singleton)
Page 80101 AMP Bank Match Rules (List)
Page 80102 AMP Bank Match Rule Card
Page 80103 AMP Bank Match Suggestions (ListPart)
Page 80104 AMP Bank Stmt Import Logs (List, History)
PageExt 80110 AMP Bank Acc Recon Ext (extends 379)
PageExt 80111 AMP Payment Recon Jrnl Ext (extends 1290)
Codeunit 80100 AMP Bank Import Mgt (dispatcher)
Codeunit 80101 AMP Lloyds Importer
Codeunit 80102 AMP Barclays Importer
Codeunit 80103 AMP HSBC Importer
Codeunit 80104 AMP NatWest Importer
Codeunit 80105 AMP Santander Importer
Codeunit 80106 AMP Match Rule Engine
Codeunit 80107 AMP OFX Parser
Codeunit 80109 AMP CSV Reader (shared helper)
Enum 80100 AMP Bank Provider
Enum 80101 AMP Match Rule Type
PermissionSet 80100 AMP UK Bank Importer
ID 80108 is intentionally unused — reserved for the v2 install codeunit (Open Banking setup seeding).

How a user runs it

  1. Open the Bank Account card and set Bank Provider (Importer) to one of Lloyds / Barclays / HSBC / NatWest / Santander.
  2. Open the Bank Import Setup card (Tell Me → "Bank Import Setup") and set the default G/L account, currency, encoding and minimum confidence threshold.
  3. Open Bank Acc. Reconciliation (or Payment Reconciliation Journal) and use the new actions:
    • Import (UK Bank Format) — file picker, dispatches to the right CSV importer or shared OFX parser.
    • Suggest Matches — re-runs the rule engine and refreshes suggestions.
    • Learn This Match — turns the most recently applied manual line into a new Match Rule with a conservative regex.
  4. Suggestions appear inline on the recon page (page extension) with a colour-coded confidence score; one-click Apply writes the suggested account back to the standard reconciliation line and bumps the rule's match counter.

What's complete in v0.1 (this MVP)

Area Status Notes
Folder + app.json + launch.json + .gitignore + .editorconfig done idRanges 80100..80199, BC 26.0.0.0, GB locale, Cloud target
Setup, Match Rule, Match Suggestion, Import Log tables done All 4 with appropriate keys, captions, classifications
Setup card, Rules list+card, Suggestions ListPart, Import Logs list done Conditional styling on confidence + import status
Bank Acc. Reconciliation and Payment Reconciliation Journal page extensions done Three actions each, all promoted under "Smart Reconciliation"
Bank Account table extension (Bank Provider + Default Stmt Format) done
Dispatcher codeunit done File picker, format sniff (csv/ofx/qfx), audit log, rule-engine call
Per-bank CSV importers (Lloyds, Barclays, HSBC, NatWest, Santander) done Format quirks documented in each codeunit header
Shared OFX parser (1.x SGML + 2.x XML) done Forgiving regex; logs unparseable blocks rather than aborting
Shared CSV reader / UK-date / decimal helpers done Streaming, RFC-4180-ish quote handling
Rule engine: DescriptionRegex / AmountTolerance / VendorHint / CustomerHint / Combined done Confidence + usage bonus capped at 100
"Learn This Match" → auto-rule generation done Builds a loose case-insensitive regex from the applied line description
Permission set done Single all-in-one set: AMP UK Bank Importer

What Lee needs to ship this

These are the gaps I've left explicit. Each one is a deliberate scope cut so v0.1 stays a working scaffold rather than a half-done product.

  1. Compile + symbols. Pull symbols (AL: Download symbols) against a BC 26 sandbox and confirm the project builds. There's no .alpackages checked in.
  2. Run-time test pass. Sample statement files for each of the five banks (and at least one OFX from a Barclays Business and a Santander export) — drop them through the importers and confirm Bank Acc. Reconciliation Line rows look right. The HSBC importer sniffs whether a header row is present; that path needs at least two real exports to be confident.
  3. AMP Bank Match Suggestion rendering on the page extension. The suggestion ListPart exists but is not yet bound as a sub-part on the two page extensions. Decide whether to use a part(...) in the page-extension layout or render via factbox; both are short additions.
  4. Permission set split. AMP UK Bank Importer is currently one all-RIMD set. AppSource expects at least a READ and a SETUP/USE split before submission.
  5. Translation file. app.json declares the TranslationFile feature but there is no Translations/ xliff yet. Generate *.g.xlf after first build, then add en-GB.xlf.
  6. Install / upgrade codeunit (ID 80108 reserved). Optional for v0.1 but recommended before production: seed the Setup singleton, seed any default AMP Bank Match Rule rows, and migrate old data on upgrade.
  7. Test codeunit. Recommended: an AMP UK Bank Importer Tests test app sitting alongside this one (separate app.json, depends on the AMS Test Toolkit), with at least one happy-path test per bank and one rule-engine evaluation test. Out of scope for v0.1.
  8. Open Banking / TrueLayer (v2). Stubbed out everywhere it would otherwise leak in: hidden setup group, Other enum value reserved, ID 80108 reserved. Defer.
  9. AppSource icons / screenshots / EULA. Placeholders only in app.json — product page collateral is a pre-submission task.

Deliberate scope cuts (don't fix unless asked)

  • No XmlPort objects. The original brief mentioned "Data Exchange Definition + import codeunit per bank". A native AL importer codeunit per bank is simpler than configuring BC's Data Exchange framework via XmlPort + DataExchDef setup data, and it makes the Santander format (line-by-line key: value, not flat CSV) actually tractable. Path forward: if a customer wants the standard Bank Statement Import UI to drive these, wrap each importer in a thin xmlport and seed the Data Exchange Definition rows from an install codeunit. Captured in the ID map (no XmlPort IDs allocated yet).
  • No use of Codeunit "CSV Buffer" (1235). The shared AMP CSV Reader is a streaming parser with no temp-table overhead; staying off the standard CSV Buffer keeps the dependency surface smaller.
  • Persistent (not temporary) Match Suggestions. Means the page extension can render them without re-running the engine on activation, and accepted/dismissed state is auditable. Costs a tiny bit of storage per statement.
  • Singleton setup. Same shape as General Ledger Setup etc. — one row per company, PK = ''.
  • Hardcoded credentials. None. The Open Banking Base URL field is in the (hidden, v2) setup group; the API key field on Setup stores a Guid handle into Isolated Storage, never the secret itself. No HttpClient is wired up in v0.1 — the fields are in place so the v2 install upgrades cleanly.

Building locally

# 1. Install AL Language extension in VS Code (publisher: Microsoft)
# 2. Configure a BC sandbox (Docker or cloud) — see .vscode/launch.json
# 3. From the AL palette: "AL: Download symbols"
# 4. Press F5 to build, publish, and launch

.vscode/launch.json ships with two configurations:

  • BC Local Sandbox (Docker)OnPrem, http://bcserver, UserPassword auth. Edit server to match your container.
  • BC Cloud SandboxSandbox environment named SANDBOX. Edit environmentName to match the tenant you're targeting.

Both use startupObjectId: 22 (Customer List) so first-launch lands somewhere familiar. Switch to 80100 (AMP Bank Import Setup) once you're iterating on the importer itself.


Versioning

Semantic-ish: 0.1.0.0 for the MVP scaffold, 0.x for in-progress builds, 1.0.0.0 for the first AppSource release. Bump the third digit for additive feature work, the second for breaking schema changes.