Singapore: IRAS document titles and GST Reg No. labels - #140
Merged
Conversation
IRAS requires the words "tax invoice" in a prominent place on GST tax invoices, and a supplier that is not GST-registered (or a self-billed supplier) must not use that heading. Derive the title for SG standard invoices from the supplier's GST registration and the invoice tags via a new components/regimes/sg package: Tax Invoice, Simplified Tax Invoice, Customer Accounting Tax Invoice, or plain Invoice. Label SG tax IDs as "GST Reg No." instead of the generic TIN, and hide a UEN identity that duplicates the GST registration number, since IRAS reuses the UEN as the GST number for most entities. When the two differ (GST groups, sole proprietorships, overseas vendors), the UEN is shown separately as "Company Reg No.". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Singapore (IRAS) regime-specific rendering so SG invoices show the correct legally-significant document headings and more accurate GST/UEN identifier labels, following the existing regime-component pattern.
Changes:
- Introduces a new
components/regimes/sgpackage to derive IRAS-compliant invoice titles (Tax Invoice / Simplified Tax Invoice / Customer Accounting Tax Invoice). - Updates party identifier rendering to label SG tax IDs as
GST Reg No.and suppress duplicate UEN output when it matches the GST registration number. - Adds SG example fixtures and corresponding rendered HTML outputs, and links them from the examples index.
Reviewed changes
Copilot reviewed 10 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| locales/en/app.yml | Adds English strings for SG regime-specific invoice titles. |
| examples/sg-invoice.json | New SG standard invoice example fixture. |
| examples/sg-invoice-simplified.json | New SG simplified tax invoice example fixture. |
| examples/sg-invoice-not-registered.json | New SG non-GST-registered supplier example fixture. |
| examples/sg-invoice-gst-group.json | New SG example where UEN differs from GST reg no. |
| examples/out/sg-invoice.html | Golden HTML output for SG standard invoice title/labels. |
| examples/out/sg-invoice-simplified.html | Golden HTML output for SG simplified tax invoice title/labels. |
| examples/out/sg-invoice-not-registered.html | Golden HTML output for non-registered supplier (plain invoice + company reg no.). |
| examples/out/sg-invoice-gst-group.html | Golden HTML output for divergent UEN/GST (renders both lines). |
| examples/index.html | Adds preview cards for the new SG examples. |
| components/regimes/sg/sg.templ | Adds SG regime title-type templ component hook. |
| components/regimes/sg/sg.go | Implements IRAS title selection and SG identity hide/label logic. |
| components/regimes/sg/sg_templ.go | Generated templ output for SG components. |
| components/org/party.templ | Wires SG identity hide/label behavior into party rendering; adds SG tax label. |
| components/org/party_templ.go | Generated templ output reflecting updated party rendering logic. |
| components/bill/invoice.templ | Adds SG title hook into invoice title coalescing chain. |
| components/bill/invoice_templ.go | Generated templ output reflecting invoice title hook update. |
Files not reviewed (3)
- components/bill/invoice_templ.go: Generated file
- components/org/party_templ.go: Generated file
- components/regimes/sg/sg_templ.go: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The generic billing.invoice.title.standard key is translated in every locale, so a non-GST-registered Singaporean supplier would get e.g. "Factura" while the other IRAS headings stay English. Use a regimes.sg.title.invoice key so all SG headings resolve consistently. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Regime-specific rendering for Singaporean invoices, in a new
components/regimes/sgpackage following the existingco/arpattern:Document title — IRAS requires the words "tax invoice" in a prominent place on a GST tax invoice, and conversely a supplier that must not issue one must not use the heading. For SG standard invoices the title is now derived from supplier GST status and tags instead of the static "Invoice":
tax_id.codeempty)self-billedtag (recipient issues the tax invoice)simplifiedtagreverse-chargetagCredit notes and all other document types fall through to the default titles. The headings are intentionally left untranslated in other locales since the English wording is what IRAS mandates.
Supplier identifiers — SG tax IDs are labelled
GST Reg No.instead of the genericTIN. AUENidentity that duplicates the GST registration number is no longer rendered (IRAS reuses the UEN as the GST number for most entities), collapsing the previous three-line output to one. When the values genuinely differ — GST group/divisional registrations, sole proprietorships, overseas vendors — the UEN renders separately asCompany Reg No.. The comparison is hyphen-insensitive; an explicit identitylabelstill takes precedence.Why
A Singaporean customer document (
PPL000003) rendered a heading of just "Invoice" — not a valid tax invoice under IRAS rules, exposing GST-registered buyers relying on it for input tax claims — plus the same identifier repeated under three labels (TIN,Company Reg. no,GST Reg No).Notes for review
regimes/sgvalidation was verified against the IRAS-published format table and is correct as-is.titleKeyif that ever lands.<title>tag comes frombill.DocumentTitle, which no regime hooks into (same pre-existing desync as AR/CO/PT/GR/IT), so the tab title still shows the default wording; the printed document is correct.🤖 Generated with Claude Code