4 Commits

Author SHA1 Message Date
Kevin Bataille
1224074837 Add TODO.md: GoCardless payment ID matching implementation plan
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 00:53:51 +01:00
Kevin Bataille
f31265c064 Add AGENTS.md for AI coding agents; clarify manual tool design in README
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 00:45:49 +01:00
Kevin Bataille
0a048628a5 Add advanced reconciliation features: retry detection, partial payments, credit notes
New features:
- Credit note handling: Exclude negative invoices from GC reconciliation
- Retry detection: Flag invoices with multiple GC payment attempts
- Partial payment detection: Track invoices where remain_to_pay > 0
- Payout fee CSV: Export detailed fee breakdown per payout
- Configurable tolerances: RECONCILIATION_DATE_TOLERANCE, RECONCILIATION_PAYOUT_TOLERANCE

Files:
- lib/reconciliation/gocardless_payouts_parser.rb (new) - Parse GC payouts CSV
- lib/reconciliation/engine.rb - Add retry_group, partial fields to Match struct
- lib/reconciliation/reporter.rb - Show partial/retry in report, write payouts CSV
- lib/reconciliation/dolibarr_fetcher.rb - Add is_credit_note field, filter negatives
- bin/reconcile - Wire up --gc-payouts argument
- README.md - Document new features and --gc-payouts usage
- .env.example - Add optional tolerance settings

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-02-26 00:38:41 +01:00
Kevin Bataille
4decb3cb3c Initial implementation of the reconciliation script
Standalone Ruby script reconciling GoCardless payments, Dolibarr
invoices (via API), and Shine bank statements. Three-pass engine:
GC↔Dolibarr matching, open invoice audit, payout↔bank verification.
Includes dry-run and --fix mode to auto-mark Dolibarr invoices as paid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 00:23:07 +01:00