Completed Milestones - archive¶
Milestones of the releases before 11.0, moved out of completed_milestones.md on 20-10-2026 to keep that file short. Newest first.
Post-10.12 development — October 2026 (shipped in 10.13)¶
- [x] Release 10.13 review fixes (from
/code-review mediumon PR #55 and the releaseverifactu-compliance-auditorrun): (1) Añadir nuevas prendas checked for paid garments only at search time while the number stayed editable: retyping an already-sent ticket after searching an unpaid one would add a paid garment to it and - since this release - submit invoice<n>again; a duplicate rejection would then have rewritten the sent rows toERROR, wiping their CSV / payload / Huella (auditor: blocking). Now the save is refused unless the number is the one searched, the paid check is repeated at save, andupdateTicketVerifactuFieldsnever rewrites a row alreadyENVIADA/ANULADA/RECTIFICADA. (2) The AEAT export filtered dates row by row before grouping, so a legacy invoice paid over several days appeared in two periods with partial amounts; it now filters on the event's earliestfecha_pago/ latestfecha_anulacion(HAVING), the latter by date rather than text. (3) A ticket with several cancelled payment events merged into one regularisation kept whichever row's payment date came first, so the period ticket count depended on row order; it keeps the latest. (4) When the reception-date retry of a cancellation also failed, the first (real) rejection was lost; the dialog now shows both. AlsokEarliestFechaPagoreuseskFechaPagoIso, and three doc drifts were fixed (AddGarment submit path, Req. 1 insert paths,NETWORK_ERRORat save staysPENDIENTE). Each fix has a test that fails without it. Smaller findings were filed in the "Verifactu review follow-ups" tracker row. - [x] Añadir nuevas prendas: a garment added as paid is submitted to AEAT at once: the open item asked whether a paid garment added with AddGarment could collide with an invoice already registered under seq 0. It cannot: AddGarment refuses any ticket that already has a paid garment, so such a garment is always the ticket's first payment event (seq 0, InvoiceID = ticket number, its payment date), exactly what the startup recovery would submit. The real gap was timing: nothing submitted it when saved; it sat
PENDIENTEuntil the next startup's recovery dialog and an operator's "Reintentar". NowAddGarmentemitspaidGarmentSavedafter inserting a paid row and MainWindow submits it throughverifactuSubmitInvoicelike a paid ticket on save; the reply is applied by the usual handler and an unanswered submission staysPENDIENTEfor the recovery. Test:test_e2e_app::test_addGarmentPaid_submittedAtOnce(one Create with the ticket number, today's date and the garment's total; rowENVIADAin seq 0; the unpaid garment untouched); it fails without the connection. Files:src/add_garment/add_garment.{h,cpp},src/app/mainwindow.cpp,tests/test_e2e_app.cpp,docs/modules/add_garment.md. - [x] AEAT's cancellation record is stored and exported: the
/Cancelreply carries AEAT's own cancellation record inReturn.Xml(parsed intoVerifactuResult::rawXmllike a/Createreply), but it was thrown away, so the Hacienda export could only show a cancellation as a date on the original invoice. New columningresos.verifactu_cancel_xml(added bymigrateDatabase, hidden in Listado and Recogida);markInvoiceSeqCancelledtakes the reply's XML and stores it on the cancelled event's paid rows (a later call without one never erases it). Exportar registros AEAT now writes a<Registro>in the period an invoice was issued and, for a cancellation, an<Anulacion invoiceId fechaPago fechaAnulacion>in the period it was made with that record inlined (sinPayload="1"for cancellations made before this change); the original invoice is no longer repeated in the cancellation's period. (The envelope element isAnulacion, notRegistroAnulacion, because AEAT's own payload root has that name.) A substituted invoice gets no<Anulacion>: its rectificativa is a<Registro>of its own. Tests:test_markInvoiceSeqCancelled_stampsTheCancelledEvent(stored, never erased),test_cancelInvoice_markedAnulada(the dialog stores the reply),test_aeatExport_oneRegistroPerPaymentEvent(issue vs cancellation periods); the dialog test fails if the XML is not passed. - [x] Anular factura sends each invoice's own date:
CancelInvoiceDialogsent every payment event's cancellation withInvoiceDate= the ticket's earliest reception date, but AEAT keys an invoice on (emisor, InvoiceID, FechaExpedicion) and every submission path issues it under the payment date (fecha_pago). For a ticket paid at pickup on a later day (the usual case) or any partial-payment event<n>-<seq>, the cancellation named a date AEAT never registered, and would probably have been rejected as not existing. Found by the compliance review of the AEAT export fix. Now each event's date comes fromverifactuEventFor(the same rule as retry and query) and is shown in a new "Fecha factura" column; an event without a readable payment date is refused locally with a pointer to "Consultar en AEAT". Following the compliance review: the earliest payment date is now taken by date, not asdd-MM-yyyytext (MINover the text put 05-03 before 28-01), inverifactuEventFor, the startup recovery and the AEAT export alike; this matters for pre-10.9 seq-0 invoices paid garment by garment on different days, which AEAT registered under the first payment. And because 8.0-10.8 resubmissions used the reception date, a rejected cancellation of a seq-0 invoice is retried once with the reception date (only one invoice can have that InvoiceID, so it cannot reach another). Tests:test_cancelInvoice_markedAnulada(ticket received 20 days ago, paid 10 days ago and partly paid again today: each Cancel's InvoiceID and date, both events ANULADA),test_cancelInvoice_olderDataDates(earliest date, the reception-date retry, the local refusal),test_verifactuEventFor(date vs text order); each fails with the old behaviour. The review also raised an unconfirmed AddGarment / seq-0 question, filed as an open item. Files:src/app/cancelinvoicedialog.{h,cpp},src/sql_lite/sql_lite.cpp,tests/test_e2e_app.cpp,tests/test_sql_lite.cpp. - [x] Exportar registros AEAT: one record per invoice (payment event): found by the dead-code pass. The Hacienda export (Verifactu Req. 7, Art. 14.1 RD 1007/2023) wrote one
<Registro>per garment row, so a multi-garment invoice repeated its XML payload once per garment. It used the baren_recibo, so the partial-payment invoices<n>-<seq>could not be told apart, filtered by reception date instead of the date the invoice was issued under, and wrote one garment's amount. Nowsql_lite::aeatExportRecordsreturns one record per paid(n_recibo, verifactu_invoice_seq)event with a stored payload (any estado: AEAT keeps cancelled and rectified invoices), filtered byfecha_pago, with the literal InvoiceID, the event total, CSV and estado. The XML writer moved out of the menu slot intosrc/app/aeatexport.{h,cpp}(writeAeatExportXml). The<Registro>attributes are nownRecibo,invoiceId,fechaPago,importe,csv,estado, plusfechaAnulacion,rectifica/tipoRectificacionandsinPayloadwhen they apply. Following the compliance review, the export also includes invoices known only by their CSV (recovered with "Consultar en AEAT", which stores no payload) and invoices from an earlier period cancelled inside the range, never merges two submissions sharing a seq (grouped by CSV too), and reports a failed query or write instead of producing an empty file. The review also found that Anular factura sends the reception date rather than the invoice's payment date, and that the cancel reply's XML is not stored; both filed as open items. Tests:test_sql_lite::test_aeatExportRecords_onePerPaymentEvent(grouping, totals, legacy id, CSV-only invoice, cancellation in the period, rectificativa link, unpaid / unconfirmed / out-of-range rows excluded, inclusive range) andtest_e2e_app::test_aeatExport_oneRegistroPerPaymentEvent(records + writer as the menu runs them; the document parses, each payload appears once). Both fail with the old per-row grouping, without the CSV-only case, and without the cancellation-date case; the unit test also fails with the reception-date filter. - [x] Dead-code cleanup pass; dead-code report and guidelines-audit doc retired: ran the
dead-code-finderagent oversrc/and removed what production never reaches. Removed: Recogida's per-garment payment writes (updateDbPAY_YES/PAY_NO, unreachable becausepb_paymentis never enabled; payments only go through PayDialog) withhasPendingSubmitand the then test-onlysql_lite::updateTicketPayment/ticketVerifactuEstadoand their tests;PayDialog::onSelectionChanged(never connected);VerifactuInvoicegetters with no caller and the never-set buyer fields (theirBuyerIDJSON branch could not fire;isValidstill refuses any type other than F2 / R1-R5, same message);VerifactuTaxItem's unusedTaxTypeand never-set description;VerifactuResult::isErrorand the never-readrawResponse;EscPosBuilder::raw; the date-range filter ofMySortFilterProxyModel(never wired); the write side ofFilterWidget's two properties;RecogPrendas::columnClickedCellandRectifyInvoiceDialog::m_loadedCSV(written, never read).VerifactuManager::getValidationUrl/getLastErrorandBackupManager::backupDirectorybecame private (internal callers only). Fixed on the way:RecogPrendas::rowClickedCellwas uninitialised and could be read before any row was clicked (now-1); a comment inverifactutypes.hsat above the wrong declaration. Kept on purpose and now listed in the agent's exclusions: the test hooks (setEndpointOverride,setOpenGeneratedReports,loadFrom,setBackupEnabled, the DPAPI wrappers,EscPosBuilder::columns). Payloads for the invoices the app issues (F2, R1-R5) are unchanged; checked by theverifactu-compliance-auditor. The pass also found that Exportar registros AEAT is not grouped by payment event; that is a real bug, filed as an open tracker item rather than folded into the cleanup.docs/dead_code_report.mdis gone (all its items are resolved; the agent now reports to the main agent and no snapshot is kept). Likewisedocs/coding_guidelines_audit.mdmoved into the skill as.claude/skills/coding-guidelines/audit.md: the grep checklist, the severity tiers and the accepted Tier 2 / Tier 3 exceptions (without line numbers); the dated findings snapshot was dropped, since open items live in the tracker. Theguidelines-auditoragent, the release skill,INDEX,README,ai_agent_instructionsand the MkDocs nav point to the new place. - [x] E2E coverage: Recogida late-reply adoption and the AEAT comparison dialog: these two screens were checked only by the smoke test's real-AEAT blocks, which were dropped when the smoke test stopped contacting AEAT. Their logic was already covered; Recogida's own wiring was not: taking over PayDialog's in-flight request, chaining a duplicate rejection into the AEAT query, the comparison dialog and its Actualizar rules, and which Verifactu buttons each row offers.
test_e2e_appgains three scenarios on the realRecogPrendaswith the fake server. (1) Pay-all → Cobrar with a Create reply delayed 7 s: PayDialog gives up at 5 s leavingPENDIENTE, then the late reply makes the rowENVIADAwith its CSV and the status bar offers the factura with QR. (2) AnERRORrow → Reintentar answered "duplicado" → automatic query → comparison dialog (match, AEAT's CSV, Actualizar enabled) → adopt →ENVIADAwith AEAT's CSV. (3) Consultar en AEAT when nothing may be adopted (not found, different amount, alreadyENVIADA= informational), plus the button rules (Reintentar only onERROR, neither on an unpaid row). Newtests/support/modaldriver.hoperates dialogs opened withexec()(one-shot match + action per dialog); stable object names were added to the Verifactu and comparison dialogs inrecog_prendas.cpp, with no behaviour change. Four mutations were each caught (no takeover of the request, no query after a duplicate, Actualizar enabled on any found record, Consultar on unpaid rows). The suite now takes about 15 s. The smoke test's "not covered" note and the tracker row are gone. - [x] Smoke test rewritten: shorter, and it never contacts AEAT: the old checklist sent smoke tickets to the real IreneSolutions endpoint with whatever service key was configured.
TEST_ENDPOINTandPROD_ENDPOINTare the same URL, so with the shop's key they landed in the shop's own AEAT records. That happened in the blocks marked registers at AEAT and, silently, in any paid save or Cobrar made while online. Their numbers would also collide with real tickets the shop issues later, because the copied DB's next number is the real one. Now the setup backs up the settings, emptiesingresos/gastosin the backup copy, and points the settings at the copy with an emptyverifactu.service_key, so every submit / cancel / rectify / QR / query path is skipped locally. The first launch must show "No se pudo inicializar Verifactu", or the run stops. A log check (noSubmitting invoice/Server response, etc.) repeats at the end, and the settings are restored afterwards. Seeds are five integer-numbered tickets plus one gasto, chosen so the Q3 / Q4 2026 reports have known figures, a regularisation included. Everything the e2e bench and unit suites check by themselves was dropped: migrations, saves, voids, cancel / rectify guards, recovery listing, offline PENDIENTE, accounting totals. What is left is start-up on a real schema, wiring, printing, PDF rendering, the Listado lock, backup, language and installer: 5 blocks and 25 checks instead of 7 blocks and 48.test_e2e_appgainedtest_cancelAndRectify_offeredOnlyForSentInvoices(Anular disabled onPENDIENTE, unpaid tickets refused) to replace two manual rows. The dropped real-AEAT screens (Recogida late-reply adoption, the comparison dialog) became an open tracker item. The release skill and the production-switch row now say the smoke test never contacts AEAT. Files:docs/testing/smoke_test.md,tests/test_e2e_app.cpp,docs/testing/e2e.md,docs/testing/README.md,.claude/skills/release/SKILL.md,docs/progress_tracker.md. - [x] Application-level test bench, phase 2: MainWindow, the app dialogs, Imprimir and Contabilidad at screen level: phase 1 covered PayDialog and the Verifactu client; the app's own windows were compiled into the executable and could only be checked by hand.
src/app/now builds alaideal_appstatic library (MainWindow + Cancel / Rectify / Void / Pending dialogs) andlaideal.exeis justmain.cpp+ resources linking it (same exe path, installer and CI unchanged). New suitetests/test_e2e_app.cpp(nine scenarios, ~6 s, every CI run) drives the windows as an operator would and asserts on the DB, on the requests the fake AEAT received and on the pop-ups: MainWindow save of an unpaid and a paid ticket (incl. the 3 s print-after-submit wait and the reqId correlation) and the no-client refusal; Anular prendas; Anular factura and its closed-quarter refusal; Rectificar por sustitución with the before-payment and closed-quarter date refusals; the startup Envíos pendientes recovery and its retry; an Imprimir reprint of one payment event (paid rows of that seq only, QR requested under its InvoiceID and payment date, none once ANULADA); and Contabilidad Trimestral generate + lock + revert writing the PDF. Each scenario was proven against a mutated build. Test seams added:Contabilidad::setOpenGeneratedReports(false)(skips opening the PDF viewer), stable object names on the dialog widgets,ModalAutoCloseranswers Yes/No confirmations with Yes, the fake server's GetQrCode returns a real image, and a sharedtests/support/e2efixture.h. Same safety rules as phase 1: local fake server only (the suite refuses to start otherwise), throwaway DB and settings. This absorbs the two parked Backlog "Test coverage" rows (MainWindow async-AEAT wiring, Imprimir seq filter / QR gating), and retires smoke-test checks A5–A7, B1 and G10. Seedocs/testing/e2e.md. - [x] Testing documentation moved to
docs/testing/: requested before phase 2 of the test bench, so test knowledge sits in one organised place instead of a long section ofarchitecture.md. It now has four pages.README.mdcovers the three layers (unit suites, end-to-end bench, manual smoke test), running locally and in CI (JUnit results, the step-summary script), the conventions (real libs, pure cores, throwaway state only, application type, prove each test can fail, 120 s timeouts, the UAC naming rule), the patterns table, adding a suite and the CI toolchain.unit_suites.mdhas every suite in an index table and then grouped by module, refreshed for this cycle's tests: listings, regularisations, migrations, ticket counts, language and IVA.e2e.mdhas the bench's safety rules,FakeVerifactuServer/ModalAutoCloserusage, the scenario table, how to add a scenario and the phase 2 plan.smoke_test.mdwas moved fromdocs/withgit mv.architecture.mdkeeps a short Testing section that links there. All live references were updated: thetest-engineeragent, the/tackle-issueand/releaseskills,ai_agent_instructions.md,INDEX.md,docs/README.md, the tracker,.gitignore. The MkDocs site gains a Testing section, plus the previously unlisted Completed milestones page.docs.ymlneeded no change, since it already triggers ondocs/**andmkdocs.yml, and the site was built locally with no new warnings. - [x] Application-level test bench, phase 1: fake Verifactu server + end-to-end payment / AEAT scenarios: the unit suites tested logic and
sql_litein isolation, while the flows across objects were covered only by the manual smoke test: payment -> AEAT submission -> reply -> estado/QR -> reconciliation -> Contabilidad. The user chose these design points. Seam: the in-processVerifactuConfig::setEndpointOverride(baseUrl)redirects every endpoint (Create / Cancel / GetFilteredList / GetQrCode). Only code linked into a test can call it, so no setting, environment variable or registry value can divert real invoices. It also matters because TESTING and PRODUCTION are the same hard-coded URL, so there is no real sandbox.tests/support/FakeVerifactuServeris a minimal HTTP/1.1 server on 127.0.0.1 (random port). It records every request (endpoint + JSON) and answers with a queued scripted reply or a default "accepted" reply (CSV, ValidationUrl, Huella XML, a real PNG QR). Replies can be delayed or dropped, and the builders follow the captured fixtures intest_verifactu_response.tests/support/ModalAutoClosercloses and records anyQMessageBox(user choice: auto-dismiss and record), so a pop-up never blocks the run headless.test_e2e_verifactu(runs on every CI run, offscreen, about 9 s) drives the realPayDialogas Cobrar does, with the real client and network stack, against a seeded throwaway DB and a throwaway settings file with printing off. It never touches the real database, the user's settings or the AEAT, and refuses to start unless the endpoint is local. Six scenarios: accepted; two payment events as invoicesnandn-1; no reply within 5 s -> PENDIENTE -> retry answered "already exists" -> the queried CSV is adopted (ENVIADA); AEAT rejection -> ERROR; a payment into a closed quarter is refused, nothing sent; paid Q1 -> Q1 closed -> cancelled in Q2 -> Q1 unchanged, Q2 regularised, the remainder charged asn-1. The last scenario immediately found a real bug in 10.12's ticket count, fixed in its own commit just below. Phase 2 (move MainWindow + the app dialogs into a static lib and add screen-level scenarios) stays Open in the tracker. Files:src/verifactu/verifactuconfig.{h,cpp},tests/support/{fakeverifactuserver.h,fakeverifactuserver.cpp,modalautocloser.h},tests/test_e2e_verifactu.cpp,tests/CMakeLists.txt, docs. - [x] Contabilidad ticket count: only a same-period cancellation offsets a ticket (bug found by the new e2e test bench): 10.12's
netTicketCountnetted a ticket's income against every regularisation of the period, regardless of which payment was being cancelled. A ticket with a new sale in Q2 (its remaining garment charged as<n>-1) and the cancellation of its Q1 payment in Q2 netted below zero in Q2, so it was not counted even though Q2 had a real sale. The first end-to-end scenario written for the test bench (paid Q1 -> Q1 closed -> cancelled at AEAT in Q2 -> remainder charged in Q2) caught it.netTicketCountnow takes the period and lets a regularisation offset only when the cancelled payment'sfecha_pagolies in that same period;figuresFromDetailspasses the report period through, andyearTicketCount(details, year)the calendar year. The user's rule is unchanged: paid and cancelled in the same period is not counted, and paid in Q1 / cancelled in Q2 is counted in Q1. Amounts were never affected, only the "Número de tickets" figure. Tests:test_netTicketCountgains the Q1-payment / Q2-sale case, and existing fixtures carry the payment date. Files:src/contabilidad/{contabilidad.h,contabilidad.cpp},tests/test_contabilidad.cpp,docs/modules/contabilidad.md.
Post-10.11 development — October 2026 (shipped in 10.12)¶
- [x] 10.12 release gate: fixes from the PR review and the compliance gate: a medium
/code-reviewof the commits after the pre-release audit, and the newverifactu-compliance-auditorrelease gate, confirmed the closed-quarter fix and found the following, all fixed before merging. Rectify: the red "AEAT accepted but the local RECTIFICADA mark failed" message was immediately overwritten by the green success text.applyRectificationResultnow returns whether the local mark succeeded, and the success text is shown only when it did (both reviewers flagged this). Cancel: after a failed local write the event is shown ANULADA, so its button cannot send a second cancellation to AEAT. A quarter closed while the request was in flight moves the stamped date to today. The new message usestr(), like its neighbours. The event list groups onlypagado = 'SI'rows, likeverifactuEventFor, so a part-paid seq-0 invoice no longer shows as SIN COBRAR with its Anular button disabled. Marks:markInvoiceSeqCancelled/markTicketRectifiedreturn false when they match no paid row, instead of reporting a silent success. Data repair: amigrateDatabasestep returns toSIN COBRARthe unpaid garments that pre-10.12 cancellations had markedANULADA, leaving local voids alone. A gate re-check showed that unpaidRECTIFICADArows are not provably safe to re-open: beforedc87a5ea substitution could have been submitted with their amounts included. They are only logged for manual review. The same re-check made a failed UPDATE of the new rectificativa row count as a failed local write too. Without it the release note's "they can still be charged" would not hold for existing data; the note now says so in both languages. Ticket count: only a positive net counts, so a by-differences credit note is not a ticket, while a comma-flagged real sale still is.yearTicketCountnow reusesnetTicketCount. Dismissed with reasons: the "last payment includes cancelled seqs" case is unreachable, because the rectify dialog refuses multi-seq tickets and accepts only ENVIADA ones; the CI regex'sr?is intentional, to stop at the legacyr7.1-style headers. Tests: marks fail on no paid row, unpaid-remainder repair (incl. a local void left alone), credit note and comma-only ticket counts. An existing fixture got realistic amounts, because a zero-amount ticket correctly no longer counts. Verified non-vacuous. Files:src/app/{cancelinvoicedialog.cpp,rectifyinvoicedialog.h,rectifyinvoicedialog.cpp},src/sql_lite/{sql_lite.h,sql_lite.cpp},src/contabilidad/contabilidad.cpp,tests/{test_sql_lite.cpp,test_contabilidad.cpp},releases_notes*.txt, docs. - [x] Release notes published in both languages; release skill reuses the review skills and agents: the GitHub release body, which is also what the in-app updater shows the shop before installing, was the English
X.Ysection only. Theci.ymlrelease job now publishes a bilingual body:## Español(thereleases_notes_es.txtsection) then## English. A sharedGet-Sectionhelper fails the release if either section is missing or empty. The/releaseskill's local fallback and the README's mirror do the same, and the extraction was checked locally against 10.11. A review of the/releaseskill against the other skills found gaps, now filled. It now runs/update-docsinstead of "mentally", and sends smoke-test findings through/debugging. It adds a Verifactu / accounting gate in step 5: theverifactu-compliance-auditorsubagent on the release diff whenever it touches invoices, numbering, theingresosschema or Contabilidad. That is the check that caught the closed-quarter path this cycle. It offers theguidelines-auditorsubagent after a large cycle, and points at/update-skillswhen the skill drifts from the README. Files:.github/workflows/ci.yml,.claude/skills/release/SKILL.md,README.md. - [x] Pre-release review: smaller fixes and the manual checks for this cycle: the remaining findings of the
10.10..HEADreview. The void-date migration now also covers old voids that a later substitution relabelledRECTIFICADA. Regularisations include same-period cancellations, so the report wording changed from "de periodos anteriores / trimestre ya cerrado" to "Anulaciones / rectificaciones del periodo" and the annex text explains it. The Mensual "cerrada" label usesquarterIsClosed, so an empty month inside a closed quarter no longer reads open. A NULL IVA rate shows?, never-1, in the comma-amount branch of the gastos annex. The live language switch moved intoSettingsDialog::accept(), so the first-run Configuración inmain.cppapplies it too, not only MainWindow's. The detail collectors size their per-bucket index bybucketCountinstead of a fixed[4]. A stale Recogida comment was fixed.docs/smoke_test.mdgains Block G with the manual checks this cycle's changes need (Anulación search and columns, migration, the Contabilidad lock box, gastos-only quarter, the annex PDF, regularisation across quarters and within one, the unpaid remainder after a cancellation, the cancel/rectify guards, IVA field removed, live language switch, both installer languages), and the suite count is corrected to 15. Tests:test_detailRegularizacionesupdated to the new heading, plus the NULL-rate?case and a relabelled-RECTIFICADAvoid in the migration test. Files:src/sql_lite/sql_lite.cpp,src/contabilidad/contabilidad.cpp,src/appsettings/settingsdialog.cpp,src/app/mainwindow.cpp,src/recog_prendas/recog_prendas.cpp,tests/test_contabilidad.cpp,docs/smoke_test.md,docs/modules/contabilidad.md. - [x] Pre-release review of everything since 10.10: accounting and Verifactu correctness fixes: a high-effort code review plus a
verifactu-compliance-auditorpass over10.10..HEADfound issues in this cycle's own work, none of it shipped yet. (1) A closed quarter could still change. Cancelling a payment event at AEAT, or a substitution rectification, marked every row of the ticket with that seq, including unpaid garments that share seq 0, asANULADA/RECTIFICADAwith afecha_anulacion. Paying one of them in a later quarter made it income there and a regularisation subtracted from the cancellation quarter, even if that quarter was already filed. Separately, and older than 10.10, such a payment was never submitted to AEAT. By user decision,markInvoiceSeqCancelled/markTicketRectifiednow touch onlypagado = 'SI'rows, the ones the invoice covered. That matches howverifactuEventForalready defines a payment event, and unpaid garments staySIN COBRARand chargeable as their own invoice. (2) The ticket count included cancelled tickets. The newContabilidad::netTicketCountcounts a ticket in a period only if its income there is not fully offset by a same-period regularisation (user decision).yearTicketCountnets over the year the same way. (3) A rectificativa could be back-dated before the original payment, into an earlier open quarter that never counted it.RectifyInvoiceDialognow refuses a date before the new testedsql_lite::ticketLastPaymentDate(), on top of the closed-quarter check. (4) Failed local writes were reported as success: both dialogs now check the mark functions' result and say in red that AEAT accepted but the local update failed. (5) Midnight race: the cancellation stamps the date the closed-quarter guard checked (m_pendingCancelDate), not the AEAT reply time. Verifactu doc drift flagged by the auditor fixed too. Tests: unpaid garments untouched by cancel/rectify,ticketLastPaymentDate,netTicketCount(same-period, partial, other-period) andyearTicketCountnetting. Verified non-vacuous. While reverting for that check, an over-broadsedalso hitverifactuEventFor's identicalpagado = 'SI'scoping, and its test caught it, which confirms the new scoping matches the existing event definition. Files:src/sql_lite/{sql_lite.h,sql_lite.cpp},src/contabilidad/{contabilidad.h,contabilidad.cpp},src/app/{cancelinvoicedialog.h,cancelinvoicedialog.cpp,rectifyinvoicedialog.cpp},tests/{test_sql_lite.cpp,test_contabilidad.cpp}, docs. - [x] Application language setting: live switch, installer default, release notes in Spanish and English: requested before the next release, keeping the scope to the setting. The full app translation stays an Open item. The
app.languagesetting and its Idioma combo already existed, but only applied Qt's standard-dialog translations at startup, so a change needed a restart, and the release notes were English-only. NewAppLanguagemodule (src/appsettings/applanguage.{h,cpp}):applyQtTranslations()installs or removes the bundledqtbase_es.qmlive. It is called at startup and again when Configuración is accepted, so no restart is needed; the tooltip now says so, and says the rest of the app is still Spanish. Release notes: the newreleases_notes_es.txtis a full Spanish translation of the history, with the same 40 version headers. Ayuda → Notas de la versión opens the file for the configured language (releaseNotesResource()), with the dialog title and button in that language too. Installer: each Inno Setup language now shows its own notes on the information page (per-languageInfoBeforeFile) and recordsHKCU\Software\La Ideal\Language. On first run, when the settings have no language yet,applyDefaults()takes that choice (initialLanguage(installerChoice()), unknown or absent meanses), so an existing user's setting is never overridden by a reinstall or update. Encoding: both notes files are now UTF-8 with BOM, because Inno Setup reads a BOM-less.txtas ANSI. The English file already contained accents ("Configuración", "Envíos"), which the installer was showing garbled. The viewer strips the BOM. Release process:ci.ymlrefuses to publish without the SpanishX.Ysection; the/releaseskill and README require both files. Tests (test_appsettings):initialLanguage(en / es / empty / unknown),releaseNotesResource, and a parity test that both files list the same versions in order, verified non-vacuous by renaming a Spanish header. The installer script was compiled locally with ISCC against a dummy payload. The live translator swap is integration-only, because it needs the app's resource bundle. Files:src/appsettings/{applanguage.h,applanguage.cpp,appsettings.h,appsettings.cpp,settingsdialog.cpp,CMakeLists.txt},src/app/{main.cpp,mainwindow.cpp},resources/laideal.qrc,releases_notes.txt,releases_notes_es.txt,releases/laideal.iss,.github/workflows/ci.yml,tests/{test_appsettings.cpp,CMakeLists.txt},README.md,/releaseskill, docs. - [x] Ingresos grids: the four dates side by side, an Anulación search, and green "NO" for every ANULADA row: follow-up to
fecha_anulacionrecording every cancellation. Columns:fecha_anulacionis appended last in the table bymigrateDatabase, so the newtableviewfree functionplaceIngresosDateColumns(QHeaderView*)moves it visually right after Recepción / Pago / Recogida in both the Recogida de Prendas grid (where it is now visible, headed "Anulación") and Listado → ingresos. Only the visual order changes, so everyINGRESOS_COL_*logical index the code reads is untouched; it is re-applied after each search and is idempotent. Search: the Recogida date filter gains a fourth option, Anulación (fecha_anulacion), which lists garments voided in place and AEAT-cancelled / rectified ones on their cancellation date. Its Importe total is 0, since all of them are excluded from totals. Colour:TextColorDelegate::classifynow also renders green any row whoseverifactu_estadoisANULADA, read from the sibling column, so a cancelled garment'sNO/ estado no longer reads as a debt, whether or not it carries a payment date. Tests (test_textcolordelegate, nowQTEST_MAINoffscreen): the ANULADA colour rule, and the header placement on a realQTableView(positions 2–5, importe after, idempotent). Both verified non-vacuous. Files:src/tableview/{textcolordelegate.h,textcolordelegate.cpp,ingresoscolumns.h,ingresoscolumns.cpp,CMakeLists.txt},src/recog_prendas/{recog_prendas.cpp,recog_prendas.ui},src/listado/listado.cpp,tests/{test_textcolordelegate.cpp,CMakeLists.txt}, docs. - [x]
fecha_anulacionrecords every cancellation; voided garments no longer carry a payment or pickup date: requested to complete the new column, and it supersedes the earlier "voided garments keep the void date infecha_pago, by design" decision below. Anular prendas:voidGarmentRownow writes the void date tofecha_anulacionand leavesfecha_pago/fecha_recogidaempty, because a voided garment was never paid nor collected.pagadostaysNOand estadoAnulado/ANULADAare unchanged. A one-off, idempotentmigrateDatabasebackfill moves the stamped date of existing voids (estadoAnulado,pagado != 'SI',ANULADA) intofecha_anulacionand empties both fields; AEAT-cancelled paid rows are not touched. AEAT cancellation / substitution rectification: by user decision,markInvoiceSeqCancelled/markTicketRectifiednow recordfecha_anulacionon every row they mark, not only on rows of an already-closed quarter, still without overwriting an existing date. The Contabilidad rule becomes uniform: a paid row stays income in its payment period and is subtracted in the period of itsfecha_anulacion. Within the same period the two net out, matching the old result. The one visible change is a sale cancelled in a later quarter while its own quarter was still open: it now shows +original / −cancellation quarter instead of silently leaving the original quarter. Pre-10.12 cancellations without a date stay excluded as before. Voided garments are unpaid, so they are never income nor a regularisation. Tests: void writes onlyfecha_anulacion; cancel/rectify stamp open and closed rows alike; regularisation across quarters, within a quarter, and voids never appearing; migration moves the date once and leaves AEAT rows alone;markTicketPickedUpexpectation updated to the empty pickup date. All verified non-vacuous by restoring the old rules. Files:src/sql_lite/{sql_lite.h,sql_lite.cpp},tests/test_sql_lite.cpp, docs (contabilidad.md,sql_lite.md,architecture.md,mainwindow.md,recog_prendas.md, Verifactu docs). - [x] Closed quarters no longer change after an AEAT cancellation or rectification; the change is counted where it happens: neither
CancelInvoiceDialognorRectifyInvoiceDialogrespected the accounting lock. Cancelling at AEAT, or substituting via a rectificativa, a garment from an already-closed quarter setANULADA/RECTIFICADA, the garment silently dropped out of its original quarter, and regenerating that filed quarter gave different figures. The rectificativa row itself was inserted unlocked (edit_lock = 0) and could be dated inside a closed month. Following the user's choice ("count where it happens", the usual fiscal treatment), a newingresos.fecha_anulacioncolumn (migrateDatabase,INGRESOS_COL_FECHA_ANULACION= 26, hidden in Recogida) is stamped only on rows whose quarter is already closed: the cancellation date, or the rectificativa's date. The DB writes moved out of both dialogs into the tested seamssql_lite::markInvoiceSeqCancelled/markTicketRectified, with the same seq/ticket scoping, still only after AEAT success, and never overwriting an existing date.kIngresosIncomeWherekeeps a stamped row as income in its closed quarter, so the filed report is reproducible. The newregularizationsBetweenDates(andQuarterlyDetails::regularizations) lists it in the period offecha_anulacion, wherefiguresFromDetailssubtracts it (PeriodFigures::ingRegularizacion). The Ingresos table then shows period income, the regularisation and the net total, and the annex adds an "Anulaciones y rectificaciones de periodos anteriores" table with negative amounts. Rows from open quarters behave as before, and pre-existing cancellations are untouched. Guards, the first two raised by theverifactu-compliance-auditorreview: the rectificativa date must be in an open quarter, and a cancellation is refused while today's quarter is closed. Both use the newsql_lite::quarterIsClosed, which checks the whole quarter acrossingresosandgastos, because the month-levelreadLockForMonthAndYearreads a row-less month (e.g. August) as open. Tests:markInvoiceSeqCancelledstamps only closed rows of the right seq;markTicketRectifieduses the rectification date; a Q1-closed ticket cancelled in Q2 stays in Q1 income and is a Q2 regularisation (incl. annual bucketing);quarterIsClosedcovers a row-less month and gastos-only; no overwrite;figuresFromDetailsnets regularisations; the regularisation table renders. All verified non-vacuous. Files:src/sql_lite/{sql_lite.h,sql_lite.cpp,ingresos_schema.h},src/app/{cancelinvoicedialog.cpp,rectifyinvoicedialog.cpp},src/recog_prendas/recog_prendas.cpp,src/contabilidad/{contabilidad.h,contabilidad.cpp},tests/{test_sql_lite.cpp,test_contabilidad.cpp}, docs (contabilidad.md,sql_lite.md,architecture.md, Verifactu README + requirements). - [x] Contabilidad figures now come from the detail rows (single source of truth), closing the annex reconciliation gaps: the Contabilidad summary used to be computed by separate SQL helpers (
totalPriceBetweenDates,countOperationsBetweenDates, plus the groupedannualAccountingByQuarterfor the annual report), while the 10.11 detail annex listed rows through other queries. Four gaps followed, all fixed. (c) Every mode now fetches the period's detail rows once (incomeTicketsBetweenDates/expensesBetweenDates; annualannualDetailsByQuarter, one scan per table bucketed by quarter), and the new pure staticContabilidad::figuresFromDetails()derives thePeriodFiguresfrom those same rows. A summary can no longer disagree with its detail, and Mensual/Trimestral drop from 6 + 2 queries to 2. (a) A comma-decimalimporteis now flagged rather than silently read as 0 or 10. The collectors count it (IncomeTicketDetail::invalidAmounts,ExpenseDetail::invalidAmount) and never sum it; the detail marks the ticket*or the gasto**with a note; andgenerateContabilidad()raises the clean-up-tool error dialog once per report. (d) Because every mode reads the same collectors, the annual report treats comma amounts exactly like the quarterly one; previously its SQLSUM()handled them differently and without the dialog. (b) Each detail table ends with a note that per-line base/IVA are rounded to cents while the totals are unrounded. The annual consolidated ticket count is nowContabilidad::yearTicketCount(), a distinctn_reciboover the year's buckets, replacing the short-livedingTicketsYearfield. Removed as dead code:totalPriceBetweenDates,countOperationsBetweenDates,annualAccountingByQuarter/QuarterlyAccountingTotals, andContabilidad::getTotalIncome/computeFigures, which had no other callers. Their tests were rewritten against the listings, plus newfiguresFromDetails,yearTicketCount, flagging and rendering tests, verified non-vacuous by breaking the sin-IVA bucket and the comma skip. Files:src/sql_lite/{sql_lite.h,sql_lite.cpp},src/contabilidad/{contabilidad.h,contabilidad.cpp},tests/{test_sql_lite.cpp,test_contabilidad.cpp}, docs (contabilidad.md,sql_lite.md,architecture.md,INDEX.md, Verifactu docs,/debuggingskill). - [x] IVA on ingresos is a fixed 21 %, no longer a setting: Contabilidad derived the ingresos base/IVA split from
AppSettings::ivaRate()read from the settings JSON at report time. A rate change would therefore have silently altered every regenerated past report, along with every ticket, factura and AEAT submission made afterwards. The user decided the ingresos rate will not change from 21 %, so it is now the internal constantAppSettings::kIngresosIvaRate, exposed as the staticAppSettings::ivaRate()so no call site had to change (Contabilidad, PayDialog, Recogida retry, MainWindow, Imprimir, RectifyInvoiceDialog, TicketRenderer data). The "Tipo de IVA (%)" field was removed from Configuración → General,setIvaRateis gone, andapplyDefaults()no longer writes a defaulttaxes.iva_rate. For backwards compatibility an existing key in a user's JSON is left untouched (older app versions still read it) but ignored. Gastos keep their per-invoiceivacolumn. Testtest_ivaRateIsFixedAndIgnoresJsonchecks a JSON value of 10 is ignored. Files:src/appsettings/{appsettings.h,appsettings.cpp,settingsdialog.h,settingsdialog.cpp},tests/test_appsettings.cpp, docs. - [x] Annual report: the consolidated ticket count no longer double-counts: "Número de tickets" in the Resumen anual consolidado was the sum of the four per-quarter
COUNT(DISTINCT n_recibo), so a ticket whose garments were paid in two quarters counted twice for the year. The amounts were correct; only the count was inflated.annualAccountingByQuarternow also returnsingTicketsYear, a year-level distinct count under the sharedkIngresosIncomeWherepredicate, and the consolidated summary uses it. The per-quarter sections keep their own counts, where the ticket correctly appears in each. Testtest_annualTicketCountIsDistinctOverYearchecks it equalscountOperationsBetweenDatesover the year. Files:src/sql_lite/{sql_lite.h,sql_lite.cpp},src/contabilidad/contabilidad.cpp,tests/test_sql_lite.cpp, docs. - [x] Contabilidad: a quarter with only gastos can now be closed and reverted: the quarterly flow read its lock state from
ingresosalone. A quarter without any ingresos row (readLockForQuarter= 2) stopped at "No hay registros de ingresos" and neither generated the report nor locked, even with gastos to declare; revert had the same blind spot. It now reads both tables and merges them in the pure staticContabilidad::combinedLockState(ingresosLock, gastosLock): no data only when both are empty, locked if either is, else open.updateLock()already locked and unlocked both tables by month, so closing and reverting a gastos-only quarter work unchanged. The Mensual and Anual "Contabilidad cerrada / no cerrada" labels use the same merge, and the empty-period message now says "ni de gastos". Testtest_combinedLockState. Files:src/contabilidad/contabilidad.{h,cpp},tests/test_contabilidad.cpp,docs/modules/contabilidad.md. - [x] Contabilidad: "Bloquear datos" is offered only where it works: the checkbox stayed enabled in Mensual and Anual mode, but only the Trimestral branch of
on_bb_ok_cancel_acceptedcallsupdateLock(), so ticking it there did nothing. Closing stays a quarterly action, matching modelo 303 (user decision). The checkbox is now enabled only for Trimestral and never while reverting, through the pure staticContabilidad::lockOptionAvailable(mode, reverting). Switching mode unticks it, so a choice made in Trimestral cannot carry over unseen. Testtest_lockOptionOnlyForTrimestral. Files:src/contabilidad/contabilidad.{h,cpp},tests/test_contabilidad.cpp,docs/modules/contabilidad.md. - [x] Voided garments keep the void date in
fecha_pago, by design: the 10.11 release review had suggested recording the void date only infecha_recogida. The user decided to keep stamping both: a voided garment carrying afecha_pagowithpagado = 'NO'and estadoAnuladoreads unambiguously as "closed, never paid" throughout the app. The side effects are already handled. Every total skipsANULADArows (garmentExcludedFromTotals,kIngresosIncomeWhere), so a Pago-date search lists a voided garment on its void date without adding it. The month lock covers it harmlessly, becausereadLockForMonthAndYear/readLockForQuarteruseMAX(edit_lock)and a voided row cannot mask a locked sibling. Closed without a code change. - [x] Completed milestones split out of the progress tracker:
docs/progress_tracker.mdhad grown to ~440 lines, mostly history. It now holds only Current Status, Blocking, Open Non-Blocking and Backlog (~55 lines). All finished work, including the Archive, moved verbatim to the newdocs/completed_milestones.md, which carries its own rules: newest first,### Post-<X.Y> developmentsections keyed on the latest release, a(shipped in X.Y)suffix at release time, never delete. The skills (/update-docs,/tackle-issue,/release,/debugging,/update-skills),CLAUDE.md,docs/ai_agent_instructions.md,docs/INDEX.md,docs/README.md, the rootREADME.mdand the docs that pointed at "Completed Milestones" now point at the new file./update-docslowers the tracker size limit to 150 lines./releaseno longer asks for a "previous release" pointer in Current Status, which contradicted the single-release rule.
Post-10.10 development — October 2026 (shipped in 10.11)¶
- [x] CI built with the wrong compiler, which hung
test_settingsdialogand put the release installer at risk: the 10.11 release CI stalled indefinitely at suite 7 (settingsdialog) on every commit that contained it, while it passed locally in under a second. Diagnosis, through a throwawayfeature/branch: a first guess (QPrinterInfoblocking without a print spooler) was stubbed and disproved. Running the exe directly on the runner showed it never started: exit0xC0000139STATUS_ENTRYPOINT_NOT_FOUND. Under ctest that loader failure shows as a modal "Entry Point Not Found" dialog that nobody can close, hence the hang. The import table explained it:install-qt-actioninstalls the Qt 6.4.3win64_mingwDLLs, which are built with MinGW 11.2 (MSVCRT), but not the toolchain itself. CMake therefore picked the runner's preinstalledC:\mingw64, a newer UCRT GCC, and those binaries load Qt's older bundledlibstdc++. Most suites happened to use only symbols present in both;settingsdialog.objpulled one that is not. The release job ships an exe built the same way, so this was a latent risk for the published installer, not just a test problem. Fix: Qt's owntools_mingw1120is no longer on the Qt online repo, so both CI jobs install MinGW GCC 11.2.0 posix-seh MSVCRT from Chocolatey (mingw 11.2.0.07112021, winlibs) and pass it to CMake explicitly. The release job also puts it onPATH, sowindeployqtdeploys the matching runtime. A newCheck runtime of built executablesstep fails the build if any exe imports the UCRTapi-ms-win-crt-*DLLs. The printer stub was reverted because it was not the cause. Kept as hardening: a 120 s CTestTIMEOUTon every suite (CI also passes--timeout 120) andtimeout-minutes: 45on the build job, so a future hang fails instead of holding a runner for the 6 h default. Files:.github/workflows/ci.yml,tests/CMakeLists.txt, docs. - [x] opencode configuration removed: the project no longer uses opencode, so
opencode.json(its command wrappers pointing at the skills) and.opencode/agents/dead-code-finder.md(a copy of the Claude subagent) were deleted. A sweep found no other live reference; the remaining mentions in this tracker are historical entries. Claude Code's.claude/skills/and.claude/agents/are the single source for AI-agent workflows. - [x] Configuración → Verifactu: show/hide toggle for the service key: the ServiceKey field was masked with no way to reveal it, so the user could not check what had been typed or pasted. A checkable Mostrar / Ocultar
QToolButtonnow sits beside the field and switches theQLineEditecho mode betweenPasswordandNormal. It changes the display only: the text, the save path and the DPAPI-at-rest storage are unchanged. A button was chosen over an eye-iconQActionbecause the project ships no eye icon and a text-only trailing action would render blank. Hidden by default comes free: both callers (MainWindow, and the first-run prompt inmain.cpp) build the dialog on the stack for each open. New suitetest_settingsdialog(15 suites now) drives the real dialog offscreen, pointingAppSettingsat a throwaway file through the existingloadFromseam and never accepting the dialog, so the real~/.laideal_settings.jsonis untouched. It checks masked by default, reveal without changing the text, hide again, and masked on reopen. Verified non-vacuous by stubbing out the toggle'ssetEchoMode. Files:src/appsettings/settingsdialog.cpp,tests/{test_settingsdialog.cpp,CMakeLists.txt}, docs. - [x] Contabilidad reports end with a detail annex of the tickets and gastos behind each summary: requested so the user can audit or debug exactly what each figure is made of. Every period (trimestral, mensual, and each quarter of the annual report, placed after the consolidated summary) now ends with Detalle de ingresos: one line per paid ticket with nº recibo, fecha de pago, cliente, garment count, base, IVA and importe. It is followed by Detalle de gastos: fecha, nº factura, empresa, servicio, IVA %, base, cuota and importe. Each table ends with a total row. Reconciliation by construction: the issue warned against duplicating the
WHERE, so the period predicates were lifted into shared constants insql_lite.cpp(kIngresosIncomeWhere,kGastosPeriodWhere). The existingtotalPriceBetweenDates/countOperationsBetweenDatesand the newincomeTicketsBetweenDates/expensesBetweenDatesall use them, as does the groupedannualAccountingByQuarter, which previously kept its own copy. A detail table therefore cannot list a row its summary excluded.totalPriceBetweenDatesnow accumulates and returnsdoubleinstead offloat, so a large quarter's total row cannot differ by a cent from the summary. Theverifactu-compliance-auditorreview confirmed the shared predicate is identical to the previous inline SQL and flagged both of these points. Release-review follow-ups (10.11): a gastos row with a NULL or non-standard IVA (e.g. 4 %) was listed and totalled in the detail but summed in no summary column. Such rows are now marked*, kept out of the detail total, and explained in a note under the table.ExpenseDetail::ivais-1for NULL, so NULL is not mistaken for sin IVA. The annual annex no longer runs 8 per-quarter scans:sql_lite::annualDetailsByQuarterfetches the year once per table and buckets rows by quarter through the same collectors as the period listings. It is asserted equal to the four per-quarter calls, including a ticket paid across two quarters. The reconciliation tests now hold thedoubletotals indouble. All three were verified non-vacuous. Ingresos lines aggregate garment rows byn_recibo, so the line count equals "Número de tickets". The annual summary still comes from the groupedannualAccountingByQuarter, whichtest_annualAccountingByQuarteralready pins to the per-period helpers. Rendering is in the pure staticsContabilidad::createHtmlDetailIngresos/createHtmlDetailGastos, with HTML-escaped client and company names and borderless zebra tables for multi-page output.contabilidadnow linkssql_litePUBLIC because its header exposes the row types. Tests:test_sql_liteasserts both listings reconcile with the total and count helpers, including ANULADA, RECTIFICADA, voided-in-place and half-open-end rows.test_contabilidadcovers the renderers. Both were verified non-vacuous by breaking the listing filter and the gastos base split. The PDF layout itself is not machine-checked; review a generated report in the app. Files:src/sql_lite/{sql_lite.h,sql_lite.cpp},src/contabilidad/{contabilidad.h,contabilidad.cpp,CMakeLists.txt},tests/{test_sql_lite.cpp,test_contabilidad.cpp,CMakeLists.txt}, docs. - [x] Recogida de Prendas
Importe totalno longer counts voided garments: reported from the shop. A search by Pago date for 07-08-2026 added ticket 31045 to the total although it had been voided. Root cause:voidGarmentRow(local void via Anular prendas) keepspagado = 'NO'but stampsfecha_pagowith the void date, so a voided garment matches a Pago-date search, and the total loop inon_pb_search_clickedsummedimporteover every proxy row. The first fix followed the issue text and counted only paid rows. The 10.11 release review then caught that this applies to every search mode: an unpaid ticket searched by number showed 0.00 instead of the amount owed, and a Recepción search lost the day's intake. The final rule, chosen by the user, skips only rows excluded from every total, via the puresql_lite::garmentExcludedFromTotals:verifactu_estadoANULADA(voided in place or cancelled at AEAT) orRECTIFICADA(superseded). Unpaid rows count again. The excluded states now live in one list,kTotalsExcludedEstados, which builds both this C++ check and thekIngresosIncomeWhereSQL, so the panel and Contabilidad cannot drift apart. The listing still shows voided rows, which is useful for auditing. Testtest_garmentExcludedFromTotalswas verified non-vacuous. Files:src/sql_lite/{sql_lite.h,sql_lite.cpp},src/recog_prendas/recog_prendas.cpp,tests/test_sql_lite.cpp, docs. - [x] New AI components adapted from addyosmani/agent-skills, gaps only: reviewed the 4 agents and 25 skills there and adopted only what this mature repo lacked. Generic duplicates were skipped:
code-reviewer,security-auditorandcode-simplificationare covered by the built-in/code-review,/security-reviewand/simplify; planning, docs and git-workflow skills are covered by/tackle-issue,/update-docsand/release; the web-only ones (Core Web Vitals, browser DevTools, frontend UI) don't apply. Each new piece is rewritten for Qt/C++/CTest and points at existing docs rather than copying them.test-engineersubagent (adapted from theirs): finds the coverage gap and writes Qt Test cases using the four seam patterns fromarchitecture.md§Testing. It must prove every new test fails against the bug, which is the repo's recurring "verified non-vacuous" practice, and it reports a needed seam extraction instead of refactoring production code on its own. It preloads/coding-guidelines./debuggingskill (adapted fromdebugging-and-error-recovery): reproduce from the shop report,~/.laideal.log, a copy of the live DB (never the DB itself) or the captured AEAT response; localize by layer with a symptom table drawn from past fixes; reduce, fix the cause, guard, verify.verifactu-compliance-auditorsubagent (project-specific, read-only, proactive): checks a diff against the ten requirements inverifactu-requirements.md, the one review a generic reviewer cannot do.guidelines-auditorsubagent: runs the existingcoding_guidelines_audit.mdmethod and returns tiered findings plus a delta, mirroring howdead-code-finderfeeds its report./tackle-issuenow routes bugs through/debugging, may delegate coverage totest-engineer, and runs the compliance auditor on Verifactu-sensitive diffs; the existing steps are unchanged. Files:.claude/agents/{test-engineer,verifactu-compliance-auditor,guidelines-auditor}.md,.claude/skills/{debugging,tackle-issue,update-skills}/SKILL.md,CLAUDE.md,docs/{ai_agent_instructions,INDEX,coding_guidelines_audit}.md. - [x] AI-agent layout migrated from
.claude/commands/to.claude/skills/: the five workflows (coding-guidelines,release,tackle-issue,update-docs,update-skills) moved (git mv, history kept) to.claude/skills/<name>/SKILL.md, the layout Claude Code now documents as standard (commands still work but are the legacy form). The real gain is the new YAML frontmatter, not the move. Legacy commands were already offered to the model, but with nodescriptionthe model only saw the H1 title ("Code Development Guidelines"), so auto-triggering was weak. Each skill now has a trigger-firstdescription. Invocation control:/releasesetsdisable-model-invocation: true(it merges tomaster, pushes a tag and publishes, so it must never fire on its own);/coding-guidelinessetspaths: src/**, tests/**, **/CMakeLists.txtso it auto-activates only when code is touched; the rest stay user + auto./tackle-issueand/releasegained anargument-hint./update-skillswas rewritten for the new format: skill vs subagent, frontmatter fields, invocation flags, and agent frontmatter, with links to the official docs. Also fixed/tackle-issue's self-contradicting "200-char cap" (the rule is 300).dead-code-finderwas already in the correct.claude/agents/layout and is unchanged. References updated inCLAUDE.md,docs/ai_agent_instructions.md(plus/review→/code-review),docs/INDEX.md(plus a broken relative agent link),docs/coding_guidelines_audit.mdandopencode.json. Adopting more agents and skills (e.g. adapting addyosmani/agent-skills'code-reviewer,test-engineer,security-auditorto Qt/C++) is left as a separate follow-up. Files:.claude/skills/*/SKILL.md,CLAUDE.md,opencode.json, docs.
Post-10.9 development — September 2026 (shipped in 10.10)¶
- [x] AEAT reconciliation picks the accepted record, not the first one (ticket 31121): reported from the shop — "Actualizar con los datos de AEAT" stayed greyed out on an invoice that was demonstrably registered (the operator validated it by hand in the AEAT sede). Root cause found in a captured log: the vendor stores every submission ATTEMPT, not one record per invoice. The query for
31121returnedCount: 5— four duplicate-rejections (ErrorCode 9999,CSV: null,ValidationUrl: null, one per retry the operator had made) plus the original acceptance from 08-09 carryingStatusResponse "Correcto",CSV "A-…"and the AEATValidationUrl. The accepted record was the last element, and the parser tookItems[0], so it read a failure: no CSV →hasUsableCsv()false → the adopt button disabled. Fixed by scanning for the accepted record (CSV present, noErrorCode, notIsRejected) and falling back to the first only so the dialog can still show what came back;VerifactuRemoteRecordgainsrecordCount, and the dialog now explains when several attempts were returned and distinguishes "datos no coinciden" from "ningún registro fue aceptado". Note the earlier single-record fixture could not have caught this — it took a real retried ticket to expose it. Regression test built from the captured 5-record shape (redacted), verified non-vacuous by restoringItems[0]and watching it fail. Files:src/verifactu/{verifactutypes.h,verifacturesponse.cpp},src/recog_prendas/recog_prendas.cpp,tests/test_verifactu_response.cpp, docs. - [x] Reprinted recibos now show IMPORTE PAGADO for a paid ticket: reported from the shop after 10.9. The 10.9 fix covered
PayDialog's AEAT-timeout fallback, but the reprint path from Recogida de Prendas is different code and hardcoded the marker off at threebuildTicket(..., /*addPayedInfo=*/false)call sites inImprimir, so a fully-paid ticket reprinted from the pickup panel never showed the payment. Fixed for the two recibo sites; the third (the multi-event loop) and the single-seq factura branch stayfalsedeliberately — a factura implies payment and omits the marker on every path, includingMainWindow::printFra. The rule is all garments paid, not any: a reprinted recibo shows the whole ticket total, so "any paid" would mark a partially-paid ticket as settled in full. Extracted as the tested seamsql_lite::ticketAllGarmentsPaid()(strictpagado='SI', so a blank never reads as paid, plus aCOUNT > 0guard so an empty result cannot print the marker on nothing) rather than readingImprimir's live model inline — which also keeps it out of the integration-only bucket its siblingcheckAnyItemPaid()sits in. Verified non-vacuous by restoring the hardcodedfalseand watching the behaviour revert. Files:src/sql_lite/{sql_lite.h,sql_lite.cpp},src/imprimir/imprimir.cpp,tests/test_sql_lite.cpp, docs. - [x] Reception date made display-only in Recogida de Prendas: the sibling of the payment-date fix shipped in 10.9.
de_date_recephad nodateChanged/editingFinishedhandler either, so edits to it were silently discarded for the clicked row — but unlike the payment date it was not inert: its one remaining reader isSEPARATE_GARM, which copies it onto the split-off row. So typing a date changed nothing visible, then silently applied to a garment split off afterwards. NowsetReadOnly(true)with no spin buttons and a tooltip, which is also the correct semantic (a split-off garment belongs to the same ticket and arrived the same day) and closes a subtler hazard:fecha_recepcionis what the Verifactu startup-recovery floor gates on (sql_lite::pendingVerifactuEvents), so a hand-typed value could shift a row in or out of the recovery window. Pure UI wiring, not unit-testable; the DB-level consequences are already covered (insertGarmentRowpersists what it is handed,pendingVerifactuEventspins the floor behaviour). Files:src/recog_prendas/recog_prendas.cpp,docs/modules/recog_prendas.md. - [x] Progress tracker archived down to a readable active section: the file had grown to 419 lines against a 250 soft limit. Everything from the pre-8.0
feature/add_mdiago_verifactubuild-out downwards was moved below the Archive header (nothing deleted, per the tracker rules), cutting Completed Milestones from 343 to 126 lines. Because that block already sat immediately above the Archive header, the move is a two-line diff — the header simply relocated above it.
Post-10.8 development — September 2026 (shipped in 10.9)¶
- [x] Manual smoke test formalised as
docs/smoke_test.md, and the three bugs it caught: the automated suite proves the pure and DB-level logic but structurally cannot reach the real network, the real printer, the migration running on a real database, or Qt signal/slot wiring with no testable seam. A full manual pass against a copy of the live DB (19 501 rows) found three defects, all fixed: (1)PendingSubmitsDialogpersisted a literal'Error'instead of the canonicalERROR;verifactuEstadoFromString()compared exactly, so those rows decoded as un-submitted and silently lost their "Reintentar envío a AEAT" button (it tests== VerifactuEstado::Error), and the QR-blocking check inImprimirwas defeated too. Fixed at the writer (bindverifactuEstadoToString), normalised for existing rows inmigrateDatabaseviaUPPER(), and the reader is now case-insensitive as a safety net — the stored value had to be corrected because the SQL filters elsewhere compare case-sensitively. (2) "Consultar en AEAT" was gated to unsettled rows only, which blocked the one way to verify what AEAT holds for a registered invoice; it is now offered on any paid row (the query is read-only) while the adopt button is disabled where there is nothing to adopt. (3) The Recogida de Prendas payment-date field was inert — nothing ever wrote it back, its only writer being the unreachablePAY_YESpath — so operator edits were silently discarded; made display-only, sincefecha_pagois part of the AEAT invoice identity and editing it after submission would make a retry register a second invoice and stop reconciliation matching. The checklist is now a release gate (/releasestep 1). Files:docs/smoke_test.md(new),src/app/pendingsubmitsdialog.cpp,src/sql_lite/sql_lite.cpp,src/verifactu/verifactutypes.h,src/recog_prendas/recog_prendas.{h,cpp},tests/{test_verifactu_models,test_sql_lite}.cpp. - [x] Migration verified to move zero money, on real data: income per quarter compared against a genuine pre-migration
backups/snapshot came out identical to the cent (2026 Q1 8 470.24, Q2 14 777.65, all-time 219 745.98), whilePENDIENTE 349 → 30andSIN COBRAR 0 → 319— 349 = 30 + 319, andANULADA/ENVIADA/ERROR/the 18 678 legacy NULL rows all unchanged. This is the empirical backing for scoping the backfill to the literal'PENDIENTE': had blanks been normalised too, that would have been an 18 678-row rewrite altering what prints on invoices. Note a copy of the live DB taken after the new build has run is not a valid baseline (it is already migrated) — thebackups/snapshots are. - [x]
GetFilteredListconfirmed working against the live service, and the parser pinned to the real schema: a captured reply proved the endpoint answers, the envelope isItems, and — decisively — that theInvoiceIDfilter is applied server-side (Count: 1for a specific id, not the whole table). Every first-choice field name guessed while blind turned out correct (InvoiceID,InvoiceDateas ISO-8601 with a time component,TotalAmount,CSV,StatusResponse,ValidationUrl). The speculative fallbacks were then removed: once the shape is known they are a liability, because the same record also carriesExternKeyandCreated, which are not the InvoiceID and not the invoice date, and a wrong-field match is worse than no match. The real payload also revealedIsRejectedandErrorCode, now required to be clear before a CSV may be adopted — a record AEAT rejected can still come back from a query. Fixtures captured from live traffic are committed redacted (NIF, company name, user e-mail, CSV) because the repository is public. Files:src/verifactu/{verifactutypes.h,verifacturesponse.cpp},tests/test_verifactu_response.cpp. - [x] Reconcile an "already exists" rejection against AEAT's own record (
GetFilteredList): the remaining half of the offline/slow-AEAT problem. Once AEAT has registered an invoice whose reply we lost, no retry can ever succeed — it can only answer "ya existe" — so the row was stuck at ERROR with the operator's only recourse being the AEAT sede by hand. This supersedes the assessment recorded in the 8.x "operator-surfaced recovery dialog" milestone below, which rejected auto-reconcile on the grounds that the Irene Solutions Kivu API had "no confirmed idempotent lookup-by-InvoiceID endpoint". That turned out to be wrong: the vendor's own REST client exposes<base>/GetFilteredList(confirmed againstmdiago/VeriFactu'sNet/Rest/ApiClient.cs+Config/Settings.cs, same base URL we already use), and ourrest_api.mdhad documented the matchingFilterSet/Filterobjects all along — namingInvoiceIDas a validFieldName— under "Not implemented (reserved for future)". What is unknown, and how it is contained: the vendor does not publish the response schema (its own client parses it into an untypedExpandoObject) and there is no sample response anywhere reachable. Since flipping a row to ENVIADA asserts a regulatory fact, the design never trusts the parse alone:parseVerifactuQueryResponse()probes several plausible envelopes (Return/Records/List/bare array) and field spellings, and crucially distinguishes "AEAT does not have it" from "we could not read the answer" — a failed query or an unparseable body yieldsparsed=false, never a confident absence.verifactuRemoteMatches()then requires the InvoiceID, the date and the amount to agree to the cent, treating a missing date or a zero amount as missing evidence rather than agreement. Only then, and only with a non-empty CSV, is the write offered — and it is always the operator who confirms it, in a dialog showing AEAT's record beside ours with the raw payload one click away. The raw JSON is also always logged, so the first real reply is what lets the candidate field names be narrowed to the truth. The write issql_lite::reconcileVerifactuFromAeat(db, nRecibo, seq, csv, url): sets ENVIADA + CSV + validation URL + timestamp, clears the error, scoped to the event's paid rows, and refuses an empty CSV or a row alreadyENVIADA/ANULADA/RECTIFICADA(re-stamping those would revive a deliberately superseded invoice). Triggers: a "Consultar en AEAT" button in the Verifactu detail dialog for any unsettled row, and an automatic query when a submission is rejected as duplicate — detected byverifactuErrorIsDuplicate(), matched on wording (Spanish + English stems) because no stable code is published. Read-only against AEAT:queryInvoiceAsyncanswers on its ownqueryFinishedsignal so it can never be mistaken for a submission reply. Tests:test_verifactu_responsegains the parser (envelope + alternative spellings + ISO dates + comma decimals + nested detail), the absent-vs-unreadable distinction, the duplicate-wording detector and the full match gate;test_sql_litegains the reconcile write and its four refusals. The match gate was verified non-vacuous by weakening it and watching the test go red. Caveat: the parser fixtures are hypothetical shapes, not captured traffic — they pin the parser's behaviour, not the real schema, which stays unconfirmed until the first live query. The dialog wiring itself is untested UI. 14 suites green. Files:src/verifactu/{verifactutypes.h,verifacturesponse.h,verifacturesponse.cpp,verifactumanager.h,verifactumanager.cpp,verifactuintegration.h,verifactuintegration.cpp},src/sql_lite/{sql_lite.h,sql_lite.cpp},src/recog_prendas/{recog_prendas.h,recog_prendas.cpp},tests/{test_verifactu_response,test_sql_lite}.cpp, docs. - [x] Offline / slow-AEAT handling: four defects behind the "ticket sin Pagado ni QR, y al día siguiente dice que ya existe" field report: traced from the customer report. Root trigger is that both UI waits are shorter than the network layer's own timeout —
VerifactuManagersets a 10 s transfer timeout while MainWindow waits 3 s and PayDialog 5 s — so a merely slow AEAT (not just a dropped line) routinely leaves the UI having given up on a request that is still perfectly alive. Four independent fixes, each committed separately: - The QR-less recibo now says IMPORTE PAGADO.
PayDialog::printPartialFacturahardcodedaddPayedInfo=false, but it is only ever reached afterpersistPaymentmarked the rowspagado='SI'— so on an AEAT timeout the customer got a ticket showing neither the payment nor a QR (the QR is absent by design:isRecibo = qrCode.isNull(), and recibos never carry one). Now passesui_impr->isRecibo, i.e. the marker appears exactly on the recibo fallback; facturas keep omitting it as every other print path does. Newtest_escpos::test_renderPaidMarkerpins the renderer contract both ways. - A transport failure is no longer recorded as a definitive ERROR. PayDialog already treated
NETWORK_ERROR/PENDINGas an unknown outcome, but MainWindow and the RecogPrendas retry passed any non-success straight through toError. New pureverifactuEstadoForResult(status)(SUCCESS→Enviada, ERROR→Error, everything else→NotSubmitted) is now used insideupdateTicketVerifactuFields, fixing every caller at once. An unknown outcome also keeps its InvoiceID so a retry reuses the identity AEAT may already hold. This was the main engine of the report: anERRORrow offers a "Reintentar" that, when AEAT did register the invoice, can only ever answer "already exists". - The RecogPrendas retry is seq-aware. It submitted the bare
n_recibowithSUM(importe)over the whole ticket on the reception date — so retrying a partial payment sent the wrong amount under an InvoiceID belonging to a different event, on a date AEAT never keyed it on (a third route to "already exists", and one that could have registered a wrong amount if it did not collide). New tested seamsql_lite::verifactuEventFor(db, nRecibo, seq)returns that event's own paid total and originalfecha_pago;retryVerifactuSubmit(ticketNum, seq)uses it and refuses to submit when no paid event exists.RecogPrendas::m_pendingSubmitsbecomesreqId → {ticketNum, seq}so the reply patches the right rows. - A late AEAT reply is no longer discarded.
PayDialogis stack-allocated byRecogPrendasand dies withexec(), and its timeout clearedm_pendingReqId— so a reply arriving at, say, 7 s hitrequestId != m_pendingReqIdand was dropped, including a SUCCESS carrying the CSV. That guaranteed a falsely-PENDIENTErow whose next-day recovery retry was doomed. The dialog now emitssubmitAdopted(reqId, ticketNum, seq)before closing andRecogPrendasadopts the request, so the existing handler applies the reply. On a late success both PayDialog and MainWindow now tell the operator the factura with QR can be printed rather than silently reporting a CSV for a ticket the customer already left with. Wait policy deliberately unchanged (3 s / 5 s): with (4) in place a longer wait buys only the chance of printing the QR on the first pass, at the cost of freezing the counter for up to 10 s on every sale when AEAT is slow. The late-confirmation message covers the same need without the hang. Raising the waits to match the 10 s transport timeout remains an option if the shop would rather wait than reprint. Not unit-tested: (4) is Qt signal/slot + dialog-lifetime wiring, and (1)'s call-site wiring; a harness would need a fakeVerifactuIntegrationthat emitsrequestFinishedon demand plus headless-constructibleRecogPrendas/PayDialog. The DB-level consequences of both are covered (updateTicketVerifactuFieldstests). 14 suites green. Files:src/verifactu/verifactutypes.h,src/sql_lite/{sql_lite.h,sql_lite.cpp},src/recog_prendas/{pay_dialog.h,pay_dialog.cpp,recog_prendas.h,recog_prendas.cpp},src/app/{mainwindow.h,mainwindow.cpp},tests/{test_escpos,test_verifactu_models,test_sql_lite}.cpp, docs. - [x] A ticket's first partial payment no longer stamps the unpaid remainder with the AEAT result: found while auditing the
SIN COBRARsplit for regressions (the split itself was clean; this turned out to be a pre-existing bug going back to the 8.5 partial-payment feature).nextVerifactuInvoiceSeqcomputesCOALESCE(MAX(verifactu_invoice_seq), -1) + 1over rows wherepagado = 'SI', so for a ticket with no paid rows yet that set is empty and the first payment event gets seq 0 — which the still-unpaid siblings also carry (already pinned bytest_nextVerifactuInvoiceSeq).PayDialog::persistPaymentcorrectly scopes the payment itself to the selected hashes, but the AEAT write-backs then ranWHERE n_recibo = ? AND verifactu_invoice_seq = ?, which also matched the unpaid remainder: those garments were stampedENVIADA+ CSV + an InvoiceID for an invoice that never covered them (orERROR/PENDIENTEon a failure/timeout). Quarterly income was never affected — every accounting query gates onpagado = 'SI'first — but the mislabelled rows became non-voidable in "Anular prendas" (garmentIsLocallyVoidablerequires an unsubmitted estado) and fed a spurious CSV into the print path'shasCsvcheck. Fixed by addingAND pagado = 'SI'to both write-backs (sql_lite::updateTicketVerifactuFieldsandPayDialog::markPendingVerifactu). That predicate was chosen over scoping to the paid hashes because it also covers the two retry paths (RecogPrendas::retryVerifactuSubmitand thePendingSubmitsDialogrecovery retry) which share the same seq-0 exposure but have no hash list; it is correct for all four callers, since an AEAT result can only ever belong to a paid row.nextVerifactuInvoiceSeqwas deliberately left alone — starting the first event at seq 1 would change the AEAT InvoiceID of a ticket's first payment from the bare<n_recibo>to<n_recibo>-1, a submission-identity change with no upside once the write-backs are scoped.updateTicketVerifactuFieldshad no test coverage at all, which is how this survived; two now pin it (success and AEAT-error), both verified to fail without the guard.test_sql_litegains an include path tosrc/verifactu(header-onlyVerifactuResult, no lib link). 14 suites green. Files:src/sql_lite/sql_lite.cpp,src/recog_prendas/pay_dialog.cpp,tests/test_sql_lite.cpp,tests/CMakeLists.txt, docs. - [x]
VerifactuEstadosplit intoUnpaid("SIN COBRAR") andNotSubmitted("PENDIENTE"): closes the Open Non-Blocking entry of the same name, the residual from issue #43.verifactu_estadonow says which of the two situations a row is in instead of leaving it to be inferred frompagado/fecha_pago: SIN COBRAR = unpaid, no invoice to send; PENDIENTE = paid and due at AEAT (submitted and awaiting a reply, or not yet sent). Writers pick per row —MainWindow::saveTicketandAddGarment::saveFacturaboth branch onrow.pagado;PayDialogand the rectificativa placeholder keep writing PENDIENTE because both are paid by construction. The load-bearing risk is on the read side: paying a garment does not rewriteverifactu_estado, so a row is still SIN COBRAR at the exact momentRecogPrendasdecides whether to submit it — a gate testing== NotSubmittedalone would have silently stopped paid garments from reaching AEAT (a compliance failure far worse than the cosmetic bug #43). Both such gates now go through the new pure helperverifactuEstadoIsUnsubmitted()(true for Unpaid, NotSubmitted, and legacy blank):sql_lite::garmentIsLocallyVoidable(keeps "Anular prendas" working on the new state) and theRecogPrendasPAY_YES submit trigger. Other read sites needed no change — they compare againstENVIADAexactly, or block only onANULADA/RECTIFICADA/ERROR, and the accounting filters (!= 'ANULADA' AND != 'RECTIFICADA') pass SIN COBRAR through exactly as they did PENDIENTE. Migration: a one-time idempotent backfill inmigrateDatabasere-labels unpaid'PENDIENTE'rows as'SIN COBRAR'. It is scoped to the literal'PENDIENTE'and deliberately leaves NULL/''alone — those are legacy split-off garments, andImprimir's event-list query plusCancelInvoiceDialogdetect them viaverifactu_estado != '', so making them non-empty would have added a spurious event group to printed invoices.pendingVerifactuEventskeeps its #43 payment gate as belt-and-braces (the estado filter now excludes SIN COBRAR on its own, but the gate still covers those untouched legacy blanks). Tests:test_verifactu_models::test_estadoIsUnsubmittedpins the "every other gate treats the two alike" contract,test_estadoRoundTripcovers the new value,test_sql_lite::test_migrateDatabase_backfillsUnpaidAsSinCobrarpins both migration boundaries (a paid pending row survives; a blank row stays blank) plus idempotency,test_pendingVerifactuEvents_excludesSinCobrarand an extragarmentIsLocallyVoidablecase cover the readers. 14 suites green. Files:src/verifactu/verifactutypes.h,src/sql_lite/{sql_lite.h,sql_lite.cpp},src/app/mainwindow.cpp,src/add_garment/add_garment.cpp,src/recog_prendas/recog_prendas.cpp,src/app/voidgarmentsdialog.h,tests/{test_verifactu_models,test_sql_lite}.cpp, docs. - [x] CI: bump Node 20 actions to v5: GitHub Actions was force-running
actions/checkout@v4,actions/upload-artifact@v4andactions/download-artifact@v4on Node 24 and warning that Node 20 is deprecated; the shim will eventually be removed and break the build + release pipeline. A first pass to@v5only half-fixed it — CI still warned, becauseupload-artifact@v5anddownload-artifact@v5/v6are themselves Node 20; onlycheckout@v5,upload-artifact@v6+anddownload-artifact@v7+run on Node 24 (verified by readingruns.usingin each major'saction.yml). Final state:checkout@v5,upload-artifact@v7,download-artifact@v8inci.ymlandcheckout@v5indocs.yml. Upload/download were taken to the current matched pair — v7 and v8 are the two halves of the same direct-upload feature — and the three inputs actually used (name,path,if-no-files-found) are unchanged.setup-python@v5/upload-pages-artifact@v3/deploy-pages@v4were left alone: not flagged, and out of scope for a warning fix. Verification gap:download-artifactruns only in the tag-gatedreleasejob, so adeveloppush exercises the upload side only. If v8 ever misbehaved the release job would fail at the download step, which happens before packaging and publishing, so a broken artifact cannot reach the GitHub release. Files:.github/workflows/ci.yml,.github/workflows/docs.yml.
Post-10.7 development — September 2026 (shipped in 10.8)¶
- [x] "Envíos Verifactu pendientes" no longer lists unpaid tickets (issue #43): reported from the shop — on startup the recovery dialog showed every ticket at
verifactu_estado='PENDIENTE', none of them paid, so none of them ever due for AEAT submission. Traced the save path:MainWindow::saveTicketstamps every garment rowPENDIENTE(VerifactuEstado::NotSubmitted) regardless ofpagado, while the actual submission is gated onif (isPaid)inon_bb_save_reset_clicked— an unpaid ticket is correctly never sent, but its rows sit atPENDIENTEuntil collection and payment inPayDialog. The dialog's feed,sql_lite::pendingVerifactuEvents, filtered only on estado + the reception-date floor, with no payment gate, so the normal steady state of the shop (garments in store awaiting collection) read as unreconciled in-flight AEAT submissions. The string"PENDIENTE"conflates "not due to be sent" with "sent, reply lost"; onlyonRetryClickeddistinguished them, one step too late (it refuses a row with nofecha_pago). Why now: the default recovery floor is2026-09-01, so from 1 September every newly-entered ticket cleared the floor and the dialog began filling up. Fixed by addingAND pagado = 'SI' AND fecha_pago IS NOT NULL AND fecha_pago != ''to the query —fecha_pagois the real gate (it is what a retry must re-submit under),pagadois the weaker literal-string check kept alongside it. Verified no recoverable event is lost: every writer that leaves a genuinely pending row sets both columns — save-time paid ticket (fecha_pago = fecha_recepcion),PayDialogpartial pay (seq>0), and theRectifyInvoiceDialogplaceholder (pagado='SI'). Newtest_sql_lite::test_pendingVerifactuEvents_excludesUnpaidmirrors the corner case both ways (samen_recibo: unpaid save-time event excluded, paid partial-pay event still surfaced) plus apagado='SI'row with nofecha_pago; confirmed it fails without the gate. 14 suites green. Files:src/sql_lite/sql_lite.cpp,tests/test_sql_lite.cpp, docs.
Post-10.6 development — July 2026 (shipped in 10.7)¶
- [x] Anular prendas: stamp the cancellation date, and keep observations editable on a voided row: two in-shop follow-ups to the "Anular prendas" tool. (1)
sql_lite::voidGarmentRownow also writesfecha_pagoandfecha_recogidawith the current date (dd-MM-yyyy), so the DB records when a garment was anulada — previously both stayed empty and the cancellation had no timestamp anywhere. Accounting is unaffected: the row keepspagado='NO'and getsverifactu_estado='ANULADA', and every accounting query filters onpagado='SI'plus a not-ANULADAestado, so a stampedfecha_pagocan never leak into a quarter total. (2) In Recogida de Prendas, theobservacionesfield is no longer read-only for an Anulado row:updateRowClickedToFields()leavesle_obsvwritable andupdateDb()'s Anulado early-return now exempts theOBSVop, so staff can record why the garment was voided or add later notes. All other edit paths (pay / pickup / split / re-price) stay locked. Tests updated:test_voidGarmentRow_setsAnuladoAndScopesByHashasserts both dates equal today, andtest_markTicketPickedUp_excludesAnuladonow asserts a "Recoger todo" does not overwrite the voided row's cancellation date. 14 suites green. Files:src/sql_lite/{sql_lite.h,sql_lite.cpp},src/recog_prendas/recog_prendas.cpp,tests/test_sql_lite.cpp, docs. - Hardening prompted by the above (accounting-lock read made order-independent): because a voided garment now carries
edit_lock 0and a stampedfecha_pago, it becomes a matching row in the month-lock lookupsql_lite::readLockForMonthAndYear(which keys onfecha_pago LIKE '%-MM-yyyy'). That function previously took the first matching row'sedit_lock, so a voided (unlocked) row sorting ahead of a genuinely locked sibling could make an already-locked month read as open and let a write through. Changed the query toSELECT COALESCE(MAX(edit_lock), 0)so the month reads locked if any row is locked, regardless of order; an empty month still returns 0 (callers only branch on== 1/== 0, andFacturasrelies on empty → 0 to allow an expense in a fresh month).readLockForQuarteralready used theCOUNT(*), COALESCE(MAX(edit_lock),0)shape, so this only aligns the month variant.test_readLockForMonthAndYearextended with an unlocked-row-inserted-first case that returns 1 (would have returned 0 under the old read). Files:src/sql_lite/sql_lite.cpp,tests/test_sql_lite.cpp, docs.
Post-10.5 development — July 2026 (shipped in 10.6)¶
- [x] Status API watchdog recalibration (warning was suppressed on lid-open): after the shop reinstalled APD6 (which fixed the
BiOpenMonPrinterhang), the diagnostic showed every call fast, but lid-open prints still showed no warning. Cause: the watchdog timeout (4 s) was below the offlineBiDirectIOExsend time, so a normal offline send tripped the watchdog first -> it returnedstatus.valid=false, suppressed the warning, and latched the API off for the session. Key finding from the field logs: the DLL'sERR_ACCESS(-80) path on an open cover / no paper returns after its own internal ~5 s and ignores ourBiDirectIOExtimeout parameter (lowering it 5000 -> 2500 ms did not speed up the-80case). So the fix is to size the watchdog well above that: set it to 10 s (was 4 s, briefly 6 s which left only ~0.3 s margin over the real ~5.5 s offline send and would still occasionally false-trip). A genuine hang is indefinite, so 10 s cleanly separates "normal offline" from "hung". Confirmed on the shop TM-T20III: lid-open now shows the warning and queues via RAW, normal prints are unaffected. Root cause of the whole saga (BiOpenMonPrinterhang) was a printer firmware update that reset the interface config; reinstalling the APD6 Status API package restored it. Files:src/printing/statusapiprinter.cpp,src/imprimir/imprimir.cpp, docs. - [x] Status API diagnostic button ("Probar Status API") to pinpoint the firmware-induced hang: to find which
Bi*call the printer firmware update made block, addedStatusApiPrinter::runDiagnosticsBounded(queue, timeoutMs)- it opens the printer and calls each Status API function in sequence (BiOpenMonPrinter->BiGetStatus->BiGetType->BiDirectIOExa real-timeDLE EOT 1status request that does not print ->BiCloseMonPrinter), logging[diag]a line before and after each call with elapsed ms, and returns a report. It runs behind the same watchdog thread, so a hang cannot freeze the UI: the culprit shows as the last->line with no result after it, and the report ends with a "BLOQUEO" note. A "Probar Status API (diagnóstico)..." button in SettingsDialog (General tab, beside the Status API checkbox) runs it and shows the report (also in the log).src/appsettingsnow linksprintingforStatusApiPrinter; theDLE EOTrequest is safe (real-time status, no paper used). Not unit-tested (Win32 DLL / UI). 14 suites green. Next: run it on the shop TM-T20III and read which call stalls. Files:src/printing/{statusapiprinter.h,statusapiprinter.cpp},src/appsettings/{settingsdialog.cpp,CMakeLists.txt}, docs. - [x] Status API watchdog: a hung Epson DLL can no longer freeze the app: after a printer firmware update on the shop TM-T20III, enabling the Status API froze the app on every print - one of the synchronous
Bi*DLL calls (BiOpenMonPrinter/BiGetStatus/BiDirectIOEx) now blocks indefinitely on that printer, and it ran on the UI thread. Since the DLL is third-party and out of our control, wrapped it in a watchdog: newStatusApiPrinter::sendAndReadStatusBounded(..., timeoutMs)runs the DLL calls on a detached worker thread and waits at most 4 s (std::thread+condition_variable; notstd::async, whose future destructor would re-block). On timeout the UI thread abandons the worker (itsshared_ptrresult slot keeps it memory-safe), falls back to RAW, and latches the API off for the rest of the process so only one print pays the 4 s, not every one.Imprimir::printTicketnow calls the bounded variant. Net effect: the optional Status API can never freeze the POS again - worst case is one 4 s delay then silent RAW. Not unit-tested (threading/DLL/UI wiring, no pure logic); 14 suites still green. Workaround already in the field: the shop turned the setting off to unblock. Files:src/printing/{statusapiprinter.h,statusapiprinter.cpp},src/imprimir/imprimir.cpp, docs. - [x] Status API cover-open detection: read-before-send +
isFatalsplit + send-failure warning (hardware-driven): iterated on the shop TM-T20III to make the optional Epson Status API actually warn on an open cover. (1) ReorderedStatusApiPrinter::sendAndReadStatusto the APD6 manual's flow -BiOpenMonPrinter->BiGetStatus(read first) ->BiDirectIOEx(send) - since the send returnsERR_ACCESS(-80) while the cover is open, so a send-first design never read status. (2) NewPrinterStatus::isFatal()splits faults: fatal (cutter/mechanical/unrecoverable) -> warn and do NOT print; recoverable (cover/paper) -> warn but fall through to RAW so the spooler queues the job. (3) Hardware finding: this unit reports an open cover asASB_NO_RESPONSE(raw ASB0x1), notASB_COVER_OPEN(0x20) -BiGetStatussucceeds but decodes to "ready", and the send fails -80. So a specific "Tapa abierta" isn't obtainable here;Imprimir::printTicketnow warns generically ("comprueba tapa / papel / conexión") whenever the API send is refused and we reached a valid status, and still queues via RAW. A missing DLL leaves status invalid -> stays silent (RAW only). Kept a gatedqDebugof the raw ASB word inStatusApiPrinter(only logs when nonzero / read error) to identify the offline cause in the field. Newtest_escpos::test_printerStatus_fatalVsRecoverable(pure decode/classification). TheprintTicketwarning wiring is UI-coupled, not unit-tested. 14 suites green. Validated on the shop TM-T20III (APD6 Status API installed): the warning dialog appears for lid-open, no-paper and printer-off, and the ticket still queues via RAW and prints once the printer is fixed. Hardware quirk recorded: this unit reports printer-off as raw ASB0x1(ASB_NO_RESPONSE) and both lid-open and no-paper as0x4(and the value is not even stable per condition), so a specific "Tapa abierta" / "Sin papel" is not obtainable here - the send-failure-keyed generic warning is the right design. This closes the former "Validate the ESC/POS Status API on hardware" open issue. Files:src/printing/{printerstatus.h,printerstatus.cpp,statusapiprinter.cpp},src/imprimir/imprimir.cpp,tests/test_escpos.cpp, docs. - [x] Test coverage: Imprimir InvoiceID selection extracted to a pure seam: the "which InvoiceID to print" rule in
Imprimir::displayInvoiceId()was a first-non-empty scan over the ticket rows'verifactu_invoice_idcolumn with a bare-n_recibofallback, trapped behindImprimir'sQSqlQueryModel/QLineEditmembers and so untested. Extracted the pure decision intosql_lite::verifactuDisplayInvoiceId(const QStringList &invoiceIds, const QString &fallback)(sibling of the existingverifactuInvoiceIdformat seam);displayInvoiceId()now just gathers the column and delegates. Newtest_sql_lite::test_verifactuDisplayInvoiceIdlocks the invariant that matters - it picks the first NON-EMPTY literal (not row 0, which can be an unpaid row of a multi-event ticket with an empty id) and falls back to the baren_recibofor all-empty legacy (8.0-8.4) rows. The remaininggetTicketInfoseqWHEREfilter andresolveQrCodeQR gating stay parked as integration-only (see Backlog). 14 suites green. Files:src/sql_lite/{sql_lite.h,sql_lite.cpp},src/imprimir/imprimir.cpp,tests/test_sql_lite.cpp, docs. - [x] RecogPrendas: integer-only quantity (follow-up to the pre-payment editing feature): the review of the 10.5 feature noted that
le_qtyaccepted a decimal like2,5, whichtoInt()would store as cantidad2while the importe recompute used2.5- a divergence. Fixed at the source:initialSettings()installs aQIntValidator(1, 9999)onle_qtyso a non-integer count can't be typed, and Qt suppresseseditingFinishedwhile the field is notAcceptable, so the existingnewQty < 1guard in theQTYcase is now belt-and-suspenders. Files:src/recog_prendas/recog_prendas.cpp, docs.
Post-10.2 development — July 2026¶
- [x] RecogPrendas: edit quantity / service / importe before payment: the garment-pickup panel now lets staff correct a garment's quantity, service and amount while it is still unpaid, instead of only observations/size.
le_qtyandle_pricebecame editable and the read-onlyle_servicline edit was replaced by acb_servicQComboBoxoffering the two services the app prices (Limp./Plan.). Editing quantity (QTYop) or changing the service (SERVICEop) re-prices the row automatically viasql_lite::garmentImporte(importe = qty * unitPrice * size, unit price fromreadGarmentPrice);le_price(PRICEop) is a manual comma-normalised override applied last. All four widgets are gated bypriceEditable = !isAnulado && !isPaid && !editLockinupdateRowClickedToFields(a paid row was already submitted to AEAT), and everyupdateDbcase re-checks!editLock && pagado=="NO"as defense-in-depth. The combo writes onactivated(int)(user interaction only) so loading a row never fires a spurious write, and a legacyservicionot in the list maps tofindText()==-1-> blank rather than a wrong value. New DB seamsql_lite::updateGarmentServiceAndImporte(servicio + importe) withtest_sql_lite::test_updateGarmentServiceAndImporte; QTY reuses the existingupdateGarmentQtyAndImporteseam and PRICE reusesupdateTicketSizeAndPrice. Files:src/recog_prendas/{recog_prendas.ui,recog_prendas.h,recog_prendas.cpp},src/sql_lite/{sql_lite.h,sql_lite.cpp},tests/test_sql_lite.cpp, docs. - [x] Auto-update fixed for a hardened-
%TEMP%machine: per-user install + non-elevated launch withTMP/TEMPredirect: a shop report that the in-app update "only works when the app is run as administrator" turned into a three-layer investigation on the actual machine. (Layer 1) The installer targetedC:\Program Files\La Ideal(admin), so it was manifestedrequireAdministrator;QProcess::startDetached/CreateProcesscannot elevate, so launching it from a non-elevated app failed withERROR_ELEVATION_REQUIRED. A first attempt (released as 10.3, then retracted) switched the launch toShellExecuteW("runas")to raise the UAC prompt. (Layer 2) On-machine testing showed 10.3 still failed - the downloaded installer in%TEMP%could not be executed at all (not by the app, not by Explorer: "Windows cannot access the specified device, path, or file... permissions"). Its inherited%TEMP%ACL wasAdministrators:(F)+Everyone:(R,W,DC)with no execute for the normal user - a hardened Temp (the "AV/Controlled-Folder blocks executing from %TEMP%" the README warns about). Under UAC the Administrators SID is deny-only, so a non-elevated process fell toEveryone= no execute; the same file in%LOCALAPPDATA%\<app>\updatesgets<user>:(F)(execute allowed). (Layer 3) Even after downloading to that executable folder, Inno Setup's own loader extracts its bootstrap into%TEMP%and runs it there, so an elevated installer hit "Unable to execute file in the temporary directory. Error 5". A direct test proved UAC elevation resets the environment (an elevated child saw the default hardened%TEMP%, not aTMP/TEMPwe had set) - so redirecting Inno's temp only works if the installer runs non-elevated. Final fix (10.4): (a)releases/laideal.isssetsPrivilegesRequired=lowest-> per-user install to%LOCALAPPDATA%\Programs\La Ideal, no elevation, no UAC; (b)Updater::downloadInstallersaves toQStandardPaths::AppLocalDataLocation + "/updates"(execute-allowed) instead of%TEMP%, clearing stale installers; (c)UpdaterDialog::onDownloadFinishedsetsTMP/TEMPto that folder viaqputenvand launches withQProcess::startDetached(non-elevated, so the redirect is inherited) - the 10.3ShellExecute("runas")andshell32link were reverted. Validated on the hardened machine: a minimalPrivilegesRequired=lowestInno installer, run non-elevated withTMP/TEMPredirected, installed per-user with exit code 0 and no Error 5. Note: every build up to 10.3 has the broken (Temp/admin) updater, so 10.4 must be installed manually once; auto-update works from 10.4 onward. The oldC:\Program Files\La Idealinstall should be uninstalled once (data is safe - the DB path lives in settings). Not unit-tested: environment-dependent download path + process launch + installer packaging, no pure logic;compareVersionsstays covered. Files:releases/laideal.iss,src/updater/{updater.cpp,updaterdialog.cpp,CMakeLists.txt}, docs.
Post-10.1 development — June 2026¶
- [x] Dev-experience: self-healing VSCode Debug + Rectify INSERT clarity comment: (1) the F5 build task (
.vscode/tasks.json) nowdependsOn"CMake: configure (Debug)", so a fresh clone or a wipedbuild-debug/self-configures instead of failing with no exe - CMake no-ops an already-valid cache, so it costs nothing on repeat runs; the README Debug section was trimmed accordingly (the manual one-time-configure step is no longer needed, troubleshooting kept). (2) Added a one-line comment at theRectifyInvoiceDialogINSERT INTO ingresosexplaining it deliberately bypassessql_lite::insertGarmentRowbecause a rectificativa row writes the fullverifactu_*column set theIngresoGarmentRowseam does not carry - so a future reader does not "fix" it into the seam. Files:.vscode/tasks.json,README.md,src/app/rectifyinvoicedialog.cpp. - [x] Global UI language setting (Español/English) via a bundled Qt translator: replaces per-widget Spanish button hacks with one global
QTranslator, so every Qt standard dialog (the Yes/No -> Sí/No confirmations, Aceptar/Cancelar, QColorDialog, etc.) follows a single configurable language. NewAppSettings::language()/setLanguage()(app.language, default "es"; persisted inapplyDefaults) + a Idioma combo in SettingsDialog -> General (note: applies on next launch).main.cppinstalls the translator at startup: English is Qt's source language (no translator), Spanish loadsqtbase_es. The.qmis bundled as a Qt resource (resources/i18n/qtbase_es.qm, prefix/i18n, loaded via:/i18n/qtbase_es.qm) because the release runs windeployqt with--no-translations- Qt's translations dir is absent on the shop PC, so shipping it in the exe is the only reliable path. As required for the global setting to actually take effect, removed the one existing per-widget override:VoidGarmentsDialogreverted from manually-built "Sí"/"No" buttons back to a standardQMessageBox::question(Yes|No)that the translator localizes. (Domain toggle text likepb_payment"SI"/"NO" andpb_estado"Recogido"/"En tienda" is data, not language, and was left untouched; bespoke buttons such as PayDialog "Cobrar"/"Cancelar" are app strings, not Qt standard buttons, so the translator does not touch them.) Not unit-tested: startup/UI wiring; the language getter/default is covered indirectly by the AppSettings suite pattern. Files:src/appsettings/{appsettings.h,appsettings.cpp,settingsdialog.h,settingsdialog.cpp},src/app/{main.cpp,voidgarmentsdialog.cpp},resources/{laideal.qrc,i18n/qtbase_es.qm},README.md, docs. - [x] AddGarment refuses to append garments to a paid ticket (follow-up to #41): closes the latent "paid-but-unsubmitted" gap -
AddGarment::saveFacturanever submits to AEAT, so a garment added to an already-paid (already-submitted) ticket and marked paid would sit paid-but-unsubmitted. Rather than wire a submit into that path, adding is now blocked at search time for any ticket that already has a paid garment: new pure-ish seamsql_lite::ticketHasPaidGarment(db, nRecibo)(EXISTS apagado='SI'row);AddGarment::on_pb_search_pressedshows "el recibo ya está pagado (enviado a la AEAT); usa un recibo nuevo" and leavesticketFound=falseso save is blocked. Only unpaid (not-yet-submitted) receipts can be altered locally by appending garments - consistent with the VoidGarmentsDialog rule for removing them. Newtest_sql_lite::test_ticketHasPaidGarment(unpaid ticket -> false, any paid row -> true, unknown ticket -> false). Files:src/sql_lite/{sql_lite.h,sql_lite.cpp},src/add_garment/add_garment.cpp,tests/test_sql_lite.cpp, docs. - [x] Log analysis + message refinement (issue #42): analysed a customer log (~43k lines, 75 sessions, May 27 - Jul 1) for misleading traces and warnings. Two code fixes plus a findings triage. (1)
MainWindow::saveTicketgarment count: the header loggedrows: <table_ticket->rowCount()>(always 9, the fixed number of empty input slots) which read as "9 garments saved" even when only 1-2 were filled; the per-row line logged the raw table slot index. Now it counts garments actually inserted (savedGarments), logssaved garment <k>sequentially per insert and a- N garment(s) savedsummary at the end. Also corrected the stale comment claiming rows may be written "empty if Verifactu not configured" (saveTicket always writes PENDIENTE). (2)BackupManager::performBackupQt warning:QSqlDatabasePrivate::removeDatabase: connection 'laideal_backup_verify' is still in usefired on every backup (21x in the log) becauseremoveDatabase()was called while the block'sQSqlDatabase/QSqlQuerywere still in scope. Restructured Step 2 (verify) - and Step 1 (snapshot) for consistency, it had the same latent bug on its error path - to do the DB work in an inner block that captures a success flag, thenremoveDatabase()after the handles go out of scope (the pattern Step 1's success path already used). Findings triaged as non-actionable (documented for the record): the ~50Verifactu submit failed/network error/timeoutwarnings are legitimate AEAT rejections of data, not code bugs (pre-2024 InvoiceDate on a bulk historical re-submission, duplicate-InvoiceID "ya existe" dedup rejections, an HTTP 429 rate-limit, connection timeouts); the singleQProcess: Destroyed while process ("cscript") is still runningis a legacy artifact from the pre-10.0 Excel/.vbsprint pipeline that was removed in 10.0 (current code only usesQProcess::startDetachedfor the updater); andreadMaxNMinYearInColumnFromTable - database path not configured(2x at startup) is the intendeddbNotConfiguredguard when a report screen is opened before the DB is configured. Not unit-tested: both fixes are logging / Qt-connection-scoping with no pure logic to assert, and aperformBackuphappy-path test is impractical because its success path callsAppSettings::instance()->save()(writes the real~/.laideal_settings.json) - a future test would need an AppSettings injection seam. 14 suites still green. Files:src/app/mainwindow.cpp,src/backup/backup_manager.cpp, docs. - [x] AddGarment now books added garments PENDIENTE (issue #41): diagnosed from a customer log (
saveTicket: ticket "30877"followed byAddGarment::saveFactura: INSERT INTO ingresos ticket= "30877"for a "Manta"). Root cause:AddGarment::saveFactura("Herramientas -> Añadir nuevas prendas") built its own inline INSERT that omitted theverifactu_estadocolumn, so a garment added to an existing ticket was written with NULL/empty estado whileMainWindow::saveTicketrows getPENDIENTE— the estado column read blank for those garments. Fixed by routing the insert through the existing testedsql_lite::insertGarmentRow(IngresoGarmentRow)seam (same onesaveTicketand the SEPARATE_GARM split use) withverifactuEstado = verifactuEstadoToString(VerifactuEstado::NotSubmitted)("PENDIENTE"), which also dedups the duplicated INSERT SQL. Safe by construction: the pending-submit recovery query (sql_lite::pendingVerifactuEvents) already treats empty/NULL andPENDIENTEidentically (verifactu_estado IS NULL OR = '' OR = 'PENDIENTE') and refuses to retry rows with nofecha_pago, so stamping PENDIENTE changes only the displayed/consistent estado, not the AEAT submission behaviour (no new duplicate-InvoiceID risk). Newtest_sql_lite::test_insertGarmentRow_addGarmentShapePendinganchors the regression (an added, unpaid garment persists PENDIENTE). The AddGarment slot itself stays UI-coupled; the meaningful contract (insertGarmentRow persists the estado it is handed) is unit-tested. 14 suites green. Files:src/add_garment/add_garment.cpp,tests/test_sql_lite.cpp, docs. - [x] Void unpaid, not-delivered garments (issue #40) — new VoidGarmentsDialog + Anulado estado + green-pagado colouring: a local counterpart to
CancelInvoiceDialogfor erroneous receipts / change-of-mind on garments not yet delivered. The key insight that shaped the design: AEAT submission only happens when a ticket is paid (save-if-paid inMainWindow::on_bb_save_reset_clicked, or at payment via PayDialog) — an unpaid garment staysverifactu_estado = PENDIENTEand was never sent to AEAT, so voiding it is a pure local DB change with no AEAT anulación (that path isCancelInvoiceDialog, for paid/ENVIADA rows). New menu action Herramientas → Anular prendas (recibo erróneo)... openssrc/app/voidgarmentsdialog.{h,cpp}: search a ticket by number, see its garments in a table with per-garment checkboxes, and void the selected ones. Only rows that pass the new pure guardsql_lite::garmentIsLocallyVoidable(pagado, verifactuEstado)(unpaid and never-submitted) are selectable; paid/ENVIADA rows show "Pagado/enviado - usar Anular Factura" and already-voided rows show "Anulado". Voiding runs the new DB seamsql_lite::voidGarmentRow(db, nRecibo, hash)=UPDATE ingresos SET estado='Anulado', verifactu_estado='ANULADA'scoped by(n_recibo, hash)(pagadodeliberately left asNO— the row is closed, not collected). The newestadovalue lives asINGRESOS_ESTADO_ANULADOiningresos_schema.h. For the colouring requirement,TextColorDelegategained a pure staticclassify(cellText, rowEstado)and now reads the row's siblingestadocolumn: a row whose estado isAnuladorenders green everywhere (viaINGRESOS_COL_ESTADO), so a voided receipt'sNOpagado no longer reads as an outstanding debt — satisfying "cambiar color del pagado a verde aunque siga siendo que NO". Accounting is unaffected: an anulado row is unpaid (pagado='NO') so it was already excluded from thepagado='SI'paid totals, andverifactu_estado='ANULADA'keeps it out of the Verifactu-based figures. New tests:test_sql_litecoversgarmentIsLocallyVoidable(paid/sent variants) andvoidGarmentRow(sets Anulado/ANULADA, leaves pagado, scopes by hash); new suitetests/test_textcolordelegate.cppcoversclassifyincl. the Anulado-green rule. 14 suites green. Files:src/app/voidgarmentsdialog.{h,cpp}(new),src/app/{mainwindow.ui,mainwindow.h,mainwindow.cpp,CMakeLists.txt},src/sql_lite/{sql_lite.h,sql_lite.cpp,ingresos_schema.h},src/tableview/textcolordelegate.{h,cpp},tests/{test_sql_lite.cpp,test_textcolordelegate.cpp,CMakeLists.txt}, docs. - Follow-up: an Anulado row is now immutable and excluded from payment, prints and accounting everywhere. After the initial dialog landed, in-shop testing found the RecogPrendas
pb_statebutton could still flip a voided garment back to "En tienda". Fixed by treating an Anulado row as read-only across every edit path: (1)RecogPrendas::updateRowClickedToFieldsdisablespb_state/pb_pay_all/pb_pku_all/pb_separ_garmand makesle_obsv/le_size/le_priceread-only for an Anulado row (and the redundant re-enable block inselectSourceRowwas removed soupdateRowClickedToFieldsis the single source of truth); (2)RecogPrendas::updateDbearly-returns on an Anulado row as defense-in-depth so no write path can revive it; (3) Recoger todo now goes through the new seamsql_lite::markTicketPickedUp(db, nRecibo, fechaRecogida)whoseUPDATE ... SET estado='Recogido'carriesAND estado != 'Anulado', so a bulk pickup never revives a voided garment; (4) PayDialog::loadTicket skips Anulado rows so a voided (unpaid) garment can never enter the payable set and be submitted to AEAT; (5) Imprimir::getTicketInfo excludesestado='Anulado'on both the recibo and factura queries so a voided garment never prints. Contabilidad needs no change: every accounting query already requirespagado='SI'(an Anulado row ispagado='NO') and also excludesverifactu_estado='ANULADA'— doubly excluded — and the payment guards guarantee an Anulado row can never becomepagado='SI'. Newtest_sql_lite::test_markTicketPickedUp_excludesAnuladoseeds a voided + a normal row and asserts the bulk pickup marks only the normal one Recogido. Files:src/recog_prendas/{recog_prendas.cpp,pay_dialog.cpp},src/imprimir/imprimir.cpp,src/sql_lite/{sql_lite.h,sql_lite.cpp},tests/test_sql_lite.cpp, docs. - [x] Documentation site (MkDocs Material → GitHub Pages): the
docs/tree is now published as a searchable static site. Newmkdocs.yml(Material theme, light/dark palette toggle, search, the fulldocs/tree as nav) renders the existing Markdown as-is; avalidation:block classifies the many cross-repo links (tosrc/sources and root files likereleases_notes.txt,.claude/…) as warnings, not errors, so a plain non-strictmkdocs buildstays green. A minimal rootpyproject.tomlhosts the build tooling as adocsoptional-dependency group (pip install ".[docs]"→mkdocs-material); it ships no Python package (py-modules = []). New.github/workflows/docs.ymluses the official Pages flow (upload-pages-artifact+deploy-pages,pages: write+id-token: write,concurrency: pagesnon-cancelling): the build job runs on push and PR (the PR run is the pre-merge publication test), the deploy job runs only on master push and then verifies publication by polling the deployedpage_urluntil HTTP 200. Requires the repo's Pages source set to "GitHub Actions" (done)..gitignoreignoressite//_site/. Verified locally: build exits 0 with the expected cross-repo link warnings. Files:mkdocs.yml,pyproject.toml,.github/workflows/docs.yml,.gitignore, docs.
Post-10.0 development — June 2026¶
- [x] Thermal ticket layout polish from shop feedback (Uds. gap, condiciones pitch, QR spacing): three readability tweaks to the printed recibo/factura after the 10.0 in-shop printouts. (1) The garment table's quantity column abutted the name column (
Uds.Prendaswith no gap because the 4-char header filled the 4-col field) —EscPosBuilder::garmentRowdefaultqtyWidthwidened 4→6 soUds.(and short quantities) clear thePrendascolumn; the name column drops from 35→33 cols @80mm, still ample. (2) The "Condiciones generales" legal block was already the smallest built-in font (Font B) but still read like body text, so its line pitch was tightened via two new pure builder methodslineSpacing(int dots)(ESC 3 n, set to 24) /defaultLineSpacing()(ESC 2, restored after the block) — the glyphs can't shrink below Font B, but the denser pitch makes it read as fine print. (3) The Verifactu QR had too much whitespace above it — the extrafeed(1)before the raster was removed (the payment marker above and the AEAT pixmap's own quiet zone already separate it). Newtest_escposcase asserts theESC 3 24/ESC 2bytes and the widened qty column; thetest_ticket_previewESC-interpreter learned to skipESC 2/ESC 3 n(the latter is 3 bytes — the old 2-byte default skip would have leaked the pitch byte into the text); committedpreview_*.pngregenerated. 13 suites green. Files:src/printing/{escposbuilder,ticketrenderer}.{h,cpp},tests/{test_escpos,test_ticket_preview}.cpp,docs/modules/printer/preview_*.png, docs.
Post-9.3 development — June 2026¶
- [x] Optional ESC/POS Status API layer (dossier Phase 4) — paper-out / cover-open / cutter status: behind the new
print.use_status_apisetting (off by default),Imprimir::printTicketroutes the same ESC/POS bytes through Epson's Status API instead of the RAW spooler and reads the device status back. Two newsrc/printing/seams:PrinterStatus(pure —fromAsb(quint32)decodes the Epson ASB 32-bit status word into named flagspaperEnd/paperNearEnd/coverOpen/cutterError/mechanicalError/unrecoverableError/offline/drawerOpen, withhasError()/hasWarning()and a Spanishsummary()), andStatusApiPrinter::sendAndReadStatus(Win32 — loadsEPSStmApi.dlldynamically viaLoadLibrary/GetProcAddressso there is no build-time Epson-SDK dependency, thenBiOpenMonPrinter(2,queue)→BiDirectIOExsend →BiGetStatus→BiCloseMonPrinter; a stub off Windows). The transport returns false without sending when the DLL/API is unavailable or the queue can't be opened, soprintTicketfalls back to the RAWThermalPrinter::sendpath — enabling the flag never stops printing. On a real problem after a successful send it shows aQMessageBox::warning(status.summary())("Sin papel", "Tapa abierta", "Papel casi agotado", …). Settings getterAppSettings::useStatusApi()+ a SettingsDialog → General checkbox. Not hardware-validated: theASB_*bit values and theEPSStmApi.dllcall path must be confirmed on the shop's TM-T20III with the APD/Status API installed (like Phase 0 for the RAW path). SixPrinterStatusdecode cases added totests/test_escpos.cpp(OK/near-end/end/cover/cutter/offline + error-ranks-before-warning + default-invalid); 13 suites green. Files:src/printing/{printerstatus,statusapiprinter}.{h,cpp}+CMakeLists.txt,src/imprimir/imprimir.cpp,src/appsettings/appsettings.{h,cpp}+settingsdialog.{h,cpp},tests/test_escpos.cpp, docs. - [x] Removed the vendored
QXlsx/library (dossier Phase 5 cleanup): the Excel→ESC/POS migration leftimprimirno longer linking QXlsx, and the vendored tree + rootadd_subdirectory(QXlsx)were kept for one release as an easy rollback until the printer was validated on hardware. With the TM-T20III validation done (previous milestone), the 906 KB tree was deleted and the CMake wiring removed. Verified first that nothing undersrc/includes any xlsx header or namesQXlsx::— only docs and thedead-code-finderagent note referenced it. Dropped the "Excel library" rows from the file map (ai_agent_instructions), the source-tree diagram + Third-Party Dependencies table (architecture), and the file/build tables (INDEX); marked dossier Phase 5 done inprinter/README.md+05_implementation_plan.md. No test change — pure build-graph cleanup, proven by the build still linkinglaideal.exe. Files: rootCMakeLists.txt,QXlsx/(deleted), docs. - [x] Direct ESC/POS printing validated on hardware + ticket-preview test + CI/release consolidation: follow-ons to the Excel→ESC/POS migration below. (1) The printer was confirmed on the shop's physical Epson TM-T20III — recibo and factura print correctly (Spanish accents via PC858, partial cut, Verifactu QR, 80 mm width), closing the dossier Phase 0 hardware-validation item. (2) New
tests/test_ticket_previewrenders a sample recibo + factura from the realTicketRendererESC/POS output back into a PNG simulation of the thermal paper + an ASCII mock (asserts the layout blocks;QTEST_MAINwith the native QPA platform on Windows so system fonts render real glyphs, offscreen elsewhere); a committed PNG pair lives indocs/modules/printer/(embedded in the dossier README), andRender-TestSummary.ps1appends the ASCII receipt to the run summary because GitHub strips inline images (PNG/SVG,data:/inline) from job summaries — an SVG render was tried and dropped (its generic monospace misaligned the right-justified values + vertical rhythm; the grid-drawn PNG aligns). (3) CI consolidated into one workflow:ci.ymlnow also triggers onfeature/**branches, and the standalonerelease.ymlwas folded intoci.ymlas a tag-gatedreleasejob (needs: build,if: startsWith(github.ref,'refs/tags/')) that reuses the build job's exe artifact instead of recompiling, then windeployqt/zip/InnoSetup/publishes —release.ymldeleted. Files:tests/{test_ticket_preview.cpp,CMakeLists.txt},docs/modules/printer/preview_*.png,.github/workflows/ci.yml,.github/scripts/Render-TestSummary.ps1, rootREADME.md,.claude/commands/release.md, docs. - [x] Excel ticket printing replaced by direct ESC/POS over the Windows RAW spooler: receipts/facturas no longer go through QXlsx →
.xlsx→ a generated.vbs→cscript→ Excel COM (which required Excel installed and licensed on the shop PC, launched a process per print, was brittle — a left-overEXCEL.EXE/dialog/macro prompt could hang the 60 s wait — and gave no print/error feedback). Newsrc/printing/static lib with three seams from the research dossier (docs/modules/printer/):EscPosBuilder(pure: chainable ESC/POS byte builder + a PC858 transcode for Spanish accents/€+ dots/char-width column math),TicketRenderer(pure: a plainTicketData→ the same header/identity/garment-table/totals/QR/policy/timestamp content and ordering as before, laid out to the printer's real column width; the factura IVA split reproduces the legacy rounding — IVA derived from the rounded base string — so base+IVA still reconstruct the total), andThermalPrinter(the only host-specific piece:OpenPrinter/StartDocPrinterdatatypeRAW/WritePrinterviawinspool, default-printer fallback, a human-readableGetLastError/FormatMessagestring surfaced in aQMessageBox; a failing stub off Windows keeps the builder/renderer cross-platform).Imprimir::createTicketExcel→buildTicket(fillsm_ticketBytes) andprintTicket→ThermalPrinter::send; the public two-step call shape (build copy → print → build next copy → print) is preserved, so all six call sites (mainwindow save + print menu, PayDialog Cobrar, RecogPrendas reprint, the multi-seq chooser) keep working with a one-word rename. The Verifactu QR is rastered from the exact AEAT pixmap (GS v 0,qr.scaled(192).toImage()) rather than re-encoded, so the printed QR stays byte-exact with what AEAT registered;resolveQrCode()(async/GetQrCode, 5 s wait, estado/CSV gating) is unchanged. New settingsprint.printer_name(empty = Windows default printer) andprint.paper_width_mm(58/80, default 80 → 576/420 dots) editable in SettingsDialog → General (printer combo fromQPrinterInfo::availablePrinterNames()); the obsoleteticketExcelPath/ticketPrintScriptPathhelpers were removed.imprimirno longer links QXlsx — but the vendoredQXlsx/tree was left in place for one release (decoupled, unused) for an easy rollback before the printer is validated on the shop PC; its removal is a new Open Non-Blocking item. Newtests/test_escpos.cpp(12th suite, links the lightprintinglib,QTEST_GUILESS_MAIN) asserts the exact control bytes (init/align/bold/font/size/cut), the PC858 transcode incl. unmapped→?, the column math (576→48/64, 420→35/46), and the recibo/factura render fragments incl. the 121→100+21 IVA split and that a QR is rastered. Not hardware-validated in CI (dossier Phase 0): the real printer-queue name, the PC858 code page for accents, and the loaded paper width must be confirmed on the shop's TM-T20III. Files:src/printing/*(new lib),src/imprimir/imprimir.{h,cpp}+CMakeLists.txt,src/appsettings/appsettings.{h,cpp}+settingsdialog.{h,cpp}+CMakeLists.txt,src/app/mainwindow.cpp,src/recog_prendas/{pay_dialog,recog_prendas}.cpp, rootCMakeLists.txt,tests/{test_escpos.cpp,CMakeLists.txt}, docs (architecture,INDEX,README,ai_agent_instructions,modules/{imprimir,printing}.md,modules/printer/). - [x] Test coverage: MainWindow
saveTicketINSERT +verifactuSubmitInvoicebase math onto existing seams: the save-side equivalent of the RecogPrendasupdateDbextraction.MainWindow::saveTicketbuilt itsingresosINSERT inline from the ticket-table widgets (22 bound columns) — trapped in the app exe, untestable. It now delegates to the existingsql_lite::insertGarmentRowseam, which gained averifactuEstadofield (the single verifactu_* column the two callers differ on): a RecogPrendas split-off row passes""(legacy/NotSubmitted, unchanged),saveTicketpasses"PENDIENTE"viaverifactuEstadoToString(NotSubmitted)so the async AEAT submit can later patch the row. The slot keeps reading its widgets (combo cells, payment toggle, optional size/obsv items) and just fills the struct. Separately,verifactuSubmitInvoice's inline tax-base splittotal / (1 + iva/100)now routes through the already-tested pureFacturas::taxBaseFromGross(gross, rate)(its InvoiceID already goes through the testedverifactuInvoiceId), so the method's whole pure surface is covered by existing suites. Newtest_sql_litecase asserts the saveTicket shape (PENDIENTE estado, payment booked on the reception date, empty pickup date). The async/UI residual (submitSimplifiedInvoiceAsync+m_pendingSubmitscorrelation,onVerifactuRequestFinishedstatus text, theQEventLoop/QTimerprint-after-submit wiring) stays a narrowed Open Non-Blocking item — exe-bound, needs a QTest-GUI harness. Minor behaviour note:insertGarmentRownow writesverifactu_estadofor every caller (split rows previously left it NULL, now""— both read as NotSubmitted, so no functional change). Files:src/sql_lite/sql_lite.{h,cpp},src/app/mainwindow.cpp,tests/test_sql_lite.cpp, docs. - [x] Test coverage: AppSettings JSON getters via a
loadFrom(path)injection seam: the secret-at-rest dpapi* helpers were already covered, but the getters that read the singleton's JSON (contabilidadPath/listadosPrendasPath/listadosGastosPath=reportsRoot+ a hardcoded subdir,ivaRate, and theencryptSecretsAtRest()legacy-plaintext migration) couldn't be asserted without touching the real~/.laideal_settings.json. New public seamAppSettings::loadFrom(const QString &path)pointsm_filePathat an arbitrary file, drops the constructor defaults (m_data = {}) and runs the realload()pipeline (parse →migrateLegacyKeys→encryptSecretsAtRest→applyDefaults, rewriting the file if a plaintext secret was encrypted) — not used in production. Newtest_appsettingscases write a throwaway JSON in aQTemporaryDir,loadFromit, and assert: the three derived report paths resolve under the configured root;ivaRatereadstaxes.iva_rateand falls back to the 21.0 default when the block is absent; a plaintextservice_keyis encrypted at rest on load (the getter still returns plaintext, the on-disk value carries the DPAPI marker on Windows and round-trips viadpapiDecrypton every platform); and an already-encrypted key is left byte-for-byte unchanged (no double-wrap). Files:src/appsettings/appsettings.{h,cpp},tests/test_appsettings.cpp, docs. - [x] Test coverage: RecogPrendas
updateDbDB-write seams extracted + tested: the per-operation SQL inRecogPrendas::updateDb(PAY_YES/PAY_NO, PKU_YES/PKU_NO, OBSV, SIZE_AND_PRICE, SEPARATE_GARM) was inline widget-reading code trapped in the app, untestable. Each write is now a puresql_litefree function keyed by(n_recibo, hash)—updateTicketPayment,updateTicketPickup,updateTicketObservations,updateTicketSizeAndPrice,updateGarmentQtyAndImporte, andinsertGarmentRow(IngresoGarmentRow)for the split-off row (which deliberately leaves theverifactu_*columns at their empty defaults so a split row reads as legacy/NotSubmitted — re-submitting it would duplicate the ticket's AEAT InvoiceID); the PAY_YES pay-all dedup's estado read-back is the newticketVerifactuEstado.updateDbkeeps all the business rules (edit_lock guard, blocked-quarter check, the Verifactu-submit decision) and now just reads its widgets and delegates — behaviour unchanged. Newtest_sql_litecases seed multi-row tickets and assert each write lands and is scoped byhash(siblings untouched), the split row persists every field with empty verifactu_estado, andticketVerifactuEstadoreturns the first row's estado / empty for an unknown ticket. The MainWindowsaveTicket/verifactuSubmitInvoice+ async-AEAT + dialog-wiring half stays a narrowed Open Non-Blocking item (needs a QTest-GUI harness + an app-logic lib split). Files:src/sql_lite/sql_lite.{h,cpp},src/recog_prendas/recog_prendas.cpp,tests/test_sql_lite.cpp, docs.
Post-9.2 development — June 2026¶
- [x] Annual Contabilidad report: 24 per-quarter scans → 2 grouped queries: the annual PDF called
computeFiguresfor all 4 quarters, each running 4totalPriceBetweenDates+ 2countOperationsBetweenDatesfull-tablesubstr()scans (~24 scans). New DB seamsql_lite::annualAccountingByQuarter(db, year)runs one grouped query per table over the whole year, bucketed by quarter (quarter = (month + 2) / 3): ingresosSUM(importe)+COUNT(DISTINCT n_recibo)under the exactpagado='SI'+ ANULADA/RECTIFICADA + half-open date filters; gastosSUM(importe)bucketed by quarter×iva (10/21/0) plus a per-quarter row count over every rate (matching the existing gastos count). It returns aQuarterlyAccountingTotals(per-quarter raw importes/counts, index 0 = Q1). The IVA base/cuota derivation was extracted fromcomputeFiguresinto the pure staticContabilidad::figuresFromTotals(...), now shared by both the per-period path (trimestral/mensual, unchanged) and the annual path (one prefetchedQuarterlyAccountingTotals), so the figures are identical. Verification (the reason this was deferred):test_sql_lite::test_annualAccountingByQuarterseeds a multi-quarter DB and asserts the grouped result equals, quarter by quarter, the per-quartertotalPriceBetweenDates/countOperationsBetweenDatesit replaces — the tax math is provably unchanged. Caveat: the grouped path sumsimportein SQL, so it does not raise the comma-decimal corruption dialog the per-row helpers do; the trimestral/mensual reports still call those helpers and keep that guard (and they are run regularly to lock quarters, so corruption still surfaces). The 4 per-quarterreadLockForQuarterreads stay (cheap, separate concern). Files:src/sql_lite/sql_lite.{h,cpp},src/contabilidad/contabilidad.{h,cpp},tests/test_sql_lite.cpp, docs. - [x] Seq-aware startup recovery of partial-pay (
seq>0) Verifactu timeouts: thePendingSubmitsDialogstartup recovery now reconciles timed-out PayDialog partial-payment events, not only save-time / full-ticket submissions. The pending-events query is extracted into the testable seamsql_lite::pendingVerifactuEvents(db, floorIso)— it drops the oldAND verifactu_invoice_seq = 0filter and groups by(n_recibo, verifactu_invoice_seq), so each event surfaces as its own{n_recibo, seq, fechaPago, cliente, importe}row with that event's ownSUM(importe). The recovered event re-submits under itsfecha_pago(the original AEAT submission date — date is part of the invoice identity, so reusing reception date would register a second invoice and defeat the duplicate-InvoiceID guard); the recovery floor still gates onfecha_recepcion. Seq is threaded through the async retry path:PendingSubmitsDialog::Entryand theretryRequestedsignal gainseq; the recovery row shows the<n>-<seq>InvoiceID viaverifactuInvoiceId;onMarkErrorClickednow scopes its UPDATE byseqso marking one event Error never clobbers a sibling event of the same ticket.MainWindow::verifactuSubmitInvoicegainsseq=0and submitsverifactuInvoiceId(ticketNum, seq)(so a recovered event re-submits under the same ID it stored);m_pendingSubmitsbecomesreqId → {ticketNum, seq}andonVerifactuRequestFinishedpatches viaupdateTicketVerifactuFields(db, ticketNum, result, seq). This changes what is re-submitted to AEAT forseq>0events — intended; it is the fix. The slow-but-already-registered case is still covered by the duplicate-InvoiceID rejection warning. Newtest_sql_lite::test_pendingVerifactuEventsseeds save-time (multi-row), partial-pay (seq>0) and ENVIADA/before-floor rows and asserts the grouping, per-event sums and ordering. Files:src/sql_lite/sql_lite.{h,cpp},src/app/pendingsubmitsdialog.{h,cpp},src/app/mainwindow.{h,cpp},tests/test_sql_lite.cpp, docs.
Post-9.1 development — June 2026¶
- [x] PayDialog "Cobrar" now auto-prints a single factura:
PayDialog::printPartialFacturaprinted two copies (customer + business:createTicketExcel(true)→printTicket()→createTicketExcel(false)→printTicket()). At the operator's request it now prints only the single customer copy after Cobrar; a second copy is available via the RecogPrendas reprint button (pb_print). Files:src/recog_prendas/pay_dialog.cpp,docs/modules/recog_prendas.md. - [x]
ReportHtml::formatEuronow groups thousands consistently: the test_reporthtml suite had surfaced thatQLocale(Spanish,Spain).toString(value,'f',2)grouped inconsistently — no separator for1234.56("1234,56") but a single misplaced one for1000000.0("1000.000,00"). Replaced the QLocale call with manual grouping: round to cents, group the integer part in threes with., join with,and two zero-padded decimals, handling the sign. Now1234.56 → "1.234,56 €",1000000 → "1.000.000,00 €",999.99 → "999,99 €",-1234.5 → "-1.234,50 €". The test was updated to assert the grouped output. Affects every euro figure in the Contabilidad + Listados PDFs (a display improvement). Files:src/reporthtml/reporthtml.h/.cpp,tests/test_reporthtml.cpp, docs. - [x] Test coverage: MainWindow
removeSpecialCharextracted + tested: the last quick pure-helper win on the MainWindow/RecogPrendas surface. The accent/special-char stripper used for client-name matching couldn't be unit-tested because MainWindow is compiled into the app executable, not a library; its logic moved verbatim intosql_lite::removeSpecialChars(NFD → narrow to Latin-1 so combining marks become?→ drop every?; case preserved) and the member now delegates, socheckClientDatabehaviour is unchanged. New cases intest_sql_lite. The remaining RecogPrendas/MainWindow surface (DB writes + async AEAT + UI wiring) is integration-level and stays a narrowed Open Non-Blocking item needing a seeded-DB + QTest-GUI harness. Files:src/sql_lite/sql_lite.h/.cpp,src/app/mainwindow.cpp,tests/test_sql_lite.cpp, docs. - [x] Verifactu InvoiceID reconstruction deduped into
sql_lite::verifactuInvoiceId(+ a seq-0 submit/persist fix): theseq==0 ? n_recibo : "<n>-<seq>"rule was rebuilt in 5 places. Lifted into the single pure helpersql_lite::verifactuInvoiceId(nRecibo, seq)and routed all callers through it. Four were behaviour-preserving dedups (updateTicketVerifactuFields,CancelInvoiceDialogreconstruction,Imprimir::labelFor,PayDialog::markPendingVerifactu). The fifth,PayDialog::onCobrarClicked, was the one site that built the InvoiceID always dashed ("<n>-<seq>"even for seq 0): a first Cobrar on an unpaid-saved ticket (seq 0) submitted"<n>-0"to AEAT whileupdateTicketVerifactuFieldspersisted bare"<n>"— a latent submit/persist mismatch that misaligned the reprint QR / cancel for that case. Routing it through the helper makes the submitted InvoiceID match what is stored (bare"<n>"for seq 0). This is a Verifactu AEAT-submission behaviour change (only for the seq-0 partial-pay case; both forms are valid unique InvoiceIDs, and the new one aligns submit with persist). Unit-tested intest_sql_lite::test_verifactuInvoiceId. Files:src/sql_lite/sql_lite.h/.cpp,src/recog_prendas/pay_dialog.cpp,src/app/cancelinvoicedialog.cpp,src/imprimir/imprimir.cpp,tests/test_sql_lite.cpp, docs. - [x] Test coverage: GenListado pure helpers: extracted the model/ui-independent logic from two ui-reading slots into pure statics —
GenListado::filenameSuffix(agrupar, tipoGastos, allYears, selectedYear)(the gastos-PDF filename suffix:agrupado_<agrupar>_<tipo>_<year|todos_los_años>, lower-cased, spaces→underscores) andGenListado::shouldPrintGastoRow(allYears, selectedYear, rowYear, onlyClosed, rowClosed)(the year + accounting-type row filter); thecheck_years_invoice_type_for_row/add_suffix_to_filenamemembers now read the widgets/model and delegate. Newtests/test_genlistado.cppcovers both. The gastos/prendas HTML row builders (heavy model iteration + ui) were left uncovered. Files:src/listado/genlistado.h/.cpp,tests/test_genlistado.cpp,tests/CMakeLists.txt, docs. - [x] Test coverage: MySortFilterProxyModel sort comparators: extended
test_mysortfilterproxymodelwithlessThancases driven viasort()+ row-order assertions on aQStandardItemModelwithtable_nameset — an ingresos date column sorts chronologically (dd-MM-yyyyparsed, not lexicographically:15-12-2025 < 31-01-2026 < 02-02-2026), an importe column sorts numerically (9 < 50 < 100, not as strings), and a non-special column falls back to locale string compare. No production change. Files:tests/test_mysortfilterproxymodel.cpp, docs. - [x] Test coverage: Facturas IVA split: extracted the base/cuota math that was inline in
Facturas::on_le_importe_textEditedinto pure staticsFacturas::taxBaseFromGross(gross, rate)=gross/(1+rate/100)andtaxAmountFromGross(gross, rate)=gross*(1 - 1/(1+rate/100)); the slot now calls them (parse switchedtoFloat→toDouble, output still 2 decimals so behaviour is preserved). Newtests/test_facturas.cppcovers the 21/10/0 % rates and that base+cuota reconstructs the gross. Files:src/facturas/facturas.h/.cpp,tests/test_facturas.cpp,tests/CMakeLists.txt, docs. - [x] Test coverage: AppSettings DPAPI secret-at-rest: exposed the file-local
encryptSecret/decryptSecret/isEncryptedhelpers as public static delegators (AppSettings::dpapiEncrypt/dpapiDecrypt/dpapiIsEncrypted, distinct names so they don't clash with the unqualified internals the getters/setters keep calling) so the security-relevant crypto is testable without the settings file. Newtests/test_appsettings.cppasserts thedpapi:v1:marker, the encrypt→decrypt round-trip (on Windows the value is real ciphertext carrying the marker; the round-trip holds cross-platform since non-Windows is a passthrough), the legacy-plaintext passthrough, and empty→empty. The settings-file getters (derived paths /ivaRate/encryptSecretsAtRestmigration) were deferred — they read the singleton JSON and need an injection seam (re-filed as a narrower Open Non-Blocking item). Files:src/appsettings/appsettings.h/.cpp,tests/test_appsettings.cpp,tests/CMakeLists.txt, docs. - [x] Test coverage: Verifactu model classes (config / tax item / invoice / estado): new
tests/test_verifactu_models.cpp(linksverifactu, all pure) coversVerifactuConfig(default TESTING env, the service-key→NIF→name validation order, and the prewww2-vs-www2getValidationUrl/getQrUrlper environment);VerifactuTaxItem(operationTypeToStringfor S1/S2/N1/N2/E1,toJsonkeys, negative-rateisValid);VerifactuInvoice(isRectificationInvoiceType,rectificationTypeToStringS/I,calculateTotals= Σbase+Σtax,toJsonkeys incl. F1/F2/R1InvoiceTypeand the rectificativaRectificationType/base/amount block, and the validation rules incl. F2 needing no buyer but F1 requiring one); and theverifactuEstadoToString/verifactuEstadoFromStringround-trip (PENDIENTE/empty/unknown → NotSubmitted). 8 suites pass. Files:tests/test_verifactu_models.cpp,tests/CMakeLists.txt, docs. - [x] Test coverage: reporthtml + updater pure helpers: closes the first "grow test coverage" sub-item. New
tests/test_reporthtml.cppcoversReportHtml::formatEuro(Spanish comma decimals + euro suffix),tableOpen(grid vs borderless) anddocumentClose(footer / closing tags); newtests/test_updater.cpp(built as exetest_versioncompare) coversUpdater::compareVersions(numeric major-then-minor, leading-vnormalisation,9.10 > 9.2) andcurrentVersion. Two issues surfaced and handled: (1)formatEurodoes not group thousands the way its doc claimed (re-filed as an Open Non-Blocking note; the test asserts the real small-value behaviour + structure rather than the quirky grouping, and the doc comment was corrected); (2) the test executable could not originally be namedtest_updater- Windows' UAC installer-detection heuristic flags any exe whose name containsupdate/setup/installas requiring elevation and CTest failed withBAD_COMMAND, so the target was renamed totest_versioncompare(noted intests/CMakeLists.txt). 7 suites pass. Files:tests/test_reporthtml.cpp,tests/test_updater.cpp,tests/CMakeLists.txt,src/reporthtml/reporthtml.h(doc), docs. - [x] Test coverage grown into BackupManager retention + Contabilidad period math (two more testability seams): continues the "grow test coverage" item. (1)
BackupManager::pruneOldBackups()mixed the retention decision with filesystem I/O (entryInfoList+QFile::remove); the decision is split into the pure staticBackupManager::backupsToPrune(fileNames, now)(sorts chronologically, keeps every copy < 30 days, then the earliest per calendar month up to 4 years, drops the rest, ignores non-schema names), andpruneOldBackups()now just lists the dir, calls it, and removes the returned names. Newtests/test_backup_manager.cppdrives the policy with synthetic filenames + a fixednow(recent kept, monthly dup dropped, >4y dropped, junk ignored) - no filesystem needed. (2)Contabilidad::periodRange()read the mode/quarter/year off the widgets; the date math is split into the pure staticContabilidad::periodRangeFor(mode, unit, year, &start, &endExclusive)(the member now just reads the ui and delegates), andtests/test_contabilidad.cppasserts the half-open quarter/month ranges incl. the Q4/December year-boundary roll-over. Both suites run underQTEST_GUILESS_MAIN. The Imprimir invoice-id target stays deferred (heaviest lib to link). All 5 suites pass. Files:src/backup/backup_manager.{h,cpp},src/contabilidad/contabilidad.{h,cpp},tests/test_backup_manager.cpp,tests/test_contabilidad.cpp,tests/CMakeLists.txt, docs. - [x] Test coverage extended to the Verifactu response parser and the garment price math (with the seams to make them testable): closes the named half of the "extend test coverage" item. (1)
VerifactuManager::processResponse()was a private method, untestable without a liveVerifactuManager; its body (pure: JSON reply ->VerifactuResult, incl. the<...:Huella>SHA-256 extraction and base64 QR decode) is lifted verbatim into a free functionparseVerifactuResponse()+decodeVerifactuImageBase64()in newsrc/verifactu/verifacturesponse.{h,cpp}; the manager's two call sites now call the free function and the private method +decodeImageFromBase64member are gone. Newtests/test_verifactu_response.cpp(8 cases) covers invalid JSON,ResultCodeerror +ResultMessage/Return.ErrorDescriptionprecedence, an invoice-levelReturn.ErrorCodeunderResultCode 0, the success path (CSV / ValidationUrl / Huella upper-cased, and thatHuellaPreviais not mistaken forHuella), and the GetQrCode base64->QPixmap decode (usesQTEST_MAINunderQT_QPA_PLATFORM=offscreensince QPixmap needs a QGuiApplication). (2) The duplicatedsetGarmentPriceprice math inMainWindowandAddGarment(comma-decimal-normalised quantity x unit price x non-zero size factor, clamp >= 0) is extracted into the puresql_lite::garmentImporte(); both dialogs now call it (also collapses the duplicate and removes the latent MainWindow "empty cell on negative" quirk - it now shows 0.00 like AddGarment). SixgarmentImportecases added totest_sql_lite(incl. the comma-decimal regression and the size factor). All 3 suites pass; the foldable CI report now lists a third suite. Files:src/verifactu/verifacturesponse.{h,cpp},src/verifactu/verifactumanager.{h,cpp},src/verifactu/CMakeLists.txt,src/sql_lite/sql_lite.{h,cpp},src/app/mainwindow.cpp,src/add_garment/add_garment.cpp,tests/test_verifactu_response.cpp,tests/test_sql_lite.cpp,tests/CMakeLists.txt, docs. - [x] Test suite: Qt Test + CTest foundation, wired into CI and the release gate: closes (the bulk of) the long-standing "Unit and integration tests" Open Non-Blocking item. New top-level
tests/(enable_testing()+add_subdirectory(tests),Testadded to the rootfind_package) with two Qt Test executables registered viaadd_test, bothQTEST_GUILESS_MAINso they run headless on CI.test_sql_litespins up a throwaway SQLite DB in aQTemporaryDir, creates the ingresos/gastos/clientes schema and exercises the free functions against it:genHash16shape/uniqueness,readMaxValueInColumnFromTable,totalPriceBetweenDates(ingresos ANULADA/RECTIFICADA +pagado='SI'+ half-open[start,end)filters; gastos IVA-rate filter),countOperationsBetweenDates(distinct n_recibo),readLockForMonthAndYear,readLockForQuarter(incl. the 9.1 first-month-only regression guard),nextVerifactuInvoiceSeq,readClientPhones.test_mysortfilterproxymodelcoversremoveDiacriticsand accent-insensitivefilterAcceptsRow. Fixtures stay on success paths + dot-decimal importes so the QMessageBox error paths never fire under the guiless main. CI (ci.yml) replaced its placeholder withctest --output-on-failure;release.ymlrunsctestbetween Build and Stage as a hard gate (a failing test aborts the publish); the/releaseskill (step 3) and README document the localctestgate. Surfaced a doc bug: the test showedreadLockForMonthAndYearreturns0(not2) for an empty month — a valid-but-empty SELECT hitsq.first() ? ... : 0, so it conflates "no data" with "open" (harmless: its only caller checks==1). Corrected the function'ssql_lite.mdrow; the distinct-2-for-no-data behavior lives only in the newreadLockForQuarter. Remaining originally-listed targets (processResponse,setGarmentPrice) re-filed as a narrowed Open Non-Blocking follow-up — each needs a production change (test seam + AEAT fixtures / pure-function extraction). Files:CMakeLists.txt,tests/CMakeLists.txt,tests/test_sql_lite.cpp,tests/test_mysortfilterproxymodel.cpp,.github/workflows/{ci,release}.yml,.claude/commands/release.md,README.md,docs/{architecture,INDEX,modules/sql_lite}.md.
Post-9.0 bug fixes — June 2026¶
- [x] Startup backup moved off the GUI thread + single-query client phone lookup: two of the three perf findings from the 9.0 review. (1)
BackupManager::performBackup()(VACUUM INTO+PRAGMA integrity_check, seconds on a large DB) ran on the GUI thread ~3 s after launch and froze the UI for its duration; it now runs on aQThread::createworker (safe — it uses its own dedicated DB connections and touches no GUI), with theResultmarshalled back to the main thread viaQMetaObject::invokeMethod(this, …, Qt::QueuedConnection)for the success status-bar / failure message-box. (2)RecogPrendas::updateRowClickedToFieldslooked uptel_fijoandmovilwith two separateselectFromWhereLikecalls (two DB open/close + two SELECTs) on every row click; newsql_lite::readClientPhones(db, client)returns both in oneSELECT tel_fijo, movil … WHERE nombre = :n. The third finding (annual Contabilidad report's ~24 full-table scans) was deliberately deferred — see Open Non-Blocking — because it rewrites the quarterly tax aggregation and needs verification against real data. Files:src/app/mainwindow.cpp,src/sql_lite/sql_lite.h/.cpp,src/recog_prendas/recog_prendas.cpp,docs/modules/sql_lite.md,docs/architecture.md. - [x] PayDialog AEAT timeout now records
PENDIENTE, notError(and recovery is scoped so it can't mis-resubmit): when the 5 s bounded wait expired,PayDialog::persistPaymentran aNETWORK_ERRORresult throughupdateTicketVerifactuFields, which wroteverifactu_estado = Error. A slow-but-accepted AEAT submission was therefore recorded as a failure, andPendingSubmitsDialog(which only re-surfacesNULL/empty/PENDIENTE) never offered to reconcile it, so a later manual retry risked an AEAT 8003 duplicate. Now aNETWORK_ERROR/PENDINGoutcome (timeout or transport failure — an unknown, not a definitive rejection) is persisted asPENDIENTEvia the newPayDialog::markPendingVerifactu(seq), which keeps the<n_recibo>-<seq>InvoiceID and leaves CSV/XML empty; a genuine AEATERRORreply still writesError. BecausePendingSubmitsDialogre-submits a whole ticket as a baren_recibo(it is seq-unaware), its query was scoped withAND verifactu_invoice_seq = 0so a partial-pay (seq>0)PENDIENTErow is never auto-retried with the wrong amount/InvoiceID — full seq-aware recovery is filed as a new Open Non-Blocking item. Income totals are unaffected (PENDIENTE, likeError, is still counted). Files:src/recog_prendas/pay_dialog.h/.cpp,src/app/pendingsubmitsdialog.cpp,docs/modules/verifactu/README.md. - [x] Reprinted factura QR now uses the submitted payment date (
fecha_pago), notfecha_recepcion:Imprimir::resolveQrCode()rebuilt the QR'sFechaExpedicionfrom row 0'sfecha_recepcion. For a partial payment (PayDialog submits to AEAT withfecha_pago) or a late pickup payment (retry submits with the payment date), payment day ≠ reception day, so a reprint produced a QR whose date — and thus the AEAT cotejo URL — did not match the registered invoice. Now reads the first paid row'sfecha_pago, which equals the date submitted to AEAT on every path: PayDialog/retry submit the payment date, and save-time submissions storefecha_pago = fecha_recepcion(mainwindow binds:fecha_pagotode_date_recep), so the common counter-sale case is unchanged. Scans for the first non-emptyfecha_pagobecause row 0 can be an unpaid garment in the legacy unfiltered reprint path. Files:src/imprimir/imprimir.cpp. (Note: the QR is regenerated via the AEAT GetQrCode service rather than rendered from a stored URL because there is no local QR encoder; storing/rendering the cotejo URL locally remains a possible future simplification.) - [x] Trimestral accounting lock now reads the whole quarter, not just its last month:
Contabilidad::on_bb_ok_cancel_accepted()decided whether a quarter was already done/locked by callingreadLockForMonthAndYear(db, "ingresos", sb_trim*3, year)— i.e. only the quarter's third month. A quarter with income in its first month(s) but nothing paid in the last month read back as "no data" (status 2), hit the default branch ("no hay registros"), andupdateLock()was never invoked, so the quarter stayed editable after the operator closed contabilidad — AEAT-reported income could then be altered. Newsql_lite::readLockForQuarter(db, table, quarter, year)does one pass over the quarter's three months (substr(dateCol,4,2) IN (m1,m2,m3) AND substr(dateCol,7,4)=year):COUNT(*)=0→ 2 (no data), elseMAX(edit_lock)→ 1 locked / 0 open. Used both for the lock decision and for the Annual report's per-quarter "Contabilidad cerrada/no cerrada" label (which had the same last-month-only bug). As part of the change the lock read moved inside theTrimestralbranch (it was computed unconditionally at the top, producing a meaninglessmonth=sb_trim*3up to 36 in Mensual mode) and the dialog's stay-open-on-revert decision now uses an explicitkeepDialogOpenflag instead of re-testing the now-scopededitLock. Files:src/sql_lite/sql_lite.h/.cpp,src/contabilidad/contabilidad.cpp,docs/modules/{contabilidad,sql_lite}.md.
Post-8.4 development — May 2026¶
- [x] Pickup-all (
pb_pku_all) scoped to the clicked ticket (closes the name-search blast-radius bug):RecogPrendas::on_pb_pku_all_clicked()used to loopsqlQueryModel->rowCount()and fireupdateDb(PKU_YES)per source row. On a name search the model holds the wholeingresostable (SELECT *), so the loop marked every ticket in the DB as Recogido — the same blast-radius pattern that was fixed for pay-all in 8.5 viaPayDialog. Now reads the clicked row'sn_recibo(isCellClickedguard) and runs a single preparedUPDATE ingresos SET fecha_recogida = :fr, estado = 'Recogido' WHERE n_recibo = :nbounded to that one ticket, then refreshes viaon_pb_search_clicked(). Pickup never carried the Verifactu duplicate-InvoiceIDconsequence (no AEAT submission), which is why it was non-blocking. Shipped in commit9f8d217; this entry reconciles the tracker (the item had a dangling "tracked in Open Non-Blocking" reference but the fix had already landed). Files:src/recog_prendas/recog_prendas.cpp,docs/modules/recog_prendas.md. - [x]
dbhandle privatised + constructor-injected across all dialogs (extends the Contabilidad #9 fix): following the Contabilidad cleanup, the same anti-encapsulation pattern (QSqlDatabase db;as a public member assigned after construction, e.g.ui_x->db = db;) was removed from every other dialog opened fromMainWindow.dbis now a private member set through the constructor (explicit Foo(const QSqlDatabase &database, QWidget *parent = nullptr)), so callers writenew Foo(db, this)instead ofnew Foo(this)+ a separate->db = db. Classes converted:Imprimir,Listado,RecogPrendas,Facturas,AddGarment,GenListado,InsertNewItem,PayDialog,CancelInvoiceDialog,RectifyInvoiceDialog. All nested instantiations updated too (RecogPrendas→PayDialog/Imprimir, PayDialog→Imprimir, Listado→InsertNewItem/GenListado). Verified safe: every constructor-invokedsetupUi()/initialSettings()/buildUi()is db-free (db is only touched in event handlers), so injecting the handle earlier is behaviour-preserving; and there were no external reads of another object'sdb(every prior occurrence was adb = dbassignment), so privatising breaks nothing. In each headerdbwas placed after theuimember so the constructor init-list order matches declaration order (no-Wreorder).MainWindow::dbstays public — it is the owner that creates the connection. The other public flags/pointers flagged in audit item #9 (qrCode,isRecibo,revertirOn,m_verifactu, …) were left as-is — out of scope. Release build links clean (30/30). Files touched: headers + cpps of all ten classes above,src/app/mainwindow.cpp,src/listado/listado.cpp,src/recog_prendas/recog_prendas.cpp,src/recog_prendas/pay_dialog.cpp; docsdocs/modules/{imprimir,add_garment,recog_prendas,facturas,listado}.md,docs/coding_guidelines_audit.md(item #9 marked resolved fordb). - [x] Contabilidad / sql_lite review fixes (re-verified
todo.bakfindings): an earlier opencode review ofcontabilidadhad logged 10 issues; re-checking against the post-rewrite code, two were already resolved (the malformed<th<'>HTML — the table builders now go throughReportHtml::tableOpen(); and the missingrevertirOnguard for Mensual/Anual —resetAllContents()now forcescb_configto Trimestral and disables it in revert mode, so the unguarded branch is unreachable). The rest were fixed: (#1 SQL injection / guideline)totalPriceBetweenDates,countOperationsBetweenDates,readLockForMonthAndYearand the lock-update helper now useprepare()+bindValue()named params instead of+string concatenation (table/column names stay interpolated — still validated against"ingresos"/"gastos"— since SQL can't bind identifiers). (#2 misnamed)updateLockInIngresos→updateLockForMonth: the name no longer hides that it UPDATEs bothingresosandgastos. (#3 leak + modality)Contabilidadchanged fromQMainWindowtoQDialog(the.uilost itscentralwidgetwrapper) and now setsWA_DeleteOnClose, so the non-modalnew Contabilidad(...)+show()instances self-delete instead of leaking until MainWindow dies. (#6 dead code) removed the three no-opui->sb_trim->minimum()calls. (#7 readability)static_cast<int>(!revertirOn)replaced with a namedconst int lockValue = revertirOn ? 0 : 1. (#8 hardcoded 2019) the year-selector lower bound now comes fromreadMaxNMinYearInColumnFromTable(db, false, "fecha_pago", "ingresos")(falls back to the current year when there is no data). (#9 publicdb) thedbhandle is now a private member injected via the constructor (Contabilidad(const QSqlDatabase &, QWidget *)) instead of a public field assigned after construction. (#10 text-coupled constants) theC_MENSUAL/C_TRIMESTRAL/C_ANUAL#defines (compared against combobox text) replaced by aConfigMode { Mensual=0, Trimestral=1, Anual=2 }enum compared viacurrentMode()(the combobox index), so renaming an item can't silently break the logic. Release build links clean. Files touched:src/contabilidad/contabilidad.h/.cpp/.ui,src/sql_lite/sql_lite.h/.cpp,src/app/mainwindow.cpp,src/recog_prendas/pay_dialog.cpp(comment),docs/modules/contabilidad.md,docs/modules/sql_lite.md,docs/architecture.md,.claude/commands/coding-guidelines.md(staleC_TRIMESTRALexample). - [x] Dead-code cleanup in
src/verifactu/(19 unused methods removed): closes the Open Non-Blocking entry. RemovedVerifactuConfig::getEmitterCompanyName(),getSystemDeveloper(), and thecompanyName/developerparameters fromsetEmitterData/setSystemData(the members were never read outside their own setters); thinnedVerifactuTaxItemby 6 accessors (setTaxType,setOperationType,setDescription,getTaxType,getTaxRate,getOperationType); thinnedVerifactuInvoiceby 12 items (setBuyerNIF/Name,setTotalAmount,setTotalTaxAmount,getInvoiceType,getDescription,getBuyerNIF/Name,getTotalTaxAmount,clearTaxItems, the memberoperationTypeToStringoverload,taxTypeToString). All dead as of the async refactor that removedcreateAndSubmitInvoice— codebase is self-contained with no external linkers. Updated call sites:verifactuintegration.cpp,mainwindow.cpp. Snapshot refreshed via thedead-code-findersubagent. Files touched:src/verifactu/verifactuconfig.h/.cpp,src/verifactu/verifactutaxitem.h,src/verifactu/verifactuinvoice.h/.cpp,src/verifactu/verifactuintegration.cpp,src/app/mainwindow.cpp,docs/dead_code_report.md,docs/progress_tracker.md. - [x] Verifactu ServiceKey encrypted at rest (Windows DPAPI, per-user): closes the "ServiceKey stored in plaintext JSON" Open Non-Blocking entry. The AEAT API credential was kept as plaintext under
verifactu.service_keyin~/.laideal_settings.json. NowAppSettings::setVerifactuServiceKey()encrypts via Windows DPAPICryptProtectData(scoped to the current Windows user,CRYPTPROTECT_UI_FORBIDDENso no prompt) and storesdpapi:v1:<base64>;verifactuServiceKey()transparentlyCryptUnprotectDatas on read, so every caller (VerifactuIntegration,SettingsDialog) still sees plaintext and nothing else changed. Chosen over a master password (the shop runs unattended at the counter) and over an app-embedded key (not real security). Migration:encryptSecretsAtRest()runs inload()(both the new-file and existing-file branches) and re-encrypts any value lacking thedpapi:v1:marker — covering both legacy plaintext already in the JSON and a key just imported from~/.verifactu_key; the existing-file branch thensave()s immediately so the plaintext does not linger on disk. Fallbacks (key never lost):CryptProtectDatafailure stores plaintext rather than dropping the key;CryptUnprotectDatafailure (file copied to another Windows user/machine — DPAPI is user+machine bound) returns empty so "Probar conexión" fails clearly and the operator re-enters it. Non-Windows builds (none shipped) compile via a passthrough. Logs were already redacted (verifactumanager.cpp). Tradeoff documented: the encrypted key is not portable across Windows accounts/machines and must be re-entered after a reinstall or migration. Files touched:src/appsettings/appsettings.h/.cpp,src/appsettings/CMakeLists.txt(linkcrypt32on Windows). Docs:docs/architecture.md(AppSettings + Known Issues),docs/INDEX.md(glossary). - [x] Size-dependent garment price fixed for comma-decimal input (m² cortinas): closes the "Price calculation for size-dependent garments (cortinas) may be incorrect" Open Non-Blocking entry. Root cause: both
MainWindow::setGarmentPriceandAddGarment::setGarmentPriceparsed the user-entered size (and quantity) withQString::toFloat(), which is C-locale only (dot decimal), while every storage site normalises with.replace(",",".")before binding:size/:importe. So a Spanish-entered size like2,6parsed as0.0and the size factor was silently dropped: inMainWindowthe importe fell back toquantity × unitPrice(too low), and inAddGarment(which multiplies unconditionally when the field is non-empty, no!= 0guard) it became0.0 × price = 0,00— yet the size was stored correctly as2.6, so the saved/printed importe did not match the entered size. Fix: normalise both inputs with.trimmed().replace(",", ".")beforetoFloat()at both price-calc sites (mirroring the existing save-time convention), and switch the size test to a parsedsizeValue != 0.0fso non-numeric input no longer multiplies. No schema change. The DB unit price itself is out of scope (kept clean by the existingHerramientascomma-cleanup tool /updateComasInDecimalData). Files touched:src/app/mainwindow.cpp(setGarmentPrice),src/add_garment/add_garment.cpp(setGarmentPrice). Docs:docs/modules/add_garment.md(price-calc note). - [x] Investigated & discarded "clients missing from Listado but present in MainWindow combobox": no reproducible mechanism remains, so the entry was removed from Open Non-Blocking Issues (to be reopened only if observed again). The combobox is populated solely from
clientes.nombreviareadColumnFromTable(mainwindow.cpp:216,SELECT nombre FROM clientes) andListado(tableName == "clientes") shows the sameclientestable viaQSqlTableModel.Listado::populateTable()drainsfetchMorefor every non-ingresostable (while (model->canFetchMore()) model->fetchMore()), which deterministically loads allclientesrows — this replaced an older flaky "scroll the view to the bottom until rowCount stops growing" hack (commit b39cda7 "fix ingresos table view"). The 256-rowQSqlTableModellazy batch was the only plausible original cause (same family as the RecogPrendas name-search 256-row bug) and it is now force-drained. The issue's "encoding differences" hypothesis is refuted: both paths readclientes.nombrethrough the same QSQLITE driver (SELECT nombre …vsSELECT * …), so a row cannot decode into one result set and disappear from the other; the default (empty)MySortFilterProxyModelfilter hides nothing. No code change. Files touched: docs only (docs/progress_tracker.md,docs/architecture.md). - [x] Report visualisation: shared professional A4 style + IVA settlement / net result / counts / annual consolidated: closes the "Improve report visualisation" Open Non-Blocking entry for the two A4 PDF surfaces (the thermal-ticket half stays open, re-scoped, since
imprimir.cppis a 58 mm Excel/cscript path where the A4 redesign does not apply). Shared styling, no drift: the three report generators (Contabilidad::generate*,GenListado::generate_html_prendas_table,generate_html_gastos_table) each hand-rolled their own<!DOCTYPE>…<style>…<body>+ business header, with an undefinedtext-smallCSS class, a hardcoded "Granada", and malformed tags (<th<'>,<td colspan='6',>). Lifted the common scaffolding into a new tiny static libsrc/reporthtml/(ReportHtml::documentOpen(title, subtitle)/documentClose()/formatEuro(value)): one "clean professional" stylesheet (Arial, slate#2c3e50headings, soft#b6bec7grid, grey#e8ecf0header row,#f6f7f9zebra, bold accent total rows), a business header band (name / address / city / NIF fromverifactuNif()/ phone, issue date right-aligned) and a generation-timestamp footer. Everything stays table- and inline-style based becauseQTextDocumentrenders only a subset of HTML/CSS (no flexbox). Currency now prints with Spanish grouping viaQLocale(Spanish, Spain)—1.234,56 €instead of1234.56 €. New contabilidad figures (all computed from existing data, no schema change): a per-period Liquidación de IVA block — IVA repercutido (ingresos) − IVA soportado (gastos) = Resultado IVA, labelled "a ingresar"/"a compensar" by sign (the modelo-303 figure previously computed by hand); Resultado del periodo = base ingresos − base gastos (beneficio/pérdida); the explicit period range (Periodo: dd-MM-yyyy a dd-MM-yyyy) and operation counts (distinct paid tickets for ingresos, invoice rows for gastos) via a newcountOperationsBetweenDates()insql_litethat mirrors the estado/date filters oftotalPriceBetweenDates; and, for the annual report, a Resumen anual consolidado that sums the four quarters. Refactors that fell out: the four-way quarter/month date switch duplicated insidegetTotalIncomeis now a singleperiodRange()helper reused by the counts and the period subtitle; the figures are computed once into aPeriodFiguresstruct (withresultadoIva()/resultadoPeriodo()/accumulate()helpers) and shared by the ingresos table, gastos table and summary, replacing the old per-table recomputation and the deadcreateHtmlHeader()/createHtmlTables(). The listados keep their columns but adopt the shared header/footer/stylesheet, right-aligned euro cells, and the malformed group-totalcolspanrows are fixed. Files touched:src/reporthtml/(new:reporthtml.h/.cpp,CMakeLists.txt),CMakeLists.txt(add_subdirectory),src/sql_lite/sql_lite.h/.cpp(countOperationsBetweenDates),src/contabilidad/contabilidad.h/.cpp(+CMakeLists.txtlink),src/listado/genlistado.cpp(+CMakeLists.txtlink). Docs:docs/modules/contabilidad.md,docs/INDEX.md,docs/architecture.md. - [x] Tag-triggered release workflow —
release.ps1pipeline reproduced in CI and fully automated: new.github/workflows/release.yml(runs on push of anX.Ytag) reproduces every step ofreleases\release.ps1on awindows-latestrunner — validate tag ==CMakeLists.txtversion, install Qt 6.4.3 MinGW + Ninja + Inno Setup, configure/build (CMake + Ninja, Release), stagelaideal.exe,windeployqt, zip intoX.Y.zip, compile the Inno Setup installer (laideal_setup_X.Y.exe), extract this version'sreleases_notes.txtsection, and publish a GitHub Release with both artifacts attached + the section as the release body. So cutting a release is now justgit tag X.Y && git push origin X.Y— no localrelease.ps1run or manualgh release createneeded (release.ps1stays as the offline/local fallback). Toolchain parity, no separate pin:jurplel/install-qt-action@v4witharch: win64_mingwrunsaqt install-qt … --autodesktop, which auto-downloadsMinGW-w64 11.2.0(the exact toolchainrelease.ps1pins atC:\Qt\Tools\mingw1120_64) and puts it on PATH, so the build andwindeployqtuse the same compiler runtime DLLs the libraries were built against — confirmed in the run log (Finished installation of MinGW-w64-x86_64-11.2.0-…-runtime.7z). An initial attempt to pin it explicitly withtools: 'tools_mingw1120'failed (aqt: not a valid tool name) and was redundant, so it was removed. Hardening added over the plain script translation (caught during a max-effort review of the new file): (1) thewindeployqtstep now asserts the runtime DLLs were actually deployed (libgcc_s_seh-1.dll,libstdc++-6.dll,libwinpthread-1.dll,Qt6Core.dll,platforms\qwindows.dll) —ci.ymlonly builds the bare exe and never runswindeployqt, so this is the only place that guards the packaging step from shipping an installer that crashes on launch on a clean machine; (2)Test-Pathexistence checks after build (exe) and after Inno (installer), mirroringrelease.ps1; (3) the release-notes extraction now throws whenreleases_notes.txthas no section for the tag, or the section is empty, instead of silently publishing a release with a blank body that the in-app updater would then show users; (4) the publish step is idempotent — if a release already exists for the tag (re-run after a transient failure, or a moved tag) it is deleted first (the git tag is kept) sogh release createalways succeeds. The tag glob'[0-9]+.[0-9]+'is valid GitHub filter syntax (+= one-or-more), the bareX.Ytag (nov/rprefix) matchesUpdater::currentVersion()/tag_name, and thelaideal_setup_X.Y.exeasset name matches the updater'skInstallerAssetPrefix— so the auto-published release is consumable by the in-app updater unchanged. Validated end-to-end via a throwaway0.1tag (on a temp commit bumpingCMakeLists.txt/notes to0.1, never merged): the full pipeline ran green in 3m38s and published0.1.zip(22 MB) +laideal_setup_0.1.exe(17.6 MB) with the correct notes body;0.1chosen because the updater is downgrade-safe (0.1 ≤ 8.4→ no update offered) so no user was affected during the brief window it was/releases/latest. Test release + tag deleted afterwards, restoring8.4as Latest. Files touched:.github/workflows/release.yml. Docs: rootREADME.md(Development workflow step 6 + Release procedure now lead with the tag-push automation,release.ps1documented as the local fallback),docs/INDEX.md(CI/CD workflow files),docs/ai_agent_instructions.md(release-pipeline note). - [x] GitHub Actions CI/CD pipeline: new
.github/workflows/ci.yml— Windows runner that builds on every push/PR (Qt 6.4.3 MinGW viajurplel/install-qt-action+ CMake + Ninja), with a test placeholder and artifact upload oflaideal.exeon push branches. Closes the Open Non-Blocking entry. Files touched:.github/workflows/ci.yml. - [x] RecogPrendas landline phone (
tel_fijo): visualization of the home phone added to the dialog fromclientestable alognside client name. - [x]
CancelInvoiceDialogper-seq cancellation: closes the Open Non-Blocking entry of the same name and removes the 8.5 partial-pay guard that previously blocked the dialog whenever any row of the searched ticket carriedverifactu_invoice_seq > 0. The dialog now lists every(n_recibo, verifactu_invoice_seq)AEAT submission as one row in aQTableWidget(InvoiceID, importe, estado, CSV, per-row "Anular" button). Single-event legacy tickets render the same uniform table with one row (seq=0) and behave identically to before. AEAT side: each cancel sends the literalverifactu_invoice_idstored at submit time — when that column is empty (8.0-8.4 rows or pre-Phase-G PayDialog events) the dialog reconstructs the same string AEAT would have under (seq=0 → baren_recibo, seq>0 →<n>-<seq>). Local side: the post-success UPDATE is now scopedWHERE n_recibo=:n AND verifactu_invoice_seq=:seq, so the other payment events of the same ticket stay ENVIADA. Only events whoseverifactu_estado=ENVIADAare cancellable; ANULADA / RECTIFICADA / ERROR / PENDIENTE rows show the button greyed out. Single in-flight cancellation is enforced — the dialog disables all action buttons while a request is pending and re-enables them on reply. The header (cliente + fecha_recepcion) is rendered once above the table since it is invariant per ticket. No schema change. Public surface of the dialog (db+m_verifactu+exec()) is unchanged;MainWindow::on_actionAnular_factura_verifactu_triggeredkeeps working as-is. Files touched:src/app/cancelinvoicedialog.h/.cpp. - [x] RecogPrendas "Recoger todo" blast-radius bug closed: closes the Open Non-Blocking entry of the same name. The legacy
on_pb_pku_all_clickediteratedsqlQueryModel->rowCount()source rows and calledupdateDb(PKU_YES)per row. On a name-search (SELECT * FROM ingresos) the source model held the entire table, so pressing "Recoger todo" marked every ticket in the databaseestado=Recogido+fecha_recogida=today— same blast-radius pattern that was fixed forpay_allin 8.5 via PayDialog. Closed here with the same scope strategy but a much smaller change since pickup has no per-garment choice / AEAT submit / print: read the clicked row'sn_recibofrom the source model (no proxy mapping needed —rowClickedCellis already a source row thanks to the 8.4 coord-space fix) and run oneUPDATE ingresos SET fecha_recogida=:fr, estado='Recogido' WHERE n_recibo=:nthen re-fire the search to refresh the view. No new dialog, no schema change.fecha_recogidais bound fromui->de_date_pickup->date()to match the legacy semantics where the operator could pick a different pickup date in the form. Files touched:src/recog_prendas/recog_prendas.cpp. - [x]
hashcolumn: UUID-based generator + maintenance action regenerates legacy duplicates instead of just listing them: closes the Open Non-Blocking entry "Manualhashcolumn — review necessity, fix duplicates". Why the dialog was reporting "wrong" duplicates: the legacySELECT n_recibo, COUNT(*) FROM ingresos GROUP BY hash HAVING COUNT(*) > 1returned ONE arbitraryn_reciboper duplicate group, so when ticket 21484 shared a hash with ticket 17510 the operator saw21484listed but checking 21484's own rows showed unique hashes within that ticket — the collision was cross-ticket, not within-ticket; ticket numbers appearing twice in the list (21484, 21484) just meant that ticket participated in two distinct collision groups. The collisions themselves are legacy data from the olderrand()-eragenHash16(). The hash IS still required: it is the per-row addressing key used byPayDialog::persistPayment(WHERE n_recibo=:n AND hash=:h) and seven RecogPrendas operations (Entregar / Separar / Pagar / etc.), plus every INSERT site, so dropping it in favour of SQLite'srowidwould be a wider refactor than this task warranted. Changes: (1)genHash16()now returnsQUuid::createUuid().toString(QUuid::Id128).left(16)— 16 hex chars from a cryptographic UUID, ~2^64 entropy, no realistic birthday-collision and no manual retry loop; (2)on_actionCrear_hash_en_ingresos_triggered()rewritten as three phases — A fillshash IS NULL OR hash = ''rows keyed byrowid(not the legacy all-fields equality, which mass-stamped identical garment rows with one hash); B detects every collision groupGROUP BY hash HAVING COUNT(*) > 1, keeps the first row's hash (ordered byrowid), regenerates the rest viaUPDATE ... WHERE rowid = :rid; C defensive re-check, surfaces remaining groups in a warning if Phase B didn't converge. Dialog now reports actionable counts: filled / collision groups / rows regenerated, instead of the opaque ticket list. Idempotent — a clean DB returns0 / 0 / 0. The action is kept as an operator escape hatch even though the schema is now self-healing. Files touched:src/sql_lite/sql_lite.cpp(genHash16body + swap<QRandomGenerator>for<QUuid>),src/app/mainwindow.cpp(on_actionCrear_hash_en_ingresos_triggeredrewrite). - [x] Pending Verifactu submissions across app restarts: operator-surfaced recovery dialog: closes the Open Non-Blocking entry of the same name. Until now
MainWindow::m_pendingSubmits(reqId → ticketNum) lived only in RAM, so an app close or crash mid-submission left the row atverifactu_estado='PENDIENTE'with no recovery path — and a naive auto-resubmit risks AEAT duplicate-InvoiceID if the original POST had actually reached AEAT before the reply was lost. Resolution path picked: operator-surfaced recovery rather than auto-reconcile (the alternative, auto-reconcile via lookup, was rejected because the Irene Solutions Kivu API has no confirmed idempotent lookup-by-InvoiceID endpoint that returns the AEAT-side CSV). New modulesrc/app/pendingsubmitsdialog.{h,cpp}— a modalQDialogopened fromMainWindow's startup viaQTimer::singleShot(4000)so it lands after the updater + backup prompts have settled.loadPending()SELECTs distinctn_recibowith at least one row whoseverifactu_estadois NULL/empty/PENDIENTE, aggregatesfecha_recepcion/cliente/ SUM(importe) per ticket, and returns false (so the dialog never opens) when there is nothing pending. Two gates protect against surfacing pre-Verifactu legacy tickets: (1) operator toggleverifactu.pending_recovery_enabled(default true) — when off,loadPending()returns false unconditionally; (2) floor dateverifactu.pending_recovery_floor_date(ISOyyyy-MM-dd, default2026-09-01matching the planned PROD cutover) — added to the SQL assubstr(fecha_recepcion,7,4)||'-'||substr(fecha_recepcion,4,2)||'-'||substr(fecha_recepcion,1,2) >= :floorsince the DB stores dd-MM-yyyy and the substr-rebuild gives a lexicographically-comparable ISO key. Both settings are user-configurable in the Verifactu tab ofSettingsDialog(QCheckBox+QDateEditwithdd-MM-yyyydisplay, calendar popup, persisted as ISO in~/.laideal_settings.json). Each row shows three per-row buttons: Reintentar emitsretryRequested(ticketNum, date, total)→MainWindow::verifactuSubmitInvoice(...)which already registers the newreqIdinm_pendingSubmitssoonVerifactuRequestFinishedpatches the row when AEAT replies; Marcar como error runs a single UPDATE settingverifactu_estado='Error'+verifactu_error='Pendiente sin reconciliar tras cierre - revisar en sede AEAT'(no AEAT call, no duplicate-InvoiceID risk); Posponer just drops the row from the table —verifactu_estadostays PENDIENTE and the dialog will resurface it on the next launch. Files touched:src/app/pendingsubmitsdialog.h/.cpp(new),src/app/CMakeLists.txt(add to executable sources),src/app/mainwindow.cpp(#include+ deferred-launch hook +retryRequestedconnect →verifactuSubmitInvoice),src/appsettings/appsettings.h/.cpp(two new accessors + defaults),src/appsettings/settingsdialog.h/.cpp(two new controls under the Verifactu tab). Docs:docs/architecture.md(new module box under MainWindow's children),docs/INDEX.md(new file entries). - [x] Drop the legacy
VerifactuConfigINI cache: closes the Open Non-Blocking entry of the same name. Pre-8.5 builds wrote aQSettingsINI copy of NIF/name/serviceKey/environment to<AppDataLocation>/verifactu_config.inion every Verifactu submit, butVerifactuIntegration::loadEmitterConfiguration()always overwrote the in-memory state from~/.laideal_settings.json(AppSettings) at startup, so the INI was never read back. The file was therefore a stale plaintext copy of the same credentials already kept in the JSON — a credential-footprint smell with no functional purpose. Changes:VerifactuConfigis now a pure in-memory holder. Droppedsave(),load(), them_settingsmember, the<QSettings>include, and theconfigPathconstructor parameter. Constructor performs a one-time delete of the legacy INI at<AppDataLocation>/verifactu_config.iniif it exists, so existing installs are cleaned up the next time the app starts (idempotent — once gone, the file-exists check no-ops).VerifactuManagerctor signature loses itsconfigPatharg; the sole caller inVerifactuIntegration::initialize()updated. The lingeringm_manager->getConfig()->save();call inloadEmitterConfiguration()is gone since there is no more persistent target. Net: zero credential bytes written by Verifactu code outside of~/.laideal_settings.json. Side-benefit: removes theVerifactuConfig::load()row called out as dead in the open "Dead-code cleanup insrc/verifactu/" tracker entry. Files touched:src/verifactu/verifactuconfig.h/.cpp,src/verifactu/verifactumanager.h/.cpp,src/verifactu/verifactuintegration.cpp. Docs: this entry;docs/modules/verifactu/README.mdInternal note removed. - [x] Coding-guidelines Tier 1: split
verifactuinvoice.hinto one-class-per-header: closes the last open Tier-1 item from the 2026-05-26 audit.VerifactuTaxItemandVerifactuInvoicepreviously sharedsrc/verifactu/verifactuinvoice.h/.cpp. Newverifactutaxitem.handverifactutaxitem.cppcarry only theVerifactuTaxItemclass;verifactuinvoice.hnow declares justVerifactuInvoiceand#includes the new header at the top so existing transitive consumers (verifactumanager.{h,cpp},verifactuintegration.{h,cpp},mainwindow.cpp,rectifyinvoicedialog.cpp,pay_dialog.cpp,sql_lite.cpp) keep working without edits.verifactuinvoice.cpplikewise slimmed toVerifactuInvoice-only implementation; the#include <cmath>and the tax-item-specificqDebuginclude moved to the newverifactutaxitem.cpp.src/verifactu/CMakeLists.txtadds the two new files toPROJECT_SOURCES(alphabetical order: taxitem before invoice, mirroring header dependency). No public API change, no behaviour change. Same one-class-per-header direction as the 8.4 split ofverifactutypes.hout ofverifactumanager.h. Files touched:src/verifactu/verifactutaxitem.h/.cpp(new),src/verifactu/verifactuinvoice.h/.cpp(slimmed),src/verifactu/CMakeLists.txt. - [x] Verifactu Req. 5: close per-user trazabilidad (Art. 8.1) by stating the monoperador scope in the declaración responsable: removes the only remaining PARTIAL row from
docs/modules/verifactu/verifactu-requirements.md(Req. 5) and the matching entry from Open Non-Blocking Issues. The issue text offered two closures — full per-operator-stamping (newoperador TEXTcolumn oningresos, login prompt at startup, stamp on each write) vs. single-operator declaration — and we picked the second because La Ideal is run by a single clerk and the regulator accepts "implicit identification by Windows session" when the scope is documented. Added a new paragraph to theAcerca de Verifactu...dialog body inmainwindow.cppdeclaring (a) the system is used in a monoperador installation, (b) the single operator is identified implicitly by the Windows session, (c) under that scope Art. 8.1 is satisfied, and (d) incorporating a second clerk requires enabling per-event identification first — so the operator is aware that hiring re-opens the requirement.verifactu-requirements.md§5 flipped PARTIAL → COVERED with the new wording; §8 cross-references the monoperador clause; the audit table at the bottom now shows all ten requirements COVERED. No schema change, no UI prompt, no new module. Files touched:src/app/mainwindow.cpp(HTML body of the declaración),docs/modules/verifactu/verifactu-requirements.md. - [x] Verifactu Req. 4: automated SQLite backup + 4-year retention + in-app manual trigger: closes the Open Non-Blocking entry "Verifactu Req. 4 — automated SQLite backup + 4-year retention (Art. 8.2.c RD 1007/2023)" and flips that requirement from PARTIAL to COVERED in
docs/modules/verifactu/verifactu-requirements.md. New modulesrc/backup/backup_manager.{h,cpp}exposesBackupManager::performBackup()(synchronous),needsBackup(minIntervalSeconds=24*3600), andpruneOldBackups(). The snapshot uses SQLiteVACUUM INTO 'target'on a dedicated connection (laideal_backup_snapshot), which produces a transactionally-consistent point-in-time copy without taking exclusive access on the live DB — so the operator's current session is not interrupted. Each snapshot is then re-opened read-only on a second dedicated connection (laideal_backup_verify) andPRAGMA integrity_checkmust returnokbefore the file is counted toward the retention window; a corrupt copy is deleted on the spot. Filenames followlaideal_yyyy-MM-dd_HHmmss.db(same.dbextension as the live DB so the operator manages a uniform set of files) and sort lexicographically by time, which keeps the pruner trivial. Backups live in abackups/subdir next to the live DB — derived fromQFileInfo(dbPath()).absolutePath() + "/backups"— so the operator manages one location and the snapshots stay isolated from the live file. Retention policy: keep every backup from the last 30 days, then one per calendar month for 4 years, then delete (matches the tax prescription period in Ley 58/2003 LGT). AppSettings gainsbackup.enabled(default true) andbackup.last_time(ISO timestamp persisted after each success); the directory is not a separate setting — it followsdbPath(). MainWindow instantiatesm_backupManagerin the constructor; ifneedsBackup()is true it schedulesperformBackup()viaQTimer::singleShot(3000)so the snapshot runs after the first paint and doesn't delay the UI. The auto path is silent on success (status-bar 8 s message) and shows aQMessageBox::warningonly on failure — since the regulatory requirement is durable storage, a failed snapshot is worth surfacing. Herramientas → Hacer copia de seguridad ahora... is a newQActionin the menubar (actionHacer_copia_de_seguridad) that runs the sameperformBackup()under aWaitCursorand reports the resulting path + size in aQMessageBoxso the operator can grab the file for offsite copies. No installer / Task Scheduler changes were needed: the shop opens the app daily, so an in-app daily backup covers the prescription window equivalently, and the manual trigger handles ad-hoc offsite workflows. Files touched:src/backup/backup_manager.h/.cpp(new),src/backup/CMakeLists.txt(new),CMakeLists.txt(add_subdirectory),src/app/CMakeLists.txt(linkbackup),src/appsettings/appsettings.h/.cpp(new backup keys + default opt-in),src/app/mainwindow.h/.cpp(include + member + startup hook + slot),src/app/mainwindow.ui(Herramientas menu entry + action). Docs:docs/architecture.md(new module box),docs/INDEX.md(new files),docs/modules/backup.md(new module reference),docs/modules/verifactu/verifactu-requirements.md(Req. 4 → COVERED). - [x] Partial-payment dialog (PayDialog) — operator picks a subset of garments and Verifactu submits one invoice per payment event: closes the long-standing tracker entry "Per-payment Verifactu InvoiceID seq (restore per-garment payment)" and the 8.5 Blocking Issue for "Pagar todo on name search marks every ticket paid". v8.0 disabled per-garment payment as a workaround for AEAT duplicate-InvoiceID rejection; v8.5 restores it with the proper mechanism. Schema:
migrateDatabase()addsverifactu_invoice_seq INTEGER DEFAULT 0toingresos. ConstantINGRESOS_COL_VERIFACTU_INVOICE_SEQ = 24iningresos_schema.h. Legacy rows (8.0-8.4) keep seq=0, matching the bare-InvoiceID convention they were submitted under. sql_lite helpers:nextVerifactuInvoiceSeq(db, ticketNum)returnsMAX(verifactu_invoice_seq)+1across rows of that ticket that have a non-emptyverifactu_estado(so it skips never-submitted rows), andupdateTicketVerifactuFieldsForSeq(db, ticketNum, seq, result)patches AEAT metadata scoped by(n_recibo, seq)instead ofn_reciboalone. Imprimir gains an optionalint invoiceSeq = -1member; when>=0,getTicketInfo()filtersWHERE n_recibo=? AND verifactu_invoice_seq=?, the factura header printsNº: <n_recibo>-<seq>, and the reprint QR path uses the same seq'd InvoiceID forgenerateQRAsync— so printed receipt and AEAT-side invoice are always aligned. PayDialog (src/recog_prendas/pay_dialog.{h,cpp}) is a modalQDialogopened fromRecogPrendas::pb_pay_allwith the clicked ticket pre-loaded: every unpaid row of thatn_reciboappears as aQTableWidgetline with a per-row checkbox pre-checked. Live "Total seleccionado (N prendas)" label updates as boxes are unticked. "Cobrar" readsnextVerifactuInvoiceSeq, buildsInvoiceID = "<n_recibo>-<seq>", firessubmitSimplifiedInvoiceAsyncwith a 5 s bounded wait viaQEventLoop+QTimer::singleShot, UPDATEs the chosen rowspagado='SI', fecha_pago=:date, verifactu_invoice_seq=:seq, callsupdateTicketVerifactuFieldsForSeqfor the AEAT metadata on the matched rows, and prints the partial factura viaImprimirwithinvoiceSeqset so only the paid subset is on the print. AEAT-not-configured and 5 s-timeout paths still persist the payment locally and print a paid recibo (no QR). RecogPrendason_pb_pay_all_clickedwas rewritten: instead of loopingsqlQueryModel->rowCount()source rows and pressingon_pb_payment_toggled(true)per row (the v8.5 blocking bug: on name-search the source model held the full table, so the loop marked every ticket in the DB paid), it now takes the clicked row'sn_recibo, opensPayDialog, waits for it to close, and re-runs the search.pb_printwas updated to read the clicked row'sverifactu_invoice_seqand forward it toImprimirviaprintFactura(ticketNum, askSecondCopy, invoiceSeq)so a reprint covers exactly that payment event's rows. CancelInvoiceDialog gets a guard: if the queried ticket has any row withverifactu_invoice_seq > 0, the dialog blocks the cancel and tells the operator to use the AEAT sede electrónica — its currentUPDATE WHERE n_recibo = Xwould mark every payment event's rows ANULADA in one shot and lose the per-seq alignment, so full per-seq cancellation is deferred to 8.6 (filed in Open Non-Blocking Issues).pku_allleft unchanged - same blast-radius pattern but no Verifactu corruption pressure, also filed in Open Non-Blocking. Files touched:src/sql_lite/sql_lite.h/.cpp,src/sql_lite/ingresos_schema.h,src/imprimir/imprimir.h/.cpp,src/recog_prendas/pay_dialog.h/.cpp(new),src/recog_prendas/CMakeLists.txt,src/recog_prendas/recog_prendas.h/.cpp,src/listado/listado.cpp(hide the new column),src/app/cancelinvoicedialog.cpp. Six commits in sequence (Phase A→F): f8ebbce, b964c60, 6430528, da0cef7, 7a64e2c, plus this docs commit.
8.4 release — May 2026¶
- [x] Split
verifactutypes.hout ofverifactumanager.h: the previous milestone movedupdateTicketVerifactuFields()intosql_lite.cppand added#include "../verifactu/verifactumanager.h"to bring inVerifactuResult+VerifactuEstado+ the helpers. That header transitively pulls<QNetworkAccessManager>(because it declares the REST client), so thesql_litestatic lib - which links only Core / Gui / Sql, not Network - failed to compile (fatal error: QNetworkAccessManager: No such file or directory). Lifted the lightweight types (theVerifactuEstadoenum,verifactuEstadoToString/FromString, theVerifactuResultPOD) into a newverifactu/verifactutypes.hthat depends only on<QString>+<QPixmap>.verifactumanager.hnow includes that header instead of carrying the types;sql_lite.cppincludes the small header so it never sees Network. Same one-class-per-header direction as the open Tier-1 task forverifactuinvoice.h. Files touched:src/verifactu/verifactutypes.h(new),src/verifactu/verifactumanager.h,src/verifactu/CMakeLists.txt,src/sql_lite/sql_lite.cpp. - [x]
RecogPrendas: fix latent proxy/source row-coord bug under header sort + settable_nameso date /importesort correctly:recog_prendas.uialready hadsortingEnabled=trueon the table view andon_pb_search_clickedalready calledsortByColumn(0, DescendingOrder), so header-click sorting was nominally working - but two flaws made it silently wrong. (1) Coordinate-space bug:on_tableView_clicked(const QModelIndex &index)received a proxy-space index from the view, storedindex.row()asrowClickedCell, and the rest of the class then consumed that value as a source-model row viasqlQueryModel->index(rowClickedCell, ...). Whenever the desc-by-n_recibo default sort actually reordered rows (i.e. searches that span multiple tickets - typically name search), every click that wasn't on the first visible row hit the wrong DB record - sopb_state(Entregar) could mark the wrong ticket as picked up,pb_separ_garmcould split the wrong garment, etc. Same-ticket searches were immune because all rows share the same n_recibo so the sort was a no-op. Factored row storage into a new private helperselectSourceRow(int sourceRow, int sourceCol);on_tableView_clickednow maps viaproxyModel->mapToSource(index)before delegating. The pay-all / pku-all loops, which previously fake-calledon_tableView_clickedwith rawsqlQueryModel->index(row, 0)source indices (an existing layering oddity that happened to work because of the bug above), now callselectSourceRow(row, 0)directly - same outcome, less magic. (2)table_namewas never set on the proxy:MySortFilterProxyModel::lessThan()keys ontable_name("ingresos"/"gastos"/"prendas") to pick the date or numeric comparator;Listadosets it butRecogPrendasnever did, so clicking a date column header sorted lexicographically ("31-01-2026" < "02-02-2026"reverses by day, not chronology) andimportesorted as strings ("100" < "9"). AddedproxyModel->table_name = "ingresos";right after the proxy is constructed. Defensive:MySortFilterProxyModel *proxyModelwas an uninitialised pointer member; changed to= nullptrso theproxyModel ? mapToSource : indexguard in the click handler is safe before the first search. ThesortByColumn(0, ...)call now usesINGRESOS_COL_N_RECIBOinstead of a bare literal. Files touched:src/recog_prendas/recog_prendas.h/.cpp. - [x] Consolidate
ingresoscolumn-index constants intosql_lite/ingresos_schema.h: three parallel macro sets indexed the same 24 columns ofingresos:INGRESOS_IDX_*inmysortfilterproxymodel.h(used bymysortfilterproxymodel.cpp,mainwindow.cpp,listado.cpp— half-Spanish names ID/IMPORTE/PAYED/CANTIDAD/PRENDA/SERVICIO/OBSV),TABLE_*inimprimir.h(used byimprimir.cpp,add_garment.cpp— English-ish names TICKET/PRICE/IS_PAYED/QUANTITY/GARMENT/SERVICE/OBSERV), and a near-duplicateTABLE_*inrecog_prendas.h(withTIMESTAMPinstead ofTSand a comment leaning on imprimir.h forTABLE_HASH). The previous Verifactu milestones in the tracker explicitly note new columns being added to all three blocks for each schema change — exactly the drift hazard that produced the v8.0verifactu_xml/verifactu_hashsilent-drop bug. Lifted into a single canonical set in a new tiny headersql_lite/ingresos_schema.h(no QtSql dep, so light consumers liketableviewcan include it without picking up the SQL link):INGRESOS_COL_<UPPER_DB_COLUMN_NAME>(INGRESOS_COL_N_RECIBO=0...INGRESOS_COL_VERIFACTU_RECTIFICATION_TYPE=23).sql_lite.hre-includes it so existing SQL consumers keep working transparently. The name = uppercase SQL column avoids the English-vs-Spanish bikeshed (DB names are what they are) and makes a grep for any column hit both the schema and the C++ constant. All ~80 call sites renamed (mainwindow.cpp, listado.cpp, mysortfilterproxymodel.cpp, imprimir.cpp, recog_prendas.cpp, add_garment.cpp). Headers (mysortfilterproxymodel.h,imprimir.h,recog_prendas.h) gain a one-line breadcrumb pointing atsql_lite.hso future readers know where the constants live.TABLE_TICKET_*inmainwindow.hwas not touched — those index the in-memoryQTableWidgetused for ticket entry, a distinct concept from theingresosDB row layout. The mechanical rename was driven by a regex script with\bboundaries soTABLE_TICKET_QNTYetc. were correctly skipped. Docs updated:docs/modules/imprimir.md,docs/modules/recog_prendas.md(column-index tables rewritten to point atINGRESOS_COL_*). Files touched:src/sql_lite/sql_lite.h,src/tableview/mysortfilterproxymodel.h,src/imprimir/imprimir.h,src/recog_prendas/recog_prendas.h,src/app/mainwindow.cpp,src/listado/listado.cpp,src/tableview/mysortfilterproxymodel.cpp,src/imprimir/imprimir.cpp,src/recog_prendas/recog_prendas.cpp,src/add_garment/add_garment.cpp,docs/modules/imprimir.md,docs/modules/recog_prendas.md. - [x] Consolidate
updateTicketVerifactuFields()intosql_lite:MainWindow::updateTicketVerifactuFields()andRecogPrendas::updateTicketVerifactuFields()were byte-identical (same UPDATE oningresos, same bindings, same logging shape) — exactly the drift hazard flagged in the previous milestone where the RecogPrendas copy missed the xml/hash columns for weeks. Lifted into a single free functionupdateTicketVerifactuFields(QSqlDatabase &db, const QString &ticketNum, const VerifactuResult &result)insql_lite.h/.cpp, alongside the other ingresos-touching helpers (updateLockInIngresos,insertNewItemToTable, etc.). Both call sites now invoke the free function with their memberdb.sql_lite.hforward-declaresVerifactuResultso consumers do not need to includeverifactumanager.htransitively; the implementation includes it. The rectifyinvoicedialog helperapplyRectificationResult()was intentionally not folded in — its WHERE clause has the extraAND verifactu_rectifies_n_recibo = :origguard and a different success-state mapping, so it is a sibling helper, not a duplicate.docs/architecture.mddata-flow box updated to point atsql_lite::updateTicketVerifactuFields. Files touched:src/sql_lite/sql_lite.h/.cpp,src/app/mainwindow.h/.cpp,src/recog_prendas/recog_prendas.h/.cpp,docs/architecture.md. - [x] Save-time print: bounded 3 s wait for AEAT so the factura carries the QR when possible, otherwise degrade to a paid recibo: previously the
isPaidbranch ofon_bb_save_reset_clickedalways calledprintFra()immediately after firing the asyncverifactuSubmitInvoice(), so the printed factura simplificada always went out without QR / CSV - the AEAT reply was still in flight and the DB row was still PENDIENTE. The Verifactu legend gated onverifactu_estado = ENVIADA(line 415 ofimprimir.cpp) was likewise never printed at save time. New flow:verifactuSubmitInvoicenow returns thereqId(wasvoid); the save handler opens a localQEventLoopwith a 3 sQTimer::singleShottimeout and listens onVerifactuIntegration::requestFinishedfiltered by thatreqId. The existingonVerifactuRequestFinishedslot fires first (FIFO connect order) and UPDATEs the row toENVIADA/ERROR+ CSV / Huella before the local lambda runs, so by the time the lambda quits the loop the DB is consistent. If the reply arrived ANDresult.isSuccess() && !result.qrCode.isNull(), we call the newprintFra(const QPixmap &qrCode = QPixmap())overload - it forwards the pixmap intoImprimir::qrCodesoresolveQrCode()short-circuits on itsif (!qrCode.isNull()) return qrCodeearly-out, skipping a secondgenerateQRAsyncround-trip. Otherwise (timeout, success-without-QR, or error) we callprintRecibo(), which - because the ticket is paid - already stamps "Importe pagado" on the customer copy viacreateTicketExcel(true, ui->pb_payment->isChecked()). The async submit is still alive inm_pendingSubmitsandonVerifactuRequestFinishedwill eventually patch the row even if it missed the 3 s window; the customer can reprint a Verifactu-complete copy via RecogPrendas at pickup time onceENVIADAlands. Picked 3 s because the median Irene Solutions round-trip from local logs is around 1-2 s; longer waits start to feel laggy at the counter. Files touched:src/app/mainwindow.h/.cpp- new+#include <QEventLoop>,verifactuSubmitInvoicesignature change (void→QString),printFragains a defaultQPixmapparameter, save handler rewritten with the bounded wait.docs/architecture.mdData Flow updated.
Post-8.2 development — May 2026¶
- [x] Ayuda → Notas de la versión: in-app version history viewer: complements the updater dialog (which only shows the new version's body during an upgrade) by letting the user browse the full history of what shipped at any time, offline.
releases_notes.txtis now bundled into the exe as a Qt resource (resources/laideal.qrc, alias:/docs/releases_notes.txt) — the same file Inno Setup already shows at install time (InfoBeforeFile=..\releases_notes.txt) and thatgh release create --notes-filereuses for the GitHub release body, so all three surfaces are guaranteed to stay in sync without any deploy-time copy step. New menu entry inAyudabetween "Buscar actualizaciones..." and the separator. Handler opens a small modalQDialogwith a read-onlyQTextEditin the system fixed font (so the tab-indented release notes layout is preserved), sized 680×560, with cursor anchored at the top so the newest release is what the user sees first. No network involved — the dialog works on offline machines. Files touched:resources/laideal.qrc(new/docsprefix),src/app/mainwindow.ui(newactionNotas_de_la_version+ menu wiring),src/app/mainwindow.h/.cpp(new slot, +4 includes). - [x] In-app updater (Ayuda → Buscar actualizaciones + startup check): end-user upgrade no longer requires manually downloading the installer from GitHub and uninstalling the prior version. New
src/updater/module with two classes:Updater(asyncQNetworkAccessManagerclient againsthttps://api.github.com/repos/germanbravolopez/laideal/releases/latest, compares the returnedtag_nameto the compile-timePROJECT_VERSIONmacro via the sametarget_compile_definitions(... PROJECT_VERSION="${PROJECT_VERSION}")trick the Verifactu module already uses, picks thelaideal_setup_X.Y.exeasset out ofassets[], and emitsupdateAvailable / noUpdateAvailable / checkFailed) andUpdaterDialog(shows current vs. new version plus the GitHub release body, on "Actualizar ahora" collapses to a progress bar, downloads the .exe to%TEMP%via the sameUpdater, thenQProcess::startDetached(installer, {}); qApp->quit();so Inno Setup can replace the running files). The dialog is modal but the network is fully async so the UI never blocks.MainWindowctor instantiates oneUpdater, wires the three signals, and — gated onAppSettings::checkUpdatesOnStartup()(defaulttrue) — firescheckForUpdates(silentOnNoUpdate=true)viaQTimer::singleShot(1500, ...)so the main window is fully shown first. Menu actionAyuda → Buscar actualizaciones...usessilentOnNoUpdate=falseso the user always sees an outcome. AppSettings gainedcheckUpdatesOnStartup() / setCheckUpdatesOnStartup(bool)reading/writingupdater.check_on_startupin~/.laideal_settings.json, andSettingsDialog's General tab gained a "Buscar actualizaciones al iniciar la aplicación" checkbox. Inno Setup (releases/laideal.iss) declaresCloseApplications=yes,RestartApplications=yes,CloseApplicationsFilter=*.exeso a running app is auto-closed and relaunched (the updater's ownqApp->quit()usually wins the race; the Inno flags are the safety net). The repo was made public so unauthenticated GitHub API calls resolve/releases/latest(private repos return 404). Files touched:src/updater/(new dir, 5 files:CMakeLists.txt,updater.h/.cpp,updaterdialog.h/.cpp),CMakeLists.txt(add_subdirectory),src/app/CMakeLists.txt(linkupdater),src/app/mainwindow.h/.cpp(new fields + slots + startup-check timer),src/app/mainwindow.ui(Ayuda menu entry + new QAction),src/appsettings/appsettings.h/.cpp(new key + default seeding inapplyDefaults),src/appsettings/settingsdialog.h/.cpp(checkbox on General tab),releases/laideal.iss(3 new keys). Limits: only checksreleases/latest(no pre-release / multi-version paths); the GitHub release body is shown verbatim as plain text (no markdown rendering); if the installer fails to launch (QProcess::startDetachedreturns false) the dialog surfaces the local path so the user can run it by hand; download timeout uses Qt's default (no explicit deadline). Known UX caveat: an in-place upgrade keeps the user's~/.laideal_settings.json,~/.laideal.logand the SQLite database (all under%USERPROFILE%, outside Inno's{app}scope) — no migration risk for end-user data. - [x] Repo switched from private to public (
gh repo edit --visibility public): required for the in-app updater above — the GitHub Releases REST API returns 404 to anonymous callers on private repos, so the updater could not see/releases/latest. Pre-flight grep confirmed no NIF / ServiceKey / .env / .key / .cfg files were ever committed; the "secret"-looking matches in the tree were source-code variable names and dialog labels, never literal values. The Verifactu ServiceKey lives only in~/.laideal_settings.jsonon the customer machine.
Post-8.0 maintenance — May 2026¶
- [x]
RecogPrendas"Pagar todo" now auto-prints the factura and offers a second copy; print no longer closes the window: previously the operator had to click "Pagar todo" (which marks every row of the ticket as paid and fires the async Verifactu submission), then separately click the print button to send the factura to the thermal printer. The print button also unconditionally closed the RecogPrendas window, which made it awkward to print a second copy for the establishment - the operator had to reopen RecogPrendas, search the ticket again and reprint. New flow: at the end ofon_pb_pay_all_clicked(), the ticket number is captured beforeresetAllContents()clearsle_nr_ticket(when no row was originally clicked the loop leaves it on the last paid row), and the factura is generated + sent to the printer via a new private helperprintFactura(ticketNum, askSecondCopy). WhenaskSecondCopy=true, the helper then opens aQMessageBox::question"¿Imprimir una segunda copia de la factura?" (Yes / No, defaulting to No) and re-runsprintTicket()on the same Excel file if the operator picks Yes. After the print returns,resetAllContents()clears the form so the operator can move on to the next client without reopening the window.on_pb_print_clicked()is refactored to call the same helper withaskSecondCopy=falseand thenresetAllContents()(replacing the previousthis->close(), so the standalone print button no longer dismisses the window either). Both copies use the same Excel parameters (createTicketExcel(copyForClient=false, addPayedInfo=false)) so the output is identical - "second copy" just reprints the same file rather than rendering a different variant. TheAppSettings::enablePrinting()guard wraps both the first print and the second-copy dialog, so testing-mode runs still generate the Excel but skip the printer and the dialog. Caveat: when "Pagar todo" is pressed on a multi-ticket search (e.g. name search returning all of a client's tickets), only the last paid ticket gets printed - separateprintFacturacalls pern_recibowould be needed to cover that, deferred until the multi-ticket case is actually exercised. AqDebugwas added at the top ofprintFacturashowingticketandaskSecondCopyso the operator can confirm the flow ran via~/.laideal.log. Files touched:src/recog_prendas/recog_prendas.h/.cpp. - [x]
RecogPrendasname search silently dropped tickets past row 256 (no log was registered because the function had no entry-timeqDebug): the name-search branch diddb.open() / SELECT * FROM ingresos / setQuery() / db.close()and then, ~30 lines later in the common post-search section, ranwhile (sqlQueryModel->canFetchMore()) sqlQueryModel->fetchMore();to drain the rest. ButQSqlQueryModellazy-fetches in 256-row batches andfetchMore()needs the underlying SQLite statement handle to still be valid, whichdb.close()had already invalidated. SocanFetchMore()returnedfalseimmediately and the proxy filter only ever saw the first 256 rows ofingresos- any client whose receipts landed past that point would have some tickets in the result and some silently missing, regardless of whether the search term was a partial or complete name. Fix: pulled thefetchMore()loop inside the name branch, ordered assetQuery -> fetchMore-until-done -> db.close(), and dropped the now-redundant common loop. Added threeqDebuglines so the search is now visible in~/.laideal.log: (1) at function entry, showing the input and the date-mode combobox value; (2) after the SELECT, showing how many source rows were loaded and the normalized filter; (3) at the end, showingproxyMatched / sourceLoaded. The samedb.close()pattern exists in the phone / ticket / date branches but doesn't trigger the bug there because each of those returns a small result set (single client, single ticket, single day) that fits in one 256-row batch. Files touched:src/recog_prendas/recog_prendas.cpp. - [x] Streamlined release pipeline: one PowerShell command builds + deploys + installs: the previous flow required opening the Qt Creator IDE, building Release manually, closing Qt Creator, opening a special "Qt command prompt" shortcut (
cmd.exe /K C:\Qt\6.4.3\mingw_64\bin\qtenv2.bat) with admin rights, and runningdeploy_laideal_run_in_qt_cmd.batwhich chained three other batch scripts (zip_folder.bat,find_replace.bat,create_installer.bat). The deploy script searched for Qt Creator's specific shadow-build folder (build-laideal-Desktop_Qt_*_MinGW_64_bit-Release), so the README'scmake -B buildinstructions actually produced an exe in a folder the deploy script could not find - a hidden disconnect that broke the documented build path. Replaced by a singlereleases\release.ps1 <version>invocation (withreleases\release.bat <version>as a thin cmd.exe wrapper) that: (1) prepends Qt + MinGW toPATHitself so the Qt cmd shortcut is no longer required, (2) cross-checks the supplied version againstproject(laideal VERSION X.Y ...)inCMakeLists.txtand aborts on mismatch, (3) refuses to overwrite an existing zip/installer/staging dir, (4) configures CMake (Release, MinGW Makefiles) intobuild-release/, (5) builds with-j, (6) stages the exe intoreleases\<version>\and runswindeployqt --release --no-translations --no-system-d3d-compiler, (7) zips intoreleases\old_releases\<version>.zipvia .NETSystem.IO.Compression.FileSystem, (8) compiles the Inno Setup installer viaISCC.exe /DMyAppVersion=<version> laideal.iss, (9) deletes the staging dir. Thelaideal.isstemplate was rewritten to use ISCC preprocessor#define MyAppVersion(with#ifndefguard so it still compiles standalone with a 0.0 default), and all paths inside it switched from absolute to relative-to-iss (..\License.txt,..\releases_notes.txt,..\icon\lavadora.ico,setup_outputs,{#MyAppVersion}\*) so the installer recipe is portable to any clone of the repo, not just this developer's machine. The four obsolete batch scripts were deleted (deploy_laideal_run_in_qt_cmd.bat,zip_folder.bat,find_replace.bat,create_installer.bat) - the brittlefind_replace.batsed-replace of "1.0" in the iss is now redundant since ISCC handles substitution natively..gitignoreupdated: dropped the now-unusedlaideal_upd.issentry, addedbuild-releasealongsidebuild. README's "Build" section now shows the explicit-G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Releaseflags (so a fresh CMake configure picks the right toolchain even on machines with Visual Studio installed), and the "Release procedure" collapsed from 12 manual steps to 5 (bump version + commit, run script, tag, push, gh release). Files touched:releases/release.ps1(new),releases/release.bat(new),releases/laideal.iss(rewritten),.gitignore,README.md; deletedreleases/deploy_laideal_run_in_qt_cmd.bat,releases/zip_folder.bat,releases/find_replace.bat,releases/create_installer.bat.
Archive (Entries older than 6 months / no longer actionable)¶
Pre-8.0 development history. The feature/add_mdiago_verifactu entries below are the original Verifactu build-out, all shipped in 8.0; moved here from Completed Milestones on 2026-09-14 to keep the active section readable.
Pre-release bug fixes — May 2026 (feature/add_mdiago_verifactu)¶
- [x] Code-review fixes for v8.0 release (twelve findings from the branch review): (1) ServiceKey log leak [release-blocker]:
VerifactuManager::submitInvoiceAsyncwas dumping the full/CreateJSON payload - includingServiceKey- to~/.laideal.logon every paid ticket save and every "Probar conexion". Now redacted to[redacted, N chars]before logging. Other request-emitting paths (cancel / QR / testConnection) were already safe (they log endpoint URLs only). (2)Listadoallowed inline edit ofingresosviaQSqlTableModel::OnFieldChange- includingverifactu_csv/verifactu_estado/importe/etc. - which contradicts Verifactu Req. 1 (Art. 8.1 RD 1007/2023). AddedsetEditTriggers(NoEditTriggers)on theingresostable view; all changes must now flow through RecogPrendas / Cancel / Rectify which keep AEAT and the accounting lock in sync. (3)insertNewItemToTablebuilt SQL with raw quote concatenation of user values - a client namedO'Brienwould have crashed, and a hostile input could have injected DDL. Replaced withq.prepare("... VALUES (?, ?, ...)")+ positionaladdBindValueso values are bound by the driver, never interpolated. (4)AppSettings::save()was non-atomic: a crash mid-write produced a zero-byte JSON and the next launch saw "first run" (DB path lost, Verifactu credentials lost). Now writes to<path>.tmpfirst, flushes, thenQFile::renameover the target - previous file survives a crash. (5) Operator-precedence ambiguity inMySortFilterProxyModel::lessThan: the&&/||chain happened to parse correctly but triggered-Wparenthesesand was fragile to refactors. Eachtable && colclause is now its own paren group. (6)RectifyInvoiceDialogn_recibo race: max(n_recibo)+1 was allocated at submit time and INSERTed only on AEAT reply, leaving a seconds-long window where a regularsaveTicketcould re-use the same number. Now eagerly INSERTs a PENDIENTE placeholder row at submit time (same pattern asMainWindow::saveTicket);applyRectificationResultpatches it to ENVIADA/ERROR on reply. (7) Huella regex was too permissive:<[^>]*Huella[^>]*>would also have matched a hypothetical<HuellaPrevia>. Tightened to<(?:\w+:)?Huella(?:\s[^>]*)?>so only the exact element (with optional namespace prefix) matches. (8)Imprimir::resolveQrCodechecked only row-0 CSV: a ticket with mixed row states (e.g. some PENDIENTE / RECTIFICADA / ANULADA / ERROR) could still print a QR claiming AEAT validity. Now aggregates across all rows: emits a QR only when at least one row has a CSV AND no row is in a state that contradicts the claim. (9) Annotated the magic10infilterAcceptsRow- it caps the search to user-facing columns so the hidden verifactu_* metadata never bleeds into the visible filter. (10)testConnectionreply now held viaQPointer: defensive against the dialog being closed mid-loop. (11) Documented the intentional NULL verifactu_* columns in theSEPARATE_GARMINSERT (split rows must not re-submit to AEAT - would trigger duplicate-InvoiceID). (12) Tier-1 coding-guidelines cleanups: lastSIGNAL/SLOTmacro converted to pointer syntax intableview.cpp; Spanish localsestado/cliente/fecha/estadorenamed tostate/client/date/verifactuStateincancelinvoicedialog.cpp,imprimir.cpp,recog_prendas.cpp;add_sufix_to_filenametypo fixed toadd_suffix_to_filenameingenlistado.h/.cpp. The remaining Tier-1 item - splittingverifactuinvoice.hinto two headers - stays in Open Non-Blocking Issues. Files touched:src/verifactu/verifactumanager.h/.cpp,src/verifactu/verifactuintegration.cpp,src/listado/listado.cpp,src/sql_lite/sql_lite.cpp,src/appsettings/appsettings.cpp,src/tableview/mysortfilterproxymodel.cpp,src/tableview/tableview.cpp,src/app/rectifyinvoicedialog.h/.cpp,src/app/cancelinvoicedialog.cpp,src/imprimir/imprimir.cpp,src/recog_prendas/recog_prendas.cpp,src/listado/genlistado.h/.cpp. - [x] App icon now embedded in the executable + bundled as a Qt resource: the desktop shortcut produced by the Inno Setup installer was inheriting a blank icon from
laideal.exebecause the Windows resource file only carriedVS_VERSION_INFO— noIDI_ICON1 ICONdirective. AddedIDI_ICON1 ICON DISCARDABLE "@CMAKE_SOURCE_DIR@/icon/lavadora.ico"toresources/laideal.rc.inso windres compiles the icon into the exe; the desktop shortcut, Explorer thumbnail, Alt-Tab and taskbar now all pick it up automatically without the.issneeding anIconFilename:. Added a newresources/laideal.qrcthat ships the same.icoas a Qt resource (alias:/icons/laideal.ico), wired intosrc/app/CMakeLists.txt'sadd_executable()so AUTORCC compiles it in.main.cppnow loads the icon from the resource (QIcon(":/icons/laideal.ico")) instead of from a user-configured filesystem path, so the title bar/taskbar work deterministically regardless of install location. Dropped the now-obsoleteapp.icon_pathsetting fromAppSettings(iconPath()/setIconPath()removed), the corresponding row fromSettingsDialog's General tab, and the post-accept icon re-apply block inMainWindow::mainwindowInitialSettings().migrateLegacyKeys()strips the orphanedapp.icon_pathkey from existing~/.laideal_settings.jsonfiles on first load. Closes the "Bundle icon with installer" non-blocking item. Files touched:resources/laideal.rc.in,resources/laideal.qrc(new),src/app/CMakeLists.txt,src/app/main.cpp,src/app/mainwindow.cpp,src/appsettings/appsettings.h/.cpp,src/appsettings/settingsdialog.h/.cpp. - [x] Verifactu — Factura rectificativa UI (R1-R5) (Req. 1; Art. 8.2.a RD 1007/2023): new
RectifyInvoiceDialog(modelled onCancelInvoiceDialog) underHerramientas → Rectificar factura Verifactu.... Operator searches byn_recibo, picks one of R1-R5 (R1 default - error fundado en derecho), picks Por diferencias (I) or Por sustitución (S), enters either the corrected total (S) or the signed delta (I) including IVA, and submits asynchronously via the newVerifactuIntegration::submitRectificationAsync(). The submission builds an F2-style invoice (La Ideal only issues simplified) withInvoiceType = R1..R5,RectificationType = S|I, and - for S -RectificationTaxBase/RectificationTaxAmountcarrying the original values being replaced. New columnsverifactu_rectifies_n_recibo(TEXT, link to original) andverifactu_rectification_type(TEXT, "S"/"I") added viamigrateDatabase(). A newVerifactuEstado::Rectificada("RECTIFICADA") marks the original rows when the rectificativa is submitted in substitution mode;totalPriceBetweenDates()now excludes RECTIFICADA the same way it excludes ANULADA, so the books reflect the corrected total without double-counting. For differences (I) the original rows stay ENVIADA and the delta row alone reconciles accounting. The new rectificativa row gets the next availablen_recibo,pagado = SI,estado = "Rectificativa",prenda = "Rectificativa de ticket <orig>", and full Verifactu metadata (csv/xml/hash/url) from the AEAT reply. AEAT XML export (Herramientas → Exportar registros AEAT (XML)...) broadened to include ANY row with non-emptyverifactu_xmlregardless of estado (ENVIADA/ANULADA/RECTIFICADA) - all were sent to AEAT and Hacienda has them on record. NegativeVerifactuTaxItem::taxBaseis now accepted (was previously rejected byisValid()) because a downward-correction rectificativa por diferencias is a legitimate use case.VerifactuInvoice::RECTIFICATIONenum value renamed toRECTIFICATION_R1and joined byRECTIFICATION_R2..R5; newRectificationType(BY_DIFFERENCES / BY_SUBSTITUTION) andisRectificationInvoiceType()helper.isValid()no longer demands a buyer NIF on rectificativas of simplified invoices. Files touched:src/verifactu/verifactuinvoice.h/.cpp,src/verifactu/verifactumanager.h,src/verifactu/verifactuintegration.h/.cpp,src/sql_lite/sql_lite.cpp,src/app/rectifyinvoicedialog.h/.cpp(new),src/app/mainwindow.h/.cpp,src/app/mainwindow.ui,src/app/CMakeLists.txt,src/imprimir/imprimir.h,src/recog_prendas/recog_prendas.h/.cpp,src/tableview/mysortfilterproxymodel.h. Audit table indocs/modules/verifactu/verifactu-requirements.mdupdated to COVERED. - [x] DB interactions: comprehensive qDebug/qWarning logging: audit of every
q.prepare/q.execcall site undersrc/. Every WRITE (INSERT / UPDATE / DELETE / ALTER) now has both (a) aqDebug()at the start of the operation showing the action and the key identifiers (ticket / hash / client / table / column / etc.) and (b) aqWarning()onexec()failure carryingq.lastError().text(). One real bug found and fixed alongside:CancelInvoiceDialog::onVerifactuRequestFinished()at the AEAT-cancel-confirmed branch calledq.exec()on theUPDATE ingresos SET verifactu_estado = ANULADAstatement without checking the return value — a silent failure would have left the row showing ENVIADA in the UI while the user had been told the cancellation was confirmed. SELECTs were not blanket-logged (each is read withq.first()/q.next()/q.isSelect()which already surface errors at the result-reading step; blanket-logging them would just be noise). Files touched:src/sql_lite/sql_lite.cpp(5 helpers),src/recog_prendas/recog_prendas.cpp(updateDb()start),src/app/cancelinvoicedialog.cpp(the silent UPDATE),src/app/mainwindow.cpp(per-row save log),src/facturas/facturas.cpp(saveFactura),src/add_garment/add_garment.cpp(saveFactura). - [x] Printed ticket columns too wide for printer — verified on the physical thermal printer: column widths reduced from (5, 21, 8) = 34 units to (4, 20, 7.5) = 31.5 units in
Imprimir::createTicketExcel(), andexcel.setPageMargins(0.2, 0.1, 0.1, 0.4)added (left/right/top/bottom in inches; the asymmetric margins were tuned empirically against the actual thermal printer output by the user — top tighter than bottom, left slightly larger than right). The page-margin call uses the newWorksheet::setPageMarginsAPI patched into the vendored QXlsx (see "QXlsx — page-margin support" milestone). Ticket now prints on a single page with no horizontal split. Files touched:src/imprimir/imprimir.cpp. - [x] Verifactu — fix
verifactu_xml/verifactu_hashnever being persisted from the pay-at-pickup path: when the AEAT submission came from theRecogPrendas → Pagar todoflow (not the save-at-creation flow inMainWindow), the duplicateRecogPrendas::updateTicketVerifactuFields()had not been updated alongsideMainWindow::updateTicketVerifactuFields()during the xml/hash work, so its prepared UPDATE statement was missing theverifactu_xml = :xmlandverifactu_hash = :hashcolumns. Added both columns to the prepared statement and the correspondingbindValue()calls (with empty strings on the error branch, matching the MainWindow shape). Also added aqDebug()line at the top of bothupdateTicketVerifactuFields()implementations that logs ticket, estado, csv, hash, xml_len, error — so any future regression of this kind is visible in~/.laideal.lograther than silent. Worth flagging the underlying issue: the two implementations are near-duplicates and drift like this is the predictable outcome — a future refactor should fold them into a free function insql_lite.htakingdb,ticketNumand aVerifactuResultso there is one source of truth. Files touched:src/app/mainwindow.cpp,src/recog_prendas/recog_prendas.cpp. - [x] Verifactu — persist chained hash from AEAT response (Req. 3; Art. 12 RD 1007/2023): the SHA-256 chained hash returned by AEAT/Irene as
<sum1:Huella>...</sum1:Huella>insideReturn.Xmlis now captured into a newVerifactuResult::rawHashfield byVerifactuManager::processResponse()(regex tolerant of any namespace prefix; normalised to upper-case hex) and persisted to a newverifactu_hash TEXTcolumn oningresos(added inmigrateDatabase()). INSERT insaveTicket()writes empty;updateTicketVerifactuFields()writes the real value on Enviada or clears it on failure - same async path as csv/url/xml. Column constantsTABLE_VERIFACTU_HASH = 21(imprimir.h, recog_prendas.h) andINGRESOS_IDX_VERIFACTU_HASH = 21(mysortfilterproxymodel.h); column hidden inRecogPrendas::tableViewandListadoingresos view. (Identifiers use the English termhash/rawHashper/coding-guidelines; the regulatory Spanish term "Huella" appears only in code comments and the XPath-style regex matching the AEAT XML element name.) Strengthens local tamper-detection independently of the AEAT side - the hash chains to the previous record's, so any silent edit/insert iningresosis detectable by recomputing and comparing. Files touched:src/sql_lite/sql_lite.cpp,src/verifactu/verifactumanager.h/.cpp,src/app/mainwindow.cpp,src/imprimir/imprimir.h,src/recog_prendas/recog_prendas.h/.cpp,src/listado/listado.cpp,src/tableview/mysortfilterproxymodel.h. Audit table indocs/modules/verifactu/verifactu-requirements.mdupdated to COVERED. - [x] AppSettings — fewer user-facing paths: collapsed five user-configurable paths into one. (1)
print.template_pathremoved: the Excel ticket file is now always regenerated at the hardcoded~/.laideal_ticket.xlsx(matches the~/.laideal.log/~/.laideal_settings.jsonconvention) — newAppSettings::ticketExcelPath()static helper. (2)print.script_pathremoved:Imprimir::printTicket()now generates a small VBScript at~/.laideal_print.vbswith the Excel-COM print logic templated with the current xlsx path, then invokescscript //nologo //B <path>.vbsdirectly — no separate.batto ship, no setting to configure. NewAppSettings::ticketPrintScriptPath()static helper. (3)reports.contabilidad_path/reports.listados_prendas_path/reports.listados_gastos_pathcollapsed into a singlereports.root: getterscontabilidadPath(),listadosPrendasPath(),listadosGastosPath()now compose<root>/Contabilidad,<root>/Listados/Prendas,<root>/Listados/Gastosrespectively — subdirs are hardcoded, mkpath-on-demand is unchanged at the call sites. Setters removed for all three (users only edit the root). Migration:migrateLegacyKeys()runs at JSON load and strips the well-known suffix from any of the three legacy values (Contabilidad,Listados/Prendas,Listados/Gastos) to derive the root; falls back to the parent dir of the contabilidad path; ultimate default is~/Tintoreria. Obsolete keys are removed via the newremoveNested()helper.SettingsDialog's "Rutas de salida" tab now shows one row instead of five, with a grey note listing the hardcoded subfolders. Files touched:src/appsettings/appsettings.h/.cpp,src/appsettings/settingsdialog.h/.cpp,src/imprimir/imprimir.cpp. Existing call sites incontabilidad.cpp/genlistado.cppare untouched (the composed getters return the same shape they expect). The oldresources/print_ticket.batis no longer referenced by the app; left in the repo as a reference for the in-app VBScript. - [x] Verifactu — XML export of
ingresosrecords for Hacienda (Req. 7; Art. 14.1 RD 1007/2023, Orden HAC/1177/2024): the AEAT-style XML returned by Irene Solutions inReturn.Xmlof every/Createreply is now captured into a newVerifactuResult::rawXmlfield byVerifactuManager::processResponse()and persisted in a newverifactu_xml TEXTcolumn oningresos(added inmigrateDatabase()so existing DBs auto-migrate).MainWindow::saveTicket()writes an empty placeholder on initial INSERT (estado=PENDIENTE) andupdateTicketVerifactuFields()UPDATEs the column with the real XML when AEAT replies (estado=ENVIADA) or clears it on failure. A new menu action Herramientas → Exportar registros AEAT (XML)... opens a small inline dialog (twoQDateEditfor the range), thenQFileDialog::getSaveFileNamefor the output path, and writes a single envelope file<RegistrosFacturacionLaIdeal>with attributesfechaDesde / fechaHasta / generadoEl / nif / emisor, containing one<Registro nRecibo=… fechaRecepcion=… importe=… csv=…>child per qualifying row (estado=ENVIADA AND non-emptyverifactu_xmlANDfecha_recepcionin range). Each row's stored payload is inlined verbatim with its leading<?xml ?>declaration stripped (single regex) so the outer document stays well-formed. Caveat: only tickets submitted after this fix landed haveverifactu_xmlstored; older Enviada rows are silently skipped (no retroactive AEAT lookup — would need a separate REST endpoint, out of scope). Hidden inRecogPrendas::tableViewandListadoto keep the column from blowing up row heights. Files touched:src/sql_lite/sql_lite.cpp,src/verifactu/verifactumanager.h/.cpp,src/app/mainwindow.h/.cpp,src/app/mainwindow.ui,src/imprimir/imprimir.h,src/recog_prendas/recog_prendas.h/.cpp,src/listado/listado.cpp,src/tableview/mysortfilterproxymodel.h. Audit table indocs/modules/verifactu/verifactu-requirements.mdupdated to COVERED. - [x] Verifactu — mandatory verification leyenda next to the QR on printed receipts (Req. 9; Disposición Final Primera RD 1007/2023):
Imprimir::createTicketExcel()now writes the centred lineFactura verificable en la sede electrónica de la AEAT(font 7, merged A:C, row height 9.6) immediately below the 140×140 QR. Emitted only when the model's row-0verifactu_estadoequals"ENVIADA"(compared via the canonicalverifactuEstadoToString(VerifactuEstado::Enviada)helper instead of a bare string literal), so PENDIENTE / ERROR / ANULADA rows never carry the verifiability claim — and save-time prints (which always have estado=PENDIENTE in the new async flow) silently skip it too. The full-sentence form is chosen over the shorterVERI*FACTUmark because the receipt has the vertical room and the long form directs the customer to the AEAT sede explicitly. Files touched:src/imprimir/imprimir.cpp. Audit table indocs/modules/verifactu/verifactu-requirements.mdupdated to COVERED. - [x] QXlsx — page-margin support added (local patch): upstream QXlsx (QtExcel/QXlsx, including the
liufeijinfork bundled here) has the sixpageMarginsfields (PMleft/PMright/PMtop/PMbotton/PMheader/PMfooter) inWorksheetPrivateand serializes the<pageMargins>XML element when all six are non-empty, but exposes no public setter — the only public page method wassetStartPage. AddedWorksheet::setPageMargins(left, right, top, bottom, header=0.3, footer=0.3)inQXlsx/header/xlsxworksheet.h+QXlsx/source/xlsxworksheet.cpp(following theliufeijin/setStartPagepattern), and aDocument::setPageMargins(...)forwarder inQXlsx/header/xlsxdocument.h+QXlsx/source/xlsxdocument.cppthat delegates to the current worksheet. Units are inches (XLSX standard).imprimir.cppnow callsexcel.setPageMargins(0.6, 0.6, 0.4, 0.4)right after the column-width setup increateTicketExcel(). Note: the serializer is all-or-nothing — passing only some margins would still drop the whole element, hence the header/footer defaults (0.3″) so a 4-argument call always works. This is the first local modification toQXlsx/in this project; the AI agent docs previously said "do not modify" — that note has been relaxed to "minimal local patch — see Completed Milestones". - [x] Verifactu — declaración responsable visible in the software (Req. 8; Art. 13 RD 1007/2023): new
Ayudamenu withAcerca de Verifactu...action opens aQDialogdisplaying the fixed-text declaración. Producer NIF / name / address are pulled fromAppSettings(the bespoke deployment treats the user-business as producer); software name isLa Idealand the version is interpolated fromPROJECT_VERSION_MAJOR/MINORin the generatedversion.h, so the declaration is automatically per-version as Art. 13 requires. Body cites RD 1007/2023 + Orden HAC/1177/2024 and states VERI*FACTU mode explicitly. Files:src/app/mainwindow.ui(new menu/action),src/app/mainwindow.h/.cpp(slot + dialog). Verifactu compliance audit table updated to COVERED indocs/modules/verifactu/verifactu-requirements.md. - [x] Temp debug code removed from
MainWindowconstructor — early development debug code that printed module state at startup; cleaned up before the v8.0 cut. - [x] Verifactu fully async — UI no longer blocks on AEAT:
VerifactuManagerandVerifactuIntegrationrewritten —submitInvoice/cancelInvoice/generateQRCode(sync,QEventLoop-blocking) replaced withsubmitInvoiceAsync/cancelInvoiceAsync/generateQRAsyncthat return aQString requestIdimmediately. Results arrive via a newrequestFinished(reqId, VerifactuResult)signal. Each consumer holds a smallQHash<reqId, ticketNum>map to correlate. - MainWindow save flow:
saveTicket()writes rows withverifactu_estado = PENDIENTEimmediately. Print branching now diverges by payment state — paid →printFra()only (factura simplificada), unpaid →printRecibo()only (claim ticket, two copies). In both casesverifactuIntegration = nullptr, so save-time prints never carry CSV/QR (AEAT response is still in flight). The async submit is fired for paid tickets, status bar shows "Enviando ticket NNNN a AEAT..." and the form resets. When AEAT replies,onVerifactuRequestFinished()UPDATEs the row(s) and shows "Ticket NNNN enviado (CSV: ...)" or "Error..." in the status bar (no popups). Customer can reprint a Verifactu-complete copy with QR/CSV viaRecogPrendas → Imprimir.AppSettings::enablePrinting()is checked insideprintRecibo()/printFra()and only guards the actualprintTicket()calls — the Excel file is generated even in testing mode for inspection. - RecogPrendas pay-all + retry: same async pattern.
updateDb(PAY_YES)now consults an in-memoryhasPendingSubmit(ticketNum)map in addition to the DB-state check (pay-all iterates per row, async submits don't update DB synchronously, so the old DB-only dedup would double-fire).retryVerifactuSubmitis now fire-and-forget; status bar shows progress. - CancelInvoiceDialog: async cancel; dialog stays open with "Enviando anulación..." label until AEAT replies.
m_pendingCancelIdguards against re-entry. - Imprimir reprint:
resolveQrCode()keeps a synchronous API (print needs the QR before embedding in Excel) but built on the async core — uses a localQEventLoop+QTimer::singleShot(5000, ...)to bound the wait. On timeout, prints without the QR and logs a warning. The pre-existing DB-CSV short-circuit means save-time prints never hit this path (CSV is still empty). - testConnection() stays sync — interactive button with explicit feedback, already bounded by
setTransferTimeout(10000). - Dead-code cleanup landed alongside: removed
submitInvoices(batch, never called),encodeImageToBase64,onNetworkReplyslot,m_lastResultmember,createAndSubmitInvoice(full invoice, never called),validateEmitterConfiguration(only caller was itself dead),getManager()andgetConfigInfo()(no callers) — perdocs/dead_code_report.md. - [x] Dead-code audit snapshot + agent:
docs/dead_code_report.mdlists ~20 unused methods (mostly insrc/verifactu/— the module was built with a broader API thanMainWindow+RecogPrendasactually use). Snapshot is reproducible via the new.claude/agents/dead-code-finder.mdsubagent, which knows about Qt auto-connect slots, virtual overrides, and signals so it doesn't false-flag them. Invoke with theAgenttool,subagent_type: "dead-code-finder". Report is informational only — no methods removed in this pass. - [x] "Probar conexión" button in SettingsDialog: new button on the Verifactu tab tests the configured endpoint with the current dialog values (no save required).
VerifactuManager::testConnection()was previously broken — fired a GET and returnedtrueimmediately, ignoring the reply. Rewritten to POST a stub{"ServiceKey": "..."}payload to/Create(GET on the base URL hangs and never returns — only POST to/Createactually responds), useQEventLoopwith a 10ssetTransferTimeout, and return aVerifactuResult. SUCCESS = any HTTP response (server rejects the stub with 400/401, but that still proves connectivity + auth path); NETWORK_ERROR = no HTTP status (DNS failure, refused, timeout); INVALID_CONFIG = local validation failed. The dialog emitstestConnectionRequested(nif, name, key, production);MainWindowbuilds a transientVerifactuManager, runs the test, and shows the result viaQMessageBox— keepsappsettingsfrom depending onverifactu. - [x] Em-dash purged from source code: 49 occurrences across 13
.cpp/.hfiles (comments, log strings, a few user-visible Spanish strings like the Verifactu dialog window title and empty-value placeholders) replaced with ASCII-. Some Windows code pages mangle U+2014 in source files. Coding guidelines updated with a "no non-ASCII punctuation in source" rule (em-dash, en-dash, curly quotes, ellipsis) so future agents don't reintroduce them. - [x] Log de depuración dialog opens the log file directly:
on_actionMostrar_log_triggered()button relabelled from "Abrir carpeta" to "Abrir archivo";QDesktopServices::openUrlnow points topathinstead ofQFileInfo(path).absolutePath(). Faster for support — customer can attach the file with one click instead of navigating Explorer. - [x] Per-garment payment disabled in
RecogPrendas:pb_paymentbutton is no longer re-enabled on row selection — payment can only be marked via "Pagar todo" (pb_pay_all), which submits one Verifactu invoice per ticket. Prevents the duplicate-InvoiceID rejection from AEAT that would occur if the user paid one garment, triggered an F2 withInvoiceID = n_recibo, then later paid another garment for the same ticket. Theon_pb_pay_all_clicked()loop callson_pb_payment_toggled(true)programmatically, which still fires on a disabled button — full-ticket pay flow unchanged. See "Per-payment Verifactu InvoiceID seq" in Open Non-Blocking Issues for the architectural follow-up that would restore per-garment payment. - [x] Verifactu conditional on payment:
on_bb_save_reset_clicked()now only callsverifactuSubmitInvoice()whenpagado == "SI"; unpaid saves produce NotSubmitted state.updateDb(PAY_YES)inrecog_prendas.cppauto-submits if the ticket is still NotSubmitted, using the payment date as invoice date; DB is queried directly so the pay-all loop never double-submits.
Contabilidad dialog improvements — May 2026 (feature/add_mdiago_verifactu)¶
- [x] Contextual confirmation dialogs added to
on_bb_ok_cancel_accepted(4 cases: lock/revert × already-done/not-done) - [x] Fixed syntax bug:
QMessageBox::informationcall had, + "..."as a separate argument instead of string concatenation - [x] Fixed double-dialog: removed redundant
QMessageBoxcalls fromupdateLock()(replaced withqDebug) sinceon_bb_ok_cancel_acceptednow owns those dialogs - [x] Fixed wrong comment:
checkBox_lock->setDisabled(revertirOn)line had copy-paste "configuration combobox" comment — corrected to "lock checkbox when reverting"
Herramientas menu reorganisation — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
menuHerramientasreordered: Imprimir, Recogida de prendas, Añadir nuevas prendas, ─, Añadir factura de gastos, Anular factura Verifactu, ─, Generar contabilidad, Revertir contabilidad - [x]
actionFormulario_facturasrenamed to "Añadir factura de gastos" - [x] Log de depuración moved from Herramientas to Archivo, below Configuración (before the separator)
VerifactuEstado enum — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
VerifactuEstadoenum class added toverifactumanager.h(NotSubmitted, Enviada, Anulada, Error) - [x]
verifactuEstadoToString()andverifactuEstadoFromString()inline helpers in the same header - [x] All hardcoded
"ENVIADA"/"ANULADA"/"ERROR"literals replaced inmainwindow.cpp,cancelinvoicedialog.cpp,recog_prendas.cpp - [x] SQL literal
'ANULADA'incancelinvoicedialog.cppreplaced with parameterized bind - [x]
NotSubmittednow serializes as"PENDIENTE"instead of empty string — user-visible status in the Verifactu info dialog and Anular factura search.verifactuEstadoFromString()still maps NULL/empty toNotSubmittedfor legacy pre-Verifactu rows
Contabilidad bug fixes — May 2026 (feature/add_mdiago_verifactu)¶
- [x] Missing
}incontabilidad.cpp::on_cb_config_currentTextChangedfixed (syntax error, prevented compilation) - [x]
totalPriceBetweenDatesnow excludesverifactu_estado = 'ANULADA'rows from ingresos — cancelled invoices no longer counted as taxable income - [x]
gastosquery changed fromBETWEEN(endpoint-inclusive) to>= AND <— eliminates double-counting on quarter boundary dates
Unsuccessful invoice handling — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
verifactuSubmitInvoice()inMainWindownow showsQMessageBox::warning(Spanish) when submission fails withERRORorNETWORK_ERROR;INVALID_CONFIG(not configured) remains silent - [x]
retryVerifactuSubmit(ticketNum, invoiceDate)added toRecogPrendas: sums ticket total from DB, resubmits viasubmitSimplifiedInvoice, updates alln_reciborows iningresos, refreshes table - [x]
on_pb_verifactu_clicked()extended: shows "Reintentar envío a AEAT" button in the info dialog whenestado == "ERROR"and Verifactu is configured
Persistent debug logging — May 2026 (feature/add_mdiago_verifactu)¶
- [x] New
src/logging/module:AppLoggerstatic class withinstall()andlogFilePath() - [x]
qInstallMessageHandlercaptures allqDebug/qWarning/qCriticaloutput — no changes needed to any existing call site - [x] Log format:
yyyy-MM-dd HH:mm:ss [DEBUG|WARN|CRIT|FATAL] message; session separator written on each app start - [x] Rotation: file renamed to
.laideal.log.oldwhen it exceeds 5 MB; thread-safe viaQMutex - [x] Log file location:
~/.laideal.log(consistent with~/.laideal_settings.json) - [x] Herramientas → Log de depuración… dialog shows full path + "Abrir carpeta" button (opens Explorer)
General conditions rewritten for legal correctness — May 2026 (feature/add_mdiago_verifactu)¶
- [x] Conditions block (client copy only) rewritten against RD 1453/1987 (BOE-A-1987-26716) and Consumo Responde (Junta de Andalucía)
- [x] Clause 1 (receipt/identity): receipt required to collect garment; loss does not prevent collection — client identifies themselves
- [x] Clause 2 (storage — legal fix): storage fees may accrue after 3 months from delivery; custody obligation ends at 6 months (Art. 6 RD 1453/1987 correctly applied to custody, not documentation)
- [x] Clause 3 (accessories — per-receipt): disclaimer for buttons/ornaments applies only when noted on this specific receipt; removal recommended before delivery
- [x] Clause 4 (NEW — pre-cleaning advisory, Art. 6 RD 1453/1987): if garment condition implies risk of damage or uncertain outcome, client will be informed before treatment proceeds
RGPD first-layer notice added to client receipt — May 2026 (feature/add_mdiago_verifactu)¶
- [x] 4th bullet added to
createTicketExcel()conditions block (client copy only): "Sus datos son tratados por [businessName] para gestionar el servicio (RGPD). Derechos arts.15-22: [businessPhone or 'ver cartel en tienda']." Complies with LOPDGDD Art. 11 layered-notice requirement verified live against aepd.es
General conditions omitted from establishment receipt copy — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
createTicketExcel()conditions block wrapped inif (!isRecibo || copyForClient)— establishment copy now ends at the timestamp; invoice copies (noisRecibo) always show conditions as before
Ingresos Listado: clickable Verifactu URL column — May 2026 (feature/add_mdiago_verifactu)¶
- [x] New
LinkDelegateadded tosrc/tableview/— renders non-empty cells as blue underlined text; follows the sameinitStyleOptionpattern asTextColorDelegate - [x]
INGRESOS_IDX_VERIFACTU_ERROR(18) andINGRESOS_IDX_VERIFACTU_URL_QR(19) constants added tomysortfilterproxymodel.h - [x]
Listado::populateTable()appliesLinkDelegateto the URL QR column and moves it visually beforeverifactu_errorviaQHeaderView::moveSection() - [x]
Listadoconstructor connectstable_listado->clickedto open the URL in the system browser viaQDesktopServices::openUrl()
RecogPrendas bug fixes — May 2026 (feature/add_mdiago_verifactu)¶
- [x] Buttons (payment, state, pay-all, pku-all, separ-garm, print) no longer grey out after an action — moved
setEnabled(true)calls intoupdateRowClickedToFields()so they fire after everyupdateDb()cycle, not only on direct row click - [x] Print button in RecogPrendas now generates QR code —
m_verifactuIntegrationadded as public member toRecogPrendas;MainWindowpasses it at creation;on_pb_print_clicked()forwards it toImprimir
Ticket header + business phone setting — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
createTicketExcel()header rewritten: 6-row block (business name at font 22, then company name / NIF / address / city / phone at font 11 bold) sourced entirely fromAppSettings— removed deadformatCenterAlignand brokenverifactuIntegrationcall - [x]
AppSettings::businessPhone()/setBusinessPhone()added — persisted underbusiness.phonein~/.laideal_settings.json - [x]
SettingsDialogBusiness tab gains "Teléfono:" field wired tobusinessPhone
Verifactu QR on printed ticket — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
ImprimirgainsqrCode(QPixmap) andverifactuIntegrationmembers;resolveQrCode()returns the pre-supplied pixmap if any, otherwise calls/GetQrCodeviaVerifactuIntegration::generateQR()using ticket number/date/taxBase/taxRate fromingresos - [x]
Imprimir::createTicketExcel()embeds the QR (scaled 140×140) at the bottom of the receipt usingQXlsx::Document::insertImage() - [x]
Imprimircolumn constants extended (TABLE_VERIFACTU_CSV…TABLE_VERIFACTU_URL_QR) for the newingresoscolumns - [x]
MainWindow::printRecibo()/printFra()now takeconst VerifactuResult &and passresult.qrCodetoImprimir(no extra REST call when QR is already in hand) - [x]
Imprimir → Recibo / Factura / Factura completareprint actions injectm_verifactuIntegrationso the dialog can hit/GetQrCodefor tickets without an in-memory pixmap - [x]
VerifactuIntegration::generateQR()signature fixed: now builds a valid F2 simplified invoice (with tax item) so the/GetQrCodeendpoint accepts the request (previous version failedisValid()due to missing TaxItems) - [x]
imprimirCMake target now links theverifactulibrary
Invoice cancellation — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
CancelInvoiceDialogadded tosrc/app/— search ticket by number, show cliente/fecha/importe/CSV/estado, enable cancel only whenestado == "ENVIADA" - [x]
Herramientas → Anular factura Verifactu…menu action opens the dialog; disabled with warning if Verifactu not configured - [x] On AEAT confirmation: updates
ingresosrows (verifactu_estado = 'ANULADA',verifactu_timestamp = now, clearsverifactu_error) - [x]
VerifactuManager::cancelInvoice()fixed to includeCompanyNamein cancel JSON — required by AEAT API - [x] AEAT error 3002 "No existe el registro de facturación" diagnosed: TESTING environment purges old records; must cancel a freshly-submitted invoice in the same session
RecogPrendas UX + Listado fixes — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
showQrToClient()removed fromMainWindow— QR dialog after invoice submit was disruptive; Verifactu info is now accessible inRecogPrendasinstead - [x]
pb_verifactubutton added toRecogPrendas— enabled only when selected row hasverifactu_estadonon-empty; opens dialog showing estado, CSV, timestamp, error, and clickable AEAT validation link - [x] All action buttons in
RecogPrendas(pb_payment,pb_state,pb_pay_all,pb_pku_all,pb_separ_garm,pb_print,pb_verifactu) start disabled; enabled on row selection - [x]
ingresosListado view now loads most-recent rows first (ORDER BY n_recibo DESC) so latest tickets are visible without loading the full table - [x] Other tables in Listado use
model->fetchMore()loop replacing the unreliable scrollbar hack - [x] Row height no longer expands on lazy-load:
setDefaultSectionSize(rowHeight(0))locks compact height after initialresizeRowsToContents() - [x] Listado window width capped at
screen()->availableGeometry().width()— prevents window from expanding off-screen wheningresoshas many columns - [x]
TABLE_VERIFACTU_CSV/TIMESTAMP/ESTADO/ERROR/URL_QR(15–19) added torecog_prendas.h; hash + verifactu columns hidden from table view viasetColumnHidden()
Debug mode replaced by AppSettings::enablePrinting() — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
bool debugmember andon_actionModo_debug_triggeredslot removed fromMainWindow - [x]
actionModo_debugUI action removed frommainwindow.ui(Archivo menu) - [x]
AppSettings::enablePrinting()/setEnablePrinting()added — persisted underprint.enablein~/.laideal_settings.json - [x]
SettingsDialogGeneral tab gains checkbox "Habilitar impresión de tickets y facturas" - [x]
on_bb_save_reset_clicked()now guards printing withAppSettings::instance()->enablePrinting()instead of!debug
Verifactu DB persistence + response capture — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
migrateDatabase()added tosql_lite— adds 5verifactu_*columns toingresoson startup (idempotent) - [x]
processResponse()inVerifactuManagernow extractsValidationUrlandQrCodefrom the/Createresponse alongsideCSV - [x]
saveTicket()extended to persistverifactu_csv,verifactu_timestamp,verifactu_estado,verifactu_error,verifactu_url_qrfor every garment row in the ticket - [x]
verifactuSubmitInvoice()now returnsVerifactuResult; caller inon_bb_save_reset_clicked()passes it tosaveTicket() - [x] Error and unconfigured states also written to DB (empty estado = not submitted; estado=ERROR stores error description)
Module consolidation + tilde search fix — May 2026 (feature/add_mdiago_verifactu)¶
- [x] All src subdirectory names lowercased; root
CMakeLists.txtupdated to match - [x] Five separate CMake libraries (
FilterWidget,MySortFilterProxyModel,NumberFormatDelegate,TextColorDelegate,TableView) merged into a singletableviewlibrary — source files stay in their own dirs, all exposed via thetableviewINTERFACE include path - [x]
listadolibrary renamed to lowercase, now linkstableviewas PUBLIC (propagates headers to consumers) - [x]
recog_prendasandapptarget_link_librariesupdated — no more references to old individual targets - [x]
MySortFilterProxyModel::removeDiacritics()added — strips Unicode combining marks via NFD decomposition; covers all Spanish accented characters and ñ - [x]
MySortFilterProxyModel::setNormalizedFilter(text, column)added — OR-combined with existing regex filter insidefilterAcceptsRow;column = -1searches all columns - [x]
Listado::textFilterChangednow callssetNormalizedFilterso searches without tildes (e.g., "garcia") match names with tildes (e.g., "García") - [x]
RecogPrendasname search changed from SQLWHERE cliente LIKE(ASCII-only) to fullSELECT * FROM ingresos+ proxy-model normalized filter onTABLE_CLIENTcolumn - [x]
RecogPrendastotal-price calculation now sums from the proxy model rows (correct for name search filtered set)
Centralised AppSettings + sql_lite refactor — May 2026 (feature/add_mdiago_verifactu)¶
- [x] New
src/appsettings/module:AppSettingssingleton +SettingsDialog - All previously hardcoded paths and values (DB path, icon, report dirs, Excel template, batch script, business identity, IVA rate, Verifactu NIF/name/key/environment) now live in
~/.laideal_settings.json - Legacy
~/.laideal_cfgand~/.verifactu_keyfiles migrated automatically on first run - Settings dialog accessible from Archivo → Configuración...; changes applied at runtime (icon, Verifactu) or require restart (DB path)
- [x]
main.cpp— validates DB path before constructingMainWindow; opensSettingsDialogon first run or misconfiguration - [x]
sql_literefactored —const QString ¶ms,dbNotConfigured()guard prevents error dialogs when DB path not set,monthStr()helper deduplicates month-padding logic,QRandomGeneratorreplacesrand()ingenHash16() - [x] All module CMakeLists.txt updated to link
appsettings
First successful Verifactu submission — May 2026 (feature/add_mdiago_verifactu)¶
- [x]
submitSimplifiedInvoice()added toVerifactuIntegrationfor F2 (simplified) invoices — no buyer NIF required, correct for laundry retail - [x] Fixed
CompanyNamefield name — API requiresCompanyName, was incorrectly sent asSellerName - [x] Emitter NIF and name moved out of source code to
~/.laideal_cfg(key=value, same location as~/.verifactu_key) - [x]
logResponse()added toVerifactuManager— pretty-prints server JSON with QR blob truncated - [x] First confirmed AEAT TESTING submission: invoice
24417, CSVA-9VARYQTZTARVU2,StatusResponse: Correcto - [x] Confirmed API returns
QrCode,ValidationUrl, andQrCodeUrldirectly in thesubmitInvoiceresponse
Documentation expansion — May 2026¶
- [x] Created per-module reference docs for all non-Verifactu modules (
docs/modules/*.md) mainwindow.md,sql_lite.md,listado.md,recog_prendas.md,facturas.md,contabilidad.md,imprimir.md,add_garment.md- [x] Condensed Verifactu docs:
README.md(Spanish→English, shorter),RESUMEN_IMPLEMENTACION.md(246→85 lines), removed redundantINDEX.md - [x] Updated
architecture.mdandai_agent_instructions.md— method names reflect current camelCase identifiers - [x] Removed
docs/todo/anddocs/development/references from all docs; deletedhardcoded_paths.png - [x] Updated
docs/INDEX.mdanddocs/README.mdto register all new module docs
Code quality improvements — May 2026 (feature/add_mdiago_verifactu)¶
- [x] Applied coding guidelines to all
src/modules (commit157c354) - Translated Spanish dev comments and debug strings to English
- Converted
SIGNAL/SLOTmacro syntax to new-style pointer syntax - Fixed SQL injection in
add_garment.cppon_pb_search_pressed(parameterised query) - [x] Renamed all user-defined snake_case identifiers to camelCase across all
src/modules (commit551b920) - Methods, members, parameters, local variables, free functions, signals
- Qt auto-connect slots (
on_*) and Qt virtual overrides preserved unchanged - Updated call sites in
insertnewitem.cppandgenlistado.cpp
Documentation reorganisation — May 2026¶
- [x] Moved all
.mddocs fromsrc/verifactu/todocs/modules/verifactu/ - [x] Created
docs/README.md(docs folder index) - [x] Created
docs/modules/verifactu/with full Verifactu docs - [x] Created
docs/ai_agent_instructions.md— agent onboarding guide - [x] Created
docs/architecture.md— full module/DB/flow documentation - [x] Created
docs/progress_tracker.md— this file - [x] Created
docs/INDEX.md— project-wide quick-find index - [x] Created
.claude/commands/update-docs.mdand.claude/commands/update-skills.mdskills - [x] Created
.claude/commands/coding-guidelines.mdskill (/coding-guidelines) - [x] All documentation translated to English
8.0 — Verifactu Support — May 2026 (feature/add_mdiago_verifactu)¶
- [x] Created
src/verifactu/module:VerifactuConfig,VerifactuInvoice,VerifactuManager,VerifactuIntegration - [x] Added
VerifactuIntegrationinstance toMainWindow(m_verifactuIntegration) - [x]
verifactuSubmitInvoice()called in ticket save flow - [x]
showQrToClient()— QR + CSV + validation URL dialog - [x] Graceful degradation: shows warning if Verifactu not configured, does not block ticket saving
- [x] TESTING environment available; production environment ready
- [x] CMake integration (
src/verifactu/CMakeLists.txt+ rootCMakeLists.txt) - [x]
initializeVerifactu()inMainWindowconstructor
r7.1 — PDF export for listados¶
- [x] Print listado de prendas to PDF via
actionGenerar_pdf_con_el_listado
r7.0 — Hardcoded path update¶
- [x] Updated hardcoded paths for new laptop (still hardcoded, different machine address)
r6.1 — Fix waiting cursor¶
- [x] Fixed waiting cursor in listados and other time-consuming operations
r6.0 — Garment management upgrades¶
- [x]
AddGarmentmodule: add garments to existing tickets - [x] Split garments in
RecogPrendas - [x]
hashcolumn added toingresosfor unique row identification - [x]
RecogPrendasDB updates based onn_recibo+hash(not just row number)
r5.x — Listado & accounting improvements¶
- [x] Revert accountings feature (r5.0)
- [x] Data lock on closed quarters (r5.6)
- [x] Generic
Listadoclass replacing per-table views (r5.1+) - [x] Sort/filter for all table columns
- [x] New
InsertNewItemdialog for adding clients - [x] Quarter lock prevents out-of-period data entry (r5.0)
r4.x — Print, UI, and invoice improvements¶
- [x] Print support via Excel + batch script (r3.0/r4.x)
- [x] Debug mode toggle (r4.0)
- [x] Invoice form: show IVA and base, replace "producto" with description (r4.0)
- [x] App icon (r4.1)
- [x] Version metadata in
.exe(r5.4)
r1.0–r2.0 — Foundation¶
- [x] Initial release with garment/client/receipt/accounting/invoice features
- [x] SQLite database
- [x]
serviciostable for unique services in invoices - [x] 2-decimal currency display