Skip to content

fix(i18n): say what monodivisa really does, it drops every currency conversion - #433

Merged
GeiserX merged 7 commits into
mainfrom
fix/monodivisa-wording
Nov 16, 2026
Merged

GeiserX merged 7 commits into
mainfrom
fix/monodivisa-wording

Conversation

@GeiserX

@GeiserX GeiserX commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Problem

The monodivisa toggle said it was «compatible con el enfoque de Autodeclaro, Taxdown…». That overstates it. Monodivisa switches off the whole FX engine. It computes no currency result at all, not even for the taxpayer's own USD→EUR conversions or broker auto-conversions. It matches those tools only in how it values shares: buy at the buy-date rate, sale at the sale-date rate. Autodeclaro also documents a «Cash (Forex)» section for currency sales. Users who convert dollars got 0 in 1633/1637 with no hint why.

Several DGT citations were also wrong. V2324-10 (investment funds) was cited for a currency FIFO and "symmetric" rule. V0583-16 (a corporate restructuring) was cited for the ECB rate. Art. 37.1.l was cited for FX instead of Art. 33.1 with timing Art. 14.2.e.

Fix

No computed figure changes. The only test lines that changed are one text assertion and two comments.

Tests

9 new tests: the notice (count, opt-out, monodivisa off, no conversions) and the localized texts. Each was proven to go red. Full suite: 2635 passed. Lint and typecheck are clean.

Refs #230, #242

Monodivisa switches off the whole FX engine, so it computes no currency
result at all, not even for the taxpayer's own USD->EUR conversions or
broker auto-conversions. It only matches those tools in how shares are
valued (buy at the buy-date rate, sale at the sale-date rate).

Say exactly that in the profile detail, the Renta Web closing tip, the
competitor-reconciliation hint (5 locales and the engine fallback), the
CLI help and the code/test comments, and point users who convert
currency to the default mode. No figure changes.

Refs #230
With monodivisa on, every currency conversion in the file (manual CASH
trades like EUR.USD, IBKR AFx/FXCONV auto-conversions) was dropped with
no message at all. Now the report adds one info message with the number
of this year's conversions that were not computed, and says the default
mode computes them.

The count mirrors extractFxEvents: non-EUR CASH trades, minus AFx/FXCONV
rows when the user also opted out of auto-conversions. Localized in all
5 locales. No figure changes.

Refs #230
#252 rewrote guide_rw.fx_note because the old text said FX results only
appear on manual currency trades, which is false since broker
auto-conversions (#239) and stock round-trips (#230) are processed.
#265 integrated a fork branch whose stale base put the old text back
(the same rebase dropped other keys that #265 restored by hand; this one
was missed). Restore the #252 text in all 5 locales; it still matches
what the engine does.
In #242 we agreed to label the toggle as the traditional method (cost at
the buy-date rate), keeping "monodivisa" as a searchable word and the
localStorage key unchanged. The label still read "Modo simplificado
(monodivisa EUR)". Relabel it in all 5 locales.

Refs #242
- V2324-10 is about investment funds in foreign currency (cost at the
  subscription-date rate, proceeds at the reimbursement-date rate). It
  does not set a FIFO rule for currency, nor a "symmetry" between the
  stock-buy and stock-sell FX producers. Drop it from those engine
  comments and from docs/casillas.md, and cite V2422-20 (the worked
  example the default mode reproduces) in the monodivisa warning, all 5
  locales.
- V0583-16 is a corporate restructuring answer and says nothing about
  exchange rates. The ECB rate is the official rate by Ley 46/1998
  art. 36; income is valued at the rate when it becomes payable
  (V1024-11 dividends, V0463-21 interest). Fix ecb.ts and the docs.
- CLAUDE.md: monodivisa matches other tools only in share valuation and
  computes no currency result; FX is Art. 33.1 with timing Art. 14.2.e,
  not Art. 37.1.l; FIFO on currency is an inference, not a consulta.

Comments, docs and UI text only. No logic changes.

Refs #230
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 38 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2cf2411 and 42cca45.

Files selected for processing: 16

  • CLAUDE.md
  • docs/casillas.md
  • docs/modelos-fiscales.md
  • src/cli/index.ts
  • src/engine/ecb.ts
  • src/engine/fx-fifo.ts
  • src/generators/report.ts
  • src/i18n/locales/ca.ts
  • src/i18n/locales/en.ts
  • src/i18n/locales/es.ts
  • src/i18n/locales/eu.ts
  • src/i18n/locales/gl.ts
  • tests/generators/report.test.ts
  • tests/i18n/localize-message.test.ts
  • tests/integration/fx-carry-basis-e2e.test.ts
  • tests/integration/fx-stock-proceeds-e2e.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

… note

The engine realizes a USD->GBP conversion as a disposal, so the guide no
longer says the difference waits for a conversion to euros. The docs now say
the real EUR amount values a conversion when the statement has it, and keep
the report's payment-date rate apart from the DGT's exigibility rule. The
notice test uses a count that cannot match 1633/1637.
@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.07%. Comparing base (2a98f4a) to head (42cca45).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #433   +/-   ##
=======================================
  Coverage   93.07%   93.07%           
=======================================
  Files          63       63           
  Lines        6840     6849    +9     
  Branches     2337     2343    +6     
=======================================
+ Hits         6366     6375    +9     
  Misses        391      391           
  Partials       83       83           
Files with missing lines Coverage Δ
src/cli/index.ts 0.00% <ø> (ø)
src/engine/ecb.ts 98.42% <ø> (ø)
src/engine/fx-fifo.ts 99.55% <100.00%> (ø)
src/generators/report.ts 96.29% <100.00%> (+0.14%) ⬆️
src/i18n/locales/ca.ts 100.00% <ø> (ø)
src/i18n/locales/en.ts 100.00% <ø> (ø)
src/i18n/locales/es.ts 100.00% <ø> (ø)
src/i18n/locales/eu.ts 100.00% <ø> (ø)
src/i18n/locales/gl.ts 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GeiserX
GeiserX merged commit 0b07282 into main Nov 16, 2026
8 checks passed
@GeiserX
GeiserX deleted the fix/monodivisa-wording branch November 16, 2026 14:28
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.

1 participant