Skip to content

Fix TradeRepublic PDF import for Spanish documents (#5458)#5554

Open
blastik wants to merge 5 commits intoportfolio-performance:masterfrom
blastik:fix/tr-spain-pdf-import-5458
Open

Fix TradeRepublic PDF import for Spanish documents (#5458)#5554
blastik wants to merge 5 commits intoportfolio-performance:masterfrom
blastik:fix/tr-spain-pdf-import-5458

Conversation

@blastik
Copy link

@blastik blastik commented Mar 6, 2026

Summary

Fixes three broken PDF import cases for Trade Republic Spanish locale documents, reported in #5458.

  • Spanish deposits (Transferencia): Account statement entries where the date line contains Incoming transfer from … and the following line says Transferencia <amount> were not imported. Added Transferencia as an alternative to Überweisung in the deposit section pattern.

  • Interest statement (INFORME DE INTERESES): No importer existed for the Spanish monthly interest document. Added a new addInterestStatementTransaction_Format04() handler that extracts gross interest, net credit, and the Spanish IRPF withholding tax (Retención IRPF).

  • Saveback buy order (LIQUIDACIÓN DE VALORES EN SAVEBACK): The date line Ejecución del Saveback el <date> en Lang und Schwarz Exchange. was not matched. Extended the date-extraction patterns in both addBuySellTransaction and addBuySellCryptoTransaction to recognise this Spanish prefix.

Test plan

  • testTransaccionesDeCuenta10 – three deposits, including two with the previously broken Transferencia prefix format
  • testInformeDeIntereses01 – interest of 77.42 EUR gross, 14.71 EUR IRPF tax, 62.71 EUR net
  • testLiquidacionDeValoresSaveback01 – Saveback purchase of FTSE All-World USD (Acc), 0.761108 shares, 5.55 EUR, dated 2026-02-02
  • Full TradeRepublicPDFExtractorTest suite (260 tests) – no regressions

🤖 Generated with Claude Code

blastik and others added 2 commits March 6, 2026 10:28
…ance#5458)

Three fixes for broken Spanish locale PDF imports:

1. Account statement deposits: accept "Transferencia" as alternative to
   "Überweisung" so that Spanish "Incoming transfer from ..." entries
   on the date line are correctly imported.

2. Interest statement (INFORME DE INTERESES): add new document type
   handler with Spanish IRPF withholding-tax support. Gross amount,
   net credit, and retained tax are all extracted correctly.

3. Saveback buy order (LIQUIDACIÓN DE VALORES EN SAVEBACK): extend the
   date-matching patterns in both addBuySellTransaction and
   addBuySellCryptoTransaction to also recognise the Spanish prefix
   "Ejecución del Saveback el <date> en …".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
blastik and others added 2 commits March 7, 2026 23:12
- Merge addInterestStatementTransaction_Format04 (Spanish INFORME DE
  INTERESES) into Format02 by adding the document type and RESUMEN block
  pattern; the existing oneOf DD.MM.YYYY case already handles the Spanish
  IBAN line format
- Fix assertThat deposit() formatting in testTransaccionesDeCuenta10 to
  place the first value-check on a new line per project convention

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@blastik blastik requested a review from gamue March 7, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants