Skip to content

feat(tax): a notice for documents that carry no tax, set on the tax page (#449) - #471

Merged
Panelica merged 1 commit into
Panelica:mainfrom
ertugrulkeyvan:feat/tax-exemption-notice
Nov 18, 2026
Merged

Panelica merged 1 commit into
Panelica:mainfrom
ertugrulkeyvan:feat/tax-exemption-notice

Conversation

@ertugrulkeyvan

Copy link
Copy Markdown
Contributor

Closes #449.

What was missing

A business under a small-business VAT exemption, such as Austria's § 6 Abs. 1 Z 27 UStG 1994 or Germany's § 19 UStG, charges no VAT and must say why on its invoices. PNLCS could already stop charging tax (the "Charge tax" switch on the tax page, #305), but it had nowhere to put the legal line. The reporter edited client/cart/index.blade.php and pdf/invoice.blade.php by hand and has to redo that on every update.

What changes

  • Tax page: a new field, "Notice on documents without tax" (setting TaxExemptionNotice, up to 500 characters), under the two existing switches. Leave it empty and nothing changes anywhere.
  • Where the notice is shown: on any invoice whose tax and tax2 are both zero:
    • the built-in PDF, under the totals;
    • the customer's invoice page;
    • a new {tax_notice} placeholder for uploaded templates, also added to the three sample templates in database/invoice-templates/.
  • Cart and checkout: the notice also shows under the total when the cart adds no tax.
  • One place decides: App\Support\TaxNotice. An invoice that charged tax never shows the notice, even if the field is filled in later.

The text is read when the document is shown, not copied onto the invoice. That is how the company's own address and tax number already reach the PDF (InvoicePdfService::companyDetails()). Copying the line onto every invoice would need a new column, so I left it out; it is easy to add if you would rather freeze it.

What is not covered:

  • Emails: the invoice email templates are editable, so a shop can add the line there today.
  • Admin invoice page: it is not changed.

Tests

tests/Feature/TaxExemptionNoticeTest.php (5 tests) covers:

  • the tax page saves the notice and shows it again;
  • an invoice without tax carries it on the PDF, in {tax_notice} and on the customer's invoice page;
  • a taxed invoice carries none of them;
  • nothing is added while the field is empty;
  • the cart and checkout show it while no tax is added, and drop it once tax is switched back on.

All 5 fail on main and pass here.

Full suite: 5431 passed, 3 skipped, 2 failed. The two failures (CurrencyAndBackupTest, MailLinkHostTest) fail the same way on main in my environment.

@Panelica
Panelica merged commit 07aba9f into Panelica:main Nov 18, 2026
1 check passed
@Panelica

Copy link
Copy Markdown
Owner

Merged, thank you — and closing #449 with it.

Verified the escaping, since the notice goes into a document: placeholderValues() escapes every value that is not in its $markup list, and tax_notice is not in it, so what the operator types is escaped on the custom-template path; the Blade PDF view and the two cart views escape it themselves. Checked as well that an invoice issued with tax never gains the line (forInvoice() reads the document's own tax) and that the text is read at display time, like the company address and tax number.

All 5 tests red on 1.29.0, green after. Measured on the merge result: the full suite is green — 5463 passed in parallel (--exclude-group=serial, 4 processes) plus the 17 serial installer tests, 5 skipped, 0 failed.

@Panelica

Copy link
Copy Markdown
Owner

Released in 1.30.0, the stable channel, offered to every installation.

Gates on the tag and that package: full suite 5463 passed in parallel plus the 17 serial installer tests (0 failed, 5 skipped); 276 translation and parity tests green; the update lab 14 scenarios ALL GREEN; the real package updated the last stable (1.29.0 → 1.30.0, 13 checks) and the last beta (1.25.1-beta.1 → 1.30.0, 14 checks), each installed from its published package in the published runtime image with the signature checked by the key built into the application; the three uploaded assets re-downloaded and compared byte for byte before publishing.

@Wolfcom

Wolfcom commented Nov 18, 2026

Copy link
Copy Markdown

Thank you very much for implementing this feature so quickly!

I've updated our WHOST installation to PNLCS 1.30.0 and tested the new tax exemption notice with the Austrian small business VAT exemption (§ 6 Abs. 1 Z 27 UStG 1994).

Everything works as expected:

  • The notice appears correctly in the shopping cart.
  • It is displayed on the customer's invoice page.
  • It is included in the PDF invoice.
  • No VAT is charged, and the notice is displayed only once after removing our previous custom modifications.

It's great to have this functionality built directly into PNLCS instead of maintaining custom Blade changes.

Excellent work, and thank you again for the incredibly fast implementation!

Best regards,
Wolfcom / WHOST

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Small business VAT exemption support

3 participants