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.
pl-favat-v3: Preceding no longer required when it is a credit note
eu-en16931-v2017: BR-32 validation requiring taxes on document-level discounts.
bill:Invoice.Invert()returns an error if the invoice has thebypasstag.num:AmountFromStringnow limits precision to 18 significant digits.tax: Added$defsand$refsto thetax.RegimeCodeJSON schema
tax: FixedSincedate comparison to be inclusivegr-mydata-v1: Corrected exemption codes 3 and 4 mapping tooutside-scope
pkg/template: removed as no longer used.
fr-ctc-v1: French CTC Flow 2 B2B e-invoicing addonfr: SIREN and SIRET identity types format validationorg: New note keys:payment-methodandpayment-term
eu-en16931-v2017: Identity normalization now supports type-based identitiesdk: Updated CVR identity to use Type instead of Key
bill: Invoice, Order, Payment, and Delivery now normalize Notes fieldsbill: Invoice and Order now normalize Attachments fields
dk: Added the Danish regimede: Added support for NW Steuernummerpl-favat-v3: Added Poland FAVAT V3 addon
l10n:UnionDefmethodHasMemberOnnow correctly handles empty codes
bill:LineandSubLinenow normalize negative item prices to quantity.org:Itemrequires zero or positive price.
head:Linksupport for category and improved file support.pt-saft-v1: Add new exemption codes (M44, M45, M46)
eu-en16931-v2017: Allow 0 item prices.
ar-arca-v4: Added initial Argentina ARCA addon.eu-en16931-v2017: Added check for negative prices.br-nfse-v1: Add extensions for IBS/CBS tax determination (RTC)br: Add CBS and IBS tax categoriesgr-mydata-v1: New charge types: fees, stamp duties and other taxes.
eu-en16931-v2017: Removed constraint for payment terms in Credit Notes.bill:LineDiscountandLineChargeno longer return an error when the amount is 0.
bill: Add replicate logic to payments, orders and deliveries.tax:Tags.RemoveTags()method for removing tags from a list.es-verifactu-v1: Bill Lines require at least one of the main tax categories.org:Itemnow definesservicesandgoodsas predefined options, required by some formats/regimes.org:Identityhas ascopefield for defining where an identity should be used, such as for tax or legal purposes.es-sii-v1: Added initial Spain SII addon.
bill: Refactor replicate logic to rely on calculations to set default values.
es-verifactu-v1: Simplified invoices no longer require a tax ID.
org:Attachment.Namefield is no longer required.it-sdi-v1: removed IBAN length validation.
org:Identitynow hasglnas a possible Key.eu-en16931-v2017:Identitynormalization adds iso scheme codes extension for certain keys.ar: Argentine regimeit-sdi-v1: Add Italian phone number validation and normalizationit-sdi-v1: Add validation for IBANs.
pay: Removed terms.Detail in favour of terms.Notes
eu-en16931-v2017: Remove address constraint for all parties, keep for Supplier and Customer.be: Update regex to account for new VAT numbers starting with 1.
l10n: union will now check alternative country codes: fixes issue with GR and EL codes in the EU.
co: Add new INC tax defenition.sg: Singaporean regimetax:keysfor GSTbill:Linewithsellerproperty, to be used in Mexico.org:DocumentRefsupports theschemafield.se: Swedish regime.luhn: package for handling luhn Mod10 calculations.br-nfe-v4: added Brazil NF-e addon for NF-e and NFC-e documentsregimes/ie: Irish regime.
eu-en16931-v2017: fixed issue with payment details when due is zero
es-verifactu-v1: validation to prevent forbidden characters in names.org:Attachment.datafield removed in favour of URL. We don't believe that embedding binary data inside a JSON object is aligned with the objectives of GOBL to be lightweight and easy to use.
it-sdi-v1: Updated mapping of exemption (natura) codes to reflect CIUS mapping guide.
it-sdi-v1: added validation for name and persons so that at least one is set.eu-en16931-v2017: Add missing scenario for self billing credit notes.es-verifactu-v1: validation to prevent forbidden characters in names.
eu-en16931-v2017: Add missing Business Rules with labels at implementation level.de-xrechnung-v3: Add missing validation from CIUS.fr: Add identity validation and normalization.it-sdi-v1: Modify address validation to accept postbox.bill: support forbypasstag, to prevent billing total calculations (experimental).- Updated normalizer ordering so that inside fields/objects are processed before the parent object
pt: migrations for Zone, no longer needed
pt-saft: minimum exemption note length corrected to 6 characters
org:Item-imagesfield for storing links to images of the item.it-sdi-v1: added fund contributions via charges and validation for despatch (delivery documents)it: added new tax category forCPto handle codeRT06for retained taxespt-saft-v1: positive quantity validationpt-saft-v1: tax rate normalization to prevent rate extension and percent mismatchespt-saft-v1: exemption note text length validation
es-verifactu-v1: removed preceding validations for credit notes andF3invoice type
es: IGIC now uses VAT keysbill: fixed zero-percent handling in charges and discounts
gr-mydata-v1: Fix incorrect VAT rate mapping.
tax: Comboexemptrate will be migrated tokey. Addons need to handle specific migrations.pt-saft-v1: fixedexemptrate handling.it-sdi-v1: fixedexemptrate handling.
pt-saft-v1: added extensions to handle integration of documents (other systems, manually issued or recovered)
pt: added comprehensive validations to regimept-saft-v1: added comprehensive validations to addon
mx: normalize codes withMXcode at the beginninges-verifactu-v1: correctN2operation code scenario
cbc: newNormalizeStringmethod to help clean texts used throughout GOBL to trim whitespace and remove invalid or nil UTF-8 characters.tax:Combo: removing migration ofexemptratefield tokey, so as not to make assumptions about manually assigned extensions.pl: moved to new addonpl-favat-v2- only basic implementation at this time to remove restrictions on regime, expect more changes in future.
IMPORTANT: Significant refactor of tax combo handling with the addition of tax "keys" that help identify the sub-classification of a tax, specifically VAT, ensuring that they can be correctly mapped.
Unmarshalling JSON GOBL documents will be migrated automatically to the new structure, including any rate tags or addon extensions, but consuming may require changes if using the tax combo rate property.
tax:Combonow includes akeyfield with VAT values taken from the EN16931. We've tried to normalize all common use-cases from theratefield, so no changes should be required.br: added retained taxes CSLL, INSS and IRRFtax: added support forinformativetax categories that will be calculated and reported but will not affect the invoice totals.br: made ISS an informative tax
fr: handle exception cases in Tax Identity Codes.
tax: renamedstandardrate togeneralto more closely reflect usage and differentiate from newstandardkey using theCombo.pt-saft-v1: moved exemption notes to line-level and added validations
org.Party: avoid panic when regime's normalizer is not presentbr: set missing normalizer in regime definitiontax:Normalizers()method inRegimeDef
br: tax identity validation for CPF code.
pt-saft-v1: restore generic notes for M99 and M19 exemption codes for backwards compatibility.
es: tax identity codes for nationals will be zero padded.
es: refactored tax identity code checks for easier re-use, removed old specific errors and replacesDetermineTaxCodeTypemethod withTaxIdentityKey.es: removed old tax identity zone check.
bill: CorrectingConvertIntoto handle item level currency values.
tax:Identity#InEUmethod for checking if Identity is in the EU on a specific date.
es-verifactu-v1: refining copy related to identity handling.
co-dian-v2: addedco-dian-fiscal-responsibilityextension for suppliers and customers
es-verifactu-v1:- Refining customer validation to support Tax ID or identity with extension.
- New
replacementtag to use when simplified invoices are replaced with a complete version. - Setting credit-note default document type to
R1if not set in correction process. - Improved extension documentation and usage.
tax: Correcting$tagsJSON Schema properties from OneOf to AnyOf.
bill:Orderingnow includes anissuerfield.es/verifactu: Support fores-verifactu-simplified-art7273andes-verifactu-issuer-typeextensions.
bill: All invoices will now have a default set of$tagsthat can be used.
es-verifactu-v1:[]*org.Notevalidation will check the note's length ifkey=generalpt-saft-v1: adapted and additional validations for the newbill.Paymentstructurept-saft-v1: updatedpt-exemption-codeextension list and related scenarios to use the texts complaint with the regulations.fr-choruspro:bill.Linequantityfield will now be normalized to four decimal places.
mx-cfdi-v4: Validate price greater than 0.it-sdi-v1: Validate names and addresses contain only latin characters as required by SDI.it-sdi-v1: Payment means now supportonlinekey as a card payment.org:Unitadditional standard units.es/verifactu: map identity keys for specific codes.org:Person: newkey,addresses, andidentitiesproperties.
bill:PaymentLinewill recalculate tax totals based on proportional amounts paid per-line, alongside the total advances and amount due.bill:PaymentLineremoved thedebitandcreditfields which were confusing, especially alongside the advances. Please now use therefundflag.bill:Paymentwill check the line document's currency and require an exchange rate if different from the document's.bill:Paymenttaxfield is no longer supported, we assume convertors will deal with tax for each payment line.fr: Removed unnecessary length check when validating the SIREN.
bill:PaymentLineincludes arefundboolean to indicate flow of funds, and impacts thePayment's total potentially making it negative.org:DocumentRefnow includes apayableproperty.bill:PaymentLineincludesdescription,installment,payable,advances,due, andtaxproperties.mx-cfdi-v4: Define payment method in document.fr-choruspro-v1: Created addon for Chorus Pro to handle invoice types and identity schemes
tax: SimpleNormalizemethod support.
mx: updated examples to use postcodes in the central timezone (most common)cbc: Code: allow,(comma) as separator.org: Telephone normalized and format restrictions removed.
es-verifactu-v1: only validate presence of tax in preceding rows for corrective types.org: normalizing Item Ref field.
tools: removed as considered too opinionated for other projects using GOBL.org: normalize inboxes with thepeppolkey, splitting participant ID between scheme and code.
cal: JSON Schema pattern for time.
regimes: template.tools: explicit dependency for golangci-lint via tools.go.- CONTRIBUTING.md file.
num: improvedMakePercentagedocumentation.
es: small typo in the description for simplified scheme description.it-sdi-v1: Do not enforce Italian postcode format on foreign addresses.
bill.Line: Add extensions to line.it-ticket-v1: Stamp key for document number added and void document number.it-ticket-v1: Extension for customer lottery code.it-ticket-v1: Add line extension for line ID that will be issued by the AdE.it-ticket-v1: Add corrections to addon with document number stamp.tax: Totals now have publicRoundmethod.
bill: Rounding before payment calculations.tax: Rounding bug in totals calculations.it-sdi-v1: RemovedisItaliancheck on customer address
bill:Totalsnow separates retained from indirect taxes, with a newRetainedTaxfield applied between theTotalWithTaxandPayableamounts.tax:Totalswill now calculate sum with separateRetainedamount.
bill: Support forissue_timefield, which will be updated automatically if provided with a zero value. Nil issue times will always be ignored.bill: Payment will now set issue date automatically, alongside issue time if provided.mx-cfdi-v4: Support for "Global" B2C invoice reporting that group together B2C sales into a single document.mx-cfdi-v4: Automatically set theissue_timeif not already provided.tax:ExtensionsRequireAllOrNonevalidation rule.es-verifactu-v1: validation for export exemption codes.tax:ExtensionsExcludeCodesvalidation rule.
tax:ExtensionsHasusage should be replaced withExtensionsRequirevalidator.
es-tbai-v1: removing series presence check
bill:Orderingwithcostcode for accounting.it-sdi-v1: Normalize address codes with 0 padding.eu-en16931-v2017: Validating inboxes.org:Inboxnow withschemefield.
dsig: Upgraded signing packages.
it-sdi-v1: validation for non latin and latin-1 characters in item names.pt-saft-v1: support for stock movements (frombill.Delivery) and work documents (frombill.Invoiceandbill.Order)tax: Regime Definition now supports a primaryTaxSchemeproperty for usage in converting to other formats.tax:Identitynow supports an overrideSchemefield andGetSchememethod that will fallback to the Regime's tax scheme default.
bill: line rounding will now check for nil item and nil item price.bill:codefield now "recommended" in Order, Delivery, Invoice, & Payment schemas, but should not raise JSON Schema warnings. Validation will continue to fail when signing.bill: more sub-schemas published for re-use by main document schemas.
bill: reverting back to maintaining precision in line totals forpreciserounding for consistency with old data. Usecurrencyrounding for compatibility with EN16931 specs.bill: line sum rounded to currency precision incurrencyrounding.
Significant refinements to rounding and clarifying the naming for more clarity and widespread usage.
it-ticket-v1: implemented addon for AdE e-receipt formatbill: line discount and chargebaseproperty, to use instead of the line sum in order to comply with EN16931.bill: line Charge support for Quantity and Rate special cases for charges like tariffs that result in a fixed amount base on a rate, like, 1 cent for every 100g of sugar.
bill: line totals will be rounded to currency precision for presentation onlybill: document Discount and Charge base and amounts always rounded to currency's precisionbill: line Discount and Charge base and amounts always rounded to currency's precisiontax: renamed rounding rulessum-then-roundtoprecise, andround-then-sumtocurrency, to more accurately reflect their objectives.bill:currencyrounding rule implies that line totals will be calculated with the currency's precisions, bringing closer alliance with EN16931 requirements.
Another significant release that adds more documents related to the order-to-payment billing flows, and renames the "Receipt" document to simply "Payment". There are now 4 primary billing documents:
- Order
- Delivery
- Invoice
- Payment (renamed from Receipt)
Each document class has a subset of types to cover multiple situations. Its been tough, but we've tried to keep naming as simple and down to earth as possible so that every combination of document class and type should be easy to understand.
NOTE: the new billing document types are still considered experimental and subject to significant changes. Please use with caution.
bill:Deliverydocument now supported.bill:Orderdocument now supported.bill:Payment-requesttype now supported.bill:Linenow includes abreakdownarray of sub-lines that will be used to calculate the item's price, including individual discounts and charges. This effectively implements grouping, while maintaining compatibility with all other formats that do not support breakdowns.bill:Linenewsubstitutedarray of sub-lines for informational purposes when the originally requested line could not be fulfilled, especially relevant for orders.bill:Taxincludesroundingfield to be able to override the tax regimes default rounding mechanism.bill:CorrectionOptionsnow includescopy_taxflag, and will automatically copy tax details from a previous document.org:DocumentRefincludestaxproperty with the Tax Totals of a previous document.
bill: renamingPaymenttoPaymentDetails, andDeliverytoDeliveryDetails, to make room for new document types.bill: renamingReceipttoPayment, and associated payment types to simplyadviceandreceipt.org:Itemprice is now a pointer and optional, so that items without prices can be used inbill.Orderandbill.Deliverydocuments.bill.Invoicecontinues to validate for the presence of an item's price, as expected.bill:PaymentLinetaxproperty moved to thedocument.
pay:Terms, replacedNAoption with explicitundefinedkey, to avoid defining empty constants in JSON.
pt-saft-v1: support for payments and receipts
pt-saft-v1: changed default unit toonebill:Linenow incudes three new fields intended for greater EN16931 compatibility:identifier,period,order, andcost.org:Attachmentnew structure for dealing with attachments.bill:Attachmentsadded to invoices.eu-en16931-v2017: addon now includes additional validation for attachment codes.
eu-en16931-v2017: removing validation of advanced payment means extension.pay:Cardfields now optional.bill.Receipt: fixed panic calculating receipts with no linesbill.Receipt: require code only to signbill.Receipt: calculate line indexes
This significant release adds support for the new bill.Receipt schema, to be used to represent payments (sent from suppliers) and remittance advice (sent from customers). This is still in testing phases, so may still require significant changes.
bill: newReceiptmodel, includingReceiptLine.l10n: support for unions, including filtering members by date.l10n: european union including members.num:Negatemethod in amounts and percentages.fr-facturx-v1: addon placeholder dependent oneu-en16931-v2017de-zugferd-v2: addon placeholder dependent oneu-en16931-v2017pt,pt-saft-v1: new extensions, normalizations and validations.here: package will now convert unescaped~to backticks in documents.cbc:Sourcetype, for defining sources of data.org: Unitonefor generic use-cases.
tax: (internal) tax total calculation moved toTotalmodel from calculator.num:Invertnow has deprecated warning.tax:CalculatorRoundingRulerenamed to justRoundingRuleeu-en16931-v2017: validate presence of item unit (BR-23).eu-en16931-v2017: improving validation of tax combos.eu-en16931-v2017: normalization with reasonable defaults for minimal invoices.
gr-mydata: addedgr-mydata-other-taxextension to set the category of other taxes in charges.untdid: 4451 -untdid-text-subject(Text Subject Qualifier) catalogue.
org: Movedcbc.Notetoorg.Notein order to include extensions.tax: usingScenarioNoteinstead ofcbc.Noteto avoid cyclic dependency issues.
es-verifactu-v1: added initial Spain VeriFactu addon.tax: ExtensionsGetconvenience method that helps when using extensions using sub-keys.tax:ExtensionsExcludevalidator for checking that extensions do not include certain keys.tax:ExtValue.Infor comparing extension values.bill:Tax.MergeExtensionsconvenience method for adding extensions to tax objects and avoid nil panics.cbc:Key.Popmethod 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) extensions.
tax: renamedExtensionsRequirestoExtensionsRequire, to bring in line withExtensionsExclude.cbc: refactoredKeyDefinitionandValueDefinitioninto a singleDefinitionobject that supportskeyandcode.tax: removedExtValueand replaced withcbc.Codewhich 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: removedOutlaysfrom 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-productextension to items, indicating default value.
es-tbai-v1: issue with preceding validation.
org:AddressincludesLineOne(),LineTwo(),CompleteNumber()methods to help with conversion to other formats with some regional formatting.
bill:Invoicecan now have empty lines if discounts or charges present.
ch: Deleted Supplier validation (not needed for under 2300 CHF/year)bill:InvoiceGetExtensionsmethod now works correctly if missing totals Issue #424.
org:Addressnow includes astatecode, for countries that require them.es-tbai-v1: normalize address information to automatically add newes-tbai-regionextension to invoices.org:Inboxnow supportsemailfield, with auto-normalization of URLs and emails in thecodefield.currency: Exchange rate "source" field.
- Moved regime examples into single
/examplesfolder. org:Address,codefor the post code is now typed as acbc.Code, like the newstatefield.
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-codeextension 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-idextensions.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: Addedsepapayment means key extension in main definition to be used with Credit Transfers and Direct Debit.org:IdentityandInboxsupport for extensions.tax: tags forexportandeea(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-chargewill 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:Outlayhas been removed in favour of Charges, we've also not seen any evidence this field has been used.bill:reffield from discounts and charges in favour ofcode.tax: RegimeChargeKeysremoved. Keys now provided inbillpackage.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-liabilityextension 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: renamedlinetolinesthat 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: newJoinandJoinWithmethods 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 withtaxbut noextinside.
es-tbai-v1: added validation for presense ofseriesandgeneralnotes 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 fromcotax 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 thedraftflag. 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
Calculatemethods toNormalizeand removed errors, to clearly differentiate between the two processes. bill: Moved taxtagsto the invoice level$tagsproperty.tax: RenamedRegimetoRegimeDef.tax: RenamedCategorytoCategoryDef.tax: RenamedRatetoRateDef.tax: RenamedRateValuetoRateValueDef.mx: local normalization, validation, and extensions moved to theaddons/mx/cfdipackage to use with themx-cfdi-v4key.es: moved FacturaE and TicketBAI extensions to theaddons/es/facturaeandaddons/es/tbaipackages respecitvely.pt: moved SAF-T specific extensions toaddons/pt/saft.it: moved SDI and FatturaPA extensions toaddons/it/sdiwith 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:seriesandcodenow usecbc.Codeand normalization instead of the independent invoice code.cbc:Codenow allows spaces, dashes, and lower-case letters. Normalization will remove duplicate symbols.
tax:Regimetype now used to add$regimeattribute to documents.tax:Addonstype which uses the$addonsattribute to control which addons apply to the document.tax:Tagstype which adds the$tagsattribute.tax:Scenarionow hasFilterproperty to set a code function.tax:AddonDefprovides support for defining addon extension packs.gr:gr-mydata-invoice-typeextension with related tags and scenarios.org:DocumentRefconsolidates references to previous documents in a single place.bill: invoice type optionotherfor 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:customercan now be empty by default, thesimplifiedsimplified tag will have no effect on the document unless used by regime scenarios.bill.Invoice: using thecustomer-ratestag will now automatically copy the customer's country code, if available, to the individual tax combo lines.tax: movedNormalizeIdentitymethod 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-rateis provided.gr: simplified validation to use tax categories.it: always addit-sdi-fiscal-regimeto Invoice suppliers.it: renamed extensionit-sdi-retained-taxtoit-sdi-retained, now with validation on retained taxes.it: renamed extensionit-sdi-naturatoit-sdi-exempt.bill.Invoice: deprecated theScenarioSummarymethod, 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-sumcalculation methodtax.Combo: rates when defined will always update the combo.bill.Invoice: tax tags will always cause scenarios to update the document.es: support forfacturaetag which will correct set local extensions instead of using scenario summary codes.
tax:Combonow supports acountryfield.tax.Category: addedValidationmethod 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: addedExtKeySDIDocumentTypeas an extension that will be automatically included according to the scenario.it: now addingExtKeySDIFormatvalue to document instead of just referencing from scenarios.cbc.Note: now providesSameAsmethod that will compare key attributes, but not the text payload. This is now used in Schema Summaries.bill.Line: addedRequireLineTaxCategoryvalidation helper method.cbc: added newValueDefinition.gr: added "Income Classification" extensions.tax.TotalCalculator: now supportsround-then-sumas an alternative to the defaultsum-then-roundcalculation method to meet the requirements of regimes like Greece.
tax.Category: removedRateRequiredflag, 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: renamedCountryDefinitionsvariable 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:localityno longer required.
- Including
recommendedarray 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: NewLinkmodel 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:nameis now optional, but recommended.
org.People:nameis now correctly validated.
org.Person: now haslabelfield.
org: Refining availability oflabelfield.
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-correctioncode toco-dian-credit-codewhile also addingco-dian-debit-codeto extensions. - CO: support debit notes
- CO: updated validation for simplified invoices
- GR: renamed greece country code to
ELto reflect local naming in tax code, package still namedgrfor 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: experimentalConvertIntomethod 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-formatextension added with the two main document formats in Italy:FPA12andFPR12(default for B2B/C if none assigned).
tax.Identity: deprecated thetypefield, and directly removed theuuidandmetafields which no longer make sense here.tax.Regime: standardised naming around key definitions to always include_keysas suffix.- IT: moved fiscal code (codice fiscale) from the
org.PartyTax 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
typeusage to theidentitiesarray. - CO: moved Tax ID type definitions to
identitiesarray.
- 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-RescaleDownmethod, that helps reduce accuracy from a number if higher.num.Amount-RescaleRangemethod, ensures that the exponent is within a specific range.- Greece tax regime
tax.Combo- regime specific calculations now supported.
org.Registration: addedotherfield.
- Field descriptions of
org.Website
- PT:
at-app-idstamp for the application ID used to register a document.
num.AmountFromFloat64method helps avoid rounding issues when using floats.- PT:
at-hashstamp 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.TaxIdentityCodeGenericconstant 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, renamednameproperty tolabel, andaddrtoURL. Also addedkeyproperty. 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.
seriesproperty added to bill Correction Options to allow a series for a credit note to be added.labelproperty added toorg.Party.
- Invoice Discounts and Charges will no longer update the
baseproperty according to the document's sum. - Exempt rate in
tax.Combono 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.ExchangeRateto clearly definefromandtocurrencies (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-placethat replaces previous post code option in the supplier. Automatic normalization added. headpackage now hasGetStampmethod to find a stamp by its provider from an array.num.PercentagehasBase()method to access base amount.- MX: FuelAccountBalance complement now supports
percentas 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-chargetag will no longer have impact on tax calculations, each tax combo per line should define if taxes are exempt or not.- Renaming
mx.StampProviderSATUUIDconstant to justmx.StampSATUUID. - MX: FuelAccountBalance complement renamed tax
codetocat(Category) with explicit usage of regular tax codes to be more aligned with other usage of tax categories.
- UUID
IsNotZerowill 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.Identifiableinterface to be able to read and set UUIDs on documents.uuid.Identifythat 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.Identifyembedded 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:
MergeandContains.
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.Codewas to avoid dashes in tax IDs, but these are now normalized automatically.)- PT: moving from tax tags
azoresandmadeiratopt-regionextension 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.
numpackage now provides advanced number formatting.currencyprovides "definitions" loaded from JSON with support for formatting.- Polish (PL) correction and preceding validation.
- Polish (PL) header stamps for QR code.
numpackage refactored so thatnum.Percentageis independent fromnum.Amount.
- Minor fixes around tax regime definitions.
- invopop/yaml upgraded.
- Last version before CHANGELOG.md.