feat: add tax settlement summary to PDF export#18
Conversation
The PDF export only included the accounting entry data but not the tax settlement summary (accrued VAT, deductible VAT, result) that is shown in the web via the Twig template. Since HtmlView does not export its content to PDF, the summary was missing. Override exportAction() to load modelo303 data and append a summary table with boxes 27, 45 and 46 after the standard export. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Hola! Os dejo este PR por si os interesa incluirlo en futuras versiones. Nos lo ha pedido algún cliente: que al exportar el PDF del Modelo 303 aparezcan los totales de IVA repercutido, IVA soportado y el resultado (la diferencia, lo que hay que pagar/devolver a Hacienda). Actualmente en el PDF solo sale el asiento contable, pero no el resumen de liquidación que sí se ve en la web. Es algo más bien estético para el documento PDF, pero las asesorías lo agradecen porque les queda más claro lo que hay que presentar. Si os encaja, genial. Si no, no pasa nada, lo mantenemos por nuestra parte. 👍 |
There was a problem hiding this comment.
Pull request overview
This PR adds tax settlement summary information to PDF exports of tax regularization documents (Modelo 303). Previously, the PDF export only included accounting entry data but not the summary totals (boxes 27, 45, and 46) that are displayed in the web interface via the HtmlView template.
Changes:
- Overrides
exportAction()to manually load modelo303 data and append a summary table with settlement totals (total accrued fee, total to deduct, and general regime result) after the standard view export - Sets PDF orientation to landscape before exporting
- Loads data for all views before exporting (necessary because exportAction runs in execPreviousAction, before standard loadData)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Modelo303.html.twigtemplate.HtmlViewdoes not export its content to PDF, the summary (boxes 27, 45 and 46) was completely missing from the exported document.exportAction()to manually loadmodelo303data and append a summary table with the settlement totals after the standard view export.Changes
Modified:
Controller/EditRegularizacionImpuesto.phpThe overridden
exportAction():EditController::exportAction()logicexportActionruns inexecPreviousAction, beforeloadDatais called)Test plan
🤖 Generated with Claude Code