Hoppa till huvudinnehåll
Petanque Life

Bank Reconciliation

F08.12 6 features Planerad

I korthet

Bank Reconciliation imports CAMT.053, OFX, SIE4 and bank-specific CSVs (Nordea, SEB, Handelsbanken, Swedbank, BNP Paribas, Credit Agricole), runs rule-based and heuristic auto-matching against invoices and payments, surfaces unmatched lines in a colour-coded admin inbox, generates double-entry AccountingEntry rows on match and locks the period only when the closing balance reconciles.

Så fungerar det

Bank statements arrive in any of four formats: CAMT.053 (ISO 20022), CSV (generic and bank-specific), OFX or SIE4. Format detection is automatic and deduplication uses a SHA-256 hash of the file contents so the same statement re-uploaded never creates duplicate rows. Auto-matching runs in two passes.

First, the club treasurer's own rules (counterparty-name regex, amount range, OCR prefix) execute in priority order; supported actions are book_to_account (post directly to a configured account), match_to_invoice_by_ocr (look up the invoice by OCR reference) and ignore. Second, heuristic matching applies: an exact reference or OCR match against an existing Payment scores 1.0 confidence, while fuzzy name plus amount plus date within 3 days uses Jaro-Winkler with threshold 0.85; anything below 0.6 is left unmatched. Unmatched lines feed the manual inbox, colour-coded green (high confidence), yellow (medium) and red (low or no match) with three actions per row: match against invoice, post as new entry or ignore.

Split matching is supported for one bank line that should clear several invoices. On every match the engine writes a balanced AccountingEntry voucher: incoming lines book debit bank, credit accounts receivable; outgoing lines book debit accounts payable, credit bank; new revenue posts as debit bank, credit revenue account. Balance reconciliation is the gate to locking: closing_balance must equal opening_balance plus the sum of all lines AND every line must be matched before status flips to locked.

The balance-check endpoint returns expected, actual and diff so the operator can spot a missing line before attempting to lock. The implementation under PL-T076 covers parser, matcher, admin inbox, AccountingEntry generation and the lock flow.

Centrala funktioner

  • Multi-format import: CAMT.053, OFX, SIE4 and bank-specific CSVs from Nordea, SEB, Handelsbanken, Swedbank, BNP Paribas and Credit Agricole
  • SHA-256 file deduplication so re-uploaded statements never duplicate rows
  • Rule-based auto-matching with counterparty regex, amount range and OCR prefix in priority order
  • Heuristic matching: 1.0 confidence on exact reference/OCR, Jaro-Winkler 0.85 on fuzzy name plus amount plus date
  • Colour-coded manual inbox with three-button flow and split-matching support
  • Automatic double-entry AccountingEntry generation on match (incoming, outgoing and new-revenue patterns)
  • Balance reconciliation gating with expected vs actual diff before period lock

I praktiken

On Monday the treasurer uploads last week's CAMT.053 from Swedbank. The platform deduplicates by SHA-256 (the file is new), parses 47 lines, and auto-matches 38 — 31 exact OCR matches against open invoices, four fuzzy matches at 0.91 confidence on member names, three rule-driven postings (regular hall-rental refund) booked direct to account 6210. Nine lines remain in the inbox: six green (likely matches the treasurer just confirms), two yellow (wrong amount, she splits one across two invoices), one red (unknown payer that turns out to be a forgotten sponsor — she posts as new revenue).

She runs balance check; expected matches actual, every line is matched, status flips to locked, the corresponding AccountingEntry vouchers are visible in /accounting-entries/.

Features i detta subsystem

6
ID Status Funktioner
F08.12.01 Levererad Import av kontoutdrag — stöd för CAMT.053 (ISO 20022), CSV (generisk + bankspecifik: Nordea, SEB, Handelsbanken, Swedbank, BNP Paribas, Crédit Agricole), OFX, SIE4. Formatdetektering automatisk. SHA-256-deduplicering. ✅ PL-T076
F08.12.02 Levererad Regelbaserad auto-matchning — klubbkassörens egna regler (motpartsnamn-regex, beloppsintervall, OCR-prefix). Prioritetsordning. Stöder book_to_account, match_to_invoice_by_ocr och ignore. ✅ PL-T076
F08.12.03 Levererad Heuristisk matchning — referens/OCR-matchning mot Payment (1.0 conf), fuzzy namn+belopp+datum ±3d (Jaro-Winkler ≥ 0.85). Under 0.6 → unmatched. ✅ PL-T076
F08.12.04 Levererad Manuell inbox — obematchade rader med färgkodning (grön/gul/röd). Tre-knapps-flöde: matcha mot faktura, bokför som ny post, ignorera. Split-matchning stöds. ✅ PL-T076
F08.12.05 Levererad AccountingEntry-generering — automatisk dubbelbokning vid matchning: debet bank/kredit kundfordran (incoming), debet leverantörsskuld/kredit bank (outgoing), debet bank/kredit intäktskonto (new). ✅ PL-T076
F08.12.06 Levererad Saldo-avstämning och lock — closing_balance == opening_balance + sum(lines) OCH alla lines matchade ⇒ status=locked. Balance-check-endpoint returnerar expected/actual/diff. ✅ PL-T076

Intressenter som behöver detta subsystem

Förekommer i 2 intressentanalyser