Skip to content

feat: update and expand invoice templates for all 24 regimes#224

Open
pablocaeg wants to merge 3 commits intoinvopop:mainfrom
pablocaeg:feat/update-templates
Open

feat: update and expand invoice templates for all 24 regimes#224
pablocaeg wants to merge 3 commits intoinvopop:mainfrom
pablocaeg:feat/update-templates

Conversation

@pablocaeg
Copy link
Copy Markdown

@pablocaeg pablocaeg commented Mar 28, 2026

I've been exploring the GOBL ecosystem lately and while playing around with gobl.builder I ran into a couple of things. Would love to hear what you think.

Most of the current templates show warnings when loaded against the latest GOBL version, and the Italy freelance one is broken. Also noticed only 8 countries had templates out of 24, so thought it would be nice to fill that gap.

I fixed all the existing ones and added templates for every supported regime, including addon variants like XRechnung, CFDI, SDI, SAF-T, TicketBAI, VeriFactu, etc.

To generate them I used gobl.mock, a small library I put together while getting familiar with GOBL. It reads regime definitions and generates invoices with valid tax IDs (correct check digits and all that) for every country. Ended up making it really easy to cover all 24 regimes without crafting each template by hand.

The templates that were already there for specific scenarios (IT hotel with tourism tax, stamp duty, ES freelance with IRPF, reverse charge, CO simplified) I kept and just rebuilt through gobl build to bring the totals up to date. They show useful edge cases so didn't want to lose them.

50 templates total, all passing validation.

16 new countries: AE, AR, AT, BE, BR, CA, CH, DE, DK, GB, GR, IE, IN, PL, SE, SG

13 addon variants: ARCA, NF-e, NFS-e, DIAN, SII, TicketBAI, VeriFactu, Chorus Pro, Factur-X, myDATA, CFDI, FA_VAT, SAF-T

Also added a search bar to the template loader because with 24 countries the accordion was getting a bit hard to scroll through. Hope it helps!

Replace stale templates that produce warnings against current GOBL
and expand coverage from 8 to 24 countries with addon variants.

Templates generated with gobl.mock, hand-crafted scenario templates
(IT hotel, IT stamp duty, ES freelance, ES reverse charge, CO
simplified) preserved and rebuilt through gobl build.

Add search filter to template loader for easier discovery.
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 28, 2026

Deploy Preview for gobl-build ready!

Name Link
🔨 Latest commit 21d4a69
🔍 Latest deploy log https://app.netlify.com/projects/gobl-build/deploys/69cd079ea195cd0008f85912
😎 Deploy Preview https://deploy-preview-224--gobl-build.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

39 new templates generated with gobl.mock scenarios. 90 templates total.

Proposed-By: Juan Moliner (@juanmoliner)
@pablocaeg
Copy link
Copy Markdown
Author

Added hotel, freelance, restaurant, e-commerce and reverse-charge templates across most countries, 90 total now. Each scenario generates realistic invoices with the right tax rates per country, things like reduced VAT for hotel accommodation, retained taxes for freelancers (IRPF in Spain, IRPEF in Italy, ISR in Mexico), service charges for restaurants and shipping for e-commerce. This came out of expanding gobl.mock with scenario generation as @juanmoliner suggested (https://github.com/pablocaeg/gobl.mock).

@methodofaction
Copy link
Copy Markdown
Contributor

Thanks for your contribution @pablocaeg. This PR actually resurfaced a need that we have of sharing examples across docs, builder, and our gobl.html library, we want to have tax-compliant examples across the board and to keep them updated as our implementation evolves.

This shouldn't block us from updating the current builder with more examples or making improvements as you have done. There are some subtle interaction/design details in the search implementation that may prove difficult to correct. Next week I'll take a closer look. I might make use the examples you generated via gobl.mock (super cool!) but reimplement the front-end differently.

Thanks again for your contribution and I will ping you here once I've done the deep dive.

@pablocaeg
Copy link
Copy Markdown
Author

Hey @methodofaction , thanks for your feedback!
Happy to hear you find the mock library useful. All the templates pass through the full GOBL validation pipeline so they should be safe to reuse across different GOBL projects.
No worries about the frontend part of it, feel free to remove that and re-implement it in a way that fits Invopop more. It was a quick solution to make it easier to show all the different examples that were added.
Happy week 😄

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.

2 participants