feat: update and expand invoice templates for all 24 regimes#224
feat: update and expand invoice templates for all 24 regimes#224pablocaeg wants to merge 3 commits intoinvopop:mainfrom
Conversation
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.
✅ Deploy Preview for gobl-build ready!
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)
|
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). |
|
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. |
|
Hey @methodofaction , thanks for your feedback! |
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 buildto 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!