Skip to content

feat: add tax settlement summary to PDF export#18

Merged
daniel89fg merged 1 commit intoFacturaScripts:masterfrom
tonomolla6:feature/export-pdf-tax-summary
Feb 26, 2026
Merged

feat: add tax settlement summary to PDF export#18
daniel89fg merged 1 commit intoFacturaScripts:masterfrom
tonomolla6:feature/export-pdf-tax-summary

Conversation

@tonomolla6
Copy link
Copy Markdown

Summary

  • The PDF export currently only includes the accounting entry data but not the tax settlement summary (accrued VAT, deductible VAT, general regime result) that is displayed in the web interface via the Modelo303.html.twig template.
  • Since HtmlView does not export its content to PDF, the summary (boxes 27, 45 and 46) was completely missing from the exported document.
  • Override exportAction() to manually load modelo303 data and append a summary table with the settlement totals after the standard view export.

Changes

Modified: Controller/EditRegularizacionImpuesto.php

The overridden exportAction():

  1. Replicates the parent EditController::exportAction() logic
  2. Loads view data before exporting (needed because exportAction runs in execPreviousAction, before loadData is called)
  3. After exporting all views, adds a table with:
    • Box 27 — Total accrued fee (total cuota devengada)
    • Box 45 — Total to deduct (total a deducir)
    • Box 46 — General regime result (resultado régimen general)

Test plan

  • Open an existing tax regularization (Modelo 303) with data
  • Click the print/export PDF button
  • Verify the PDF now includes a summary table with boxes 27, 45 and 46
  • Verify the amounts match those shown in the web interface

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings February 19, 2026 15:44
@tonomolla6
Copy link
Copy Markdown
Author

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. 👍

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Controller/EditRegularizacionImpuesto.php
Comment thread Controller/EditRegularizacionImpuesto.php
@daniel89fg
Copy link
Copy Markdown
Member

issue relacionada

@daniel89fg daniel89fg merged commit 4cf4be6 into FacturaScripts:master Feb 26, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants