Search by

content-true / bank-file-tool-reconciliation

Content-true

Reconcile normalized bank-statement CSV rows with opening and closing balances

Package info

github.com/Content-true/bank-file-tool-reconciliation

Homepage

pkg:composer/content-true/bank-file-tool-reconciliation

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-11-19 03:01 UTC

This package is auto-updated.

Last update: 2026-11-19 03:07:54 UTC


README

A small local PHP library for checking a normalized CSV bank statement against an opening balance and an optional expected closing balance. It uses integer cents, avoiding floating-point rounding in totals, and lists exact repeated rows for human review. It does not decide whether a charge is legitimate.

composer require content-true/bank-file-tool-reconciliation
use ContentTrue\BankFileTool\StatementReconciler;

$csv = "date,description,amount\n2026-11-01,Deposit,120.00\n2026-11-02,Payment,-45.50\n";
$report = StatementReconciler::reconcile($csv, '1000.00', '1074.50');
// calculatedClosing: "1074.50"; matchesExpected: true

Input must have date, description, amount headers. Amounts are signed dot-decimal strings with at most two fractional digits; expenses are negative. The output includes transactions, calculatedClosing, expectedClosing, matchesExpected, and duplicates (row numbers). Check a few exported rows against the original statement before relying on any total. When a PDF has first been converted with a Bank Statement Converter, this local check helps catch missing rows or unexpected totals. It does not parse PDFs or call the website, and no bank data leaves the local process.

Requires PHP 8.1+. Run php -d zend.assertions=1 -d assert.exception=1 tests/smoke.php. MIT license.