AAuditPro Suite· Finance manual
Finance manual PDF templates

The 3 templates

1Tax invoice (INV)
Navy accent · 5% VAT visible

Compliant with RD 121/2020. Firm letterhead, bill-from + bill-to, line table with VAT, totals, T&Cs, bank details, signature.

2Proforma (PI)
Orange · "PROFORMA" watermark

Same layout as tax invoice but watermarked + VAT shown as informational. Footer text: "Tax invoice will follow on service delivery".

3Receipt (RCT)
Green · centre-box "Amount Received"

Different shape: hero centre-box with amount in words, payment method, allocation summary, signature + firm-stamp blocks.

Cache strategy

AspectBehaviour
Cache pathstorage/invoices/{id}/{number}.pdf · storage/payments/{id}/{number}.pdf
First requestRenders fresh · ~600-1200ms
SubsequentStreamed from cache · < 100ms
Bust onInvoice line edit · header edit · status change · payment allocation
Bust mechanismDelete cache file · next request re-renders
Manual bustAdmin "Clear PDF cache" button (super_admin only)

What's on the tax invoice PDF

  1. Header strip (navy gradient)

    Firm logo (left) · "TAX INVOICE" prominent + invoice number + issue date (right). Logo loaded inline from companies.logo_path with cache-busting mtime.

  2. Bill From / Bill To grid

    Firm: name, address, VAT TRN, phone, email. Client: legal name, CR, VAT TRN, address. Two columns, equal width.

  3. Subject + scope (optional)

    Job description, fiscal year reference. Pulled from invoice.subject + linked job.

  4. Line item table

    Description · Qty · Rate · VAT · Total. Navy header. Zebra rows. Negative discount lines highlighted.

  5. Totals block

    Subtotal · VAT · Grand Total. Navy footer with gold accent on Grand Total. If advance applied, "Less: prior advance" row + new "Balance Due".

  6. Bank details footer

    Pulled from company_banks. Up to 2 bank accounts shown. Hidden on proforma.

  7. Terms & Conditions

    From client.invoice_terms_override OR firm default.

  8. Signature block

    "For [Firm Name] · Authorised signatory" with stamp space. Right-side: "Received in good order · Customer signature".

dompdf-safe layout rules

An early version of the template rendered the same invoice across 17 pages. The fix was to follow strict dompdf compatibility:

Customising the templates

Each template is a PHP view at:

To customise: copy → edit → test render via InvoicePdfService::render($invoiceId, true) (force flag rebuilds). Don't change the structure that affects compliance fields (TAX INVOICE label, VAT TRN, sequential number, total VAT amount).

Per-firm branding

The firm's companies row drives:

Settings → Company Profile → upload logo + stamp. Templates auto-pick. No code changes needed for brand customisation.

Step-by-step — preview + send a tax invoice PDF

  1. Open invoice detail

    From M11 invoice list or job → Invoices tab.

  2. Click "Preview PDF"

    Opens in new tab. Either streamed from cache or freshly rendered. Inspect every block — letterhead correct, VAT visible, totals match.

  3. If incorrect — edit

    Status must allow edits (draft only typically). Fix lines, save. Cache busts. Re-preview.

  4. Send

    Click Send. M17 attaches the cached PDF + emails via firm SMTP. Status flips draft → sent.

  5. Client downloads

    Email arrives with PDF attached. Original cached server-side; same PDF served if client requests another copy via portal.

Try this

Open any invoice → Preview PDF. The first render is ~800ms (you'll see the spinner). Refresh the same URL — instant from cache. Now edit a line item, save. Re-preview — re-renders fresh because cache was busted on save. This is what live invoice editing should feel like.

Watch out

Don't edit dompdf templates without testing. A misplaced <td> can throw the whole layout 17 pages wide. Always render at least 3 sample invoices (1 line, 5 lines, 20 lines) after any template change — long invoices break differently from short ones.

Tip — firm stamp PNG

The stamp PNG should be transparent-background (not white-square-with-stamp). If white shows, scan with a transparent layer in Photoshop / GIMP, or use rembg.app to auto-remove background. Looks much more professional in the signature block.