Repository navigation
fix: name every broker row that cannot be read, so no sale, dividend or refund vanishes in silence - #473
Conversation
…blocked and released anti-churning losses no longer make it wrong (#471) The «Total» of the results strip and of the method comparison said it went to the savings base, but it was the raw 0328-0331 + 1633-1637 net. The cuota next to it already used savingsBalances, which adds the losses the anti-churning rule blocks and subtracts the ones released this year. The Total now comes from savingsBalances().gains. «Acciones» keeps the raw casilla figure its subtitle names, and a «Pérdidas diferidas (anti-churning)» cell and comparison row show blocked minus released, so the cells add up.
…ser sees the change was saved (#472) Save in the anti-churning window, crypto prices and opening lots panels showed «Guardado» and reran the report in the same click. The rerun redraws all three panels with the label hidden, so it lasted one frame (or only while the ECB rates downloaded). The bind functions now tell main.ts whether the user saved or cleared, and the saved panel travels through processFiles to renderResults, whose renderers drop hidden for that panel only. A Clear, a refused save, a locale change or a year change redraw without the label.
…er wipes the year's acquisition or transmission value (#469) A trade with an explicit quantity of 0 (IBKR quantity="0", Kraken vol 0, Binance Executed 0, a Coinbase Convert to 0 units, DEGIRO "0.0") booked a lot of 0 shares. The next sale divided its cost by 0, the final guard set the whole year's acquisition value (long, overpay) or transmission value (short, underpay) to 0, and every casilla view printed NaN. - FIFO drops a 0-quantity BUY or SELL and names it (fifo.zero_quantity_buy / fifo.zero_quantity_sell, 5 locales); addLot and addShortLot never book a lot of 0 or less. The trade stays in the statement for anti-churning. - The FX engine parks nothing for a 0-share buy (the mirror), so no false fx_traditional_orphan. - The casilla blocks clean a non-finite leg the way guardNonFiniteTotals cleans the totals: no box reads NaN. - Kraken and Binance map a blank or unreadable volume to a trade of unknown quantity with its warning; Coinbase counts a Convert to 0 units as an unparsed destination; DEGIRO compares the quantity as a number.
… 0 units or 0 € in the 721, 720 and D-6 (#470) IBKR can export an Open Positions row with no readable position. The parser keeps it with quantity "0" and quantityUnknown, but the 721 showed 0 units, a row with no value either left the 721 and 720 totals as if worth 0 € (so the 721 said "not obliged"), and the 720 file wrote 0 in «Número de valores». - hasNoMarketValue treats an unknown quantity with value 0 as unvalued: the 721, the 720 thresholds and web table and the D-6 count it unvalued and the verdict becomes "cannot determine". - Modelo721Entry carries quantityUnknown; the web 721 shows «—» units and a banner naming the coins. - The 720 lists such a holding as the omission quantity_unknown for manual entry (it still counts toward the threshold) instead of a 0-share record. - The D-6 generator counts it to declare by hand; the web D-6 lists it with «—» shares and a banner. - The IBKR warning splits by asset: shares name the 720 and the D-6, crypto names the 721 and units (5 locales).
…e, and make the printed cells add up to the cent (#471) Review of the #471 fix found three problems in the results strip and the method comparison: - When generateTaxReport replaces a non-finite total with 0 (report.non_finite_total), the Total read the zeroed leg and showed a finite figure next to a NaN «Acciones», for example «Total −88,00 €» where the real result is +22 €: a deductible loss the user does not have. Now every figure and the cuota print «—» with a note that an amount could not be read, in the strip and in that method's column of the comparison table. - Each cell was rounded on its own, so «Acciones −432,00 + Divisa 0,00 + Pérdidas diferidas 864,01» showed next to «Total 432,00». The printed deferral is now the printed Total minus the other printed cells. - The deferral subtitle said the released losses came «de años anteriores», which is false when a loss is blocked and released in the same year. It now says «menos las integradas este año» in all five locales, and docs/casillas.md says the same. Tests: an unreadable report (NaN disposal, and the message alone), the same-year block and release (new fixture ibkr-471-same-year-eur-2025.xml) and an exact cell sum on the blocked-USD upload.
…edrawn panel so the user sees it (#472) Review of the #472 fix found two problems: - After the Save that values the last crypto swap, covers the last missing opening lot, or sets an anti-churning window back to «auto», the rerun draws a collapsed <details> panel. The label was not hidden, but it sat inside the closed panel, so the user never saw it. A panel drawn after its Save now renders open; any later redraw renders it as before. - writeStored and writeStoredOpeningLots swallowed a refused write (storage full or blocked), so the panel kept «Guardado» on screen while nothing was saved. Crypto prices and opening lots now save in one write through saveManualRates and saveManualOpeningLotGroups, which report a refused write. Then the panel shows an error (crypto_rates.save_error, opening_lots.save_error, in all five locales), shows no «Guardado» and does not rerun, so the typed values stay on screen, as the anti-churning panel already does. Tests check that the label is on screen (not hidden and not inside a closed <details>), the refused writes in the real app and in the storage helpers, and that the saved-prices list is open right after a Save and collapsed on a later redraw.
…end (#466) The Revolut transaction-log parser checked the FX Rate cell on every row before it knew the row type, and skipped the row when the cell was not a positive number. Only cash top-ups and withdrawals read that cell: trades and dividends store fxRateToBase "1" and the engine uses the ECB rate. So a cell such as "0" removed a sale (net 550 -> 0) or a dividend (0029 121 -> 0) and the user declared less. The check now runs only in the cash branch. A cash row with a bad rate is still skipped, and revolut.bad_fx_rate names it by date, amount and cell, in all 5 locales.
…ion is never proven without it (#467) Several parsers dropped a buy or sale row they could not read: a missing or false date, no ticker or ISIN, a type no branch handles, no amount. A dropped row can hide a second purchase, so the #453 one-purchase exception went to "applied" and a blocked loss was deducted with no proof. Such a row is now kept as a trade that books nothing (quantityUnknownTrade with Trade.unreadableRow naming the security, the date and the failing cell). The evidence check reads it as a row of unknown quantity, so the security stays "unverified". parser.trade_row_unreadable names every row in all 5 locales. One shared helper (unreadableTrade, unreadableCell, dateUndatedTrades) covers Revolut, Trading 212, Lightyear, Scalable Capital, Trade Republic and DEGIRO. An undated row takes the file's earliest readable date; a file with none is refused. A row of unknown type that writes a zero share count, or that names no security, stays skipped. Revolut also flags the inferred holding of a ticker with a buy of unknown size (quantity "0", quantityUnknown), instead of the readable part as if it were complete. Trade Republic's trade_skipped_no_amount message is gone: those rows are now named by the new warning.
…antity nor value, and a 0 that contradicts its value is never written as 0 units (#470) Review of the #470 fix found three gaps. The D-6 generator and the web D-6 section threw a DecimalError on an IBKR row with position="" and positionValue="" (or "N/A"), so the whole D-6 was lost. hasNoMarketValue now reads a value that is no number as no value, the D-6 checks quantityUnknown before it, and both D-6 filters read the sign through isNegativePositionValue (an unreadable value proves no short). Such a holding is counted to declare by hand and shown with «—» shares and value. An explicit position="0" next to a positionValue that is not 0 was written with 0 in «Número de valores», shown as 0 units in the 721 and dropped from the D-6 with no warning. The IBKR parser now flags that 0 as quantityUnknown, so the #470 paths and the warning apply. It no longer proves "no shares held" to the one-purchase exception either: that gives "unverified". A row of 0 units worth 0 got a phantom 720 record with 0 shares and 0 €. It is no holding now (holdsNothing): the 720 file and web table leave it out, and a security declared last year whose only row is 0/0 gets its C record. The design doc still said the 720 writes such a holding with 0 shares; it now matches CLAUDE.md and docs/modelos-informativos.md.
Freedom24 booked every operation but "sell" as a buy (so " sell", "sale" and "transfer" were purchases), Kraken every type but "sell", IBKR a trade with no buySell, Flatex any row by its Nominal's sign alone, and eToro any direction but "Short" as a long position. A false buy gave FIFO a false lot (Kraken: gain 2000 instead of 1000) or blocked a loss with a repurchase that never happened. Freedom24 trims the operation and keeps any other operation as an unreadable row. Kraken keeps an unreadable row for each coin. IBKR takes a missing side from the quantity sign, else "". Flatex takes the side from Kauf / Verkauf only. eToro keeps an unknown direction or action as an unreadable row. All of them now name these rows with parser.trade_row_unreadable and give garbage dates the same treatment. Docs and the repo CLAUDE.md get the rule and a Hard Trace entry.
…720 and the 721; the holding counts as unvalued (#470) IBKR can write an Open Positions value that is no number. The 720 (isHeldSecurity, thresholds, file, web table) and the 721 (entries, cost, web rates) parsed it with new Decimal and threw, whatever the quantity. Every reader now goes through positionValueOf: a held row is unvalued, never 0 EUR and never dropped; a row of 0 units holds nothing and a negative quantity is a short when the value cannot tell, as in the D-6. The web 720 table reuses the generator's isHeldSecurity.
… a contradicted 0, not as an unreadable quantity (#470) The parser treats such a 0 as unknown, but the warning said the file had no readable quantity, which is false for a written 0. Shares and crypto now get their own warning in all five locales: the file gives 0 units but a value, so the quantity is treated as unknown. One check, isZeroWithValue, drives both the flag and the warning split.
… holding with an unknown quantity (#470) The ibkr.test and (g) entries still described the old behaviour: a 720 record with 0 in «Número de valores» and an explicit 0 cancelled whatever its value. They now match the tests: the holding is the omission quantity_unknown with no record, the 0 control is 0 worth 0, and a 0 next to 60,000 is flagged unknown and not cancelled.
… holding drop out of the 720/721 (#466, #467, #468) Review of the lane found rows that still disappeared with no warning, and a case where the one-purchase exception was still proven without them: - An undated unreadable row took its own file's earliest date, which can fall after another broker's year-end list, where the evidence check never looks. finalizeMergedStatement now moves every such row (Trade.undatedRow) to the earliest date of the whole upload, so it stands before or inside every sale's window. - Revolut: a BUY/SELL with an empty Ticker is kept as a keyless unreadable row. DIVIDEND TAX (CORRECTION) is no trade. A ticker with a row of unknown size keeps its readable quantity, flagged, so the Modelo 720/721 still count it as a holding to value by hand; revolut.holding_size_unknown names it, and a row of unknown type alone no longer invents a holding. - eToro: an empty Action on a row with an ISIN, units or dates is kept. - DEGIRO: a row with no ISIN but an order id is kept. - Kraken: a readable row with no txid is booked under a row id (its gain was lost); a row with no pair is kept unreadable. - Scalable, Trading 212, Flatex, Trade Republic: a row that names its security only by name and moves shares is kept. - Trading 212: Stock split open/close rows are named by trading212.split_not_applied instead of being called unreadable. - unreadableCell no longer trips lint. Every committed fixture stays byte-identical in all three FX methods.
… half-cent split never shows a cent the cells lack (#471) With no anti-churning deferral, securities 1,004 and FX 1,004 printed 1,00 + 1,00 next to a Total of 2,01. The printed Total is now the sum of the printed cells: with a deferral that cell takes the rounding and the Total stays the base to the cent; without one the Total is the two rounded cells, at most a cent from the exact base the cuota reads. A method with no deferral prints 0,00 in the comparison's deferral row instead of a rounding cent.
…hen a Save rerun lands late (#472) A Save rerun waits for the ECB rates and a paint yield. A locale redraw in that gap removed the label, then the run brought it back. A Save the browser refused in that gap showed its error, then the earlier run redrew the panel with the stored values, no error and «Guardado». A locale redraw now cancels the label of a waiting Save run; the run still lands its report. Every edit or button click in a panel bumps that panel's revision before the Save handler runs, and a run leaves a panel touched since it started as the user left it.
…and value of opposite signs no longer lets the 720 say "not obliged" (#470) One reader decides what a number is for every holding field (`readPositionNumber`): a finite decimal, exponent forms included. "NaN", "Infinity", hex and "1_000" are no number. - A position value of "NaN" made the 720 total NaN, which passes no threshold, so the verdict said "not obliged" and the file was empty next to real holdings; the D-6 wrote NaN, the 721 dropped the coin, and "Infinity" wrote a 501-character record. It is now «sin valorar». - The IBKR parser read numbers with its own regex, which refused "1e5", so position="0" next to positionValue="1e5" was not flagged and the 720 wrote 0 in «Número de valores». The parser now uses the same reader. - An IBKR CashReport endingCash of "" or "N/A" crashed the 720, and a missing one read 0 EUR. An unknown balance is now held and unvalued: the accounts category counts it (`accounts.unvalued`), the web bar says «No se puede determinar», a banner and a parser warning name the account and currency, and the file leaves it out. An unreadable Q4 average is a missing one. IBKR's BASE_SUMMARY row is no balance of its own. - 700 units worth -5000 (or the reverse) contradicts itself. The 720 left it out as a short while the D-6 listed it at -4250 EUR. It is now held and unvalued in the 720, the 721 and the D-6 (`hasSignConflict`, `isD6Holding` shared by the D-6 generator and web table), with a warning. - The 0-next-to-a-value hints now hold for a negative value (a short), and the 721, D-6 and 720 unknown-quantity texts no longer say the file gives no number, which was false for a written 0. All in 5 locales.
… cash balance and a sign conflict are treated (#470)
…o holding or income vanishes (#466, #467, #468) A split or corporate-action row, or a trade row whose date could not be read, still disappeared or stopped the upload, so the #453 one-purchase exception could be applied with no proof. A cash row with a bad date vanished with its amount, and Revolut date cells came out as "1/10/25". - Trading 212, Lightyear and Scalable split rows and Trade Republic CORPORATE_ACTION/DELIVERY rows that name a security are kept as rows that book nothing (evidence "unverified"), named by parser.corporate_action_not_applied. - No parser throws for a date. A trade with no readable date is kept with no date; the merge gives it the upload's earliest day, so a row with no ISIN can never leave the exception "applied". IBKR still refuses a file in the wrong Date Format setting. - A cash row with no readable date is not booked under a guessed date; parser.cash_row_undated names it with its amount. - Revolut and eToro XLSX date cells are read as their real day. - Revolut DIVIDEND TAX (CORRECTION) rows are named in an info message.
… or disagree on one (#470) - A cash balance in a currency with no year-end rate (IBKR's CNH) was left out of the 720 accounts total without a word, so the verdict could say «No estás obligado». It now counts as unvalued (unvaluedCashBalances), and the web banner, the generate button and the CLI name its account and currency. heldCashBalances skips IBKR's BASE_SUMMARY row only when the account has currency rows; alone, it is the only balance and is unvalued. - A position value of "-0" with an unknown quantity was held in the 720 and a short (cancelled) in the D-6. isD6Holding now uses isShortPosition, so both forms share one sign rule; isNegativePositionValue is gone. - The web D-6 valued a holding with no share count while the D-6 guide left it out. Both now leave it out of the total and count it, and the guide names every such holding to add by hand. - The 721 listed a NaN or sign-conflict coin while the missing-holdings notice said the data had no crypto. Both use isModelo721Holding. - The CLI still called a 0 next to a value «legible»; it now says «válido». - The parser's sign-conflict and unknown-quantity warnings named options and other rows no form reads. They now name only stocks, funds, bonds and coins, and the sign-conflict hint says which form applies. - A holding under 0.005 units wrote 0 in «Número de valores». It is now the omission quantity_below_hundredth, and a lot tranche that small is merged into its neighbour.
…o share count and a fraction under 0.005 shares are declared by hand, never dropped (#470)
…e, so the panel never shows a value nobody stored or typed (#472) The keep check counted touches per panel kind. An edit or a refused Save made before a locale redraw in the middle of a Save rerun still counted, so the run kept the locale-drawn panel, which comes from the report before the Save: it showed neither the stored value nor what the user typed. The touch stamp now lives on the panel element. A locale redraw draws unstamped panels, so the run replaces them with the stored values; only an edit made in the locale-drawn panel keeps it.
…ates, and name dividends with no security (#466, #467, #468) Round 3 of the review. Each case left a row out with no word, or read a real date as another day: - Flatex: a row of an ISIN with a written Kurs 0 (Depotübertrag, split, free shares, a Kauf at 0) and an unmatched Lagerstellenwechsel leg are kept as corporate-action rows. A same-day pair that nets to zero is still skipped. Next to the #453 IBKR file: 0.00/applied -> 100.00/ unverified in all 3 FX methods. - DEGIRO: a written zero price is found by value, not by spelling, so "0", "0.00" and "0.0000" are all kept as corporate-action rows (before, "0.00" booked 40 shares at zero cost). A no-ISIN row shaped as an option or a future is kept as OPT/FUT, so it no longer stands for every share. - isoDateCells passes the workbook's date1904 flag: Revolut and eToro 1904 workbooks no longer move every date back 4 years and 1 day. - IBKR cash dateTime with a "," / space / no Date/Time separator is rewritten with ";": the dividend is no longer dropped as undated. - Text slash dates read the same with or without a leading zero, in one order per file (day first unless the file shows month first), with 2-digit years as 20YY. - Revolut: stop and stop-limit orders are trades; a zero-quantity row of unknown type with an amount (a cash merger) is kept and named unless it is a fee; a split with no readable date is a named corporate-action row. - A dividend with no ticker goes by its ISIN (Lightyear, Trading 212); one with no security is named by parser.cash_row_unidentified (5 locales) in Lightyear, Scalable, Trading 212 and Revolut. - An unknown Trading 212 / Lightyear / Scalable action with an empty share cell (Result adjustment, Fee, Tax) is a cash row, not trade evidence. The committed DEGIRO sample now keeps its rights row (books nothing, named); every report number of every committed fixture is unchanged.
…l never saves back a window the user saved over or cleared (#472) A locale redraw while a Save or Clear rerun waits draws the panel from the report before that action. When the user then edits another row, the run keeps that panel, and its selects still showed the old windows. The next Save wrote them back: a saved 2 months went back to auto, and a cleared window came back. Each select now shows the stored window (getWindowOverrides), as the crypto and opening-lots panels already prefill from storage. A normal run draws the same values, because the report is built from the same storage.
…lding in the 720 and the D-6 (#470) An IBKR row of 0 units next to a value that is no number (N/A, NaN, "60,000", "") or with no positionValue column held nothing, with no warning. A security declared last year then got a cancellation (C) record in the 720 and was cancelled in the D-6, and a coin left the 721, while the user might still hold it. A written 0 is now trusted only next to a readable value of 0. Otherwise the quantity is unknown: the holding stays held and unvalued in the 720, the D-6 and the 721, no C record or cancellation is written, and a new warning names it in 5 locales. The D-6 and 721 unknown-quantity banners now cover this case.
…r written in exponent form (#470) A finite position value past the 12 integer digits of valoración 1 (positionValue="1e999") was written as "8.5e+998", and a value of 13 to 21 digits, or a share count past 10 digits, threw and lost the whole file. A position value, a cash balance or a Q4 average that does not fit its field is now unvalued, as one with no price. A share count that does not fit is left out for manual entry (quantity_too_large). A cancellation value that does not fit is written as 0 and named to complete by hand. numPad uses toFixed, so it never writes an exponent. Every record stays 500 characters.
… too big for a 720 field is «sin valorar» (#470)
…ite signs no longer proves zero shares for the one-purchase exception (#470) buildEvidenceCheck clamped a listed quantity with Decimal.max(listed, 0), so -50 shares worth +500 read as 0 and could match trades that leave 0. The row now counts as unreadable, as the 720, 721 and D-6 treat it (hasSignConflict). Tests also pin that a round-4 unconfirmed 0 reaches the evidence as unknown.
…ear's valid costs or proceeds, and the report names it (#469) The legs were summed and then set to 0 when non-finite, so one poisoned sale wiped every cost (overpay) or every proceeds (underpay) of the year. finiteDisposalAmounts now leaves out only the non-finite amount; non-finite proceeds also drop that sale's cost, so no phantom loss. Report totals, casilla boxes and the web annex share it, and report.non_finite_disposal (5 locales) names each sale.
…epot export does not list never becomes a fee with no word (#467) A combined Konto leg that also paid a fill the Depot export does not list gave that fill's value to the listed fill as a fee. Above 50 EUR plus 2 % of the gross the fee is refused and named, but below that cap it passed with no word: a 30 EUR execution inside the leg became a 35.90 EUR fee with parserMessages [], and the gain fell from 188.20 to 158.20 EUR, in all three FX methods. The cap stays as it is. A fee below it but above an ordinary Flatex fee is still booked, and the order is now named in a new warning, flatex.commission.above_usual, in all 5 locales. The line is 10 EUR per leg plus 1 % of the gross: the order fee is 5.90 EUR, the fixture's foreign orders pay 7.90 EUR and a savings plan 0, and a stamp duty or transaction tax reaches 1 % (Ireland). A combined leg for several fills counts as one leg. The pinned 'unlisted' test now expects the warning, and so does the 69.99 EUR fee of the cap test. The cap text said "more than" 50 EUR plus 2 %, but the code also refuses a fee equal to it. docs/brokers.md and the flatex.commission.not_recovered hint in the 5 locales now say "50 EUR plus 2 %, or more". The byte-identity snapshot over every fixture shows no difference.
…zero it is, so no false refund warning is raised (#467) decimal.js counts 0 as positive, so a Distribution of 0 with a tax of 0, 0,00, -0,00, an empty or an unreadable cell raised scalable.dividend_tax_refund. The refund test is now greaterThan(0); such a row stays booked as written with no word, as before round 4.
…3 export of the same sale or convert are flagged even when one writes the fee negative (#467) V2 and V3 write a sale's and a convert's fee, and a convert's quantity, negative; V1 writes them positive, and the parser books each by its size. The round-4 row key kept the sign, so a V1 and a V3 export of the same sale got two IDs: the 10200 EUR loss became 20400 EUR with no duplicate warning. The key now reads every number cell by its size. IDs of rows written with positive numbers do not change; two identical fills in one file still get two IDs.
…ual-fee allowance, so a Storno never silences a fee above the usual (#467) The above-usual allowance is 10 EUR per leg plus 1 % of the gross. It counted every leg, so a Storno and the leg it rebooks raised it by 20 EUR: a 35.90 EUR fee on a 1000 EUR buy went silent. The legs are now counted net of Stornos, as moreLegsThanFills already counted them.
…not the next year's first dividend (#467) A refund dated 30 December for a June dividend took, as the only dividend within 7 days, the 2 January dividend of the same ISIN. The refund's year kept the tax in 0588 and the next year lost it, with no message. Pass 3b and 3c now leave out a dividend of the next year withheld after the refund. A new pass 3d gives it what is still left, so a refund with no dividend of its own year, and the room-making across the year end, match as before, in either file order.
… it refunds, as the warning tells the user (#467) A dividend of 1 December withheld 15 USD and a +15 refund came on 5 January, 35 days later. The 2025 report said the 2024 withholding drops 18.75 EUR and told the user to upload the 2024 file and recalculate 2024. But 2024 with both files still showed 18.75 and no message: pass 3c stayed in the refund's own year and pass 3b reaches only 7 days. A user who followed the hint underpaid 2024. Pass 3c now also reaches a dividend of the previous year for a refund dated 1-7 January (posted that year), the same days the prior-year warning counts for that year. So the recalculated year loses what the warning states. What still joins no dividend is named in that year's report too, so the hint never leads to a year with no message. We kept the hint as it is: a reworded hint would leave the 2024 box wrong for every user who does not lower it by hand.
…ividend, not join nothing (#467) The limits said a refund of a December dividend dated after 7 January joins nothing. When the ISIN pays again in the new year before the refund, pass 3c gives the refund to that dividend: the new year's box loses it and the earlier year keeps the tax, with no message. The text now says so, and a test pins the case in the three methods.
… order, so a fill the Depot export does not list never lowers the gain (#467) A derived fee between the usual allowance (10 EUR per leg plus 1 % of the gross) and the cap (50 EUR plus 2 %) was booked and named. So an unlisted 30 EUR fill still became a fee: a 188.20 EUR gain became 158.20 EUR. Such a fee is no longer booked. Every fill of that day keeps a fee of 0 (with one leg per fill the whole day, since a pair can then be wrong), and flatex.commission.above_usual says, in all five locales, that the fee was not deducted and that a real one can be added by hand in Renta Web. A real fee in that band is lost, which can only raise the tax. Ordinary fees (5.90, 7.90, 10.90, 15.90, savings plans) stay silent and byte-identical.
…) is true, and write down that a hidden fill below the usual fee cannot be told from a stamp duty (#467) A fill the Depot export does not list, worth less than 10 EUR per leg plus 1 % of the gross, gives a fee the two CSVs cannot tell from a stamp duty (a 10000 EUR buy with an unlisted 100 EUR fill gives 105.90 EUR, below the 110 EUR allowance). Only the order's Abrechnung PDF tells them apart. docs/brokers.md and CLAUDE.md now say so. The above-usual warning said orden(es) but counted order-days: an order above the usual on two days was 2 orders. It now counts orders; its rows stay one per day.
…s none is named (#467)
#466, #467, #468) Conflicts kept both lanes: - binance, kraken: the parsers lane names a blank or unreadable Executed or vol as an unreadable row before the trade is built, so the #469 block of the ibkr lane that flagged the same rows later is unreachable and is gone. - coinbase: a Convert to 0 units or to a count that cannot be read is kept and named by its Notes cell (parsers lane), so it books no empty lot (#469). - degiro, etoro, merge, revolut: the parsers lane logic, with every amount printed through plainOrExponent (#470). - docs/brokers.md: the Kraken limits of both lanes.
…a cash leg of 1e1000000000 no longer runs the parser out of memory (#467, #470) The parsers lane names a Flatex order whose legs and fills do not square, or a leg with no fill, and writes their sums with toFixed. The ibkr lane reads a cell of 1e1000000000 as a finite number that no row may expand (#470). Together, one such leg made the parser write a billion digits into the warning and the test worker died. The sums now print through plainOrExponent. That leg never reaches a commission any more (the parsers lane leaves it at 0 and names the order), so the test expects that message, and every parser message must now be short.
…fund past 7 days lowers an earlier dividend of its year (#467) The ibkr lane gives a refund with no dividend within 7 days to a dividend of its ISIN paid earlier in the same year (pass 3c). The parsers lane wrote its Scalable and Trade Republic tests and hints before that: a refund 60 or 30 days after its dividend kept the 0597 at 19, and the hint said such a refund is never subtracted. On the merged tree the 0597 is 14, the economic figure, so the tests pin 14 and the hints (5 locales) and docs/brokers.md say where the refund goes. The parser still names each refund row.
…469 tests of the ibkr lane hold on the parsers lane (#467, #469) The ibkr lane flagged a blank or unreadable Kraken vol, Binance Executed or Coinbase Convert destination as a trade of unknown size (parser.crypto_quantity_unknown). The parsers lane now keeps these rows earlier as unreadable rows, named with their cell in parser.trade_row_unreadable, so the ibkr block never runs and the merge dropped it. The #469 tests now expect that message and the kept 0 SOL row; the counted lots and the report totals are unchanged. The Binance spot path gave each kept row the placeholder BUY even when the Side cell was readable. unreadableTrade asks for the side when the row gives one, and Kraken passes it; Binance now does too, so a sale on ETHBTC keeps BTC as the coin given up.
… units is an unreadable row named by its cell (#467, #469) The #469 Hard Trace still described the ibkr lane's first version (quantityUnknownTrade with parser.crypto_quantity_unknown, coinbase.convert_dest_unparsed). On the merged tree the parsers lane keeps these rows as unreadable rows and names their cell.
…a possible refund is never dropped with no word (#467) A Distribution of a written zero whose tax cell was written but could not be read ("abc", "+5,00 EUR") was read as tax 0 and booked as a 0 dividend with no message. Such a cell may be a refund of the dividend next to it. The row now books nothing, the dividend keeps its own withholding, and parser.cash_income_amount_unreadable names the row with its amount and tax cells. A written zero tax (0, 0,00, -0,00 or an empty cell) stays silent, as before.
…ative tax, so a tax with no income is never a credit (#467) A Distribution of a written zero with a negative tax ("-5,00", "(5,00)") was booked alone as a late withholding, with no message. A Spanish 100 with 19 withheld and a zero row with -5 two days later gave a 0597 of 24 instead of 19, and a tax-only row of another US security raised the 0588 of the other US dividends. The withholding is now not booked, as Trade Republic does since 12d6104, and parser.cash_income_amount_unreadable names the row with its tax, so the user adds a real late withholding by hand. A positive tax stays a refund, and a written zero tax stays silent.
…efund of 1-7 January can lower a dividend of the previous year (#467) The engine takes a refund from a dividend of its ISIN within 7 days, failing that from an earlier dividend of the same year, and a refund dated 1-7 January can lower a dividend of the previous year (a 5 January refund lowers the 1 December dividend, so the 2024 0597 is 14). Otherwise it is named and not subtracted. The hints of scalable.dividend_tax_refund and trade_republic.dividend_tax_refund, in the five locales, and docs/brokers.md and docs/modelos-fiscales.md left out the January case. They now say all of it in short sentences, and CLAUDE.md says the same. New tests run the December and January cases through the real path in the three FX methods and check each locale.
… "1,5BTC" is no longer booked as 1 BTC (#467) In a comma-separated Trade History export, an Executed of 1,5BTC with no quotes splits into two cells. Every later cell moves one column on: Executed was read as 1, the Amount became the Fee, and the row was booked as 1 BTC with a 2000 fee and no message. Binance reads amounts with a dot decimal, and the file does not say whether 1,5 is 1.5 or 15, so the row is now an unreadable row named by its numeric cells as written. A row whose extra cells are empty (a trailing comma) is read as before. A quoted "1,5BTC" was already named.
… never booked as one more lot (#467) Kraken writes vol positive on both sides. A buy with a vol of -0.05 was read with its sign dropped and booked as a lot of 0.05 with no message, so a later sale took it as its cost (a gain of 399 instead of 400 in the three FX methods). A negative vol on a buy contradicts its side: the row is now an unreadable row named by its vol cell, for each coin it names. A vol of -0 stays a written zero, and a sale keeps its old read.
… an unquoted comma, so "1,5" is no longer booked as 1 BTC (#467) In a comma-separated Transaction History export, a Change of 1,5 with no quotes splits into Change "1" and Remark "5". The row was booked as 1 BTC with no message, so a later sale took a lot of 1 BTC for 20000 and the gain was 15000 instead of 5000. Remark is free text and may hold commas, so the parser does not guess. A row with more cells than the header is named only when the split may come from Change: the cell after Change is no number under EUR_Value, or Change and that cell read as one number with a comma ("1,5", "1,250.5"). Its Change is then not read, and binance.unparseable_amount names it by its cells as written. A row whose extra commas are only in Remark keeps its exact booking.
…n its Fee is empty, so "1,5BTC" is never booked as 1 BTC (#467) f759217 named a split row only when a cell past the header had text. With an empty Fee, an unquoted 1,5BTC leaves only an empty cell past the header, as a trailing comma does, and the row was still booked as 1 BTC with a fee of 2000 and no message. Such a row is now named too when a numeric cell is a plain integer that reads with the next cell as one number with a comma, and Price x Executed does not give Amount within 1%. Every row Binance writes squares, so a row with a trailing empty cell keeps its booking.
…es not show is never booked with its sign dropped (#467) b0ba85a named a buy with a negative vol. A sale with a vol of -0.1 was still read with its sign dropped and booked as a sale of 0.1 BTC with no message. Kraken writes vol positive on both sides, so such a row is no row Kraken writes, and the sale may not have happened. It is now an unreadable row named by its vol cell, for each coin it names, as for a buy. A vol of -0 stays a written zero.
…named by the report and counted nowhere (#467, #470) A Kraken vol of 1e1000000000 looked booked with no message, because the probe read only the parser messages. The report names it: Kraken writes these numbers with toString, so the cell reaches the report in exponent form, report.trade_out_of_range names the trade, and none of it counts. A vol out of range books no lot, so the sale takes the next one (a gain of 400, as with the row left out). With a readable vol the lot keeps its place and has no cost, so the sale that takes it counts its proceeds and no cost, and report.non_finite_disposal names it, the #470 rule DEGIRO and Flatex follow. No code changes. The test runs vol, price, cost and fee at 1e100000, 1e1000000000, 1e25 and 1e-25 in the three FX methods, next to a readable control, and checks that every output stays short. Written with toFixed, the vol and cost cases go red.
…that does not square, or squares only read whole (#467) 8ba74cd named such a row only when a numeric cell was a plain integer and Price x Executed did not give Amount. Two splits got through, both booked with the Amount as the Fee and no message. "1.234,5XRP" leaves Executed "1.234", no plain integer (a sale of 1.234 XRP with a fee of 740.70, a result of -740.58 instead of 123.45). A bare "1,5" at a Price of 5.00 squares by chance, 5.00 x 1 = 5 (1 DOT with a fee of 7.50, -6.50 instead of 1.50). A row with a cell past the header is now named whenever it does not square, and also when it squares once a numeric cell and the next are read as one number with a comma ("1,5", "1.234,5", "1,234.5"). An Amount and a Fee in a coin before a trailing comma ("40000,1EUR,") stay read, since the file cannot tell them from a split, and that is the row Binance writes.
…y comma is in Remark when an EUR_Value follows Change (#467) 4235670 named a row with an integer Change, a number under EUR_Value and an unquoted comma only in Remark ("1,20000,via app, card"), and left it unbooked, though it is not split. A split Change moves the EUR value one cell on, under Remark. So when EUR_Value follows Change and the cell after it is text, the row is no split and keeps its booking. An empty or numeric cell there keeps the row named, so "1,5,20000" and "1,5,," are still named.
|
Important Review skippedToo many files! This PR contains 136 files, which is 36 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. CodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #473 +/- ##
==========================================
+ Coverage 94.33% 95.52% +1.19%
==========================================
Files 65 66 +1
Lines 9119 11165 +2046
Branches 3201 4257 +1056
==========================================
+ Hits 8602 10665 +2063
+ Misses 425 402 -23
- Partials 92 98 +6
🚀 New features to boost your workflow:
|
DeclaRenta still lost or misread rows in silence. A broker row it could not read just vanished, so a sale, a dividend or a refund was gone from the report with no word. Some of those gaps let the user pay less tax than they owe:
The fix: every row that cannot be read is now named in a warning, and the report keeps the result that cannot make the user underpay. A refund that comes weeks after its dividend now lowers that dividend's tax. A refund that joins no dividend is named.
Choices to push back on:
Closes #466, closes #467, closes #468, closes #469, closes #470, closes #471, closes #472.