Skip to content

Singapore: IRAS document titles and GST Reg No. labels - #140

Merged
methodofaction merged 2 commits into
mainfrom
claude/singapore-invoice-fixes-90ff81
Aug 11, 2026
Merged

Singapore: IRAS document titles and GST Reg No. labels#140
methodofaction merged 2 commits into
mainfrom
claude/singapore-invoice-fixes-90ff81

Conversation

@methodofaction

Copy link
Copy Markdown
Contributor

What

Regime-specific rendering for Singaporean invoices, in a new components/regimes/sg package following the existing co/ar pattern:

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":

Condition Title
Supplier has no GST number (tax_id.code empty) Invoice
self-billed tag (recipient issues the tax invoice) Invoice
simplified tag Simplified Tax Invoice
reverse-charge tag Customer Accounting Tax Invoice
Otherwise Tax Invoice

Credit 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 generic TIN. A UEN identity 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 as Company Reg No.. The comparison is hyphen-insensitive; an explicit identity label still 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

  • No GOBL change: regimes/sg validation was verified against the IRAS-published format table and is correct as-is.
  • The Gross Margin Scheme case (also a plain-"Invoice" case per IRAS) has no GOBL representation today, so it cannot be derived; one-line addition to titleKey if that ever lands.
  • The HTML <title> tag comes from bill.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.
  • Four new example fixtures + goldens cover each case: simplified (mirrors the reference document), standard, divergent UEN/GST, and non-registered supplier.

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/sg package 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.

Comment thread components/regimes/sg/sg.go Outdated
Comment thread locales/en/app.yml
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>

@mrdanwa mrdanwa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@methodofaction
methodofaction merged commit d5636e8 into main Aug 11, 2026
2 checks passed
@methodofaction
methodofaction deleted the claude/singapore-invoice-fixes-90ff81 branch August 11, 2026 13:58
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.

3 participants