Add support for French Trade Republic statements

FP
7mo ago
+62-8

Summary

Trade Republic France delivers account statements in French (Relevé de compte). The current parser handles German, Italian, and English but fails on French PDFs with "Aucune transaction trouvée – veuillez vérifier le PDF."

This PR adds French support to the cash transaction parser.

Changes (single file: js/parser.js)

  • French detection: persistent flag set on the first page that contains markers like SYNTHÈSE DU RELEVÉ DE COMPTE, APERÇU DU SOLDE, REMARQUES SUR LE RELEVÉ DE COMPTE, or ENTRÉE D'ARGENT.
  • Section markers:
    • cash start: TRANSACTIONS (only when isFrench, to avoid conflicting with the English interest section marker which uses the same word)
    • cash end: APERÇU DU SOLDE / REMARQUES SUR LE RELEVÉ
  • Cash header keywords: added ENTRÉE, SORTIE, D'ARGENT, SOLDE.
  • New findStackedHeader helper for vertically-stacked French headers (ENTRÉE above D'ARGENT, SORTIE above D'ARGENT). Picks the bottom candidate with the smallest |x - top.x| so SORTIE doesn't pair with the D'ARGENT under ENTRÉE when multiple D'ARGENT items exist (which would shift the column boundary and misclassify all sells).
  • SALDO matcher now accepts SOLDE.
  • Both ASCII ' and curly ’ apostrophes supported.

Test plan

  • Tested on a 111-page Trade Republic France statement (1765 transactions over ~3 years)
  • All cash-flow sanity checks pass (prev_saldo + entrée − sortie ≈ saldo within 0.02 €)
  • Sells (entries with money flowing into cash account) correctly land in zahlungseingang
  • Buys, gifts, fees correctly land in zahlungsausgang
  • Multi-line transaction layouts (date split as 01 mai / 2023) correctly grouped into single rows
  • German / English / Italian behaviour unchanged (no regressions)

Limitations / not in scope

  • Interest section (TRANSAKTIONSÜBERSICHT) is not localized to French — French statements inline interest as Intérêts rows in the main TRANSACTIONS table, which this PR already handles correctly.
  • Portfolio (POSITIONEN) and crypto sections are not localized to French. The French equivalents (COMPTES ESPÈCES, FONDS MONÉTAIRE) could be added in a follow-up if needed.