Skip to content

[Reports]: PDF export for tabular report pages #680

Description

@nielsdrost7

v1 rendered every report as a PDF (pdf_create() via mPDF — application/modules/reports/controllers/Reports.php:38-42 and equivalents for all five reports). v2's tabular reports (#145 / PR #609) ship with CSV export only. #145's status note explicitly defers "print/PDF export of these reports through builder templates" to "a separate issue once #130 Phase 3 (ReportRenderer) lands" — this is that issue.


Specific

Add a Download PDF header action to each tabular report page (Payment History, Invoicing History, Invoiced Amount by Client, Sales by Date, Invoices per Client, and Invoice Aging when it exists) producing a print-ready A4 PDF: report title, company name, selected date range/filters, the table, and the totals line.

Measurable

  • Every report page shows Download PDF next to Export CSV.
  • The PDF contains the same rows and totals as the on-screen table for the active filters.
  • Long reports paginate with repeated column headers per page.
  • Filename pattern: <report-slug>-<from>-<to>.pdf.

Achievable

Consume the Report Builder rendering pipeline (#130 Phase 3 ReportRenderer / Browsershot driver from PR #608) with a default tabular template; fall back to a simple Blade→Browsershot render if the builder integration is not ready. No new packages.

Relevant

v1 parity (v1 reports were PDF-first) and the stated follow-up of epic #506 Track B.

Time-Bound

One sprint after both #609 (report pages) and #608 Phase 3 (renderer) merge.


Arrange

  • Company with 3 payments inside a chosen date range and 1 outside it.
  • Payment History report filtered to that range.

Act

  • Trigger Download PDF.

Assert

  • Response is a PDF download with the expected filename.
  • PDF text contains the 3 in-range payments and the totals value; the out-of-range payment is absent.
  • Company name and date range appear in the header.
  • Works for all report pages (smoke test per page).
  • PHPUnit feature tests assert the download response + content type; content assertions via PDF text extraction or the intermediate HTML.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refinedRefined with SMART plan / test suggestions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions