All notable changes to GOBL will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning. See also the GOBL versions documentation site for more details.
gr-mydata
: addedgr-mydata-other-tax
extension to set the category of other taxes in charges.
es-verifactu-v1
: added initial Spain VeriFactu addon.tax
: ExtensionsGet
convenience method that helps when using extensions using sub-keys.tax
:ExtensionsExclude
validator for checking that extensions do not include certain keys.tax
:ExtValue.In
for comparing extension values.bill
:Tax.MergeExtensions
convenience method for adding extensions to tax objects and avoid nil panics.cbc
:Key.Pop
method for splitting keys with sub-keys, e.g.cbc.Key("a+b").Pop() == cbc.Key("a")
.in
: added Indian regimecef
: catalogue for CEF VATEX reason codes.untdid
: 1153 -untdid-reference
(Reference Code Qualifier) and 7143 -untdid-item-type
(Item Type Identification) extenions.
tax
: renamedExtensionsRequires
toExtensionsRequire
, to bring in line withExtensionsExclude
.cbc
: refactoredKeyDefinition
andValueDefinition
into a singleDefinition
object that supportskey
andcode
.tax
: removedExtValue
and replaced withcbc.Code
which is now much more flexible.tax
: Catalogue definitions now loaded from JSON source as opposed to Go code. This improves memory efficiency, especially when the source data is large.
bill
: corrected issues around correction definitions and merging types.bill
: removedOutlays
from totals.
org
: Party validation now working with regimes when defined.
ae
: added UAE regimebr-nfse-v1
: new extensions, validations & identities for the typical service note and supplier.
es-tbai-v1
: always addes-tbai-product
extension to items, indicating default value.
es-tbai-v1
: issue with preceding validation.
org
:Address
includesLineOne()
,LineTwo()
,CompleteNumber()
methods to help with conversion to other formats with some regional formatting.
bill
:Invoice
can now have empty lines if discounts or charges present.
ch
: Deleted Supplier validation (not needed for under 2300 CHF/year)bill
:Invoice
GetExtensions
method now works correctly if missing totals Issue #424.
org
:Address
now includes astate
code, for countries that require them.es-tbai-v1
: normalize address information to automatically add newes-tbai-region
extension to invoices.org
:Inbox
now supportsemail
field, with auto-normalization of URLs and emails in thecode
field.currency
: Exchange rate "source" field.
- Moved regime examples into single
/examples
folder. org
:Address
,code
for the post code is now typed as acbc.Code
, like the newstate
field.
cal
: Fixing json schema issue with date times.
bill
: normalize line discounts and charges to remove empty rows.
tax
: identity code handling will skip default validation for specific countries that use special characters.
br-nfse-v1
: added initial Brazil NFS-e addon
mx
: deprecated themx-cfdi-post-code
extension in favor of the customer address post code.- New "tax catalogues" used for defining extensions for specific standards.
tax
: New "tax catalogues" used for defining extensions for specific standards.iso
: catalogue created withiso-schema-id
extensions.untdid
: catalogue created with extensions:untdid-document-type
,untdid-payment-means
,untdid-tax-category
,untdid-allowance
, anduntdid-charge
.eu-en16931-v2017
: addon for underlying support of the EN16931 semantic specifications.de-xrechnung-v3
: addon with extra normalization for XRechnung specification in Germany.pay
: Addedsepa
payment means key extension in main definition to be used with Credit Transfers and Direct Debit.org
:Identity
andInbox
support for extensions.tax
: tags forexport
andeea
(european economic area) for use with rates.bill
: support for extensions inDiscount
,Charge
,LineDiscount
, andLineCharge
.bill
: specifically defined keys for Discounts and Charges.
tax
: rate keys can now be extended, soexempt+reverse-charge
will be accepted and may be used by addons to included additional codes.tax
: Addons can now depend on other addons, whose keys will be automatically added during normalization.cbc
: Code now allows:
separator.
pay
: UNTDID 4461 mappings from payment means table, now provided by cataloguesbill
:Outlay
has been removed in favour of Charges, we've also not seen any evidence this field has been used.bill
:ref
field from discounts and charges in favour ofcode
.tax
: RegimeChargeKeys
removed. Keys now provided inbill
package.it
: Charge keys no longer defined, no migration required, already supported.
mx
: Tax ID validation now correctly supports&
andÑ
symbols in codes.
br
: added basic Brazil regimeuuid
: SQL library compatibility for type conversion.it-sdi-v1
: addedit-sdi-vat-liability
extension for EsigibilitaIVA.
bill.Invoice
: remove empty taxes instances.tax.Identity
: support Calculate method to normalize IDs.tax.Regime
: properly set regime when alternative codes is given.
org.DocumentRef
: renamedline
tolines
that accepts an array of integers making it possible to define a selection of reference lines in another document as opposed to just one.
cbc.Code
: newJoin
andJoinWith
methods to help concatenate codes.it-sdi-v1
: added CIG and CUP identity type codes.de
: added validation and normalization for tax identities (not VAT).
mx
: fixed panic when normalizing an invoice withtax
but noext
inside.
es-tbai-v1
: added validation for presense ofseries
andgeneral
notes in Invoices.es
: moving invoice customer validation to the facturae and tbai addons.it-sdi-v1
: fixing validation issue for payment terms with no due dates.
pt
: reduced rate category for PT-MA was updated to reflect latest value of 4%co-dian-v2
: moved fromco
tax regime into own addon.
pt
: moving invoice tags from saft addon to regime, ensure defaults present.
Another significant epic release. Introducing "add-ons" which move the normalization and validation rules from Tax Regimes to specific packages that need to be enabled inside a document to be used.
Tax Regimes are now also defined using the $regime
keyword at the top of the document under the $schema
and alongside $addons
and $tags
. This is a significant move with the aim of making the core GOBL project as flexible as possible, while allowing greater levels of validation and customization to be added as needed.
Another very significant internal change is around normalization. There is now a much clearer difference internally between Calculate
and Normalize
methods. Calculate methods are used when there is some type of math operation to perform, and normalize will simply clean the data as much as possible. The three key steps in order are: normalize, calculate, and validate.
Finally, the draft
flag has been removed from the header, and much more emphasis has been placed on the signatures for validation. For example, the invoice's "code" property will only be required in order to sign the envelope.
(We've made a big jump in minor version numbers to clarify the extent of the changes.)
head.Header
: Removed thedraft
flag. Instead envelopes must now be signed in order to activate additional validation rules such as requiring the invoice code, and allow "stamps" in the header.- Renamed
Calculate
methods toNormalize
and removed errors, to clearly differentiate between the two processes. bill
: Moved taxtags
to the invoice level$tags
property.tax
: RenamedRegime
toRegimeDef
.tax
: RenamedCategory
toCategoryDef
.tax
: RenamedRate
toRateDef
.tax
: RenamedRateValue
toRateValueDef
.mx
: local normalization, validation, and extensions moved to theaddons/mx/cfdi
package to use with themx-cfdi-v4
key.es
: moved FacturaE and TicketBAI extensions to theaddons/es/facturae
andaddons/es/tbai
packages respecitvely.pt
: moved SAF-T specific extensions toaddons/pt/saft
.it
: moved SDI and FatturaPA extensions toaddons/it/sdi
with keyit-sdi-v1
.gr
: moved MyDATA toaddons/gr/mydata
, keygr-mydata-v1
.bill.Preceding
: replaced withorg.DocumentRef
.bill.Invoice
: Ordering now using arrays oforg.DocumentRef
.bill.Invoice
:series
andcode
now usecbc.Code
and normalization instead of the independent invoice code.cbc
:Code
now allows spaces, dashes, and lower-case letters. Normalization will remove duplicate symbols.
tax
:Regime
type now used to add$regime
attribute to documents.tax
:Addons
type which uses the$addons
attribute to control which addons apply to the document.tax
:Tags
type which adds the$tags
attribute.tax
:Scenario
now hasFilter
property to set a code function.tax
:AddonDef
provides support for defining addon extension packs.gr
:gr-mydata-invoice-type
extension with related tags and scenarios.org
:DocumentRef
consolidates references to previous documents in a single place.bill
: invoice type optionother
for usage when regular scenarios do not apply.
tax
: totals calculator was ignoring tax combos with rate and percent, when they should be classed as exempt.
This one is big...
Significant set of changes around Scenario handling. Scenarios defined by tax regimes can now set tax extensions at the document level automatically. The objective here is to move away from external projects using scenario summaries directly, and instead use the absolute values set in the document.
For example, the document format and type in Italy are now set inside the extensions and can be overriden if needed manually. This will be especially important when receiving and converting invoices into GOBL from external formats; its much easier to set specific values than trying to determine the appropriate tags.
Also included is support for defining the country in tax combos, making it possible for taxes from a customers country to applied directly if needed. Typical use case would be for selling digital goods into or between EU states for B2C customers.
Invoices in GOBL can now also finally produced for any country in the world, even if not explicitly defined inside the tax regimes.
bill.Invoice
:customer
can now be empty by default, thesimplified
simplified tag will have no effect on the document unless used by regime scenarios.bill.Invoice
: using thecustomer-rates
tag will now automatically copy the customer's country code, if available, to the individual tax combo lines.tax
: movedNormalizeIdentity
method from the regimes common package so that it can be applied to all tax IDs, regardless of if they have a regime defined or not.pt
: VAT rate key is now optional ifpt-saft-tax-rate
is provided.gr
: simplified validation to use tax categories.it
: always addit-sdi-fiscal-regime
to Invoice suppliers.it
: renamed extensionit-sdi-retained-tax
toit-sdi-retained
, now with validation on retained taxes.it
: renamed extensionit-sdi-natura
toit-sdi-exempt
.bill.Invoice
: deprecated theScenarioSummary
method, as tax regimes themselves should be using extensions to apply all the correct data to a document up front.mx
: scenarios will now copy the document and relation types to the tax extensions.cbc
: consolidated "keys" and "codes" lists from key definitions into a single values array.gr
: switched to use the newround-then-sum
calculation methodtax.Combo
: rates when defined will always update the combo.bill.Invoice
: tax tags will always cause scenarios to update the document.es
: support forfacturae
tag which will correct set local extensions instead of using scenario summary codes.
tax
:Combo
now supports acountry
field.tax.Category
: addedValidation
method support for custom validation of a tax combo for a specific tax category.tax.Scenario
: added "extensions" to be able to automatically update document level extensions based on the scenario detected.it
: addedExtKeySDIDocumentType
as an extension that will be automatically included according to the scenario.it
: now addingExtKeySDIFormat
value to document instead of just referencing from scenarios.cbc.Note
: now providesSameAs
method that will compare key attributes, but not the text payload. This is now used in Schema Summaries.bill.Line
: addedRequireLineTaxCategory
validation helper method.cbc
: added newValueDefinition
.gr
: added "Income Classification" extensions.tax.TotalCalculator
: now supportsround-then-sum
as an alternative to the defaultsum-then-round
calculation method to meet the requirements of regimes like Greece.
tax.Category
: removedRateRequired
flag, regimes should instead should help users determine valid extensions (eg. PT and GR).cbc
: removedCodeDefinition
.
tax.Scenario
: potential issue around matching notes.tax.Set
: improved validation embedded error handling.
org.Name
: either given or surname are required, as opposed to both at the same time.
head
: validation rule to check for the presence of stamps- GR: support for credit notes
Significant set of small changes related to renaming of the l10n.CountryCode
type. The main reason for this is an attempt to reduce confusion between regular ISO country selection, and the specific country codes used for tax purposes. Normally they coincide, but exception cases like for Greece, whose ISO code is GR
but use EL
for tax purposes, or XI
for companies in Northern Ireland, mean that there needs to be a clear selection.
- CO: improved regime's documentation
l10n
: split "CountryCode" into "ISOCountryCode" and "TaxCountryCode", for the two explicit use-cases.l10n
: renamedCountryDefinitions
variable toCountries()
method.
- Code coverage report (still a lot to improve there!)
- GR: support for simplified invoices
l10n
: ISO and Tax lists of country definitions available, e.g.l10n.Countries().ISO()
tax
: support for alternative country codestax
: Scenarios now handle extension key and value for filtering.- PT: exemption text handling moved to scenarios.
- invopop/validation - upgrade to latest version with nil pointer fix.
- GR: fixed certain tax combos not getting calculated by the regime
org.Address
: recommended fields added
org.Address
:locality
no longer required.
- Including
recommended
array in more JSON Schema objects. bill.Invoice
: validation and changes around acceptance of simplified invoices with customer name. A customer without a tax ID now implies that a name is also not required.uuid
: Compact Base64 encoding and decoding of UUIDs for compact URLs.head
: NewLink
model for associating Envelopes with static URLs.head.Header
: Link array in addition to stamps.- PT: support for debit notes
- PT: validations for debit and credit notes
- CO: renamed credit and debit extension names to fit in UIs.
org.Party
:name
is now optional, but recommended.
org.People
:name
is now correctly validated.
org.Person
: now haslabel
field.
org
: Refining availability oflabel
field.
Multiple version upgrade after merging the gobl.cli project directly here instead.
- CLI: move the command line interface and wasm binary support directly into GOBL.
- CO: support debit notes with additional validations for required reason extensions.
- CO: renaming
co-dian-correction
code toco-dian-credit-code
while also addingco-dian-debit-code
to extensions. - CO: support debit notes
- CO: updated validation for simplified invoices
- GR: renamed greece country code to
EL
to reflect local naming in tax code, package still namedgr
for ease of use. - l10n: extension countries like EL, XI, EU for special tax cases
- l10n: country definition extension flag to be able to filter ISO codes
- IT: Company fiscal code can be the same as the VAT code.
bill.Invoice
: experimentalConvertInto
method to convert the invoice's amounts from one currency into another.- DE: support for "de-tax-number" identity which can be used instead of regular tax ID code inside Germany.
- DE: "simplified" tax tag removes requirement for supplier tax identification.
tax.Regime
: added new "Identity Keys" definition.- IT:
it-sdi-format
extension added with the two main document formats in Italy:FPA12
andFPR12
(default for B2B/C if none assigned).
tax.Identity
: deprecated thetype
field, and directly removed theuuid
andmeta
fields which no longer make sense here.tax.Regime
: standardised naming around key definitions to always include_keys
as suffix.- IT: moved fiscal code (codice fiscale) from the
org.Party
Tax ID to the Identities array with the specific keyit-fiscal-code
. This implies that invoices can now be issued with both a VAT code (partita IVA) and a fiscal code (codice fiscale). - IT: data will be normalized automatically to move the fiscal code from the tax ID to the identities array.
- IT: removed explicit support for Tax ID type field.
- ES: moved Tax ID
type
usage to theidentities
array. - CO: moved Tax ID type definitions to
identities
array.
- GR: Invoice and address validations
- GR: Payment means key definitions
- GB: removed requirement for suppliers to have a tax ID code (country is still required!)
num.Amount
-RescaleDown
method, that helps reduce accuracy from a number if higher.num.Amount
-RescaleRange
method, ensures that the exponent is within a specific range.- Greece tax regime
tax.Combo
- regime specific calculations now supported.
org.Registration
: addedother
field.
- Field descriptions of
org.Website
- PT:
at-app-id
stamp for the application ID used to register a document.
num.AmountFromFloat64
method helps avoid rounding issues when using floats.- PT:
at-hash
stamp to store the AT's hash of an invoice
- MX: Fuel account balance totals calculated maintaining item price precision.
- ISO 3166-1 alpha-3 codes (and a function to access them) added to the country definitions (
l10n.CountryDef
) - MX:
mx.TaxIdentityCodeGeneric
constant added with the generic RFC for final consumers
- MX: customer extensions no longer required for foreign customers
- CH: fixing tax ID checksum validation that ends in
0
.
- Default values added to correction options schema based on values from previous invoice.
- In
pay.Online
, renamedname
property tolabel
, andaddr
toURL
. Also addedkey
property. Auto-migration included.
bill.Invoice
: fixed issue with invalid currency codes that don't have a definition, will always resort to Tax Regime's currency.
Fixing important bugs with some tax regimes and tax identity code validation, along with a new 'series' property for correction options.
series
property added to bill Correction Options to allow a series for a credit note to be added.label
property added toorg.Party
.
- Invoice Discounts and Charges will no longer update the
base
property according to the document's sum. - Exempt rate in
tax.Combo
no longer required when percent is empty. - When correcting an invoice, if no new series is provided, the previous document's series will be maintained.
- Precision handling of calculated invoice discounts and charges.
- Multiple tax regime were not validating the presence of supplier identity code.
Finally, invoice multi-currency support! It's been a very long time coming, but we've finalized the details on how to handle currency conversion in invoices and potentially other documents.
- Invoice Line Item alternative pricing added to be able to define custom prices in different currencies:
line.AltPrices
- Automatic conversion of invoice line item prices into invoice currency based on exchange rates defined in invoice if no alternative prices provided.
- If an invoice has a currency that is different from that of the tax regime, a validation rule ensures that an exchange rate is defined.
currency.Amount
- new model that combines a currency with an amount.- BE: added Belgium regime.
- BREAKING: refactor of
currency.ExchangeRate
to clearly definefrom
andto
currencies (this was never supported, so we're not expecting anything to actually break). - Removed all regime specific currency validation, this is now performed by the invoice and depends on the available exchange rates.
- MX: invoice line totals validated to be zero or more, instead of positive.
- Removing code requirement from Tax ID validation in all regimes so that when issuing a document to another country, the customers tax ID code will be validated if present, but will not be required. Any local rules for the issuing country for foreign IDs will continue to be applied.
- MX: allow line taxes to be empty.
- Bill Invoice Tax objects now support tax extensions.
- MX Stamps for signatures from CFDI and SAT.
- MX: extension for Place of Issue code:
mx-cfdi-issue-place
that replaces previous post code option in the supplier. Automatic normalization added. head
package now hasGetStamp
method to find a stamp by its provider from an array.num.Percentage
hasBase()
method to access base amount.- MX: FuelAccountBalance complement now supports
percent
as an alternative torate
. - ES: added extra TicketBAI exemption reasons
- Envelope
Replicate()
and supporting methods to be able to clone/replicate an envelope or document without any potentially conflicting data.
reverse-charge
tag will no longer have impact on tax calculations, each tax combo per line should define if taxes are exempt or not.- Renaming
mx.StampProviderSATUUID
constant to justmx.StampSATUUID
. - MX: FuelAccountBalance complement renamed tax
code
tocat
(Category) with explicit usage of regular tax codes to be more aligned with other usage of tax categories.
- UUID
IsNotZero
will not raise error for empty UUIDs.
UUID Unmarshal fix.
- UUID: parsing empty strings from JSON no longer causes error.
Refining UUID library and moving to using version 7 as the default in GOBL.
- Additional UUID validation rules:
Valid
,IsV6
,Isv7
,HasTimestamp
, andTimeless
.
- Using Version 7 UUIDs as default in GOBL. This version enables ordering by UUID and uses random extra data instead of a node ID.
- Parsing empty UUIDs now returns an empty UUID instead of an error.
Refactoring UUID support.
IMPORTANT: When running Calculate()
, a uuid will now be assigned automatically to the document embedded in an Envelope if not already set. This is important to ensure that links between documents can always be maintained, no matter the source.
- Schema Object:
Calculate()
will now inject UUIDs. - Schema Object:
UUID()
method will provide the UUID of the underlying document. schema.Identifiable
interface to be able to read and set UUIDs on documents.uuid.Identify
that makes it easier to embed UUIDs into documents with helper methods.
- UUID: refactored to use underlying string type instead of external package. This makes it easier to manage empty values, and avoids usage of pointers.
- Removed all pointers to UUIDs and many cases replaced with
uuid.Identify
embedded structure.
- none
Refactoring region handling for Portugal VAT and now supporting -
in cbc.Code
.
- Regimes: Extensions can now be used to match tax rates.
- Tax: Extensions helper methods:
Merge
andContains
.
cbc.Code
: Now supports-
symbol alongside.
as a separator. Mixed feelings on this as we wanted to avoid normalization complications, but it became clear with the PT changes that a bit more flexibility here is useful. (Side note: the original intent ofcbc.Code
was to avoid dashes in tax IDs, but these are now normalized automatically.)- PT: moving from tax tags
azores
andmadeira
topt-region
extension provided in taxes combo for each line. - PT: auto-migrate invoice supplier tax ID zone to appropriate line tax combo extension.
- none
New number formatting support! Expect some possible breaking SDK changes with the num
packages. No significant schema changes.
- This CHANGELOG.md file (finally!)
- Swiss (CH) tax regime.
- Austrian (AT) tax regime.
num
package now provides advanced number formatting.currency
provides "definitions" loaded from JSON with support for formatting.- Polish (PL) correction and preceding validation.
- Polish (PL) header stamps for QR code.
num
package refactored so thatnum.Percentage
is independent fromnum.Amount
.
- Minor fixes around tax regime definitions.
- invopop/yaml upgraded.
- Last version before CHANGELOG.md.