Completed Milestones — La Ideal¶
Finished work, split out of progress_tracker.md so the tracker stays a short, actionable list (current status + open issues). This file is the project history behind the changelog; the customer-facing summary of each release lives in releases_notes.txt.
Rules:
- Add new entries at the top of the current ### Post-<X.Y> development — <Month Year> section. X.Y is the latest released version when the work was done (see "Latest release" in the tracker's Current Status). If a release has shipped since the top section was created, start a new section above it. When a release ships, suffix its section header with (shipped in X.Y).
- Format: - [x] **Title**: what was done, why, key files. Write fresh prose about the actual change, with the rationale that is not obvious from the diff. Do not paste the original issue text.
- Never delete entries. Entries older than ~6 months with no further action move to Archive at the bottom.
Completed Milestones¶
Post-12.6 development — November 2026 (shipped in 12.7)¶
- [x] Release 12.7 gate: findings of the compliance audit and the code review, fixed before the merge (26-11-2026;
verifactu-compliance-auditoron everything since 12.6: nothing blocking, three points;/code-review mediumon the release pull request: six points, one shared). None could happen before the shop switches to PRODUCTION. - Anular of an invoice the gateway registered at the real AEAT: "dated before the direct client's production start" was taken as "never at the real AEAT", so it would have been cancelled in the books only.
invoicePredatesProductionandcancelInvoiceAsynctake the invoice's stored QR URL (invoiceQrUrl,sql_lite): on the real AEAT's host the cancellation is sent. A URL that cannot be read stops the cancellation with an error. Recogida's AEAT query passes it too. - Production left and entered again: the start day moves on purpose, which would strand an invoice the real AEAT had refused. Configuración refuses to leave production while such invoices remain (
SettingsDialog::setProductionRefusedCount, the count behind the red notice). - Production whose start day cannot be read: the boundary let everything through and the status bar showed the test-environment text. It now fails closed (a date before today is refused, saying why) and the status bar text follows the configured environment (
VerifactuCoordinator::aeatEnvironmentText). - A cancelled invoice under another system's block with no usable huella or time is named in the log instead of dropped silently (it does not stop the sync: it is another system's record).
- Recogida: a mouse click loaded its row twice since the details follow the arrow keys; once now. Printing: a QR printed as received is shrunk by a whole factor that keeps its modules exact, or resampled to black and white with a warning (
shrinkReceivedQr). - Kept and documented, no code change: a ticket of the switch day that the test environment refused is sent to the real AEAT on a retry (a real sale of a day in production; pinned by
test_switchDayTicketIsNotBeforeProduction); another system's cancellation at or after our tip restarts the chain on a first sync that cannot prove our last record is at AEAT (AEAT may show our own cancellation under that block). - Second audit, on these fixes (
verifactu-compliance-auditor, pass, two should-fix applied): the stored QR is matched by its exact host (a look-alike host or the name inside the query no longer counts); with production's start day unreadable, Anular of an earlier invoice stops with an error instead of being sent (cancellationUndecidedReason);invoiceQrUrlreads a NULL sequence as 0. - Tests: each code fix has one (
test_invoiceTheGatewayRegisteredInProductionIsCancelledAtAeat,test_productionWithUnreadableStartDayRefusesEarlierDates, the refused-count case intest_settingsdialog,test_recogida_aClickLoadsTheRowOnce, the twoshrinkReceivedQrcases,test_environmentTextFollowsTheEnvironment, the Anular dialog case intest_production_invoicesFromBeforeItStayLocal). The first four were shown red without their fix; the rest cover new functions or were not run red. - [x]
aeat_direct_backend: two cases that failed on a loaded machine (26-11-2026; tests only, nothing undersrc/). Reproduced by running the suite with the processor saturated (two of three copies failed; eight plain copies at once did not, the suite is bound by its own waits). Two timing assumptions, both in the tests: test_restartWaitsForTheOldChainsUnsentRecordsexpected the sync to refuse while record 2 was unsent, but only the first resend was lost: with a 2 s retry delay, a slow sync let the retry send the record first and the sync restarted the chain instead.FakeAeatServer::setSubmissionsUnavailable(on)now loses every submission until the test has seen the refusal, then turns sending back on.test_restartSecondKeepsOnlyTheNewNumbersRecordInOneReplyneeds two records of two installation numbers in the same second and retried when they fell in different seconds, but a later attempt's two databases both adopted the number of the chain already at AEAT, so the retry could never pass (it also failed on a quiet machine whenever a second ended between the two records). The helper's backends now keep their own number (adoptInstallationNumber = false), sync first, and submit just after a second starts; up to eight attempts. Checked by forcing a retry.- After the fix: three of three copies of the whole suite pass under the same load, and six of six of the two cases. The suite's time limit goes from 600 to 900 s (290 s on a quiet machine, 450-480 s saturated).
- [x] Chain sync out of
AeatDirectBackend(26-11-2026, last of the three refactors from the architect's review of pull request #73; no behaviour change). The rules that decide, from AEAT's answer, where our hash chain continues are nowAeatChainSync(src/verifactu/aeatchainsync.*):plan(Input)takes plain data (AEAT's candidates, the local head, the anchors, the restart time and number, the last-seen marker, the installation number and the two flags) and returns aPlan(no records / restart with the lost invoice / continue with the tip, the installation number to adopt and whether the head moves). No store, transport, certificate or database.AeatDirectBackend::adoptTipreads the store in the same order as before, callsplanand applies it (restart, installation number, anchor and head writes, message); texts keep theAeatDirectBackendtranslation context. Tests:test_aeat_direct_backenduntouched and green; new suiteaeat_chain_sync, 20 cases on the rules alone, three of them shown red against a broken rule (35 CTest tests).verifactu-compliance-auditorrun on the change. - [x] Verifactu coordinator out of
MainWindow(26-11-2026, from the architect's review of pull request #73; no behaviour change). NewVerifactuCoordinator(src/app/verifactucoordinator.*, aQObjectchild of the window, no form widget): it owns theVerifactuIntegration, the pending-submit map, the bounded wait for the gateway's reply (waitForReply, withisWaitingForAeatforcloseEvent) and the four connection tests (checkAeatProduction,testGatewayConnection,runAeatSelfTest,runAeatConnectionTest). A reply is written to its rows by the coordinator, which then tells the window by signal (status text, refusal, settled); the window disables and restores the form and menus onaeatWaitStarted/aeatWaitFinished. Left in the window on purpose, because each touches the form, the result panel or the print order:submitAndPrint, printing,onRecordSettled,showVerifactuRejection,settlePendingRectifications,continueDirectChain,showPendingSubmits, and the two labels (their text comes from the coordinator). Moved strings keep theMainWindowtranslation context.mainwindow.cpp1,968 to 1,689 lines. Tests:test_e2e_appandtest_e2e_verifactupass with no expectation changed; new suiteverifactu_coordinatordrives the coordinator without the window on the fake gateway (34 CTest tests). - [x] Text helpers out of the data layer (26-11-2026, first of the three refactors from the architect's review of pull request #73; no behaviour change). New leaf library
src/textformat/(Qt Core only):roundToCents,moneyText,moneyParse,displayMoney,displayEuro,parseDecimal,displayDecimal, and the stored date text (kDbDateFormat,parseDbDate,dbDateText), moved fromsql_litewith names, signatures and bodies unchanged.sql_litelinks it PUBLIC andsql_lite.hincludes it, so code that uses the data layer needed no edit. One date constant instead of two:AeatHash::kDateFormatand two local copies inverifactuare gone,verifactulinkstextformat.uikitandreporthtmluse the constant instead of a literal;numberformatdelegate.cppno longer includes the data layer to format. Other date formats (dd/MM/yyyy, timestamps) and the standalone test tools keep their literals. - [x] Smoke test: the QR is read at the printed size, on a fixed symbol (26-11-2026, from the test review of pull request #73). Step C2's QR carries the day's date, so its symbol changes daily and OpenCV misses some of them at the printed size (in CI the one of 26-11-2026 was read only at half size); its content check keeps trying four sizes and warns when the printed size is not the one that read. The size itself is now proved in step C3, on the reprint of ticket 4: its verification URL is a fixed text in the seed (
TICKET_4_QR,tests/ui/seed.py), so the symbol is the same on every run, and both the factura and the factura completa must give that exact text at the printed size (check_printed_qr,tests/ui/block_c.py). Checked against the print jobs of the last CI run: both reprints read at every size. No change undersrc/. The tracker entry "Two window fixes without a test" was filed in error and is dropped:test_mainWindow_cerrarClosesTheWindowandtest_mainWindow_titleFollowsTheBusinessNameexist since wave 2 of the deep review. - [x] Deep review of
src/: dead code, bugs, simplification, then the docs (owner 26-11-2026; branchreview/deep-src, findings fixed and not filed). Twelve read-only reviews (nine by module, dead code, coding guidelines, duplication across modules) were triaged against the code and applied in three waves, each ending with the suite green; thenverifactu-compliance-auditor(pass, four should-fix applied) and an independent review of the whole diff (its findings applied). - Wave 1, dead code: unreachable branches, members and methods nobody reads, unused includes, the
DB_PATHmacro,Facturas::taxAmountFromGross(its tests moved tosplitGross). - Wave 2, bugs, each with a test that fails without the fix. Direct AEAT client: a batch AEAT refuses whole no longer counts as reached; a record that is no longer pending keeps its stored answer (
AeatDirectBackend::settleRecord); the chain head compares huellas without case; the self-test waits for the final outcome; no certificate holder in the log. Gateway and facade: in-flight flags survive a re-initialise; a rectificativa dated before production is refused; totals are exact cents; an HTTP error body gives the gateway's reason.sql_lite: every amount writer refuses an unreadable amount; the closed quarter is checked inside the statements;nextVerifactuInvoiceSeqandticketHasPaidGarmentfail closed; a repeated cancellation keeps its record and a later call fills an empty cancellation XML. Windows: the client is written only after a good save, refusals stay visible, the recovery prompt waits for open dialogs, Recogida's details follow the arrow keys, no charge when the invoice sequence cannot be read, the payment date is checked against the production start, Enter no longer toggles check boxes, a locked expense row cannot be removed, the expense IVA accepts only 0 / 10 / 21. Settings, backup, printing: settings are never overwritten after an unreadable file; a backup skipped because one is running is not a failure; a complete invoice is refused until there is a recipient address (owner); with printing disabled the panel says "preparado, no impreso"; an amount wider than its column is printed whole; a QR that cannot be redrawn is printed as received. Accounting: the summary counts only the supplier invoices it sums (owner) and names the ones left out. - Wave 3, simplification, no behaviour change: one format and parser for stored dates,
ticketHeader, pagado / estado constants, quarter helpers,displayEuro,parseDecimal(sql_lite.h);adoptTipsplit into named steps;migrateDatabaseas one function per step;on_pb_save_clickedsplit intosaveTicket/submitAndPrint/savedMessage;AppSettings::value/set;PrinterQueue::defaultName;UiKit::limitDateRange; the reconcile summary as a pure function; history comments dropped. - Review on GitHub (pull request #73, five expert reviews posted and answered: compliance, async client, data integrity, architecture, tests; none blocking). Fixed from them:
- Recogida: the status bar showed AEAT's text inside a literal
<span>with HTML entities (QStatusBardraws plain text); it shows it as typed. - Data layer:
markInvoiceSeqCancelledis all or none; a late cancellation reply fills the record of rows already marked; a failed search inroundOpenAmountsfails the migration run;storeChargedGarmentsand a paid insert refuse an invalid payment date; an empty stored importe splits as 0; a negative gasto amount can be edited as it can be entered. The relabel of unpaidPENDIENTErows asSIN COBRARnow also takes rows whosepagadois NULL (a row that is not paid has no invoice); tested. - Direct client and facade: an answer the store could not write is no longer taken as "settled meanwhile" (the waiters get the reason, the record is sent again); the self-test fails at once when nothing can send; in-flight ids of a backend deleted on re-initialise are dropped;
AeatStore::appendreads its row back before the commit; the gateway's error text in a message is capped at 300 characters; an unreadable certificate expiry has its own message. - Windows: the production check ignores input while it waits; a close while a save waits for AEAT is refused; the pre-migration repairs run only when a copy of this start exists; the stored rectificativa label comes from the combo index; an unreadable ticket is told apart from one not found.
- Structure:
SettingsDialogin its own library (src/settingsdialog/), soappsettingslinks only Qt Core;expenseIvaIsSummarisedinsql_lite(nolistado->contabilidadlink);AddGarment::InvoicingPolicybuilt byinvoicingPolicyOfat both wiring sites;aeatReconcileSummaryHtmlin a.cpp. - Tests: three more direct-client tests (both numbers in the restart's second in one reply, the previous-month fallback of a query without date, a release during the sync); the certificate holder never in the log; the printed "impreso" wording; a gated reply in
FakeAeatServerinstead of a 2 s window; no#define private public; the smoke test warns when a QR is read only resized. - Filed for later in the tracker (owner): the Verifactu coordinator out of
MainWindow, the chain sync out ofAeatDirectBackend, the text helpers out of the data layer.
- Recogida: the status bar showed AEAT's text inside a literal
- Size:
src/+3,054 / -2,431 lines (the fixes outweigh the removals),tests/+2,038; 33 suites. -
Docs: the living documents were checked against the code and rewritten shorter (461 KB to 278 KB), one owner per topic, long paragraphs as lists and tables, change history left to this file.
-
[x] Rectificar factura opens on R5 (owner 26-11-2026): the type combo started on R1, the usual type for a full invoice (F1), although every ticket of the shop is a simplified invoice (F2), whose rectificativa is R5, and the direct connection refuses any other type; each rectificativa began by changing the combo or by a refusal. It now starts on R5 and the index-to-type fallback is R5 too.
src/app/rectifyinvoicedialog.cpp;test_refusedRectificativaRedoneUnderItsNumberno longer sets the type and fails if the dialog opens on another. - [x] Ready for PRODUCTION: the shop only ticks the box (backlog item "Switch Verifactu to PRODUCTION", owner 26-11-2026: as if the switch were tomorrow; two legal choices asked and taken;
verifactu-compliance-auditorrun, its blocking finding and the rest applied): the app had no notion of an invoice from before production. After the switch it would have sent a cancellation to the real AEAT for an invoice only the test environment ever held, and Reintentar would have registered old test-era tickets there with their old dates. The boundary is a day the app records itself:aeat_environment_startkeeps when the direct client began in each environment (AeatStore::markStarted), set for production when the owner confirms the switch in Configuración (again on a later re-entry) and, failing that, the first time a production client runs. What follows from it, in one place (VerifactuIntegration): an invoice dated before that day is never sent to the real AEAT (dateBeforeProductionReason, applied to every submission, so a retry of an old ticket is refused); the pending and refused lists take that day as their floor when it is later than Solo tickets desde (verifactuRecoveryFloorIso), so nobody has to move the setting; and a new invoice cannot carry such a date at all: Recogida's payment date starts at that day, and a paid ticket or a paid added garment with an earlier date is refused before anything is stored (the audit's blocking finding: it would have been a paid invoice that is refused and then hidden from every list). Anular (owner: in the books only): an invoice the real AEAT never held (invoicePredatesProduction: no production record of it, and dated before that day or, on the day itself, accepted by the test environment before the switch) is cancelled withmarkInvoiceSeqCancelledand nothing is sent; the confirmation says so, the log keeps a warning, the stored payload is an<AnulacionLocal>note and the AEAT export marks itlocal="1". The facade refuses to send such a cancellation whoever asks. The switch itself (SettingsDialog::accept): refused while test-environment records are unsent (they would be orphaned) and when the check MainWindow supplies fails (AeatConnectionProbeagainst production: the certificate and one read-only query), then confirmed with a text that says earlier invoices are not sent. The status bar always shows where the direct client registers: the test environment, or AEAT: PRODUCCIÓN desde el. Also: the AEAT export marks each record's entorno(from the host of its QR link) so test-environment records are not read as real ones; Consultar en AEAT explains why an earlier invoice is not at the real AEAT instead of calling it lost;aeat_records.generated_atis stored with its UTC offset (the autumn hour could misplace a record by an hour forIncidencia); the gateway's own QR link uses AEAT's production host, asAeatHashdoes. Decided and left as they are: a rectificativa issued in production that corrects an earlier ticket is sent (it is a new invoice); a reprint keeps the QR the invoice was issued with;verifactuRemoteMatchesstill does not reconcile a downward rectificativa (total <= 0), which stays a manual check;numberingBlockedReasonalso holds a local cancellation back while the chain is unchecked.src/verifactu/aeatstore.*,verifactuintegration.*,src/app/cancelinvoicedialog.*,src/appsettings/settingsdialog.*,src/recog_prendas/pay_dialog.cpp,src/sql_lite/sql_lite.*,src/app/aeatexport.cpp;test_production_invoicesFromBeforeItStayLocal(e2e),test_environmentStartAndRecoveryFloor,test_generatedAtKeepsItsOffset,test_directProductionNeedsConfirmation. - [x] A cancellation AEAT returns continues the chain; the restart is kept for the ones it cannot prove (tracker item of 25-11-2026;
verifactu-compliance-auditorrun, its findings applied): AEAT's test environment returns a cancelled invoice with the invoice's own data but the huella,FechaHoraHusoGenRegistroandEncadenamientoof its cancellation record; the registration's huella is no longer shown (raw replies saved with the newtests/tools/aeat_query_dump, 13 cancelled invoices of October and November). 12.6 assumed the opposite and restarted the chain as a new SIF whenever a restored database lacked a cancellation that might be the last record. Telling the shapes apart needs nothing but the reply:AeatResponse::carriesCancellationRecordrecomputes the huella aRegistroAnulacionof the reply's issuer, number, date, previous huella and time would have, and compares (it matched every real one). Such a record enters the sync as a cancellation (RecordSummary::cancellationFromQuery); any other cancelled record is, as before, a registration whose cancellation is hidden (cancelledAtAeat), so production keeps the 12.6 behaviour should it answer like AEAT's email. Whose cancellation it is the reply does not say (another system may cancel our invoice, and ours may cancel the gateway's), soadoptTipchains to one only when it is proven ours: this database holds its huella, the settings' chain marker names it, or it chains to a record of ours. Unproven, it is never a link and counts as a hidden cancellation: the restart of 12.6. That leaves the restart for two cases of a new PC without the marker: a cancellation chained to the registration it cancels (cancelled at once), or to a record itself cancelled later; legally safe (art. 7.b), accepted. From the audit: whichSistemaInformaticoblock AEAT attaches to a cancelled invoice (the registration's or the cancellation's) cannot be told from our data, so both are handled: a cancelled invoice under another system's block is kept in view (foreignSystem), may be proven a link like any other, and otherwise restarts the chain only when AEAT received its cancellation after our tip (never on another system's older history); theNumeroInstalacionadopted from a cancellation tip is the one of the chain's newest registration, not the block's; huellas compare case-insensitively; a first sync with nothing to continue from but an unproven cancellation restarts instead of sending a barePrimerRegistro.FakeAeatServernow answers like the real service (setQueryHidesCancellationRecordfor the email's shape,setQueryShowsCancellersSystemfor the other block), the 12.6 restart tests run on the hidden shape, and five new tests cover the real one. Not seen: AEAT production.src/verifactu/aeatresponse.*,aeatdirectbackend.*;test_carriesCancellationRecord,test_cancellationAeatReturnsContinuesTheChain,test_markerProvesTheCancellationAeatReturns,test_unprovenCancellationAeatReturnsRestartsTheChain,test_ourCancellationOfAnotherSystemsInvoiceIsALink,test_ourInvoiceCancelledByAnotherSystemUnderItsBlockRestarts. - [x] What AEAT's query returns for a cancelled invoice: the cancellation's huella (tracker item of 25-11-2026, answered the same day against AEAT pre-production): the shop's log suggested that AEAT's query gives a cancelled invoice with the huella of its cancellation record, against the premise 12.6 took from AEAT's email. The reply was never logged, so the client now says it: for each of our records AEAT returns as cancelled, the chain sync logs whose huella the query carried, compared with the stored records of that invoice (
registration,cancellation, orunknownwhen this database holds neither). The pre-production run got a step 8 that restarts the app after its cancellation, reads that line for the invoice it cancelled and prints it in the report. Run against the fake AEAT it says registration (the fake's default); run against AEAT's test environment with the issuer's certificate (aeat-run/20261125-231818-real, 8 of 8 steps passed) it says cancellation, with the cancellation's generation time. The question is closed; what it means for the chain restart is the tracker's new item, not decided here. No behaviour changed: a log line and a test step.AeatDirectBackend::cancelledHuellaOwner,tests/ui/aeat_preproduction.py;test_ownCancellationIsTheHeadexpects the line in both shapes. - [x] The self-test is hidden only in pre-production and is renamed "Ensayo en el entorno de pruebas de la AEAT" (owner 25-11-2026, two steps the same day): on the direct connection the tab had two test buttons, and the self-test stayed greyed out for as long as the shop works in pre-production. It is now hidden there instead of disabled (the note under it went with it), so the shop sees one button, Probar conexión. A first version also hid it with the PRODUCCIÓN box ticked; the owner kept it for production, where it is the only way to see AEAT accept a record without spending a real invoice (a new certificate, a new version, a new PC, a refusal to tell apart), and asked for a name that cannot be read as a test against the real AEAT: the button and its window say where they run instead of Prueba con la AEAT.
SettingsDialog::updateDirectRows,MainWindow::runAeatSelfTest;test_selfTestHiddenWhileTheShopIsInPreProduction. - [x] Chain sync names a cancellation tip "anulación" (tracker item of 25-11-2026, from the shop's log): the shop's first direct sync reported its chain as continuing after an "alta" that was the self-test's cancellation.
adoptTipnamed the tip fromRecordSummary::operation, which is always a registration for a record AEAT's query returns and empty for the head taken from the store; it now also asks the store whether the tip's huella is that of our cancellation of the invoice. Text only: the head, the marker and the restart decision are untouched. Reproducing it showed the wording appears only when AEAT's reply carries the cancellation's huella for the cancelled invoice, which is filed in the tracker as a question to settle against pre-production.src/verifactu/aeatdirectbackend.cpp;FakeAeatServer::setQueryShowsCancellationRecord,test_ownCancellationIsTheHead(fails without the fix). - [x] Probar conexión for the direct AEAT connection (owner 25-11-2026): once the gateway's test button was hidden on the direct connection, and with Prueba con la AEAT disabled while the shop works in pre-production, the tab had no way to check the connection in use. The direct group now has its own Probar conexión:
AeatConnectionProbeloads the certificate chosen in the form (an expired one fails, a NIF other than the issuer's is a warning, as in the self-test) and sends one query for the issuer's invoices of the current month to the environment ticked in the form, then says how many AEAT holds. It generates and sends no record and opens no database, which is why it can stay enabled beside the shop's running client; a SOAP fault, an unreadable answer (a refused certificate comes back as an HTML page) and no connection each give their reason. 15 s timeout.src/verifactu/aeatconnectionprobe.*,SettingsDialog::aeatConnectionTestRequested,MainWindow::runAeatConnectionTest;test_connectionProbeandtest_connectionProbeVerdict(fake AEAT server),test_directConnectionTestSignal. - [x] Configuración → Verifactu shows only the chosen connection's fields (owner's screenshots from the shop PC, 25-11-2026): with Directa con la AEAT selected the tab still showed the gateway's service key, its Entorno de PRODUCCIÓN box and Probar conexión, so there were two PRODUCCIÓN boxes and two test buttons, one pair of which did nothing for the connection in use (Probar conexión always tests IreneSolutions). The gateway's rows now sit in their own group, shown only while the gateway is the connection, as the direct group already was; the connection choice moves up under the issuer's NIF and name, and the pending-submissions notice and Solo tickets desde follow as rows common to both. Hidden boxes keep their values, so nothing changes in what is saved or confirmed. Prueba con la AEAT stays disabled while the direct client works in pre-production (the tickets are the test and both would send the same outbox), but its reason is now a line under the button instead of a tooltip on a greyed-out control. The three stacked forms share one label column (
alignLabelColumns).src/appsettings/settingsdialog.*;test_onlyTheChosenConnectionsRowsShow,test_selfTestOffWhileTheShopIsInPreProduction. - [x] Shop on 12.6 and on the direct AEAT client in pre-production (shop files of 25-11-2026: self-check report, settings, log): the shop installed 12.6 on 24-11-2026 and ran Comprobar tras actualizar on 25-11-2026 with every check CORRECTO (settings and database, a backup of the day, migrations and numbering, repeated migrations, amounts, the AEAT chain with 2 records, last ticket and closed quarter, printer with QR, installer notes). The same evening it left the IreneSolutions gateway for the direct client, still in AEAT's test environment, which the tracker had planned only for the production switch. The log shows the order: the self-test from Configuración (first sync found no records of our system, alta and anulación of the test invoice accepted, 60 s apart), then the connection saved and the direct backend's first sync continuing after the self-test's last record, with the chain marker written to the settings. No warning or error in the day's log; the day's ten paid tickets went through the gateway before the switch, all ENVIADA, and none through the direct client yet. One finding filed in the tracker (the sync message names the tip "alta" when it is a cancellation; see the entry above). Docs brought in line: tracker status and the production plan's steps,
docs/modules/verifactu/README.md,aeat-direct-investigation.md.
Post-12.5 development — November 2026 (shipped in 12.6)¶
- [x] Restored backup that lost a cancellation: the chain starts again as a new SIF (AEAT's email answer of 24-11-2026): AEAT's query returns registrations only, so a database restored from before a cancellation of ours could not know that cancellation was the chain's last record and chained the next record to an older one. AEAT's developer mailbox answered that the chain is rebuilt from the query when the previous record can be recovered and that, when it cannot, a new chain starts as a new SIF with its own installation identification and no previous record (art. 7.b of Orden HAC/1177/2024). The direct client now does that on a first sync (first start, restored database, new PC). How it decides (
AeatDirectBackend::adoptTip): a lost cancellation is a registration of our system that AEAT reports asAnuladowith no cancellation record in the database (AeatResponse::lostCancellation, pure). (1) On the same PC the settings' chain marker names the chain's last record (an empty marker, as after a restart, names none and rule 2 applies; so does a marker whose record is visible but has records of ours after it, which shows a settings file older than the database, restored or copied on its own): if that huella is visible, here or at AEAT, nothing of ours came after it and the chain continues, whoever cancelled an invoice since (the gateway, another system); if it is not visible and a cancellation is lost, the chain restarts. No clock is involved. (2) Without the marker (a new PC, settings lost) only AEAT's own times can tell (lostCancellationAfter): the chain continues when AEAT cancelled the invoice before it received the chain tip (TimestampUltimaModificacion< the tip'sTimestampPresentacion, both AEAT's clock; records reach AEAT in generation order), and restarts otherwise, also when a time cannot be read or both fall in one second. The restart (restartChain,AeatStore::restartChain, tableaeat_chain_restarts): first any record of the old chain still unsent goes out (the sync fails with a message, the outbox sends them, the sync repeats on its own); then, in one transaction, a newNumeroInstalacion, the head cleared (the next record saysPrimerRegistro = S) and a row with the number replaced, the invoice and the UTC time. Later syncs ignore records generated before the restart (in its own second, all but AEAT's under the new number),AeatChainCheck::verifyaccepts onePrimerRegistroafter other records for that issuer's recorded number (any other restart is still an alteration), and the main window shows the restart in the result panel whichever sync decided it (VerifactuIntegration::takeChainRestartNotice). Not done for a backend beside the shop's (the self-test), which never changes the database's number. While a restart waits, the message names the unsent invoices (up to five) and why they do not go out (the send error, such as the certificate, or AEAT's last refusal). Known and accepted: a settings file and a database both taken back to the same earlier moment agree with each other, so nothing on the PC shows the loss and no AEAT query is forced (the app's backups hold the database only, so this needs a hand-made copy of both); on a new PC without its settings, a cancellation by another system as AEAT's latest change restarts an intact chain (harmless, and it cannot be told apart); one number serves both environments (Backlog). AEAT's other suggestion, rebuilding the lost tickets from the query, is not implemented: numbering already continues above AEAT's highest number. Tests:test_lostCancellationAfter,test_restartChain,test_recordedRestartAccepted,test_markerShowsTheLostCancellationWhateverTheTimes,test_cancellationByAnotherSystemDoesNotRestart,test_restartWaitsForTheOldChainsUnsentRecords,test_backupRestoredAgainAfterARestart,test_markerOlderThanTheDatabaseProvesNothing,test_restartSecondBelongsToTheNewNumbersRecords,test_lostCancellationAsHeadRestartsTheChain,test_lostCancellationBeforeTheTipContinuesTheChain,test_mainWindow_showsAChainRestart; the fake AEAT now stamps each record with the time it received it. Reviewed for 12.6 (/code-review,verifactu-compliance-auditor). - [x] CI runs the
make.ps1targets (owner 21-11-2026): the build and test commands were written twice, inmake.ps1and in the steps ofci.yml, and could drift. Thebuildjob now runs./make.ps1 buildand./make.ps1 test; theui-smokejob runsuitest,venv, the newprintertarget,ui-smokeandaeat-dry. What CI needed went into the runner: on GitHub (GITHUB_ACTIONS) it takes the toolchain fromsetup-toolchain, which now also setsCXXto the MinGW 11.2 compiler instead of a-DCMAKE_CXX_COMPILERon each configure line;testpasses--no-tests=error --timeout 120and writes the run's summary page there;ui-smokeandaeat-drytake-Exe <laideal.exe> -Tools <folder>(the installed app: the build's Qt and MinGW leavePATH),-Installerand-Out. The UI-test build of CI moved frombuild\tobuild-uitest\, as locally. A make call is the last line of its step, because a script's exit code is only the step's when nothing runs after it (the ccache statistics are a step of their own). Left in the workflow: what only CI does (the runtime check of the built exes, the UI-test marker check, packaging and installing, the release job).docs.ymlbuilds the site on Linux and runs no tests: unchanged. Every target was run locally after aclean-all(configure from empty folders included); the GitHub mode oftestwas simulated with the variables set. Key files:make.ps1,.github/workflows/ci.yml,.github/actions/setup-toolchain/action.yml. - [x] Root task runner
make.ps1(owner 20-11-2026): the build and test commands lived only inREADME.mdas long lines to paste, after aPATHline: three CMake trees,ctest, the Python UI smoke test, the AEAT pre-production run and the clean-ups. The day 12.5 was prepared, two pasted commands ran together on one line, a reusedaeat-runfolder was refused andbuild-uitesthad to be rebuilt by hand.make.ps1is the Windows equivalent of a Makefile:.\make <target>withhelp,build,debug,test(-Filter,-Jobs),xsd,uitest,venv,ui-smoke(-Blocks,-Printer),aeat-dry,aeat-real -Settings <file>,regression,clean,clean-all. It only wraps the documented commands: it puts the Qt toolchain onPATHfor itself, configures a tree only when itsbuild.ninjais missing, builds what a target needs first (ui-smokebuildsbuild-uitestand checks.venv), gives every AEAT run its ownaeat-run\<date>-<kind>folder, stops on the first non-zero exit code, and asks before deleting build folders or sending to AEAT's test environment.cleandeletes onlyaeat-run\*-dryamong the AEAT runs: a real run's report is release evidence (the first version'saeat-run*pattern deleted the 12.5 real run's folder while it was being tried). The help is generated from the table of targets, so it cannot list a target that does not exist. A PowerShell script rather than a Makefile (recipes would run through cmd.exe and needmakeonPATHfirst) or CMake presets and targets (no readable help, no multi-tree regression, a target cannot delete its own build folder; the installed CMake 3.24 has no workflow presets).make.cmdruns it from cmd.exe. Not unit-tested (a developer script): checked by runninghelp, an unknown target (exit 1),test -Filter aeat_store,aeat-realwithout settings (exit 1) andaeat-dry(7 steps passed). Key files:make.ps1,make.cmd,README.md(Build),.gitignore(aeat-run*).
Post-12.4 development — November 2026 (shipped in 12.5)¶
- [x] CI: the duplicate build of the release commit is skipped, not cancelled (owner 20-11-2026, tracker item from the 12.5 code review): the
skip-duplicatejob of the release PR cancelled thedeveloppush run of the same commit. Two problems: it could list the runs before the push run existed (a fix pushed with the PR already open starts both together), so the commit was built twice; and a cancelled run shows as a red failure on the commit and among the PR's checks. Now agatejob runs first in every run: on a push todevelopit asks whether the release PRdevelop->masteris open on that commit and, if so,buildis skipped (grey, with a line in the run summary) and the PR's run is the only build. The check lives in the push run itself, so the order the two runs start in no longer matters. The release commit is pushed seconds before its PR is opened, so only for a commit whose message starts withreleasethe PR is waited for, up to a minute; any other push asks once. An API error counts as "no PR", so a build is never skipped by mistake.gateis never skipped itself, becausereleaseneedsbuildand a skipped ancestor would skip it. On a push todevelopthe build job reports asbuild (develop):masterrequires the checkbuild, GitHub counts a skipped required check as passed, and the PR's own checks appear up to a minute after the push run has finished, so a skipped job namedbuildon that commit would have left the merge unguarded meanwhile (seen on the first run of the gate; the cancelled run used to block it by accident). TheFiled, not fixednote in the entry below is closed by this. Key files:.github/workflows/ci.yml,CONTRIBUTING.md. - [x] 12.5 release review: what counts as an incident is stored on the record (code review of PR #71 and the compliance audit, 20-11-2026; the audit found nothing blocking):
Incidencia = Sand the art. 16.4 notice were derived fromattempts > 0, which counts every send that started. Four edge cases followed, all fixed by a newaeat_records.delayedflag set only when an incident really kept the record from being sent (AeatStore::markDelayed: no AEAT answer or a server fault, an unusable certificate, a reply without the record's line, a duplicate check that got no answer);delayedByIncidentis now that flag, or a record left by an earlier session. (1) Records held by an unusable certificate keep the flag, so they go out withIncidencia = Safter the certificate is fixed in Configuración in the same run. (2) Configuración accepted while a send is in flight no longer makes the next backend show the notice and flag the resend. (3) A record resent on its own after a batch fault is flagged when a real incident then delays it (the blanket exclusion of those records is gone; the fault itself sets no flag). (4) A duplicate AEAT answered but did not show is no incident. Also: a count query that fails keeps the notice as it is instead of hiding it (pendingCountreturns -1); the self-test passes the app's session start, and while the shop is in production or on the gateway it never changes the database'sNumeroInstalacion(Config::adoptInstallationNumber). Tests:test_backendReplacedMidSendIsNoIncident,test_backendBesideTheShopsKeepsTheInstallationNumber,test_delayedByIncidentandtest_certificateUnusableupdated (test_aeat_direct_backend),markDelayedand the failing count intest_aeat_store. Filed, not fixed: theskip-duplicateCI job can miss the push run when both start together (tracker). Key files:src/verifactu/aeatstore.*,aeatdirectbackend.*,verifactuintegration.*,src/app/mainwindow.cpp. - [x] CI: the two long suites get a 600 s limit (CI run of 20-11-2026 on
d162474):aeat_direct_backendwas stopped by its 300 s CTestTIMEOUTwith every case still passing. The suite has grown to about 75 scenarios against the fake AEAT (185 s locally, 245-254 s on the last green CI runs, more on a slow runner), so the limit no longer told a hang from a slow machine; the new count-of-unsent-records cases added about 13 s.e2e_appwas at 245 s of its 300 s in the same run. Both limits are now 600 s; the other suites keep 120 s. Key files:tests/CMakeLists.txt,docs/testing/README.md. - [x] UI smoke test: a reused output folder no longer fails A3 (found running it locally, 20-11-2026):
smoke.pyappends each session's log tolaideal-run.login--outbut never emptied it, so a second local run in the sameui-smoke-outread the earlier run's lines, with that run's fake AEAT port, and A3 / A3-end failed with "AEAT URLs other than the fake AEAT" (both URLs were127.0.0.1; nothing left the PC). CI never saw it because its folder is always new.Run.__init__now deletes the old log, as it already did for the database and the fake's URL file. Key file:tests/ui/smoke.py. - [x] Direct client: the status bar counts the records still to send (Orden HAC/1177/2024 art. 16.4) (last follow-up of AEAT's written answers of 04-11-2026, question 4): while an incident keeps records from being sent, the system must show how many are still to send, from the incident until none is left.
AeatDirectBackendnow tracks the incident itself instead of deriving it per record: it starts when a send or a duplicate's check gets no AEAT answer (or AEAT's own service fails:AeatResponse::Querynow keeps the fault code), when the certificate cannot be used, when AEAT's reply has no line for a record, or when the backend starts with records an earlier session left unsent; it ends when nothing is pending. While it lasts,unsentRecordCount()is every pending record of the issuer (also those generated behind the failed one) andunsentRecordsChangedreports each change; without an incident it is 0, so a record that only waits forTiempoEsperaEnvioor is being sent for the first time shows nothing.VerifactuIntegrationforwards both (0 with the gateway) and the main window shows a permanent warning label (lblUnsentRecords, "N registro(s) pendiente(s) de enviar a la AEAT"), refreshed also when Configuración replaces the backend. The retry (every 60 s) andIncidencia = Swere already there. From the review of the first version: the count is a realCOUNT(*)(AeatStore::pendingCount; the outbox list stops at 1000); a backend that replaces another after Configuración keeps the session's start (Config::sessionStart, kept byVerifactuIntegration), so the records the previous one generated are neither counted nor sent withIncidencia = Sas if an earlier session had left them; the label's tooltip says that a certificate problem is not retried on its own. Tests:test_unsentRecordCount,test_unsentRecordCountAcrossBackends,test_unsentRecordCountWhileADuplicateIsCheckedand asserts in four existing cases (test_aeat_direct_backend),pendingCountintest_aeat_store,test_mainWindow_countsTheRecordsStillToSend(test_e2e_app, also through a backend swap). Tracker: the production switch moved to the Backlog (owner, 20-11-2026: delayed); the email with the restore question was sent on 20-11-2026. Key files:src/verifactu/aeatdirectbackend.*,verifactuintegration.*,src/app/mainwindow.*. - [x]
NumeroInstalacionlives in the database, with the chain (owner decision 20-11-2026, follow-up of AEAT's written answers): AEAT identifies a system by issuer NIF +IdSistemaInformatico+NumeroInstalacionand keeps one chain per system, and said the program restored with its database on a new PC is the same system. The number was in the settings file, so a new PC continued the chain under a new number. NowAeatStorekeeps it inaeat_installation(one row per database, any environment or issuer) andAeatDirectBackendalways takes it from there; what the caller passes is ignored andAppSettings::aeatInstallationNumberis gone (an oldverifactu.aeat_installationkey is simply not read). First use: the number of the newest stored record (what AEAT already holds), else a newLAIDEAL-xxxxxxxx; the settings value is not a seed, since a database without records may be another installation. Without a stored number the backend is not configured, so no record goes out without it. Found by the review of the first version: a database with no records of its own (a backup from before the direct client) would have taken a new number and then continued the chain AEAT holds under the old one. The chain sync now reads each AEAT record'sNumeroInstalacionand, when the chain's last record is at AEAT under another number, stores that one before anything is generated (adoptTip); records read the system block when they are built, not when they are requested, because a request held for the first sync was otherwise built with the old number (the new test caught it). Also from the review: no rollback of a caller's transaction, and an empty stored number is repaired. Known limit, unchanged: the sync tells our records apart by system and producer, not by installation, so two installations for one issuer would share a chain (the shop has one). The interpretation "same database, same number" is asked of AEAT in the email of the restore question. Tests:test_aeat_store(7 cases on the number),test_aeat_direct_backend(test_recordsCarryTheDatabaseInstallationNumber,test_copiedDatabaseKeepsItsInstallationNumber,test_emptyDatabaseTakesTheNumberOfItsChainAtAeat,test_olderDatabaseKeepsTheNumberOfItsRecords,test_notConfiguredWithoutInstallationNumber),test_appsettings(test_oldInstallationNumberKeyIsIgnored); the fake AEAT echoes each record's number in its query replies. Key files:src/verifactu/aeatstore.*,aeatdirectbackend.*,aeatresponse.*,src/appsettings/appsettings.*. - [x] AEAT's two written answers read and applied (INFORMA+
GZ44-2026CTE29840003DandGZ44-2026CTE29840004R, both of 04-11-2026): the first answers the production questions, the second answers none and points to AEAT's technical documents, which were read instead; the full account is indocs/modules/verifactu/aeat-direct-investigation.md(AEAT's written answers). Three changes in the direct client. (1) A registration resent after a refusal now carriesSubsanacion = S+RechazoPrevio = X("alta por rechazo", AEAT holds no record of the invoice); it carriedS, which AEAT's operations table reserves for a refused correction of a record it already holds, so every resend after a first refusal would have been refused again. The chat of 13-10-2026 had saidS; the fake AEAT server accepted either, which is why no test caught it. Cancellations keepS. (2) A submission with a record delayed by a technical incident saysIncidencia = Sin its header (Orden art. 16.4): a record whose earlier send got no answer, or one left unsent by an earlier session (AeatDirectBackend::delayedByIncident, pure); a record only waiting forTiempoEsperaEnvio, or resent one by one after a client fault on a batch, is not an incident. (3) Letter d) of the declaración responsable names the third-party components (Qt, SQLite, QR Code generator), as AEAT's FAQ asks of a producer who integrates other software. Nothing else needed code: no step before the first production send,Versionalready changes with every release, queries do not wait, the cancellation flag was right. Left open in the tracker: the visible count of unsent records (art. 16.4), whereNumeroInstalacionlives, and the restore-an-older-backup question forverifactu@correo.aeat.es. Tests:test_aeat_record(test_afterRejectionFlags, newtest_incidentHeaderwith a sample foraeat_xsd, the components intest_producerDeclaration),test_aeat_direct_backend(test_rejectionThenNewRecord,test_outboxSentAtNextStart,test_automaticRetry, newtest_delayedByIncident); the fake server reads both fields.aeat_xsdis skipped on the development PC (no validator), so the new header is schema-checked by CI. Key files:src/verifactu/aeatrecord.*,aeatdirectbackend.*,producerdeclaration.cpp,tests/support/fakeaeatserver.*. - [x] CI: the release PR cancels the duplicate develop run: at 12.4 the version-bump push to
developand the release PR built the same commit twice (7m36s + 11m8s on the shared runners). Askip-duplicatejob inci.yml(PRdevelop->masteronly,actions: write) cancels any unfinisheddeveloppush run of the PR head commit; the PR run always starts after the push run, so there is no race. CONTRIBUTING (jobs per event) and INDEX updated.
Post-12.3 development — October 2026 (shipped in 12.4)¶
- [x] Release flow: develop back, one CI run per commit, merge publishes (28-10-2026, owner request).
developis restored for the work in progress (directly or via short-livedfeature/fix/docs/tests/ci/branches);masterholds only releases andhotfix/X.Yis cut frommasterfor fixes to the released version.ci.ymlnow merges the oldui-smoke.yml(deleted; aui-smokejob, also run on demand withgh workflow run ci.yml --ref <branch>), runs once per commit withcancel-in-progress, does a release dry run on a PR tomaster(version, notes and installer checked, installer kept as an artifact) and publishes on the push tomaster: no tag step, the release job tagsX.Yitself and ships the exe the run just tested. New.github/actions/setup-toolchaincomposite action installs Qt/MinGW/Ninja/Inno Setup with Qt, MinGW and ccache caching. Newreleases/package.ps1is the single packaging recipe (windeployqt, DLL check, zip, Inno Setup,.sha256) shared by the release and ui-smoke jobs andrelease.ps1.masteris protected (PR only, required checksbuild/ui-smoke/release, admins included, 0 approvals, auto-merge allowed).docs.ymljob renamedbuild->siteand PRs todeveloptoo. Rewrote CONTRIBUTING.md (Every change, Development workflow, Release procedure), the/release,/tackle-issueand/update-docsskills, README, INDEX and the testing docs. - [x] No more
develop: one branch per change, cut frommaster(27-10-2026, owner request). Each change gets a short-lived branch named after what it does (feature/,fix/,docs/,tests/,ci/+ topic) and is merged back by PR with a merge commit, then deleted; a release is arelease/X.Ybranch with the bump commit whose merge commit is tagged. Merged work now waits untagged onmasteruntil the next release.ci.ymlbuilds every pushed branch and PRs tomaster;ui-smoke.ymlruns on PRs tomasterand on UI-test pushes to any other branch. Updated CONTRIBUTING.md (Development workflow), the/release,/tackle-issueand/update-docsskills, INDEX, testing docs and the tracker. The updater test also gained three refusal cases kept from the oldmine-updaterbranch (12.0.1 / 12.0-beta tags, loopback http installer, no digest nor.sha256). Superseded the next day by the develop flow below.
Post-12.2 development — October 2026 (shipped in 12.3)¶
- [x] One search in Listado and Recogida (27-10-2026, owner request). The search box lost its options menu (case sensitivity, Expresión Regular / Comodín / Texto Fijo): the regex default had silently turned off the accent-insensitive search (UI smoke B8). One mode now,
MySortFilterProxyModel::setSearchText: accents and case ignored ("alvarez" finds Alvarez, Álvarez, álvarez), several words must all appear in any searched column and order ("ana mora" finds "Mora, Ana"), pattern characters are plain text. Recogida's client search uses the same rule. Tests:test_search_accentsCaseAndEveryWord, e2etest_listado_searchIgnoresAccentsAndCase; the regex-mode tests were removed with the modes. - [x] Review of PR #63 (the pre-12.0 branch into develop) (27-10-2026, Opus code review, medium). Fixed: Imprimir no longer says "impreso" when the client copy failed (recibo and factura), and in "Todas las facturas" an invoice whose Status API send hung is listed as "puede que se imprima", not as a print error to repeat;
AppLoggerscrubs a message before chaining it to the console too; the amount delegate hands invalid text to the model, so the gastos validator shows "Número no válido" and a new prendas validator accepts an amount or an empty price; Configuración keeps a stored key or certificate password that cannot be decrypted when its field is left empty;--settingsfollowed by another switch counts as a missing file;GenListado::splitGastousessplitGross; Facturas' combos are filled once; the retired gateway client is deleted when its last reply finishes instead of polling every 200 ms. Not a bug: a NULLimporteinsplitGarmentRow(the column is NOT NULL). Tests in test_imprimir, test_textcolordelegate, test_settingsdialog and test_selfcheck. The 12.3 UI smoke test (B8) then caught a regression of the earlier "exclusive filter modes" fix: the Listado search box starts in "Expresión Regular" mode, so "senora alvarez" no longer found "Señora Álvarez". Text without pattern characters is now a plain, accent-insensitive search in any mode (test_listado_plainSearchIgnoresAccentsInTheDefaultMode, shown to fail without the fix). - [x] Pre-12.0 review: the leftovers (27-10-2026). Refactors, no behaviour change:
MySortFilterProxyModelpicks its rules from a declaredSchema(schemaForTablefor Listado,Schema::Ingresosin Recogida) instead of comparing the table name;taxBaseFromGrossmoved next tosplitGrossinverifactutypes.h(theFacturasstatic is gone); Contabilidad's revert mode is a constructor argument (Contabilidad::Revert), so a revert dialog can no longer show the Generar UI; the repeated bold-font and read-only-date blocks in mainwindow, pay_dialog, recog_prendas and add_garment useUiKit::emphasize/UiKit::lockDate. Tests: a printer transport seam (ThermalPrinter::setTransport) and the newtest_imprimirsuite (offline warning, two copies, printing disabled, factura dates, completa, 58 mm); moretest_escposcases (58 mm fit, copy marker and legal block, factura legal fields, printed base + IVA = total from 0.01 to 30.00, raster bytes, bounds); updater download tests against a loopback fake (setAllowLoopbackForTests, off by default); legacy-schema migration fixtures intest_sql_litethat run every repair twice, plusreadColumnFromTable,readGarmentPriceand the neutral returns with no database. Doc drift across the module docs,architecture.md,unit_suites.md,e2e.md, the coding-guidelines skill and two stale code comments, each row marked in its report. The agents' worktrees started from 12.2, so their work was rebased onto the branch; four tests the Low round already had were dropped as duplicates. The last three gaps were closed the same day: the updater refuses a download redirected to a foreign host (test_downloadInstaller_redirectedToForeignHost_refused, a second fake on 127.0.0.2, shown to fail without the check); the "Cliente:" line wraps on 58 mm paper (ticketrenderer.cpp,test_render58mmFitsEveryLineno longer skips it); thesplitGarmentRowrace needs no test, since the row is read inside the transaction (F9) and the commit failure is already covered. - [x] Pre-12.0 review: the owner's decisions (27-10-2026). One
DescripcionOperacionfor every AEAT submission (kInvoiceDescription/kRectificationDescriptioninverifactutypes.h, "Servicios de lavandería" accented and untranslated; retries and the save path used to send it without the accent). The factura leyenda prints only when every paid row of the invoice isENVIADA(orPENDIENTEfor a record the direct client issued or queued), never from row 0; the compliance auditor passed it and confirmed printing F7 (exact long-form wording, right below the QR, Font A), now pinned bytest_renderLeyendaIsTheExactPhrase. Añadir prendas keeps the ticket after an unpaid save. Exportar registros AEAT asks before overwriting a file, and Req. 7 says that unaccepted direct records are not exported. Revertir contabilidad asks for confirmation and logs it.netTicketCountcounts a regularisation without a readablefechaPagoin the period (none at the shop). Configuración warns when a secret cannot be encrypted or read, keeps a stored certificate missing from the store, warns on a future floor date and asks before saving a missing database path. The direct client's data-format questions moved to the production-switch item; Listado's F5 refresh is kept (release notes). The flakytest_recogida_retrySaysWhyNothingWasSentnow queues a dropped connection for every request of the first chain sync. - [x] Pre-12.0 review: the Low round, the start-up warnings and the 12.2 review (26/27-10-2026). Five Sonnet subagents in their own worktrees, by module, reviewed and merged here: about 210 Low, doc-drift and test-gap rows fixed or closed across the 19 reports, each marked in its report. Highlights: Verifactu's start-up warnings and "Listo para un nuevo ticket." no longer hide the start problems (failed backup, incomplete migration);
--self-checkloads the settings read-only (AppSettings::loadReadOnly), exits 1 on a failed check and refuses a dangling--settings;updateTicketPickupnever revives a voided garment; supplier invoices are refused in a closed quarter inside the INSERT (insertExpenseInvoice);insertNewItemToTablewrites named columns; the QR fits 58 mm paper (unchanged on 80 mm) and is thresholded; the ASB no-response bit is decoded, so a powered-off printer logs "La impresora no responde" instead of "Impresora lista" (closes that tracker item); the log gains[INFO], milliseconds and secret scrubbing; the updater gets aparseReleaseseam and refuses non-GitHub asset URLs; Listado amounts are stored as cents (NumberFormatDelegate::storedNumberthroughmoneyText: "12," is "12.00"). The 12.2 review (compliance auditor + Opus code review): the stamped-unpaid repair now logs each row it clears, runs only inside a transaction it opened and checks the commit, and matches onlypagadoNO / empty;verifactu-requirements.mdReq. 1 lists the migration repairs. Owner decisions and leftovers are in the tracker. Two agent slips fixed in review: an ellipsis turned into "2026" in two UI strings, a leftover variable inmain.cpp. - [x] Envíos Verifactu pendientes lists every unsent invoice paid after the floor date (shop report of 26-10-2026). Seven garments paid that day stayed
PENDIENTE. Five got "Error de conexión: Operación cancelada" between 12:21 and 13:39: Qt's transfer timeout aborting gateway requests that took too long, a gateway outage. Two have no answer stored at all (no timestamp). That much is the designed behaviour: an unknown outcome staysPENDIENTEfor the start-up recovery. But the recovery never listed them:pendingVerifactuEventscompared the ticket's reception date with the floor (Solo tickets desde, default 2026-09-01), and all seven were received in April-August. Read from the shop's database: 8 more invoices paid in September and October were hidden the same way, 15 in all. The floor now applies to the invoice's own date (its earliestfecha_pago), as the refused-invoice list already did. A legacy ticket paid before Verifactu is still left out by its old payment date. Test:test_pendingVerifactuEvents_returnsPaymentDatenow asserts that a ticket received before the floor and paid after it is listed (the old assertion encoded the bug). - [x] Pre-12.0 review: the Medium findings (26-10-2026; the tracker's "items still open", Medium round). Fixed with a test each (shown to fail without the fix): add_garment: a paid garment takes the next free invoice seq (
nextVerifactuInvoiceSeq, as Cobrar does), stored on its row (IngresoGarmentRow::verifactuInvoiceSeq) and passed bypaidGarmentSavedto both senders, so it never reuses an InvoiceID the direct client already generated; the add is refused when the ticket's reception date is in a closed quarter; newtest_add_garmentsuite; the stale garment-shape test fixed. app: the 3 s AEAT wait after a paid save locks the window and menus (Limpiar could change the ticket being printed); a typed garment without a price refuses the save instead of being dropped. verifactu gateway: a reconfigured gateway client is retired only after its in-flight replies arrive; a missing ServiceKey says "Clave de servicio no configurada"; the README says the key, notverifactu.production, decides the gateway's environment. recog_prendas: a hand-typed price survives a quantity or service change; the background refresh re-runs the submitted search and reselects the garment by hash, keeping fields being typed; a garment handed to the client (Recogido) cannot be voided; the total sums in double; Reintentar / Consultar say why nothing was sent. imprimir: the recibo prints the n_recibo; voided rows no longer block IMPORTE PAGADO; "Todas las facturas" skips empty events and reports print errors. printing: a send gate makes the watchdog fallback unable to print twice (a hang inside the send no longer falls back to RAW; the operator is told to check the printer). sql_lite:splitGarmentRowreads inside its transaction and checks the commit. listado / tableview / uikit / logging: gastos IVA for any rate and totals in cents; exclusive filter modes (case-sensitive and regex narrow, an invalid regex matches nothing);NumberFormatDelegatestores amounts only; Enter presses the primary only from a text field of the dialog itself;AppLoggerchains the previous message handler. Marked handled without code: the gateway amount split (fixed bysplitGross) and gateway rectificativas (refused in production). Still open: the restore head (waits on AEAT) and printing F7 (leyenda, for the auditor at/release). Drafted by five Sonnet subagents in their own worktrees, reviewed and merged here.
Post-12.1 development — October 2026 (shipped in 12.2)¶
- [x] Garments that could not be charged: a paid sibling's AEAT data cleared from unpaid rows (shop report and log of 26-10-2026, ticket 30634; since 12.0). Cobrar failed with "a row AEAT accepted keeps its invoice data". Read from the shop's database: before 10.10 the AEAT answer of a ticket's first payment was also written onto its unpaid garments (same seq 0), and 10.10 fixed the write-back but never cleaned the rows it had stamped. They carried
ENVIADA, the paid garment's CSV, hash and InvoiceID, and since 12.0 the guard triggeringresos_accepted_identityrefuses to changepagado/fecha_pagoon such a row. There were 11 of them at the shop (June-August 2026, 10 in the shop, 1 voided). The "Recoger" before "Cobrar" was unrelated.migrateDatabasenow finds an unpaidENVIADArow whose CSV is a paid sibling's and clears the copy (SIN COBRAR, orANULADAwhen voided in place; CSV, hash, XML, QR URL, InvoiceID to NULL, seq 0). The estado moves first, so the trigger no longer guards the row and nothing drops it. The AEAT record stays on the paid row, which is untouched. Checked on a copy of the shop's database: the 11 rows clear and ticket 30634's Edredón can then be stored as paid. Test:test_migrateDatabase_clearsAeatDataCopiedOntoUnpaidGarments, which fails without the repair. - [x] M1e reads the shop's trailing-dot amounts and names the tickets (shop's 12.1 check of 25-10-2026: "10 importe(s) ilegible(s)"). Read from the shop's database: nine rows store amounts as
6.,13.…, whichmoneyParserefused because it required digits after the separator, although the totals already read them right; the tenth (ticket 25869, July 2024, paid) has an empty importe and counts as 0, left as it is.moneyParsenow takes an optional fraction after the separator (6.,12,;.and,5still refused), and M1e lists the unreadable tickets' numbers after its counts. The M2b cent differences are the per-invoice IVA rounding, kept. Tests:test_moneyParse_strict,test_checkMoney_countsUnreadableAmountsAndIva. - [x]
aeat_direct_backendno longer flakes on a slow runner (CI 39999937611test_query, master CI 40122432472test_laterSyncKeepsWhatAeatAlreadyAnswered): the suite'swaitForgave up after 10 s, andregisterElsewherethen returned an empty huella that the test compared against. The wait is 30 s, andregisterElsewherelogs a submission that did not succeed.
Post-12.0 development — October 2026 (shipped in 12.1)¶
- [x] The test schemas are the shop's (24-10-2026, read from the shop's database): every original column NOT NULL,
gastos.idNUMERIC NOT NULL without a key,prendaskeyed bynombre(testschema.h,seed.py;DEFAULT ''is the tests' only addition, for their seeding INSERTs, while every app INSERT names all the columns). Every text value ansql_liteINSERT binds goes throughnotNull()(garment rows, rectificativa client,addNewClient,insertNewItemToTable). Seeds that put NULL in a column the shop declares NOT NULL now use ''. - [x] Añadir prendas works again on the shop's database (shop report, log of 20-10-2026, since 11.2): adding an unpaid garment failed with "NOT NULL constraint failed: ingresos.fecha_pago". AddGarment leaves
fechaPago/fechaRecogidaas nullQStrings, which bind as SQL NULL, and the shop'singresosdeclares its columns NOT NULL; Guardar ticket passes empty strings, so it never failed.execGarmentInsertnow binds every text column throughnotNull()(''). The test schemas (testschema.h,seed.py) lack the shop's NOT NULL, which is why no test saw it:test_insertGarmentRow_nullFieldsOnNotNullColumnsbuilds a table with NOT NULL on every column and fails on the old code. - [x] The post-update check is asked for and says what to send (Germán 24-10-2026; pre-12.0 review, updater: nothing prompted the shop to run it). The installer's last page now ticks Comprobar la instalación (recomendado tras actualizar) and unticks Ejecutar La Ideal (
laideal.iss, now UTF-8 with BOM so ISCC reads the accent); the first start of a new version asks for the check once in the result panel (app.last_started_version,SelfCheck::isFirstStartAfterUpdate: never on a first installation); Ayuda → Comprobar tras actualizar… starts--self-checkas its own process with the same settings file, since the check swaps in a copy of the settings; and its last screen lists what to send before closing: the Desktop report, the log (linked) and a photo of the first paid factura with its QR and leyenda. Tests: unit, and e2e (notice once, the action exists). - [x]
test_partialPaymentChainedno longer crashes on a slow runner: it polledsentRecords().last()on a possibly empty list (master CI after the 12.0 merge).
Post-11.2 development — October 2026 (shipped in 12.0)¶
- [x] Release gates of 12.0 (24-10-2026): the compliance auditor on
11.2..HEAD(READY WITH NOTES; AEAT'sR-numbers now count only in production,R-rows sort by their number, the gateway's restore limit documented), CI, UI smoke and the M6 run against AEAT pre-production (7/7, AEAT acceptedR-1/R-2). The manual M6 run found two app issues, both fixed with tests: Anular's row button was too narrow for "Confirmar anulación", and a substitution after a difference rectificativa replaced the original but left the difference standing (books and AEAT off by it): it is now refused, and the ticket is corrected by differences. The M6 script waits for AEAT's answer before closing Anular / Rectificar, tells a closed dialog by its visibility (Qt only hides it), substitutes a new ticket in step 5 and lists theR-rows;printer.py listencaptures prints during a manual run;ui_smoke.mdhas one local-run section with the PowerShell commands. - [x] Release 12.0 prepared: the audit's findings fixed, rectificativas in their own series, notes, version and declaración date (release audit of 20-10-2026; owner's decisions 23-10-2026). A gateway answer without CSV no longer leaves the rectify form armed for a second rectificativa; the chain check also catches deleted newest records (
AeatChainCheck::verifyTail: the stored tail must be theaeat_chainhead unless the head is an anchor); the identity trigger also freezes paid ANULADA / RECTIFICADA rows and is recreated at start; a new version copies the database before migrating it even with automatic backups off; an accepted reply's QR always prints with the leyenda; an orphaned rectificativa's error says to check Consultar en AEAT; Consultar en AEAT reconciles NULL-estado rows. New rectificativas are numberedR-1,R-2… (nextRectificationNumber, above AEAT's and the direct store's highestR-), as art. 6.1.a RD 1619/2012 asks for a separate series; earlier ones keep their numbers, ticket numbering ignoresR-rows, andsplitInvoiceIdreadsR-<n>as one number (rectificativas are always payment event 0). The declaración's j) stays the shop's address from Configuración (no personal address in the public repo); its date is 23-10-2026. CMake 12.0 and the ES / EN notes. Plan:docs/reviews/2026-10-20-release-audit-plan.md. - [x] Repo hygiene (pre-12.0 review G11; owner's decision 20-10-2026): the stale remote branch
origin/feature/recog-prendas-edit-qty-service-pricewas already gone from GitHub.completed_milestones.mdhad grown to about 650 lines, so the milestones of 10.13 and before moved todocs/completed_milestones_archive.md. It is linked from the milestones file,docs/INDEX.mdanddocs/README.md. - [x] The last P3 leftovers of the pre-12.0 review (tableview, uikit, listado, 00 X7). Listado re-created its column delegates at every refresh and never deleted the old ones; it now keeps them in one map, deleting the previous set on refresh. The hard-coded colours (green 0,180,0 on white is about 2.6:1) are replaced by UiKit constants that reach at least 4.5:1, used by the result panels,
TextColorDelegateandLinkDelegate. The tableview and uikit strings go throughtr(), so the context menu title is now "Menú contextual". The about 25db.open()/db.close()pairs outsidesql_lite(Añadir prendas, Anular, Rectificar, Imprimir, Cobrar, Anular prendas, Recogida, Facturas) useConnectionScope. AeatStore keeps its own open helper and the self-check its read-only copies, on purpose. Drafted by a Sonnet subagent and reviewed here. - [x] Contabilidad's IVA is the sum of the invoiced cuotas (pre-12.0 review, contabilidad Medium; owner's decision 20-10-2026): the quarter's IVA repercutido was computed from the summed gross, unrounded, while each AEAT record carries its cuota rounded per invoice. Over a quarter, modelo 303 could differ from what was registered by a few cents. The income and regularisation listings now keep each payment event's gross (
invoices, perverifactu_invoice_seq), andfiguresFromDetailssums each one'ssplitGrosscuota. The base is the gross minus that IVA, and a gasto is split as one supplier invoice. The detail tables use the same split, so their totals still equal the summary to the cent. Test:test_ivaIsTheSumOfTheInvoicedCuotas, where two invoices of 10,00 give 1,74 + 1,74 instead of the 3,47 of 20,00. - [x] Backups to an optional second folder (pre-12.0 review, backup Medium "same disk"; owner's decision 20-10-2026): every backup sat next to the live database, on the same disk. Configuración now has Segunda carpeta de copias (
backup.second_folder), for a USB stick or another drive. When it is set, each verified backup is also copied there, written as.part, size-checked and renamed, and that folder is pruned with the same retention. A copy that fails, say the stick is out, leaves the main backup successful and says so in the result panel. Test:test_secondFolderGetsTheCopy. - [x] Configuración says when the gateway refuses the key (follow-up of the P2 batch):
testConnectionalready told a refused key (401 / 403 or a key error in the body) apart from a network failure, but Probar conexión still said "No se pudo conectar al servidor" for both. A refused key now gets "Clave rechazada": the server answers but refuses the service key. The status mapping is pinned bytest_testConnectionReportsARefusedKey. The message box itself is not driven by a test. - [x] Anular follows the whole chain of rectificativas (follow-up of the P2 batch's audit): the guard against cancelling an invoice that a standing rectificativa corrects looked one level down. With a rectificativa R1 substituted by R2 (R1 RECTIFICADA, R2 pointing at R1), cancelling the original was allowed, and R2's amount stayed in the books. The lookup moved from the dialog into
sql_lite::liveRectificationOf, a recursive query that finds the accepted rectificativa at any depth. Test:test_liveRectificationOfFollowsTheChain. - [x] No endless duplicate check in the direct client (follow-up of the P2 batch's audit): when AEAT answered "duplicado" but its query never returned the record (another date or period), the record went resend -> duplicate -> query every retry delay, for ever.
verifyDuplicatenow counts those rounds. After 5, the record is an ERROR (refused, in the refused count) with "compruébela con Consultar en AEAT". The fake AEAT gainshideFromQuery. Test:test_duplicateAeatNeverShowsEndsInError. - [x] No gateway rectificativa in production (follow-up of the compliance decision on the gateway's missing
RectificationItems): the gateway's rectificativas do not say which invoice they rectify (FacturasRectificadas). That is acceptable in AEAT's pre-production, where the gateway stays for 12.0, but not for a real invoice.VerifactuIntegration::submitRectificationAsyncnow refuses one when the gateway is in PRODUCTION, with a message to use the direct connection, which sends the field. Test:test_gatewayRectificativaRefusedInProduction. - [x] No rebuilt QR on a reprint with the direct client (follow-up of the direct-client hardening): an accepted row without a stored
verifactu_url_qr, which only older gateway rows have, still fell back togenerateQRAsync. With the direct client that rebuilt the URL from today's environment and IVA rate, which may not be the invoice's.Imprimir::resolveQrCodenow prints such a row without QR when the connection is direct, and logs it; the gateway still answers its own/GetQrCode. Test:test_reprintWithoutStoredUrlHasNoQr. - [x] The chain verifier also catches a deleted record (follow-up of the direct-client hardening):
AeatChainChecktook any link to a huella this database does not hold as a restored copy's continuation, so a record deleted fromaeat_recordswent unnoticed. A sync that moved the head back to an older stored record would also have raised a false alarm. Each head a chain sync adopts (adoptTip) is now stored as an anchor (aeat_chain_anchors).verifyStoredChainaccepts a continuation, or a link to an older stored record, only when it is an anchor. A store from before the anchors takes the continuations it has on that day as its first anchors, once, so an existing copy raises no false alarm. The Req. 1 wording now says deletions are detected. Tests:test_anchorsMakeADeletedRecordVisible,test_anchoredHeadMovedBack. - [x] The start-up recovery never resends an invoice that is still on its way (follow-up of the Cobrar store-first change): the recovery opens 4 s after start-up and lists every
PENDIENTEevent. A Cobrar pressed in those seconds stores its rowsPENDIENTEbefore sending, so Reintentar could resend an invoice in flight: a duplicate with the gateway, a re-queue with the direct client.VerifactuIntegrationnow tracks each invoice it sent until its answer (isInFlight).PendingSubmitsDialogdoes not list such an invoice, and its Reintentar refuses one with "se está enviando ahora mismo". Test:test_pendingRecoverySkipsAnInvoiceBeingSent. - [x] A rectificativa por diferencias keeps the invoice above zero (pre-12.0 review, app A11): the I-type difference had no lower bound, so -500 on a 20 € ticket gave a negative corrected invoice. The dialog now adds the original, the differences already issued (
sql_lite::rectifiedDifferences: accepted or pending, refused and cancelled ones left out) and the new one. It refuses the difference unless the result stays above 0, before anything is numbered, stored or sent, and points to Anular factura for an invoice that should go away. Tests:test_rectifiedDifferences,test_rectify_differenceCannotMakeTheTotalNegative. - [x] No row rewrites without a copy of the database (follow-up of the pre-12.0 backup fix): when the backup a new version takes before migrating failed,
migrateDatabase()still ran its data repairs (duplicate-hash repair, rounding, comma decimals) on the only copy. NowMainWindowthen callsmigrateDatabase(db, false), which runs the schema steps (tables, columns, closures, guards), so the app works, and leaves every row rewrite for a later start that does take the copy. The red message says the repairs wait. Test:test_migrateDatabase_schemaOnlyLeavesRowsAlone. - [x] Pre-12.0 P2 / P3, group 7: connections, layering, facade and leaks (pre-12.0 review; 00 X1 / X2 / X3 / X5 / X7, sql_lite F13, P3). About 40
sql_litefunctions opened and closed the shared default connection themselves, closing it under other windows' models (one cause of the 256-row cuts) and getting early returns wrong. The RAIIConnectionScopereplaces all 57 open / close pairs: a connection the caller holds open stays open, and every return closes only what was opened (test_connectionScope_leavesTheConnectionAsFound).sql_lite,add_garment,facturasandprintingincluded../verifactu/verifactutypes.hby relative path without linking anything. They now link the header-onlyverifactu_typesINTERFACE target.sql_lite's two reads of AeatStore'saeat_recordstable are named helpers, andtest_sqlLiteReadsTheRealTableruns them against the table AeatStore builds. The windows reached past the facade into the direct backend.VerifactuIntegrationnow answers what they asked (isDirect,holdsPendingRegistration,storedRegistrationOutcome,environmentName,sendingError,certificateExpiryWarning,verifyStoredChain,syncDirectChain), and only the self-test, the export, the self-check and the tests still usedirectBackend().verifactuis a STATIC library with the keyword link signature, and the appsettings -> printing edge is documented. Leaks: the windows opened from the menus close withWA_DeleteOnClose, theImprimirinstances are deleted after printing,Imprimirreuses its model, and Listado / Recogida delete the models they replace. The leftovers (delegates, colours,tr(), the call sites outsidesql_lite) are filed. Drafted by two Sonnet subagents in their own worktrees, merged and reviewed here. - [x] Pre-12.0 P2, group 6: one split of the gross for every invoice (pre-12.0 review; 00 X4). The base and cuota of an invoice were computed in four places, three different ways. The facade sent the gateway an unrounded base, with the cuota as base x rate. The rectificativa dialog took gross minus base. The printed factura rounded the base through
QString::number. So the record's base + cuota and the printed figures could differ from the amount charged by a cent. NowsplitGross(header-only,verifactutypes.h) rounds the base to cents, half away from zero, and takes the cuota as the rest. The facade, both rectificativa amounts,TicketRendererand the gastos window use it, so base + cuota is always the gross. The callers keep passing gross / (1 + rate), unrounded, and the facade splits it back in cents (a rounded base would lose a cent).test_splitGrossAddsUpForEveryAmountchecks every cent from -20,00 to 1.000,00. Left for the accountant: whether modelo 303 carries the sum of the per-record cuotas (tracker). Docs: the direct-client investigation is marked as a historical report, and the Verifactu README shows both backends, the amount split and the restore limit. The compliance-auditor step was skipped by the owner's instruction (until/release). - [x] Pre-12.0 P2, group 5: the test gaps (pre-12.0 review; 00 §5). The post-update self-check gains four automatic checks on the shop's own copy. M1a: the settings file is readable and points at an existing database. M1b: the newest backup is at most 3 days old. M1d: a second
migrateDatabasechanges nothing, by a SHA-256 of the copy. M1e: counts of unreadable amounts and unrecognised IVA rates, counts only. The e2e bench gains the gateway's failure modes: HTTP 500, 401, malformed JSON, a dropped connection and "success" without CSV all leave the paymentPENDIENTEand neverERROR, and a stalled reply ends as NETWORK_ERROR at the 30 s timeout. It also gains Recogida's remaining search modes (Anulación dates, accents, not found) and Cobrar pressed twice while AEAT answers. That last test found that the slot could be re-entered:PayDialog::onCobrarClickednow returns while a reply is pending. Each new test was shown to fail on a temporary break of the code it pins. Drafted by the test-engineer subagent and reviewed here. - [x] Pre-12.0 P2, group 3b: a sturdier migrateDatabase, a silent data layer (pre-12.0 review; sql_lite F8 / F12 / F18, 00 X8).
migrateDatabasenever checked that the database opened, and it closed a connection its caller had open. Its multi-row repairs (split relink, new hashes, rounding) ran row by row without a transaction. The "review manually" warnings repeated at every start until real problems drowned. The app could not start on an empty file, since nothing createdingresosor the other base tables. And uniqueness of the(n_recibo, hash)key every write uses was only repaired, never enforced. Now: the open is checked and a caller's connection stays open. Each repair loop is all or none. A notice is logged once (migration_notes). An empty file gets the base tables (CREATE TABLE IF NOT EXISTS, the shop's own columns). After the hash repair a unique index keeps(n_recibo, hash)unique; it is not built while a sent row still shares its hash, which is logged for review.sql_litealso showed eightQMessageBoxes, which popped up in windows that promise no pop-ups and in the self-check, and blocked failure-path tests. They are gone: failures are logged and returned, andsql_litelinks Qt Gui, not Widgets. Tests:test_migrateDatabase_baseSchemaNoticesOnceAndUniqueKey, withtest_migrateDatabase_reportsAFailedStepand the duplicate-hash test updated. Still open: theConnectionScopeRAII (X7 / F13). - [x] Pre-12.0 P2 / P3, group 4: invoice dialogs, estado, gateway and direct-client edge cases (pre-12.0 review; app A8-A10 / A21, verifactu-direct, verifactu-gateway, 00 P3). Anular: one press cancelled an invoice at AEAT. Now the first press says what will be cancelled and the button turns into Confirmar anulación. Anular is also refused while an accepted rectificativa points at the ticket, which would leave its delta in the books. Rectificar read an arbitrary group of a mixed ticket and now uses its paid seq-0 invoice. Both dialogs are on UiKit, with AEAT's text escaped. An estado string no version wrote fell back to PENDIENTE and could be resent. It is now
VerifactuEstado::Unknown: logged, never resent, cancelled, rectified or voided, and printed without QR or leyenda. The gateway'stestConnectionreported OK on a 401; a refused key is now its own answer, and the unused tax-item / invoice-type enums are gone. Direct client:NombreRazonEmisoris cut to the XSD's 120 characters, and a qrcodegen exception gives no QR instead of a crash. Two cases left a waiting request unanswered; it is now always answered. WinHTTP resolves and connects within 10 s on a private thread pool, so closing never waits on AEAT. A SOAP fault on a whole submission used to refuse up to 1000 records AEAT never judged. Those records now stay pending and are resent one by one, not counted as reached. A duplicate answer was adopted blindly. AEAT's own record is now queried first: another amount is an ERROR (another invoice under our number), an unreadable one stays pending, and it is ours only if an earlier send reached AEAT with our huella. WithLAIDEAL_TEST=1, set for every CTest test, both transports refuse any host but this machine. The compliance audit passed and approved the four decisions (Anular refusal, duplicate-amount ERROR, one-by-one resend for now, the gateway's missingRectificationItemsas a documented 12.0 limit). Its notes were applied (Unknown prints no QR, an unreadable amount stays pending, a faulted batch is not reached) or filed. Drafted by an Opus subagent and reviewed here. - [x] Pre-12.0 P2, group 3a: amounts read strictly, invoice rows guarded by the database (pre-12.0 review; sql_lite F4 / F6 / F16 / F21, app A13).
moneyTextturned unreadable text ("1.234,50", "abc") into 0.00, so a garbage amount was stored as a free garment. The newmoneyParsereads an amount strictly, and the amount writers andinsertGarmentRowrefuse anything else. The Verifactu feeds summedimporteas text, so a legacy "5,50" counted as 5 and a resend went out short. They now sumINGRESOS_IMPORTE_VALUEand round the totals to cents. The client autofill took the first name starting with what was typed: "Ana" got "Ana Maria"'s phone and address, and the save wrote them onto Ana.searchItemFromClientnow matches the exact name, and the generic prefix search takes%and_literally. Req. 1 rested on application code alone.migrateDatabasenow adds two triggers. One refuses deleting a row registered at AEAT (a CSV, or ENVIADA / ANULADA / RECTIFICADA). The other refuses changing an ENVIADA row's invoice identity (n_recibo,fecha_pago,pagado, CSV, XML,verifactu_hash, InvoiceID, seq) unless the write leaves it equal. The estado, the cancellation date, the pickup and the amount (Separar keeps the invoice total over the two parts) still move. The test helpers that shape data by hand drop the triggers first, and the app's own paths run with them in every e2e test that builds a MainWindow. Tests:test_moneyParse_strict,test_pendingEventsSumParsedAmounts,test_clientLookupExactAndWildcardsEscaped,test_ingresosGuardTriggers. - [x] Pre-12.0 P2, group 2: updater, gastos invoices, report files, Listado (pre-12.0 review; updater, facturas, reporthtml, listado, tableview and contabilidad rows). Updater: startup and manual checks shared one "silent" flag. Silent is now carried per request, and a second check while one runs is ignored. During the download the dialog offers Cancelar (the reply is aborted) and ignores Esc / the window close.
TMP/TEMPare set only in the installer process's environment, never the app's. A tag that is not exactly X.Y fails the check instead of reading as newer. Facturas (gastos): the amount acceptedinf,nan, exponents, zero and negatives.Facturas::parseGrossnow takes only a plain positive amount. The same supplier and number is refused with the existing invoice shown, fields are trimmed, and the id comes from the insert itself, which removes thereadMax...pop-up. Contabilidad: regenerating a closed quarter replaced the filed PDF. It now writes<name>_regenerado_YYYYMMDD.pdf, and every PDF is written as.partand renamed, so a locked or failed write keeps the old one. Reports: the business identity and the listing cells are HTML-escaped, and the prendas PDF reports a failed write in red. Listado:n_recibosorted as text, so 100000 came before 99999. It now sorts numerically, as do the amounts, andfecha_anulacionsorts as a date. The search filters once per keystroke and covers up to Observaciones. Searching or sorting first loads every row, and ingresos is read-only at the model level too (the proxy dropsItemIsEditableand refusessetData, Req. 1). Tests intest_updater,test_facturas,test_contabilidad,test_reporthtmlandtest_mysortfilterproxymodel. Drafted by a subagent and reviewed here. Open: the first 256-row ingresos batch is still ordered by text in SQL until the user sorts or filters. - [x] Pre-12.0 P2 / P3, group 1: printing, backups, log, CI and installer (pre-12.0 review; printing F3-F5 / F17, backup and logging Medium rows, 00 C1 / C3 / C5 / G11). Printing: the CP858 table mapped Ì to 0xDD, the broken bar. It is now 0xDE, and a test checks the table against hard-coded CP858 values rather than the preview decoder, which had the same error. C0 control characters in printed text become a space, so a name can no longer carry a printer command. The RAW path said "impreso" for a queue the spooler held offline, which would print later as a duplicate. It now refuses an offline, worked-offline or unavailable queue; paper-out and an open cover are left to the Epson Status API, whose spooler flags can be stale. The vendored qrcodegen is pinned by SHA-256 with a notice. Backups: the newest 3 copies are always kept. Each month keeps its last copy, not its earliest. The boundaries use
addDays(30)/addYears(4), and a clock that is wrong prunes nothing.backup.last_errorrecords a failure, and every start warns in the result panel when backups are off or none was correct for 3 days (BackupManager::currentBackupWarning). The log rotates during a session too, never loses.oldon a failed rename, and falls back to the temp folder without crashing (installAttest seam, newtest_applogger). CI and release: the UI smoke also runs on pull requests to master, andrelease.ps1runs ctest and zips like CI. The installer drops the dead.mypassociation, removes the previous version's Qt DLLs and plugin folders before copying, and offers Comprobar la instalación (--self-check), unchecked..gitignorecovers*.sqlite,*.pfxand*.p12(test fixtures excepted). The unused icons are removed. Drafted by a subagent; reviewed here, with accents added to its messages and the offline check narrowed. Open: backup's second folder (a product option) and the stale remote branch. - [x] Documentation drift of the pre-12.0 review (00 §4 G1-G6, G8-G10): the docs described the app before the direct AEAT client.
architecture.mdnow has both Verifactu backends, theaeat*classes and theaeat_chain/aeat_records/aeat_chain_synctables, with settings in the AppSettings JSON (not a QSettings INI). The README configuration table listed keys that do not exist (db.path,app.ivaRate,verifactu.serviceKey, ...) and missed most real ones. It is rebuilt fromappsettings.cpp, keys only, no values.ai_agent_instructions.md(Qt 6.4.3, the DB path, Ninja, the file map),INDEX.md(version, the six estados, test count),docs/README.mdanddocs/testing/README.md(the fake AEAT server, the self-check layer) are updated. The release skill now points to CONTRIBUTING as the source of truth.rest_api.mdloses its advice to log the ServiceKey and gains an "outdated, the code is authoritative" banner, and the printer 04 / 05 notes are marked Excel-era. The edits were drafted by a subagent and reviewed here. - [x] Compliance-audit follow-ups of the blocker fixes (pre-12.0 review): a gateway rectificativa answered "success" without AEAT's CSV, now PENDING, was stored as ERROR. AEAT may hold it, though, and the original stayed counted until it was redone. It is now stored PENDIENTE with that reason, for Consultar en AEAT. The start-up orphan rule (
markRectificationUnsent) only turns a placeholder with no answer at all, as after a crash or a window closed unanswered, into an ERROR to redo. A settings save that fails, such as the one storing the direct client's NumeroInstalacion and chain marker, was only logged.AppSettings::lastSaveErrornow feeds a red start-up message, since a new installation number after a restart would change the records. The audit's other points: Anular during the first chain sync now says why (the facade gate, item 4). Whether AEAT ever answers a duplicate on a live cancellation is checked in the M6 pre-production run at/release. The legacy reprint limitation is by design. Tests:test_markRectificationUnsent_onlyUnanswered,test_lastSaveErrorReported. - [x] Every ingresos writer is a guarded sql_lite function (pre-12.0 review; 00 X6, sql_lite F2 / F3 / F5 / F7): six
UPDATE/INSERT ingresosstatements still lived in PayDialog, RectifyInvoiceDialog and PendingSubmitsDialog, each without some of the usual guards. They are now namedsql_litefunctions.storeChargedGarmentsis Cobrar's all-or-none store, now refused in a closed quarter.markPendingEventUnreconciledis the recovery's Marcar como error. The rectificativa row has four:insertRectificativaRow, refused in a closed quarter and with its amount throughmoneyText;resetRefusedRectificativa, which only rewrites a row still in ERROR;applyRectificativaResult, where a refusal or unknown outcome never rewrites an ENVIADA row (the missing settled guard: a late duplicate rejection turned an accepted rectificativa into ERROR); andmarkRectificativaUnanswered. The dialogs keep their own decisions, such as the estado of an unknown outcome.applySettledVerifactuCancellationleft the connection open on four of its five paths and stamped today's date even in a quarter closed meanwhile. It now closes on every path and dates the cancellation throughopenPeriodDate. The 10.12 void-date backfill re-matched voided rows with no date to move at every start, so its "idempotent" claim was false. It now skips them. Tests:test_storeChargedGarments_allOrNone,test_rectificativaWritersKeepTheSettledRow,test_markPendingEventUnreconciled,test_applySettledVerifactuCancellation_closesAndDatesOpenPeriod,test_migrateDatabase_voidDateStepSkipsDatelessRows. - [x] Direct client hardening: the chain is verified, the QR reprinted as issued, the certificate watched (pre-12.0 review; 00 §2.18 and G7, verifactu-direct, imprimir F6): four gaps of the direct AEAT client before production. (a) The chain sync skipped any query record whose
SistemaInformaticoblock was missing as "another system's". If AEAT ever omitted the block, a first sync with no local records would restart the chain withPrimerRegistroover our own records. Such a record is now unusable, like one without its huella, and the first sync fails. (b) A reprint asked the backend for the QR, and the direct client rebuilt the URL from the current environment and today's IVA rate. After the production switch every older test invoice would print a production QR with the leyenda. Reprints of an accepted invoice now draw the QR from theverifactu_url_qrstored with AEAT's answer, for the gateway and the direct client alike, with no request. (c) Nothing warned before the certificate expired, and one expiring mid-run gave an endless generic retry. The start now warns under 30 days (AeatDirectBackend::expiryWarning), and a failed send with an expired certificate stops the sending with that reason. (d) Req. 1 claimed tamper detection that no code did (art. 8.1). The new pureAeatChainCheck::verifyrecomputes every stored record's huella from its XML and checks the links per issuer, failing a reordering or a restarted chain. It runs at every start (verifyStoredChain, red result-panel message,qCritical) and in the post-update self-check (M1c). A link to a huella only AEAT holds, as in a restored copy, is counted, not reported. The requirements doc now says what is and isn't detected: deletions andingresosedits are not. Tests:test_aeat_chaincheck(new suite: valid chain, edited XML, reordering, restart, continuation, separate issuers),test_firstSyncFailsWhenAeatOmitsTheSystemBlock,test_certificateExpiryWarning,test_reprintUsesTheStoredVerificationUrl,test_checkChain. The AeatChainCheck core was drafted by a subagent and reviewed and reworked here (per-issuer chains, continuations). The audit follow-ups are filed in the tracker. - [x] Cobrar stores the payment before it submits the invoice (pre-12.0 review; 00 §2.9, recog_prendas #4 / #6 / #7): PayDialog sent the invoice to AEAT first and only marked the garments paid when the reply came. A crash, kill or power cut during the round trip therefore left an invoice at AEAT, or queued in
aeat_records, for a ticket the database showed unpaid. That was the only invoicing path that did not store first, unlikesaveTicket.PayDialog::storePaymentnow writes the selected garments as paid +PENDIENTE, with their seq and InvoiceID, in one transaction before anything is sent. It is all or none: a garment paid from another window meanwhile stops the whole charge before anything goes out. Only then is the invoice submitted, and the reply (applyReply) writesENVIADA/ErrorthroughupdateTicketVerifactuFields. A timeout, a transport failure or a reply-timeINVALID_CONFIG, which used to leave the paid rows with an empty estado, now keeps themPENDIENTEfor the recovery. Cobrar now refuses a 0,00 total and a missing Verifactu integration, which booked an invoice with no record. A local refusal to send keeps the paymentPENDIENTEand shows the reason in Recogida (notSentReason) instead of a message box. Because the payment is now stored before any close can happen, two earlier paths became impossible and were removed: the "quarter closed while AEAT answered" warning and the "garments not stored after sending" report. Thee2e_appsuite gets its own 300 s ctest timeout: it takes about 105 s on the CI runner and passed the 120 s default. Tests:test_payDialog_storesThePaymentBeforeSubmitting,test_payDialog_garmentPaidMeanwhileStopsTheCharge,test_payDialog_refusesZeroTotalAndNoIntegration. - [x] Searches return every row; dates, garments and quarter closes are bounded (pre-12.0 review; recog_prendas #2 / #5, add_garment, contabilidad, app A17, sql_lite F14):
QSqlQueryModelfetches 256 rows at a time. Recogida's phone, ticket and date searches closed the connection before the rest came, so a large client or a busy day showed 256 rows and an understated Importe total. Every search now goes throughloadEveryRow. The payment date, which is the invoice date AEAT gets, had no bounds in Cobrar or Añadir prendas. It is now between the reception date and today, the pickup date too, and the MainWindow reception date and the rectification date are capped at today. Añadir prendas looked up the price of whatever was typed, so a free-typed garment opened a "no se ha encontrado la prenda" pop-up and could be saved as a 0,00 EUR invoice. It now looks up only an exact garment-list entry, and save refuses an unknown garment, a quantity under 1 and a 0,00 importe.garmentImportenow also clamps a negative size. Contabilidad could close the quarter that contains today, which refuses every payment of the day. It now closes a quarter only from its last day (Contabilidad::quarterLastDay), with a warning on that day; before that it writes the report and leaves the quarter open. A gastos IVA stored as text such as "21,0" or "abc" parsed silently to 0 and was summed as SIN IVA.sql_lite::expenseIvaRatenow maps anything that is not a whole number to -1, which is left out, flagged in the detail and counted in the red warning. Tests:test_recogida_searchReturnsEveryRowBeyondTheFirstBatch(300 garments: phone, ticket, date, name),test_addGarment_refusesAGarmentNotInTheList,test_paymentDatesBoundedByReceptionAndToday,test_contabilidad_unfinishedQuarterIsNotClosed,test_expenseIvaRate_strict,test_quarterLastDay,test_unrecognisedIvaCountedand the negative-size case. The lower bound of an I-type rectification amount (app A11) is still open. - [x] The factura prints its date of issue; a cancelled or rectified invoice reprints marked as such (pre-12.0 review; printing F1 / F2, imprimir F3): the factura simplificada printed only "Recepción" and an unlabelled print time. Its date of issue, required by art. 7 RD 1619/2012 and the
FechaExpedicionin the QR and at AEAT, was nowhere on the paper. It now prints "Fecha de expedición": the paid rows'fecha_pago, set byImprimir::buildTicketintoTicketData::issueDate. A reprint of an invoice AEAT holds as ANULADA or RECTIFICADA used to come out as a normal factura, with a panel saying it was "not confirmed". It now carries*** FACTURA ANULADA ***/*** FACTURA RECTIFICADA ***and "Factura anulada el. Esta copia no es una factura en vigor.", with no QR or leyenda, and the renderer enforces that too. The panel says the copy is marked. The "Factura completa" heading stays FACTURA SIMPLIFICADA: the AEAT record is F2, and art. 7.2 RD 1619/2012 allows the recipient's NIF and address on a simplificada. A completa now requires the DNI / NIF, since art. 7.2 is about a recipient who asks for one, and the renderer prints no empty "DNI:" line. The "Todas las facturas" panel names any copy printed as anulada or rectificada. The QR date and the printed date now come from the same paid-row scan. Tests: test_renderFacturaIssueDate,test_renderVoidedFacturaMarked,test_renderCompleteInvoiceWithoutDni, and the e2e reprint of a cancelled invoice. - [x] The updater runs only a verified installer; the deploy check covers the SQLite driver and TLS (pre-12.0 review; updater High, 00 C2): the downloaded installer was launched with no integrity check at all, so a tampered release or a cut-off download would run as the shop user. The release now publishes
laideal_setup_X.Y.exe.sha256, written by bothci.ymlandreleases/release.ps1.Updaterreads the asset's size, takes the SHA-256 from GitHub's assetdigestor from that file, and refuses a release that offers neither. It accepts only https URLs and redirects on github.com /*.githubusercontent.com. The installer is written as.part, anddownloadFinishedfires only when the size and SHA-256 match. The download gives up after 60 s without data instead of hanging. The windeployqt assertion in CI, now also inrelease.ps1, did not listsqldrivers\qsqlite.dllortls\qschannelbackend.dll. Without them the installed app has no database, and every HTTPS call fails silently. Pure helpers (findInstallerAsset,isTrustedDownloadUrl,parseChecksumFile,installerMismatch) are unit-tested intest_updater.cpp. - [x] Backups that cannot destroy a good copy, and a backup before each version's migration (pre-12.0 review; backup High, app A14):
VACUUM INTOwrote straight into the finallaideal_<ts>.db, which caused two problems. A copy cut off by a crash looked like a valid backup, so it could survive as a month's copy and lead to the good ones being pruned. And a second run in the same second failed and then deleted the existing good copy. Copies are now written as.part, checked withintegrity_checkand renamed. A run removes only files it created, and stale.partfiles are cleaned up. An atomic guard allows one run at a time, since the automatic worker and the manual action share the connection names. The snapshot connection waits 30 s on a busy database.performBackup()no longer writesAppSettingsfrom the worker thread: the caller records the result withBackupManager::recordSuccess()on the GUI thread.~MainWindowwaits for the worker, and a last-backup time in the future counts as due.migrateDatabase()used to run on a new version before any backup of it. Now the first start of a new version (backup.last_version) takes a synchronous backup first.migrateDatabase()returnsfalsewhen a step failed, the result panel says so, and the self-check uses the return value. Tests: real backups of a throwaway DB intest_backup_manager(rename, stale.part, same second, concurrent run, future last time), andtest_migrateDatabase_reportsAFailedStep. - [x] The chain gate lives in the Verifactu facade; Enter presses the focused button (pre-12.0 review; app A5 / A6, uikit): the "first chain check must finish" gate was only in the windows. Anular and the start-up Reintentar skipped it, so a cancellation or resend could be chained on a stale record.
VerifactuIntegration::submitSimplifiedInvoiceAsync,cancelInvoiceAsyncandsubmitRectificationAsyncnow refuse while the chain is unchecked, whoever asks, and Anular shows the reason. Reintentar emitted a signal and always said "reenviado", even when nothing was sent.PendingSubmitsDialog::retrynow returns why nothing was sent, and the row stays listed with that reason. In every UiKit dialog, Enter on a focused secondary button, Cerrar included, pressed the primary action, possibly an AEAT send, because secondary buttons are not auto-default. The Enter filter now clicks the dialog's focused button first. Tests: the chain-gate e2e extended to Anular and the facade,test_pendingRetryKeepsTheRowWhenNothingWasSent,test_enterOnFocusedSecondaryButtonPressesIt. - [x] Settings safety (pre-12.0 review, appsettings #2-#6): (1) Switching from the direct client to the gateway with its hidden PRODUCCIÓN box still ticked saved
aeat_direct_production = true, so coming back skipped the production confirmation. Only an active direct production is saved now. (2) The gateway's PRODUCCIÓN box switched to the real AEAT without a question; it is now confirmed going in and coming out. (3)save()removed the old file before renaming the new one, leaving a window with no settings at all; it now usesQSaveFile. (4) A settings file that failed to parse was overwritten with defaults by the next save; it is now kept aside as.corrupt-<timestamp>. (5) The plaintext legacy~/.verifactu_keystayed on disk after migration; it is now removed once the encrypted copy is saved. Tests intest_settingsdialogandtest_appsettings. - [x] No personal data in the log (pre-12.0 review, logging P1):
~/.laideal.logis what the shop sends to support, but it carried client names, phones and the address of every new client (addNewClient,updateItemToClient,readClientPhones, the AddGarment insert line). Those messages now keep only the operation and the SQL error text, and/coding-guidelinesgains a section on what never goes into the log: secrets and clients' personal data. Unittest_clientWritesLogNoPersonalDatacaptures every message of the client writes, the error paths included. - [x] Direct client: the installation number is saved at once; a lost cancellation reply settles as cancelled (pre-12.0 review blocker 10; appsettings #1, verifactu-direct High):
aeatInstallationNumber()generated the NumeroInstalacion every record carries, andsetAeatChainMarker()stored the chain marker, but neither saved the settings. A crash before an unrelated save gave the next run a different number. Both nowsave()at once. When the reply to a cancellation was lost and the stored record was resent, AEAT's answer "duplicate, invoice Anulada" went through the alta branch and became an ERROR: the books kept the income and Anular looped. A cancellation reported as a duplicate, in any state, is now accepted, and claimed as ours only when an earlier send reached AEAT. The fake AEAT now answers a repeated anulación as AEAT does, sotest_cancellationLostReplyResentIsAcceptedexercises it; it fails without the fix. Still to confirm against real AEAT pre-production (M6). Unittest_installationNumberAndChainMarkerPersistAtOnce. - [x] Gateway: no request waits forever, and an unreadable or CSV-less reply is never a final state (pre-12.0 review blocker 9, verifactu-gateway; the shop runs 12.0 on the gateway): only probar conexión had a timeout, so a stalled submit, cancel, query or QR never answered. The pending ticket got no late reply and Consultar en AEAT waited forever.
createNetworkRequestnow gives every request a 30 s transfer timeout.parseVerifactuResponseis told what it answers (VerifactuReply::Submit/Cancel/Qr). A body that is not JSON, or has noResultCode(a proxy page, a truncated reply), is now a NETWORK_ERROR: an unknown outcome, the row stays PENDIENTE and is checked. Before, it was a definitive AEAT refusal that cleared the InvoiceID and joined the red count. A submit "success" without AEAT's CSV is now PENDING instead of ENVIADA, which had no CSV, QR or Huella and was never checked again. A cancellation may still succeed without a CSV. Unit tests replace the one that locked the old behaviour. - [x] A reprint is never blank nor a merge of payment events (pre-12.0 review blocker 8; imprimir F1 / F2): Recogida's Imprimir factura with no row selected loaded every row of the ticket. It printed all its payment events as one factura, with a QR whose amount even included unpaid garments: an invoice AEAT never received. It now prints the ticket's only payment event, or asks to select a garment of the one to reprint when there are several (
submittedInvoiceEvents). The engine guards itself too:Imprimir::resolveQrCodesums only paid rows and draws no QR for rows of more than one event. The dialog searched a trimmed number but loaded the untrimmed one, and a ticket whose garments were all voided passed the existence check. Both printed a blank recibo reported as "impreso". The number is now trimmed,buildTicketbuilds nothing without printable rows, and the dialog says the ticket has nothing to print. e2etest_reprintNeverBlankNorMerged. - [x] A failed database read is never an empty period nor ticket number 1 (pre-12.0 review blocker 7; sql_lite F1 / F10, contabilidad High): the Contabilidad listings returned an empty list when their query failed (a locked database, a broken column). The report then showed zero income and, with Bloquear, closed the quarter on it.
nextTicketNumberread a failed MAX as 0 and handed out ticket number 1. The collectors now return whether the query ran, and the public listings,readMaxValueInColumnFromTableandnextTicketNumbertake an optionalbool *ok. Contabilidad writes no report and closes nothing on a failed read and says so.nextTicketNumberreturns 0: MainWindow shows no number and refuses to save; Rectificar, Facturas and the self-check refuse too.readMaxValueInColumnFromTableno longer pops a modal box from the data layer; its callers report in their panel. Unittest_failedReadsAreReportedNotEmpty, e2etest_contabilidad_unreadableDataNeitherReportsNorCloses. - [x] One copy of the app per database (pre-12.0 review blocker 6; app A4): nothing stopped two copies running on the same database. Both would hand out the same next ticket number (MAX + 1 twice) and, with the direct client, fork the AEAT hash chain.
main()now takesInstanceLock::acquire(dbPath), aQLockFilekeyed on the normalised database path in the user's temp folder; it is not next to the database, because that folder may be synced by OneDrive to other PCs. A second start waits up to 3 s for a copy that is closing, then says "La Ideal ya está abierto" and exits. A lock left by a crashed copy is taken over, since Qt checks its process.--self-checkworks on a copy and is exempt. New unit suitetest_instancelock(path normalisation, refusal until release, another database free, a crashed copy's lock). - [x] Cobrar, Anular and Rectificar cannot be closed while AEAT answers (pre-12.0 review blocker 5; recog_prendas #1, app A7): Esc or the window X during "Enviando a AEAT..." rejected the dialog. Cobrar's garments then stayed unpaid while AEAT could already hold the invoice, and nothing adopted the reply. Anular and Rectificar could be closed the same way. Each dialog now overrides
done(), the exit Esc, X and Cerrar all go through, and while a request is pending it refuses with a notice in the result panel. The dialogs still close themselves on the reply, and Cobrar also after its bounded 5 s wait, which hands the request to Recogida. A reply that never comes is bounded by the gateway timeout (blocker 9). e2etest_dialogsCannotCloseWhileAeatAnswers. - [x] Anular / Rectificar: the AEAT reply applies to what was sent; no rectificativa without its row (pre-12.0 review blocker 4; app A1-A3): a second search while a cancellation or rectificativa waited for AEAT made the reply mark the ticket shown by then. That could mark an invoice AEAT never cancelled as ANULADA, or another ticket as RECTIFICADA. Both dialogs now lock the ticket field and Buscar while a request is pending and apply the reply to a snapshot taken at click time (
CancelInvoiceDialog::m_pendingTicket/m_pendingEvent,RectifyInvoiceDialog::m_submittedTicket). Rectificar used to send to AEAT even when its placeholder row failed to insert, and then reported "enviada" with no local row.insertPlaceholderRownow returns false and nothing is sent, and a reply UPDATE that changes no row is a local failure. e2etest_cancelInvoice_replyAppliesToTheTicketItWasSentFor,test_rectify_placeholderNotStoredSendsNothing,test_rectify_replyAppliesToTheTicketItWasSentFor. - [x] The shop's Verifactu connection for 12.0 decided: the gateway on TEST (pre-12.0 review blocker 2, Germán 19-10-2026): 12.0 ships with the shop on the IreneSolutions gateway in its TEST environment, so the shop can use every change and send the self-check report while bugs are fixed. The direct AEAT client stays for the later production switch, once AEAT answers the two written requests. The tracker's Next line, the production-switch row and the Verifactu README contradicted each other and now say this; the gateway fixes are the 12.0 blockers.
- [x] Private data removed from the repository's current files (pre-12.0 review blocker 1, Germán 19-10-2026): the issuer's NIF, her full name (a header comment) and the CSVs of the two INFORMA+ written requests are gone from every tracked file. A CSV lets anyone open the official document at AEAT's sede. The QR-size test now uses AEAT's test NIF; the request references stay. The past commits still hold them: the owner chose not to rewrite the history of the public repository (tags, Releases and clones would all change). The shop's public street address stays as the first-run default, and the tracker no longer claims it is never in the source. Marked fixed in
docs/reviews/2026-10-19-pre-12.0/. - [x] Refused invoices: the red count leaves out pre-Verifactu tickets and opens the list (Germán 19-10-2026, on a copy of the shop's DB):
- Why the count was misleading: it showed 33 refused invoices. 27 were tickets paid in 2020 / 2022 that the start-up recovery sent in May 2026, before the recovery floor date existed. AEAT refuses any invoice dated in an earlier year, so they can never be resent and kept the warning up forever. The count also gave no ticket numbers to look for in Recogida.
- The floor date:
refusedInvoiceCount/ the newrefusedInvoices(sql_lite) now take the recovery floor date (verifactu.pending_recovery_floor_date, Configuración → Solo tickets desde, default 01-09-2026) and compare it with the payment date, the invoice date AEAT judges. The start-up pending check compares it with the reception date. - The list: the status-bar text is a link that opens Facturas rechazadas (
RefusedInvoicesDialog): ticket (marked when it is a rectificativa), payment date, amount and AEAT's reason. Abrir en Recogida (or a double click) opens Recogida on that ticket with its refused row selected (RecogPrendas::showTicket). The list and the count refresh when that Recogida closes. - The rows are untouched: they stay
ERRORand can still be resent from Recogida. - Tests: e2e
test_mainWindow_refusedInvoicesStayInView(floor, link, list, Recogida on the ticket) and the floor intest_refusedRectificativaRedoneUnderItsNumber. - [x] Comprobar tras actualizar: the shop user's post-update self-check (tracker item, design chosen by Germán 19-10-2026):
- Why: the manual smoke test needed someone to copy the newest backup and the settings, edit JSON by hand and compare each result with a table.
- How it runs: the installer now adds Start → La Ideal - Comprobar tras actualizar, which starts
laideal.exe --self-check.SelfCheckDialogruns instead of MainWindow and works in a temporary folder:- It copies the newest
backups/laideal_*.dband a settings copy (SelfCheck::testSettings: the database copy, the direct client in pre-production, no gateway key, backups off). - It runs M1 (
checkSchema) and M2 (checkData). - It asks M2b: the last closed quarter's figures recomputed without closing anything, against the filed PDF, which it can open.
- It asks M3 after printing the recibo and the factura of the newest invoice AEAT holds. The QR is drawn from the stored verification URL.
- It asks M5: the installer pages.
- It writes
comprobacion_laideal_<version>_<date>.txtto the Desktop, with statuses and reasons but no shop data, and deletes the copies.
- It copies the newest
- M1 in detail: the migrations run on the copy while warnings are captured; any "failed" statement fails the check. It also checks
integrity_check, the column count, thataccounting_closuresexists, and that the next number is the highest + 1. - Safety: the live DB and
~/.laideal_settings.jsonare only read. The Verifactu client is never started, so nothing can reach AEAT or the gateway. - Compliance review:
- The factura is reprinted only if every paid row of the invoice is
ENVIADAin the copy and the live DB, opened read-only, still holds it as sent. The backup can be a day old. - The QR is drawn at the size the direct client uses.
- The question says the papers are test prints.
- The certificate password is stripped from the settings copy.
- Copies left behind by a crashed run are deleted at the next start.
- The factura is reprinted only if every paid row of the invoice is
- Delivery: chosen over a PyInstaller script driving the UI (large, fragile at the shop, antivirus flags) and a PowerShell script. It needs nothing installed and is testable in ctest.
- Docs:
smoke_test.mdis now part 1 (M4 look and M6 AEAT pre-production, before the release) and part 2 (the self-check)./releasestep 1, README, CONTRIBUTING and the testing overview follow. - Key files:
src/app/selfcheck.{h,cpp},src/app/selfcheckdialog.{h,cpp},src/app/main.cpp,releases/laideal.iss. - Tests: new
test_selfcheck, including a whole run that leaves the live files byte for byte unchanged. - For the 12.0 release notes: "New: 'La Ideal - Comprobar tras actualizar' in the Start menu checks the new version with your data and printer, on a copy, and saves a report to send." / "Nuevo: 'La Ideal - Comprobar tras actualizar' en el menú Inicio comprueba la nueva versión con sus datos y su impresora, sobre una copia, y guarda un informe para enviarlo."
- [x] Decimals shown with the comma in every window and on the printed tickets, whatever the language (Germán 18-10-2026):
- Before: three formats were in use. Reports, Listado and some messages were always Spanish. The Recogida importe column followed the Windows locale. The ticket table, the Recogida / Añadir prendas fields, the Cobrar, Anular, Envíos pendientes and Rectificar windows and the printed recibo and factura used the stored dot.
app.languagechanges none of it. - The helpers: every display now goes through
displayMoney()/displayDecimal()(sql_lite, next to the storage formatmoneyText). They give two decimals with the comma and no thousands separator, so "1.234" is never ambiguous in a field. The reports keepformatEuro("1.234,56 €"). - Tables:
NumberFormatDelegateno longer reads the view's locale, and an empty cell stays empty. The newDecimalCommaDelegateshows the size columns of Recogida and Listado de ingresos. - Printed ticket:
TicketRendererprints the comma and computes base / IVA from numbers, not from the printed text. - Rectificar factura amount: a
UiKit::AmountSpinBox, which shows the comma and takes "," or "." as the decimal key, so the numeric keypad works either way. - Reading values back:
- PayDialog keeps each amount as data instead of parsing its text.
- The size writer stores a comma-typed size with the dot.
- Recogida no longer rewrites a typed comma in the size field to a dot.
- Unchanged: the database, the maths and the AEAT XML keep the dot.
- Coding guidelines: new rule in
/coding-guidelines. - Tests:
test_sql_litetest_displayMoney_andDisplayDecimal,test_uikittest_amountSpinBox_commaShownEitherKeyTyped,test_textcolordelegatetest_decimalDelegates_showTheComma. The e2e, escpos and ticket-preview expectations now read "7,00" / "100,00" / "42,20". - For the 12.0 release notes: "Amounts are shown with a decimal comma everywhere, also on printed receipts and invoices." / "Los importes se muestran con coma decimal en todas las ventanas y también en los recibos y facturas impresos."
- [x] Main window menu bar reorganised by kind of work (tracker item, layout chosen by Germán 18-10-2026):
- Why: Herramientas mixed daily work, invoice corrections, accounting and maintenance. Archivo was built in two places, with Configuración and the log inserted by position (
actions().at(1)), which was fragile. - The new layout:
- Archivo: Configuración…, Hacer copia de seguridad ahora…, Cerrar.
- Tickets: Recogida, Añadir nuevas prendas, Imprimir ▸.
- Facturas: Anular, Rectificar, Exportar registros AEAT.
- Contabilidad: Añadir factura de gastos, Generar, Revertir contabilidad….
- Ver: unchanged.
- Ayuda: updates, release notes, Log de depuración…, Acerca de Verifactu.
- Built in one place: every menu is built in
buildUi().actionConfiguracionis created there and connected once the database is migrated. - Shortcuts: all kept, except Revertir contabilidad, which lost Alt+Shift+R and gained "…", so a closed quarter is never reopened by one key press. Anular and Rectificar got Alt+A / Alt+T. The three quick buttons stay.
- "..." used one way everywhere (Germán's follow-up): it marks an entry that opens a window to fill in or choose from before anything happens.
- Gained it: Recogida, Añadir nuevas prendas, the three Imprimir entries, Añadir factura de gastos, Generar contabilidad.
- Lost it: Hacer copia de seguridad ahora, Buscar actualizaciones, Notas de la versión, Log de depuración and Acerca de Verifactu, which act at once or only show something.
- Messages naming a menu path follow it: "Ayuda → Log de depuración", and "Contabilidad → Añadir factura de gastos" in Listado. Three messages said "Ayuda → Mostrar log", an entry that never existed.
- Tests: the e2e checks the whole layout and the shortcuts. The
tests/uiscripts open the new menus. - For the 12.0 release notes: "The menu bar is organised by task: Tickets, Facturas and Contabilidad replace Herramientas; the backup is in Archivo and the log in Ayuda. 'Revertir contabilidad' no longer has a shortcut; 'Anular factura' and 'Rectificar factura' have Alt+A and Alt+T." / "La barra de menús se organiza por tareas: Tickets, Facturas y Contabilidad sustituyen a Herramientas; la copia de seguridad está en Archivo y el log en Ayuda. 'Revertir contabilidad' ya no tiene atajo de teclado; 'Anular factura' y 'Rectificar factura' tienen Alt+A y Alt+T."
- [x] Dead-code sweep; the legacy Archivo utilities removed (tracker item, Germán 18-10-2026):
- Limpiar base de datos (Alt+L) is gone. It replaced the decimal comma in
gastos.importe,ingresos.importe/sizeand theprendasprices, andMainWindow::repopulatePrendasalso ran it silently after every Listado edit. Itsingresosbranch rewroteimporteon any row, sent invoices included, which is an edit path on invoice records. - What replaces it:
NumberFormatDelegate::setModelDatastores a Listado edit with a dot (storedNumber).migrateDatabasereplaces a leftover comma at start ingastosandprendas. It skips a gasto of a closed quarter, whose report was filed without it, and a value such as "1.234,50", and never touchesingresos.- Its two messages now say where to correct an amount: Contabilidad's comma-decimal warning and
readGarmentPrice's.
- Crear hash en ingresos is gone too. It filled empty hashes and gave a new hash to rows sharing one across the whole table, invoices included.
genHash16has used a UUID for years and every INSERT sets a hash. A read-only check of the shop DB found no empty hash and no comma decimal left. It did find 33 groups (67 rows) of one ticket sharing a hash, all paid tickets from 2021-2023 never sent to AEAT. Every write keyed by(n_recibo, hash)hit both rows of such a group. - What replaces it: a
migrateDatabasestep that runs before the start-up rounding, which also writes by that key:- Every row of such a group but one gets a new hash; the row kept is one with a CSV when the group has one.
- An empty hash is filled the same way.
- A further row AEAT holds (a CSV) is only logged.
- Each change is logged with the old and new value.
- The same hash on two different tickets is no conflict and is left alone.
- The compliance review asked for the order, the empty hashes, the log and the keeper.
dead-code-findersweep: one dead method,VerifactuInvoice::getTotalTaxAmount()(its field still feeds the JSON), removed. Seven methods used only by tests are deliberate seams and were kept:AeatQr::moduleCount,AeatCertificate::isLoaded,AeatDirectBackend::chainReady,AeatSelfTest::invoiceNumber,AddGarment::loadTicket,Imprimir::ticketBytes,ReportHtml::lastReportHtml.- Key files:
src/app/mainwindow.{h,cpp},src/sql_lite/sql_lite.{h,cpp},src/tableview/numberformatdelegate.{h,cpp}. - Tests:
test_sql_litetest_migrateDatabase_givesDuplicateAndEmptyHashesANewOne/..._replacesTheDecimalCommaOutsideInvoices,test_textcolordelegatetest_numberFormatDelegate_storesADot. - [x] Cobrar warns on screen when its quarter was closed during the AEAT round trip (tracker item, from the compliance review of the
accounting_closureschange): Cobrar checks the quarter just before calling AEAT, and since that change a payment AEAT may already hold is stored even if Contabilidad closes the quarter while AEAT answers - but only a log line said so, and the filed report then missed that income.PayDialog::paidIntoClosedQuarter()now flags it and Recogida shows "Ticket N cobrado" with a warning naming the quarter, saying its report misses the payment and to revert and generate it again (result panel, no pop-up). Also dropped "bloqueado" from the unstored-garments message: since the change only a garment paid meanwhile can be left unstored. e2etest_recogida_paymentIntoAQuarterClosedDuringTheSubmitIsShown. - [x] Accounting lock moved from the per-row
edit_lockflag to anaccounting_closurestable (Germán 18-10-2026, after the cancellation-only quarter fix): - Why: the lock belongs to a period but lived on every row. A quarter's state was worked out from the rows dated in it, so a quarter without rows could not be closed; that is what forced the special case for a quarter holding only a cancellation. Closing also ran an
UPDATEover every invoice row of the quarter. Every writer had to set the flag by hand. The TEXT'0'/'1'comparison had already caused the 11.0 bug. - The table (
migrateDatabase→migrateAccountingClosures,src/sql_lite/sql_lite.cpp):- Columns:
year,quarter,closed_at,reopened_at,origin,report_file. - A partial unique index allows one open closure per quarter.
- It is append-only: triggers refuse a
DELETEand everyUPDATEother than settingreopened_atonce. Revertir keeps the closure, so the table is the close / reopen history. - The first time, one transaction carries over every quarter any row's flag had closed (
origin = 'migration'). After thatedit_lockis never read or written, so stale flags cannot close a reopened quarter again. On failure the migration rolls back, logs a critical line and retries at the next start.
- Columns:
- Row lock: a row is locked when its date is in a closed quarter:
fecha_pagofor ingresos,fechafor gastos. This iskUnlockedWhere/closedQuarterSqlin SQL, andquarterIsClosedin Recogida (rowClickedLocked). Listado and GenListado gastos useclosedQuarterKeys. Listado re-reads the closed quarters before a delete, a double click or an edit (rowLockedNow, with the validator now given the row's index), so a quarter closed while the listing is open is honoured. - Contabilidad: the flow and Comprobar bloqueo now read the closure:
- "bloqueado (contabilidad realizada el …)" or "no está bloqueado (contabilidad revertida el …)".
- The report's file name is stored with the close.
- A cancellation-only quarter is closed like any other, so
quarterHasOnlyRegularizations,combinedLockState,readLockForQuarterandupdateLockForMonthare gone. - An empty quarter is still refused (
quarterHasMovements).
- PayDialog:
- The
edit_lockskip and the race guard went: the quarter check just before the AEAT call reads the live table. - A payment AEAT may already have registered is now stored even if the quarter was closed during the round trip, and logged as critical for review. Before, it was left unstored.
- The
- Schema: the
edit_lockcolumn stays in the schema (hidden), so the column indices do not move.- The shop's
ingresos.edit_lockturned out to beNOT NULLwithout a default; the compliance review flagged this andPRAGMA table_infoon the shop DB confirmed it. EveryingresosINSERT therefore still writes'0'. TestSchemaand the UI seed now declare the column the same way, so a missing value fails in the tests instead of at the shop. The test schema's oldDEFAULT '0'had hidden this.
- The shop's
- Fails closed:
quarterIsClosedtreats an unreadableaccounting_closuresas closed, like the SQL guards. Before, a failed lock query let writes through. - Tests:
test_sql_lite,test_contabilidad,test_e2e_appandtest_e2e_verifactuwere ported tocloseQuarter, and new cases cover the migration, the history, the triggers and the row lock.TestSchema::resetClosuresdrops and recreates the table between cases, because the triggers refuseDELETE. - [x] README §Build covers every build folder (Germán 18-10-2026): a table of the four CMake trees (
build/Release + tests,build-debug/VSCode,build-uitest/the UI-test app and tools,build-release/the installer viarelease.ps1), the toolchainPATHline once, then Release build, Debug in VSCode, and a new UI-test build subsection (configure with-DLAIDEAL_UI_TEST=ON, build the three targets, create the.venv). §Tests anddocs/testing/ui_smoke.md(Running it locally) now point there instead of repeating the commands. - [x] Contabilidad: a quarter whose only movement is a cancellation gets its report (tracker item, found by the UI smoke test): a quarter's lock state comes from the payments and gastos dated in it, so a quarter holding only the cancellation of an earlier quarter's invoice read as "no data" and Generar contabilidad wrote nothing - its "Anulaciones / rectificaciones del periodo" (the -12.10 of smoke step D2) was never reported. New
Contabilidad::quarterHasOnlyRegularizations(no payments nor gastos, andregularizationsBetweenDatesnon-empty for the quarter, the same rows the report subtracts) makesonGenerateClickedwrite the report and say there is nothing of the quarter's own to lock (the cancelled row is locked with its payment quarter; Revertir on it still answers that there are no records to revert), and Comprobar bloqueo says the same. Rectifications needed nothing: the rectifying ticket is a payment of the quarter. Covered bytest_e2e_app::test_contabilidad_quarterWithOnlyACancellation(fails without the fix with the old "No hay registros" warning); UI smoke step D2 lost its precondition on block B and runs alone too. - [x] CONTRIBUTING.md (Germán 17-10-2026): the root README's Development workflow and Release procedure moved, unchanged, into a new root
CONTRIBUTING.md(the file GitHub links from pull requests), headed by the rules for every change: branch, test (README §Tests), the Verifactu compliance review, docs, commit style; the release-ready list now also asks for greenctest+ UI smoke and the manual smoke test. The README (271 → 154 lines) points to it;/release,/update-docs,ai_agent_instructions.mdandINDEX.mdfollow. No CODE_OF_CONDUCT / CONTRIBUTORS / templates: one maintainer, no outside contributors. - [x] Manual smoke test cut down to what needs a person; test commands in the README (Germán 17-10-2026): with blocks A-E automated,
docs/testing/smoke_test.mdis now a 15-minute checklist (M1-M6: the shop's real schema and data, the physical printer, how screens / PDFs / installer pages look, the AEAT pre-production script when the direct client changed), run afterui-smoke.ymlon a backup copy with its own--settingsand sending no invoice; the seeded tickets are described inui_smoke.md. The root README §Tests is a table of the four suites (ctest, UI smoke in CI and locally, the AEAT pre-production run with or without--dry-run, the manual pass) with the command, options and the doc holding the steps. The pre-production settings file now lives outside the repo at%USERPROFILE%/work/tintoreria/documents/prueba-aeat-settings.json. - [x] Automated UI smoke test, phases 1-3 (tracker item, Germán 17-10-2026; decisions: a test-only build flag for the fake AEAT, the pre-production run local): smoke test blocks A-E now run by themselves on the installed app. Fake AEAT in the installed app: CMake option
LAIDEAL_UI_TEST(OFF by default) compiles a--fake-aeat http://127.0.0.1:<port>switch intomain.cpp(anything else refused; also no PDF viewer, and a title marker);tests/tools/fake_aeat_serverruns the e2e suites'FakeAeatServeras a process. Because such a build could mark invoices sent without AEAT, the release job refuses an exe holding the UTF-16--fake-aeatmarker,ui-smoke.ymlasserts its own build holds it (the guard cannot go blind),release.ps1configures it OFF, and no UI-test exe is uploaded; the compliance auditor reviewed it. The blocks (tests/ui/block_a.py…block_e.pyon shared operator flows inactions.py, run bysmoke.py): A start-up, migrations, the recovery dialog and the log's AEAT URLs; B the recovery dialog's buttons, Recogida (search, Añadir prendas, Cobrar accepted by the fake AEAT, Anular prendas), the refusals, columns, listados, Anular factura / Rectificar; C printing; D Contabilidad Q3 / Q4 / Anual from the PDFs' text, the lock box rules, Bloquear Q3 then the refused edit and expense, Revertir; E backup, Configuración, the live English / Spanish switch, the installer's language. Each step leaves a screenshot, a failed one every window's control tree; the report goes to the job summary. Printing (P2): a Generic / Text Only queue on a RAW TCP port to a local listener that keeps one file per job (a FILE: port overwrites its file and would lose the second copy), decoded bytests/tools/escpos_previewwith the ESC/POS reader moved fromtest_ticket_previewintotests/support/escpospreview.h; the QR is read with OpenCV. P3:tests/ui/aeat_preproduction.pyruns thelaideal-prueba-aeatkit's flows against AEAT pre-production with the issuer's certificate (paid ticket, two payments, cancellation, R5 rectifications by differences and substitution, export), on a synthetic DB, with a safety stop unless the app is in PRUEBAS and every AEAT URL is prewww1; local only (the certificate cannot be a CI secret of a public repo), with a--dry-runagainst the fake AEAT that CI runs every time. Ticket numbers are 8 digits (9DDDhhmm) because Recogida reads a 9-digit search as a phone number. What UIA showed about Qt (recorded indocs/testing/ui_smoke.md): dialogs are nested windows, so lookups are scoped; cell widgets and checkable cells are invisible / without a toggle pattern, so they are clicked in place and checked through the DB; hidden columns keep zero-width headers; dates type only section by section. Found: a quarter whose only movement is the cancellation of an earlier quarter's invoice gets no Contabilidad report (filed in the tracker; D2 relies on block B's payment meanwhile). Whole run about 3-4 minutes locally (26 steps)./releasestep 1 now runsui-smoke.ymlbefore the manual pass, which keeps only the real printer, the shop schema and the look of screens and PDFs. - [x] Automated UI smoke test, phase 0 (spike) (tracker item, Germán 17-10-2026): the installed app can be driven like a person over Windows UI Automation. Qt 6.4 publishes each widget's
objectNameas its plain AutomationId, so pywinauto findspb_save,lblResult,cb_client,le_nr_ticketby the names the e2e bench already uses, and readslblResult's rich text as plain text; the only gap istable_ticket's cell-widget combos (garment, service), which UIA does not expose, so the script clicks their cell (DataItem) and types.tests/ui/seed.pybuilds a synthetic DB (thetestschema.htables; the app migrates it) and an offline settings file passed with the existing--settingsswitch (no Verifactu credentials, no printing, update check, backup or recovery dialog), so no shop data and no AEAT call;tests/ui/laideal_ui.pyholds the launch/find/read/screenshot helpers andtests/ui/smoke_p0.pysaves one unpaid ticket by mouse and keyboard and checks the result panel, the stored row (SIN COBRAR, 3.50) and the form reset. New.github/workflows/ui-smoke.yml(workflow_dispatch+ pushes touchingtests/ui/) builds, packages withwindeployqt+ Inno Setup as the release job does, installs with/VERYSILENT /LANG=spanish, runs the script with the build's Qt offPATH(so the deployed DLLs are what loads) and keeps screenshots, control tree, logs and DB as theui-smokeartifact. Passed locally against the Release build; not part ofctest(it needs a desktop session and takes the mouse). Docs:docs/testing/ui_smoke.md. - [x] A first sync reads every month (tracker "remaining limits" 1, Germán 17-10-2026): AEAT's query searches by the invoice's month, and the sync stopped going back at the first months with records. The chain's newest record can carry an older date (Reintentar of an old invoice, a back-dated rectificativa). After a restore of a backup older than that record, the next record therefore chained to an older one, and the chain at AEAT forked. A first sync now reads all 24 months and takes the newest record by generation time. It runs on the first start, a restored database or a new PC, which the chain marker detects. A daily start, whose marker matches, still reads only this month and the previous one, so it is not slowed down. The other half of the restore question, cancellations (AEAT's query returns registrations only), stays with the AEAT questions. The fake AEAT server can now answer by month (
FakeAeatServer::setQueryByMonth). From the compliance review of the change: on a first sync, a record of ours that AEAT returns without its huella now fails the sync instead of being skipped, because over 24 months it could be the chain's newest. A first sync that fails partway through adopts nothing and starts over. Teststest_firstSyncReadsEveryMonth(24 queries, the right chain end, then 2 queries on the next start),test_firstSyncFailsOnARecordWithoutItsHuella,test_firstSyncFailingMidWalkAdoptsNothing(FakeAeatServer::queryWithoutHashFor), mutation-checked. - [x] Numbering only from the real AEAT; gateway numbers count; no self-test beside the shop in pre-production (tracker "remaining limits" 2-5, Germán 16-10-2026): AEAT pre-production holds test numbers far above the shop's for the issuer's NIF (90000001-90000004 from the 12-10 run, plus many gateway test tickets). The next ticket number therefore now uses AEAT's highest only when the direct client works in production (
VerifactuIntegration::highestNumberAtAeat). In pre-production it always follows the database, and no restore warning shows. In production, the issuer's highest number counts from any system, the gateway's included. The chain still continues only our own records. This way a restore across the 12.0 switch never reissues a number the gateway registered after the backup. The self-test button is disabled while the shop's own direct client is in pre-production (the tickets are the test, and both would send the same outbox). Switching back to the gateway with direct records still pending was already refused (test_leavingDirectRefusedWithPendingRecords). The gateway-only case of a rectificativa accepted after its dialog closed is accepted as a gateway limit, since 12.0 replaces the gateway and Recogida's "Consultar en AEAT" shows the real state. Teststest_mainWindow_preProductionNumbersFollowTheDatabase,test_selfTestOffWhileTheShopIsInPreProduction,test_highestNumberAtAeat(the gateway's 9000 counts). The restore-numbering tests now run in production against the fake server. Mutation-checked. - [x] No invoice without Verifactu (tracker decision, Germán 16-10-2026; compliance auditor note 13 of the 12.0 review): up to 11.2, a paid ticket was saved and printed with no Verifactu record when the issuer's NIF, name or service key was missing. That was documented as intended, and the auditor only ever reviewed diffs, so it was never flagged. With 12.0's own declaración responsable (e: "solo VERI*FACTU: Sí") it would contradict what the producer signs. The gate now has two levels.
VerifactuIntegration::numberingBlockedReason(first chain check running or failed) refuses every save.invoicingBlockedReason(that, or!isConfigured(), with what is missing) refuses a paid ticket save, Cobrar, Rectificar and a paid garment in Añadir prendas, while unpaid tickets and garments are still saved. Añadir prendas is now checked when a paid garment is saved (AddGarment::invoicingBlocked), not when the window opens. That also closes the tracked limit of a window left open across a Configuración restart. The manual smoke test now runs on the direct client in AEAT pre-production instead of with the key removed (docs/testing/smoke_test.md,/release). New testtest_noInvoiceWhileVerifactuIsNotConfigured;test_gateOnlyWhileTheChainIsUncheckedandtest_mainWindow_noSaveWhileTheFirstCheckRunsnow save through the real Añadir window. Mutation-checked. - [x] Declaración responsable: address and place (tracker item, Germán's decision 16-10-2026): item j) reads the shop's address from the settings (
business.address,business.city, then España), so no address is written into the public repository, and item l) is "Granada, España". The date stays pending until the version is signed at/release 12.0, which is now on the release checklist. Testtest_currentSignatureFromTheSettings. - [x] One save at a time; no number refresh mid-save from the start-up sync (compliance auditor 1-3, seventh round of the 12.0 review, verdict PASS): a second click on Guardar during the save's wait for AEAT re-entered the save and stored a second ticket under the same number. Guardar is now disabled and re-entry refused while a save runs. The start-up sync's restore warning no longer refreshes the number in the middle of a save either: the form reset does it. A rectificativa whose request could not even be made is marked ERROR to redo at once, instead of staying PENDIENTE until the next start.
test_mainWindow_syncDuringASaveKeepsItsNumberextended, mutation-checked. - [x] The number holds during a save; Recogida's Añadir gated; a refused resend that cannot be prepared stops (compliance auditor 1-3, test engineer 1-2, sixth round of the 12.0 review): since every finished chain sync refreshes the number on screen, a sync ending while a paid save waited for AEAT moved it to the next number. The factura and recibo were then printed under that next number. The refresh now waits for the save, which resets the form itself (
MainWindow::m_saving). Recogida's Añadir, which opens the same window as Herramientas → Añadir nuevas prendas, is gated like Cobrar. A redo of a refused rectificativa now stops when its row cannot be read or updated (reusePlaceholderRowreturns its result) instead of sending figures the books do not hold. Teststest_mainWindow_syncDuringASaveKeepsItsNumber,test_gateOnlyWhileTheChainIsUnchecked(also pins that an ordinary start never blocks saving), mutation-checked. Note 4 (an open Añadir window across a Configuración restart) is filed with the direct client's remaining limits. - [x] Numbering safe during the first chain check too; fifth review round (compliance auditor 1-4, test engineer 1-5, guidelines auditor 1-10, dead-code finder, fifth round of the 12.0 review): the gate only refused tickets once the first chain check had failed. While that check was still running (up to two years of months asked one by one), a ticket could be saved under a number AEAT might hold. Now the gate also refuses while it runs (
AeatDirectBackend::firstSyncRunning). Every finished sync, not only the gate's retry, now refreshes the number on screen (AeatDirectBackend::chainSynced->VerifactuIntegration::chainChecked). Añadir nuevas prendas (a paid garment is invoiced) is gated too. A failedmarkRectificationResentstops the closed-quarter resend. The rectificativa helpers log failed updates. The start-up sweep moved toMainWindow::settlePendingRectifications, and the refused-resend branch toRectifyInvoiceDialog::prepareRefusedResend. Comment drift insql_lite.handverifactuintegration.hwas fixed, the schema namespaces inaeatrecord.hare file-local now, and the module and Contabilidad docs were brought up to date. New teststest_mainWindow_noSaveWhileTheFirstCheckRuns,test_mainWindow_numberRefreshedAfterAnyChainSync,test_noRedoOverAPendingRectificativa,test_storedOutcomeOnlyOnceAnswered. Extended: invalid date inopenPeriodDate, an accepted rectificativa never resent, a failed retry never reported as checked. All mutation-checked except the cosmetic "cadena comprobada" message. - [x] Rectificativa redo and start-up sweep (compliance auditor 2, 4-7, fourth round of the 12.0 review): a refused rectificativa from a quarter closed since was resent with its date and amount pinned but in whatever S/I mode the radio showed. AEAT could then hold a rectificativa by differences while the books keep an S row, and whether the original was subtracted depended on which path settled it. Now it is resent only in its filed mode. Its row goes PENDIENTE while it is sent (
markRectificationResent, nothing else changes), so the original cannot be cancelled or rectified again meanwhile. A redo is refused while the direct client still holds that rectificativa's record. At start, a PENDIENTE rectificativa whose record AEAT already answered is settled from the stored answer (AeatDirectBackend::storedOutcome) instead of being marked ERROR for a redo that would rewrite its figures. The original's subtraction date always falls in an open period (openPeriodDate: the date asked for, else today, else the next open quarter), including when today's quarter is closed. Teststest_refusedRectificativaInAClosedQuarter(extended),test_startSettlesARectificativaFromItsStoredAnswer,test_openPeriodDateAndResentRectificativa, mutation-checked. Note 10 (switching to the gateway with a pending direct rectificativa) is added to the tracked remaining limits. - [x] No ticket number until the chain is checked; number refreshed after the retry (compliance auditor 1 and 3, test engineer 1-5, fourth round of the 12.0 review): while the direct client's first chain check cannot reach AEAT, unpaid tickets were still saved, and the retried check did not move the number on screen. A restored database could then save a ticket under a number AEAT already holds, and send it later at Cobrar. Now no ticket is saved, paid or not, and no rectificativa is issued until the check succeeds (
VerifactuIntegration::invoicingBlockedReason). The retried check reportschainChecked, and the main window then takes the number after AEAT's highest. The self-test's chain rule is now one function (VerifactuIntegration::selfTestSharesShopChain). New teststest_queuedRectificativaIsLeftToTheDirectClient(a rectificativa the direct client holds stays PENDIENTE through its dialog closing and the start-up sweep),test_payDialog_noInvoicingUntilTheChainIsChecked(Cobrar and Rectificar refused),test_selfTestSharesTheShopChainOnlyInPreProduction. Recovery and the refreshed number were added totest_mainWindow_noInvoicingUntilTheChainIsChecked, and the hidden notice in production and with the gateway totest_mainWindow_showsThePreProductionEnvironment. All mutation-checked. - [x] The self-test and the shop's environment; pre-production in view (compliance auditor 8 and note 12, test engineer 4, third round of the 12.0 review): the self-test always works in pre-production. While the shop's direct client is also in pre-production, the self-test now keeps the shop's chain marker (otherwise the next start would need AEAT) and settles the shop's records it sends. While the shop is in production or on the gateway, it touches neither: before, a pre-production outcome could mark a real production ticket ENVIADA. The main window's status bar now says when the direct client registers in AEAT's test environment (
lblAeatEnvironment). Teststest_selfTestKeepsTheChainMarker,test_mainWindow_showsThePreProductionEnvironment. - [x] No invoicing until the chain is checked (compliance auditor 6, third round of the 12.0 review): when the direct client's first check cannot reach AEAT (first start of 12.0, restored database, new PC), no record can be generated, and the local numbers may already be at AEAT. A paid ticket or a Cobrar then was saved anyway and later resent under a number AEAT holds for another sale. Now both are refused with the reason (
VerifactuIntegration::invoicingBlockedReason,AeatDirectBackend::chainSyncFailed), each attempt starts a new check, and unpaid tickets are still saved. Testtest_mainWindow_noInvoicingUntilTheChainIsChecked(mutation-checked). - [x] Record states the client relies on (compliance auditor blocking 2, findings 3-5, 7 and 9, test engineer 1-2, third round of the 12.0 review):
- "pending" means pending at AEAT (
holdsPendingRecord): a refused record no longer makes a redone rectificativa or a retried cancellation look queued; - a send is marked "may reach AEAT" before it leaves and cleared only if the request never went out (
aeat_records.reached0/2/1). A send cut off by closing the app or by a new backend after Configuración counts as reached, so its duplicate answer is ours; - a rectificativa whose dialog closes without a pending record (gateway, or the direct client before its record exists) is an ERROR to redo;
- at start, any rectificativa left PENDIENTE with nothing to send it is marked ERROR (
pendingRectificationNumbers/markRectificationUnsent), so it never blocks its ticket for good; - a ticket whose cancellation is pending is not rectified;
- a refused rectificativa counted in a quarter closed since is resent only with its own amount and date, with its row untouched, and the original is marked RECTIFICADA in an open period.
Tests
test_holdsPendingRecordOnlyWhilePending,test_duplicateAfterAnInterruptedSendIsOurs,test_mainWindow_orphanedPendingRectificativaBecomesAnError,test_refusedRectificativaInAClosedQuarter, and the rectify refusal intest_cancelDirectQueuedIsPending; each guard mutation-checked. - [x] Request ids unique across backends (compliance auditor blocking 1, third round of the 12.0 review): every backend numbered its requests from
aeat-1/req-1. After Configuración re-initialised the backend, a new request could take the id a window was still waiting on, and one ticket was settled with another invoice's answer (ENVIADA, never correctable). The counters are now shared by every backend of the run. Test intest_mainWindow_reinitialisesOneBackend(mutation-checked). - [x] Late outcomes nobody else would settle (compliance auditor notes 10-12, second round of the 12.0 review):
- with the gateway, a rectificativa whose dialog closes before the answer stayed PENDIENTE where nothing resends a rectificativa. It now becomes an ERROR to redo under its number (
~RectifyInvoiceDialog); - the self-test's backend sends every pending record of the issuer and now reports those outcomes (
AeatSelfTest::recordSettled), which the main window settles like any other (MainWindow::onRecordSettled); - payment sequence numbers skip only the direct client's records of its own environment, so pre-production records under real numbers leave no gaps in production (
nextVerifactuInvoiceSeq(..., aeatEnvironment)). Teststest_rectifyGatewayClosedBeforeTheAnswer,test_selfTestReportsOtherRecordsItSettles,test_nextVerifactuInvoiceSeq; each mutation-checked. - [x] Tests from the second coverage review: the main window's next ticket number starts above our system's higher numbers at AEAT after a restore, and says so (
test_mainWindow_numbersAboveAeatAfterARestore). Our highest number at AEAT reads "7-1" as 7 and ignores the self-test's and other systems' numbers (test_highestNumberAtAeat). The R5 names the corrected invoice as its stored record has it (test_rectifyNamesTheStoredRecordsInvoice). The sql_lite helpers read the values the store really writes (test_storeValuesSeenBySqlLite). Each mutation-checked. - [x] A restored database needs AEAT before its first record (compliance auditor should-fix 4, second round of the 12.0 review): a database restored from an older backup carries its own "synced" mark. If AEAT was out of reach at that start (no certificate on a new PC, no network), the sync fell back to its stale local chain. That forked the chain and re-issued numbers AEAT already holds. The direct client now keeps the chain's last record outside the database, in the settings (
verifactu.aeat_chain_marker, written after every record and sync). A database whose chain differs, or no marker at all (new PC, first start of 12.0), must reach AEAT before any record, as on a first start. Testtest_chainMarkerOutsideTheDatabase(mutation-checked); the e2e helpermarkChainReadysets both marks. - [x] Leaving production is guarded (compliance auditor should-fix 7, second round of the 12.0 review): unticking Enviar a la AEAT real needed no confirmation. Production records still unsent would stay behind (the outbox is per environment), and the startup recovery would resend their rows to pre-production. It is now refused while production records are pending, and confirmed otherwise (default No). Test in
test_directProductionNeedsConfirmation(mutation-checked). - [x] One Verifactu backend after Configuración (compliance auditor must-fix 3, second round of the 12.0 review): Aceptar in Configuración created a new
VerifactuIntegrationwithout removing the old one. With the direct client, two backends then sent the same outbox, each with its own wait time, so AEAT'sTiempoEsperaEnviowas no longer honoured, and a duplicate could be misread as another system's. Windows opened earlier also kept using the old one. The main window now keeps one integration (its handlers connected once,connectVerifactu) and re-initialises it, andVerifactuIntegration::initializeremoves the previous backend first. Testtest_mainWindow_reinitialisesOneBackend(mutation-checked). - [x] Pending rectificativas and cancellations, end to end (compliance auditor must-fix 1 and 2, should-fix 6 and note 9, second round of the 12.0 review):
- a rectificativa is "pending, it sends itself" only when the direct client really holds its record (
AeatDirectBackend::holdsRecord). Before the first chain sync none is generated, so the row is an ERROR to redo under its number, never a PENDIENTE row nothing would send; - while a rectificativa of a ticket is PENDIENTE (
pendingRectificationOf), Rectificar and Anular factura refuse the ticket, so there is no second R5 and no cancellation the late R5 would overwrite; markTicketRectifiednever touches an invoice already ANULADA or RECTIFICADA;- a late acceptance whose date fell in a quarter closed meanwhile marks the original today;
- a cancellation the direct client stored but could not send yet says it is pending, not an error.
Tests
test_pendingRectificativaGuards,test_pendingRectificativaBlocksTheTicket,test_rectifyDirectWithoutRecordIsAnError,test_cancelDirectQueuedIsPending; each guard mutation-checked. - [x] A refused rectificativa is redone under its own number (test engineer and compliance auditor 5, second round of the 12.0 review): a refused R5 stayed a paid ERROR row, counted as income and as "refused", with no way to clear it. Recogida rightly refuses to resend it as a plain invoice, and Rectificar factura made a second R5 beside it. Following AEAT's answer (resend corrected under the same number), Rectificar factura on an original whose rectificativa was refused reuses that number and row (
refusedRectificationOf,RectifyInvoiceDialog::reusePlaceholderRow). The direct client sends it with Subsanacion / RechazoPrevio, and once accepted it is ENVIADA and leaves the refused count. Testtest_refusedRectificativaRedoneUnderItsNumber, which also checks Recogida's refusal (mutation-checked). - [x] Test: the chain sync follows AEAT's query pages (test engineer gap 12 of the 12.0 review): the fake AEAT answered every query in one page, so following
ClavePaginacionwas never exercised.FakeAeatServer::setQueryPageSizenow pages its replies, andtest_syncFollowsQueryPageschecks the chain continues after a record on the last page (fails when the pages are ignored). - [x] Tests: late outcomes settled by the main window and by Recogida (test engineer gaps 4 and 9 of the 12.0 review): with a live fake AEAT in the e2e suite (
LiveAeat,FakeAeatServeradded totest_e2e_app). A record an earlier session left unanswered goes out when the main window starts and its rows become ENVIADA (test_mainWindow_settlesAnOutcomeNobodyWaitedFor). Recogida's Cobrar over the direct connection prints at once, and Recogida settles the rows when AEAT accepts, without asking for a reprint (test_recogida_directCobrarSettledByRecogida). Both wirings mutation-checked. - [x] Tests: the R5's reference, a reply without a line, the stored event XML (test engineer gaps 6 and 7 of the 12.0 review): the rectificativa's stored record names the corrected invoice by its InvoiceID and payment date (
test_rectifyDirectQueuedWithoutAnswer). A reply with no line for a record it carried leaves that record pending (never refused or accepted without a CSV); it is answered PENDING and settles once on its own (test_replyWithoutALineForARecord, withFakeAeatServer::omitLineFor).verifactuEventRecordXmlreads the event's paid rows only (test_verifactuEventRecordXml). - [x] A duplicate is ours only if our earlier send reached AEAT (test engineer gap 3 of the 12.0 review): AEAT's duplicate answer to a resend was claimed as ours whenever the record had been sent before (
attempts > 1). If the first send never got there (no connection, TLS), the duplicate is another system's record (e.g. the gateway's), and the rows took an XML and huella AEAT never registered. The transport now says whether the request went out (requestSent:WinHttpSendRequestsucceeded) and the store keeps it (aeat_records.reached, added to older tables). Only a duplicate after a send that reached AEAT is claimed. Testtest_duplicateOfAnotherSystemAfterAFailedSend(fails with the old rule). - [x] A payment's InvoiceID is never handed out twice (compliance auditor note 12 of the 12.0 review):
nextVerifactuInvoiceSeqcounted paid rows only. A Cobrar whose garments all failed to store as paid (the lock race) left no paid row, so the next Cobrar reused<n>-<seq>, and the direct client resent the old record or answered with its result for different amounts. It now also skips numbers the direct client already holds a record for (aeat_records). Test intest_nextVerifactuInvoiceSeq. - [x] Pending direct records counted per environment (compliance auditor note 11 of the 12.0 review): leaving the direct connection is refused while it has unsent records, but
aeatPendingRecordCountcounted every environment. A pre-production self-test record left pending would block the switch back to the gateway for good, even in production. It now counts the direct client's own environment. Test intest_aeatPendingRecordCount. - [x] Tests for the direct client's QR guards and the main window's save (test engineer gaps 5 and 8 of the 12.0 review):
test_queuedRecordQrOnlyForItsPendingRecord(the early QR only from this issuer's pending record with the invoice's date and amount; none once AEAT accepted or refused it) andtest_mainWindow_directSavePrintsAtOnce(a paid ticket saved in the main window takes the print-at-once path, rows PENDIENTE, never through the gateway). The e2e suite's direct endpoint is now a local server that closes every connection at once, with a 1 s retry delay. A closed port took up to 50 s to fail on Windows and held cases behind the 60 s retry. - [x] One system name in the records and the declaración (compliance auditor 8 of the 12.0 review): the records sent
NombreSistemaInformaticoLAIDEAL while the declaración responsable's item a) said La Ideal.AeatRecord::laIdealSystemnow says La Ideal, and the declaración reads its a) from the same value. Tests intest_laIdealSystemandtest_producerDeclaration. - [x] Printed QR from a transparent image (test engineer gap 11 of the 12.0 review):
TicketRenderer::printableQrread transparent pixels as black, so a QR image with transparent light modules gave no readable grid and was printed unscaled. The image is now flattened onto white first. Test intest_printableQr(mutation-checked). - [x] Refused invoices stay in view (compliance auditor 5 of the 12.0 review): a refusal after the customer took the factura with its QR was written to a Recogida window's panel, which closes, or to the main window's panel, which the next save overwrites. The main window's status bar now keeps "N factura(s) rechazada(s) por la AEAT" (
sql_lite::refusedInvoiceCount, paid rows in ERROR) until they are resent. It refreshes at start, on every AEAT outcome and every 30 s for windows of their own. Testtest_mainWindow_refusedInvoicesStayInView(mutation-checked). - [x] Direct client: the store looks invoices up per issuer (test engineer gap 2 of the 12.0 review):
AeatStore::latestmatched the invoice number only. After the NIF changed in Configuración, the same number under the new issuer was answered with the old issuer's accepted outcome and CSV, or flagged as a resend of its refused record, or waited for a pending record of the old issuer that this backend never sends. Lookups from the backend now pass the issuer. Testtest_sameNumberUnderAnotherIssuer(mutation-checked). - [x] A database restored from an older backup (test engineer gap 1 and compliance auditor 7 of the 12.0 review; AEAT: a restored DB is the same SIF and continues the chain): a later sync whose second month failed threw away what AEAT had already answered for the first, so the chain could fork after a restore. It now keeps it. The sync also records our system's highest ticket number at AEAT (
AeatDirectBackend::highestNumberAtAeat); the next ticket and rectificativa number (sql_lite::nextTicketNumber) start above it, and the main window warns when the database is behind AEAT. Found on the way:MainWindow's pointer members had no default, and the new number read crashed the window before Verifactu was set up; they now start as nullptr. Tests:test_laterSyncKeepsWhatAeatAlreadyAnswered(mutation-checked),test_firstSyncNetworkFailureGeneratesNothing,nextTicketNumber. - [x] A production switch for the direct client (compliance auditor, must-fix 2 of the 12.0 review): production could only be set by editing
verifactu.aeat_direct_productionin the settings file, so choosing Directa con la AEAT in Configuración would have registered real sales in pre-production only. The direct section now has Enviar a la AEAT real (PRODUCCIÓN, con efectos tributarios), off by default; turning it on asks for confirmation (default No). The connection is no longer labelled "(en pruebas)". The self-test still always uses pre-production. Test:test_directProductionNeedsConfirmation(mutation-checked). Switching the shop itself is the 12.0 decision. - [x] Rectificativas and late outcomes with the direct client (compliance auditor, must-fix 1 and should-fix 4 of the 12.0 review): with the direct client a NETWORK_ERROR / PENDING answer means the record is stored and will be sent, but Rectificar factura wrote the placeholder row ERROR and re-enabled the form. A second R5 could be issued, Reintentar would resend it as a plain F2, and when AEAT later accepted it the original (substitution) kept counting as income. Now: such a rectificativa is PENDIENTE and the ticket is cleared (
RectifyInvoiceDialog::queuedWithoutAnswer). An accepted substitution settled later marks its original RECTIFICADA (applySettledVerifactuResult,rectifiedTicketOf). Recogida's Reintentar and the startup recovery never resend a rectificativa. The backend reports every definitive outcome onrecordSettled, also when a dialog waited (it may have closed); a cancellation already marked returns 2 and stays silent. Tests:test_settledRectificativa, the already-marked cancellation,recordSettledwith a waiter,test_rectifyDirectQueuedWithoutAnswer; each guard mutation-checked. - [x] Direct AEAT client: investigation done, ready for the 12.0 decision (
feature/aeat-direct-investigation): the report's phases are complete - built, run end to end against AEAT pre-production with the owner's certificate (11/12-10-2026), and adapted to AEAT's answers of 13-10-2026 (own chain per system and issuer, the factura printed at issue, refusals resent then rectified, the declaración responsable per art. 15, QR 30-40 mm). What is left needs the owner or AEAT and is in the tracker: the producer's signature data, AEAT's written answer on production, and switching the shop's connection in the 12.0 release. - [x] A refused invoice: resend, then rectify (AEAT, 13-10-2026: a refused record is resent corrected with the same number and
Subsanacion = S+RechazoPrevio = S; if the amount or date change, a rectificativa follows, because the refused record exists in the SIF): the direct client already does the first part (a resend after a refusal is a new record flaggedSubsanacion/RechazoPrevio, chained after the refused one;test_rejectionThenNewRecord). Rectificar factura answered a refused (ERROR) invoice with "no hay nada que rectificar". It now gives the path: resend it from Recogida (Verifactu… → Reintentar), then rectify it there once AEAT accepts it. Test intest_cancelAndRectify_offeredOnlyForSentInvoices. - [x] Declaración responsable per art. 15 of the Orden (AEAT, 13-10-2026: the producer signs it, even for own use): new
ProducerDeclaration(src/verifactu/producerdeclaration.*) builds the title and items a) to l) in order with their descriptions, the producer and code fromAeatRecord::laIdealSystem(so the declaración and the records name the same producer), the version, and an annex with the single-operator scope (Req. 5). Ayuda -> Acerca de Verifactu shows it and saves it as PDF (15.3); with the IreneSolutions connection it notes their own declaración (15.4). The producer's postal address and the date and place of signature (ProducerDeclaration::currentSignature) are still to be filled in by Germán: until then they read "(pendiente)" and the window warns. It named the shop as producer and missed most items. Test:test_aeat_record::test_producerDeclaration(order of the items, producer, pending and signed). - [x] Direct client: a PENDIENTE invoice is reprinted with its QR; no factura when a garment was not stored (compliance auditor, October 2026):
Imprimir::resolveQrCoderequired a CSV, so a reprint before AEAT answered had no QR although the customer's copy had one. With the direct client it now draws the queued record's QR (qrBeforeReply, the same record, date and amount) and prints the leyenda, like the copy at issue; the gateway still has none before its CSV. Combined with it: Cobrar printed the factura even when a garment could not be stored as paid (locked or paid meanwhile), so the printed garments and total disagreed with the invoice's QR.PayDialog::printPartialFacturanow prints nothing then, and Recogida's red message says so. Found on the way: the direct-client e2e tests cleared the fake-endpoint override while a backend was alive, so a queued record could have been sent to the real AEAT test environment. The e2e suite now keeps a dead local endpoint for its whole run. Tests: reprint with the direct client and the gateway, the no-print case; both mutation-checked. - [x] Printed QR 30-40 mm and the leyenda in the body font (Orden HAC/1177/2024 arts. 21.1 and 20.1.b, confirmed October 2026): the QR was scaled smoothly to 192 dots (about 24 mm, blurred modules) and the leyenda printed in Font B. New
TicketRenderer::printableQrreads the module grid back from any QR image - the gateway's pixmap or the direct client's - (bounding box, module size from the finder pattern's top band, nearest valid size 21 + 4k, sampled at module centres) and redraws it at the largest whole number of dots per module that keeps the symbol within 320 dots, plus the 4-module quiet zone; it fits the 58 mm roll. The leyenda prints in Font A on two lines. Tests: synthetic grid from a crisp and a smoothly scaled source, a real AEAT URL fromAeatQr(test_e2e_app), unreadable input, the leyenda's font. - [x] Direct client: its own chain, never IreneSolutions' (AEAT, 13-10-2026: one chain per SIF and obligado tributario; a restored DB on a new PC is the same SIF and continues it): the chain sync keeps only La Ideal's own records - the local store, and AEAT's registrations whose
SistemaInformaticois ours (MostrarSistemaInformatico = S,IdSistemaInformaticoLI + producer NIF) - and starts withPrimerRegistrowhen there are none. It runs at every start: two years back the first time (required), this month and the previous one afterwards, falling back to the local chain when AEAT cannot be reached, so a database restored from an older backup continues where AEAT is. The gateway hand-over (continueChainFromAeat,setGatewayRecordXmls,seedChain,AeatStore::seedChainHead,sql_lite::verifactuStoredRecordXmls) is gone. Found on the way and fixed with it: every record named the issuer as the producer inSistemaInformatico; nowAeatRecord::laIdealSystem(Germán Bravo López, 75929840D, LI) for the app and the self-test. Tests: other systems ignored, new DB of the same system, restored backup, own cancellation as head, fallback without AEAT, producer; the fake AEAT server returnsSistemaInformatico. Removing the system filter failstest_chainIgnoresOtherSystems. - [x] Direct AEAT client: the factura prints at once, with the QR (
feature/aeat-direct-investigation): in the pre-production runs AEAT'sTiempoEsperaEnvio(60 s) made the 3 s / 5 s wait miss the reply, so a QR-less recibo printed. The QR is now drawn from the record once it is generated and queued (VerifactuIntegration::qrBeforeReply→AeatDirectBackend::queuedRecordQr: pending, this issuer, same date and amount), printed with the VERI*FACTU leyenda (Imprimir::verifactuIssued) while the rows stay PENDIENTE. Paid at reception: factura with QR for the client + recibo with IMPORTE PAGADO for the shop (was two facturas); Cobrar: one factura. A refusal after that print stays in the result panel. The self-test's cancellation settled after its dialog closed no longer shows a false "No se pudo marcar como anulada" (applySettledVerifactuCancellation→ -1 only when the database says no ticket). Reviewed by the compliance auditor (should-fix items done); tests intest_e2e_app,test_e2e_aeat_direct,test_sql_lite, each guard mutation-checked. - [x] Direct AEAT client, implemented on
feature/aeat-direct-investigation(not merged; research): the phased plan ofdocs/modules/verifactu/aeat-direct-investigation.mdbuilt up to the proof of concept.VerifactuBackendinterface with the gateway and a newAeatDirectBackendbehind it (chosen in Configuración, gateway by default); records built and hashed by the app (AeatHash,AeatRecord, official vectors and AEAT's own XSDs in a newaeat_xsdctest), chain head and outbox in two new tables (AeatStore), flow control, resend / rejection rules, local QR (vendored qrcodegen), the owner's certificate through the Windows crypto API and WinHTTP (Qt's Schannel cannot read PKCS#12 - found by the tests), the hand-over from the gateway via AEAT's chain tip (the gateway's chain does not follow the local ticket order - found in the shop DB), settings and a self-test against AEAT pre-production. 8 new ctest entries plus a fake AEAT SOAP server; key rules mutation-checked. Not run against AEAT: needs the owner's certificate.
Post-11.1 development — October 2026 (shipped in 11.2)¶
- [x] Open garments could not be voided or edited in the shop (since 11.0): Anular prendas on ticket 31163 answered "0 prenda(s) anuladas ... se han cobrado, enviado o bloqueado" for an unpaid, unlocked garment. The guard of the amount writers (
kAmountEditableWhere, and the split's own) testedCOALESCE(edit_lock, 0) = 0: the shop DB storesedit_lockas TEXT'0', andCOALESCEdrops the column's affinity, so SQLite compared text with the integer 0 and nothing matched. Every write behind it was refused: voiding a garment, the m2 size / price, quantity and service edits, the split, and the start-up rounding of three-decimal amounts. Now one shared guard,kUnlockedWhere=COALESCE(edit_lock, 0) IN (0, '0'): only an explicit 0 is unlocked, and a blank or odd value stays locked. On a copy of the shop DB the garment is voidable and all 15,057 locked rows stay protected. The first 11.2 start rounds the 2 open three-decimal rows (24602, 31267), which no invoice covers. Release review: Verifactu auditor PASS. The test schema declarededit_lock INTEGER, so the suite could not see it; it is now TEXT as in the shop (with the old guard,sql_liteande2e_appfail). Files:src/sql_lite/sql_lite.cpp,tests/support/testschema.h. - [x] Next ticket number from a numeric maximum (found while sweeping for the same TEXT-column pitfall):
readMaxValueInColumnFromTableranMAX(n_recibo)on a TEXT column, which is alphabetical. It was right only because every number has 5 digits. Past 99999, or with any shorter number such as "9999", the next ticket would repeat an invoice number. NowMAX(CAST(... AS INTEGER)); the Envíos pendientes list is ordered numerically too. Test intest_sql_lite(fails with the old query). Swept the rest: comparisons on the column itself (edit_lock = 0),MAX(edit_lock)read withtoInt(),toBool()of "0" andSUM(importe)are type-safe.
Post-11.0 development — October 2026 (shipped in 11.1)¶
- [x] Imprimir printed twice on Enter (reported by the shop on 11.0): Herramientas → Imprimir recibo / factura ran the whole print again for the same ticket when the number was confirmed with Enter. The redesign connected the field's
returnPressedto the print and made Imprimir the dialog's default button;QLineEditemitsreturnPressedand leaves the key to the dialog, which pressed the default button as well. The same pattern hit the other ticket fields: in Añadir prendas Enter searched and then pressed Añadir prenda (the search had just cleared the garment, so it only showed "Formulario incompleto" over the search result), in Anular prendas it also pressed Anular seleccionadas, and Anular / Rectificar factura searched twice. NewUiKit::onEnter(lineEdit, action)runs the action and consumes the key; the five fields use it. Test:test_enterInNumberFieldRunsOneAction(fails for each dialog with the old wiring, and when the key is not consumed). From the 11.1 release review: the action runs once per press (an auto-repeated Enter does nothing) and only for acceptable input, the numeric keypad's Enter counts, and in Anular / Rectificar factura no button takes Enter any more (setAutoDefault(false)), so Enter in another field neither resets the form through Buscar nor sends the rectificativa (test_enterInCancelAndRectifyDialogs). Each fails its test when removed. - [x] One Enter rule for every dialog (from the same review, done in 11.1 instead of filed):
UiKit::setUpDialoginstalls a dialog-wide filter - Enter in a field presses the enabled primary button (primaryButtonmarks it), or nothing when the dialog has none; a focused button still presses itself; a held key never repeats. Before, Qt pressed whichever button it had made the default, e.g. the first row's Reintentar in Envíos pendientes or Buscar in Anular / Rectificar factura. Those two dialogs now usesetUpDialog, so their per-buttonsetAutoDefault(false)lines went. Test: newtest_uikitsuite (each rule fails it when removed), plustest_enterInCancelAndRectifyDialogs.
Post-10.13 development — October 2026 (shipped in 11.0)¶
- [x] Open non-blocking issues closed before 11.0 (the five audit notes and the start-up repairs' cost):
voidGarmentRowre-checks in SQL that the garment is open (kAmountEditableWhere) and that one row changed, and Anular prendas reports any it could not void; Cobrar stores a garment as paid after AEAT's reply only if it is still unlocked and unpaid, logs and counts the others (PayDialog::unstoredGarments) and Recogida shows them in red instead of "cobrado"; the split relink migration logs every row it relinks, since an old separate payment (Verifactu off, before 8.5) could match it - no rule tells the two apart, and the four shop tickets it relinks were checked by hand on a copy of the DB; Contabilidad never locks a quarter whose PDF was not written, andReportHtml::writePdfremoves the previous file first and accepts only a non-empty file written now (a stale PDF used to count as success); a gastos row locked by Contabilidad is read-only in Listado (proxyflags) and cannot be deleted; the start-up data repairs stay at every launch but are cheap: the split relink, nearly all of their time, is one self-join with a temporary index instead of three correlated subqueries per candidate (~50 ms instead of ~0.75 s on a copy of the shop DB, same four rows). A run-once flag (PRAGMA user_version) was tried and dropped after the compliance re-check: an older version opening the DB after the upgrade (rollback, an old exe) writes the old split shape again, and a flag would never repair it. Tests:test_voidGarmentRow_setsAnuladoAndScopesByHash, the relink log intest_migrateDatabase_relinksSplitOffPaidGarment,test_payDialog_reportsAGarmentLockedDuringTheSubmit,test_contabilidad_unwrittenReportDoesNotLock,test_listado_buttonsAndMessagesInWindow; each fix fails its test when removed. Then, at the shop owner's request, the gap this work found: in Listado de gastos an open row's date could be typed into a closed quarter, adding to its filed gastos.MySortFilterProxyModelnow runs aneditValidatorbefore writing (signaleditRefused), and Listado refuses afechain a closed quarter or not in dd-mm-aaaa. For that checkreadLockForQuarterleaves an already open connection open - closing it under the liveQSqlTableModelbroke the table (the mutation that restores the close fails the test). Test:test_listado_gastosDateNeverMovesIntoAClosedQuarter. - [x] Release 11.0 review and compliance gate:
/code-review mediumon PR #56 - Recogida reports refused writes (a Separar on a locked row, a negative price) instead of a success; Cobrar stores the same cent amount it sends to AEAT; the split checks its transaction and re-checks the row; a negativeimporteis refused by every amount writer; Añadir prendas and Recogida use the sharedgarmentUnmeasured. Theverifactu-compliance-auditorrun on10.13..developthen found two more, fixed before the merge: the redesigned Imprimir window stays open, and kept the first QR it fetched, so the next factura printed from it (another ticket, or the next partial-payment invoice) carried that QR - it now drops it at every print (test_imprimirDialog_qrNotReusedForTheNextTicket); and a ticket save that failed half-way left the first garments stored, which a second Guardar would duplicate under the same number and the start-up recovery would send to AEAT for part of the ticket -saveTicketnow inserts all rows in one transaction (sql_lite::insertGarmentRows,test_mainWindow_failedInsertStopsTheSavewith the second insert refused). Each guard fails its test when removed; the auditor's non-blocking notes are in the tracker. - [x] Main window redesigned with UiKit (the last window;
mainwindow.uiremoved - no window uses a.uiform any more): heading with the shop name and quick buttons (Recogida de prendas, Añadir prendas, Factura de gastos), explanation, Cliente and Ticket groups, the Prendas table with Añadir fila and a read-only total, Limpiar / Guardar ticket, result panel. The 25 menu actions are built in code with their former names, texts and shortcuts. Pagado is a checkbox with a SÍ / NO label instead of the red / green button. Every message box of the window (validation, client-name note, Verifactu at start-up, failed backup, the Archivo / Herramientas / Ayuda tools) became result-panel text; the log action links the file. Fixed on the way: picking a garment before its quantity raised a "Cantidad vacía" box - it now counts 1; prices were recalculated on the table's current row instead of the edited one; an unmeasured m2 garment was priced as one m2 (and only names starting with "Alfombra" could be saved at 0) - it is 0,00 until measured and any "m2" garment can be saved like that; the total could be typed by hand; saving checked one month's lock instead of the quarter (quarterIsClosed). The save result says what was printed. Test:test_mainWindow_entryFlowAndMessages(and the two MainWindow scenarios read the panel). From theverifactu-compliance-auditorrun on it: a ticket marked paid with an unmeasured m2 garment is refused (it would have reached AEAT at 0, frozen), and Cobrar refuses such a garment too (test_payDialog_refusesUnmeasuredM2Garment); one shared rulesql_lite::garmentUnmeasuredreplaces the two that differed (MainWindow, Recogida re-pricing, Cobrar); slots without a garment are no longer stored; the amount sent to AEAT is the sum of the stored rows; negative typed prices are refused. Each guard fails its test when removed. - [x] Formulario facturas: suppliers and services in alphabetical order: both combo boxes were filled in table order; they now go through the new
UiKit::sortedNames(Spanish collation, case-insensitive, accented names in place). Covered intest_facturas_saveAndRefusals. - [x] Recogida: labels of a voided garment: "Anulada" is green (as the table shows cancelled rows), and a locally voided garment no longer shows a red NO / En tienda nor a pickup date - it was never paid nor collected. The payment / pickup labels are now set for every selected row (a checkbox only signals a change, so a row could inherit the previous row's labels), and an empty pickup date shows today instead of the previous row's date. Covered in
test_recogida_voidGarmentsFromTheWindow. - [x] Recogida: Añadir prendas button; Herramientas grouped by function (requested by the shop): Recogida's Ticket group has Añadir prendas…, opening the Añadir nuevas prendas window on the selected ticket (
AddGarment::loadTicket); a garment added as paid is sent to AEAT from Recogida (retryVerifactuSubmit(ticket, 0)), and on close Recogida refreshes and reports how many were added (AddGarment::garmentSaved). The menu entry stays. Herramientas now reads Recogida (Recogida de prendas, Añadir nuevas prendas, Imprimir) · Verifactu (Anular / Rectificar factura, Exportar registros AEAT) · Gastos (Formulario facturas) · Contabilidad (Generar / Revertir) · copia de seguridad. Also: the table refresh that follows an AEAT reply no longer overwrites Recogida's last message. Test:test_recogida_addGarmentFromTheWindow. - [x] Recogida: Anulación date and Anular prendas button (requested by the shop): the Estado y fechas group shows the read-only Anulación date under Recogida (with a red "Anulada"), and an empty payment or anulación date now reads "-" instead of today. The Ticket group has Anular prendas…, which opens the void dialog with the selected ticket loaded (
VoidGarmentsDialog::loadTicket) and reports the result in Recogida; the Herramientas → Anular prendas menu entry was removed.VoidGarmentsDialogmoved fromsrc/app/tosrc/recog_prendas/(Recogida's library cannot reach the app's) and took the UiKit style; its destructive-action confirmation stays a question. Test:test_recogida_voidGarmentsFromTheWindow. - [x] Recogida de prendas redesigned with UiKit (requested after the shop approved the new style): built in code,
recog_prendas.uiremoved. Heading and explanation, a Búsqueda group, the table taking the spare height, then Prenda seleccionada / Estado y fechas / Ticket groups and a result panel. The red / green Pagado and Estado buttons became a read-only Pagada checkbox and the Recogida checkbox, each with a coloured label; Pagar todo is the bold Cobrar…; the Separar prendas input box became a count field beside the button; the ten message boxes (search, nothing to charge, unpaid reprint, split, AEAT query, CSV adopted) are written in the result panel, while AEAT replies stay in the status bar. The Verifactu details and AEAT comparison windows take the same style. Widgets keep the former object names (slots still connect by name; the e2e bench is unchanged apart from the split count field and the adopted-CSV message).updateDbno longer reads button texts (PKU writesRecogido/En tiendaexplicitly), the unused second-copy prompt ofprintFacturawas dropped, and the quantity column header ("Cant." was set on the size column twice) is fixed. - [x] UI style standardisation (UiKit): the redesigned Generar contabilidad became the style of every window except MainWindow and Recogida de prendas (deferred, customised). Centralised: new
src/uikit/library (setUpDialog,heading,introPanel,ResultPanel, primary / secondary buttons,dateEdit,closeRow, coloured result phrases, file links) and one PDF writerReportHtml::writePdf(+ the open switch the tests use) replacing the Contabilidad / GenListado copies. Redesigned in code (the.uiforms of Facturas, Añadir nuevas prendas and Generar listado deleted; the hand-copied form code of Imprimir, Insertar elemento and Listado replaced): every outcome is shown in a result panel instead of message boxes, fonts follow the app font, one bold primary action per window, windows stay open after acting. Notable behaviour changes: Imprimir asks the full-invoice address / DNI, the partial-payment choice and the shop copy in the window; Añadir nuevas prendas uses Pagada / Recogida checkboxes and only opens its form after a successful search; Listado has action buttons and a per-table explanation; Exportar registros AEAT is its own window (AeatExportDialog) defaulting to<reports>/AEAT/; listados are always regenerated; Facturas, Añadir prendas and Cobrar check the whole quarter's lock (quarterIsClosed). Fixes found on the way: Facturas wrote through the default connection and never reported a failed insert; the test schema'sgastoscolumns were not in the shop's order;insertNewItemToTablenow reports failure. Each window has an e2e scenario that drives it by object name, reads its result panel and asserts no pop-up appears; the coding-guidelines skill now asks new windows to use UiKit. - [x] Generar / Revertir contabilidad redesigned (requested by the shop): the dialog is now built in code like Rectificar factura and
contabilidad.uiis gone. It has an explanation panel, a Periodo group (fields sized to their content), an Opciones group, Comprobar bloqueo and a bold primary Generar contabilidad / Revertir contabilidad on one row, and a result panel that replaces every pop-up. Results are coloured green / amber / red and link to the generated PDF, and the comma-decimal warning is in the panel too. Revert mode sets its own title, text and button.generateContabilidad()returns the written file and the invalid-amount count instead of showing message boxes.test_contabilidad_generateLockThenRevertnow drives the buttons by object name, reads the result panel and asserts no pop-up appears; it also covers the revert texts and "nothing to revert". - [x] Generar contabilidad: gastos subtotal, detail on demand, dialog kept open, lock check (requested by the shop): (1) the gastos table reads IVA 21 %, IVA 10 %, a new Subtotal con IVA column (21 % + 10 %), Sin IVA, Total. (2) The dialog stays open after each report or revert (window-modal over MainWindow, no minimise / help button, Generar / Cerrar buttons); only Cerrar closes it. (3) New Incluir detalle de tickets checkbox (off by default): the per-ticket annex is only added when ticked, and that version is written to its own
_detalle.pdffile (title "· Detalle"), so the short summary and the detailed report are both kept (Contabilidad::reportRelativePath). (4) New Comprobar bloqueo button: tells whether the selected quarter / month's quarter / each quarter of the year is locked, has no records, or is open (Contabilidad::lockStatusMessage).Contabilidad::lastReportHtml()is a new test seam, since the PDFs are compressed. Tests:test_gastosTable_columnsAndSubtotal,test_reportRelativePath,test_contabilidad_generateLockThenRevertextended; each fails against a build without its change. - [x] Amounts of invoiced garments frozen; amounts stored in cents: ticket 30837 (AEAT: 3 Mantel at a hand-entered 10.00 each = 30.00) was re-priced to 24 + 12 by the old Separar prendas when the customer collected in two days; the shop restored 20 + 10 by hand. Separar prendas already keeps the total (previous entry); now the
sql_liteamount writers (updateTicketSizeAndPrice,updateGarmentQtyAndImporte,updateGarmentServiceAndImporte) also refuse any row that is paid orENVIADA/ERROR/ANULADA/RECTIFICADA, so no caller can change the amount of an invoice AEAT holds - only Anular / Rectificar factura can. Ticket 30723 showed m2 garments stored with three decimals (Recogida's size edit wroteQString::number(price)): 28.405 + 22.515 + 9.50 locally against AEAT's 60.43. NewroundToCents/moneyTextround half away from zero with a tolerance for binary error, and every writer ofimportestores through them;garmentImporterounds its result and the float list price, and Recogida's size edit uses it. Of the 42 three/four-decimal rows in the shop, the open (unpaid) ones are rounded bymigrateDatabasethe way they will be charged, and PayDialog reads amounts throughmoneyText; paid ones keep what was stored, and a split of one keeps the exact remainder instead of re-rounding it. From theverifactu-compliance-auditorrun: the freeze also honoursedit_lock, and an m2 size of 0 is not priced. Tests:test_moneyText_roundsHalfAwayFromZero,test_amountWriters_roundAndRefuseInvoicedRows,test_garmentImporte,test_migrateDatabase_roundsOpenAmountsToCents, the split of a 22.515 row,test_recogida_m2SizeStoredInCents; each fails without its fix. - [x] Verifactu review follow-ups (the open items left by the
verifactu-compliance-auditorreviews of the 10.13 export and cancellation work), checked first against a copy of the shop DB: (1) Separar prendas on a paid garment inserted the split-off row with emptyverifactu_*columns and seq 0, outside the invoice AEAT registered, and re-priced both rows from the price list. It happened in the shop: four tickets (30492, 30572, 30837, 30990) had an export / reprint total below AEAT's. The split is nowsql_lite::splitGarmentRow, which copies the whole row (seq, estado, CSV, id, payload) and divides theimportein proportion to the cent;migrateDatabaserelinks existing split rows to the oneENVIADAinvoice with the same payment date, garment and service (cancelled / ambiguous matches only logged), which restores three of the four to AEAT's total; 30837 was also re-priced and is filed separately. (2) Export: invoices AEAT holds without a readable payment date (none today) are counted and reported in the result message. (3) Export: a payload that cannot be inlined (not well-formed, a DOCTYPE - whichQXmlStreamReadertolerates inside an element - or an undeclared prefix) is written as escaped text withpayloadComoTexto="1". (4) A cancellation without a date (pre-10.12; none in the shop) is written after its<Registro>withsinFecha="1"instead of never. (5)fechaExpedicionis added to<Registro>/<Anulacion>when the payload's firstFechaExpedicionFactura[Anulada]differs from the payment date (an invoice registered under its reception date). (6)CancelInvoiceDialogreads all events of a ticket in one query (sql_lite::submittedInvoiceEvents) and keeps the reception date once. (7) The test suites buildingresosthroughmigrateDatabase(tests/support/testschema.h), checked againstINGRESOS_COL_*, instead of three hand-copied schemas. (8)updateTicketVerifactuFieldsreturns the rows changed; a reply for an already settled invoice is logged and reported as ignored, and Recogida no longer queries AEAT for it. (9) The one-off query found no(n_recibo, seq)group mixingENVIADAandPENDIENTErows. From theverifactu-compliance-auditorrun on this work: Anular factura dates an invoice over all its paid rows (as retry and query do), the relink only takes seq-0 rows (a payment made while Verifactu was off is its own event),splitGarmentRowrefuses a row locked by Contabilidad itself, and a reply whose local write fails no longer shows "enviado". Each fix has a test that fails without it.
Older milestones (10.13 and before): completed_milestones_archive.md.