From 7e884ddf3bd9bef9a5cdaea2fd27ccfa48676ea0 Mon Sep 17 00:00:00 2001 From: Sam Lown Date: Thu, 18 Apr 2024 08:55:13 +0000 Subject: [PATCH] Release v0.72.0 --- CHANGELOG.md | 6 ++- data/regimes/pt.json | 89 ++++++++++++++++++++---------------- data/schemas/cbc/code.json | 2 +- data/schemas/tax/regime.json | 5 ++ version.go | 2 +- 5 files changed, 61 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b71e0470..76138ebe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,9 @@ All notable changes to GOBL will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). See also the [GOBL versions](https://docs.gobl.org/overview/versions) documentation site for more details. -## [Unreleased] - yyyy-mm-dd +## [v0.72.0] - 2024-04-18 -Pending release notes... +Refactoring region handling for Portugal VAT and now supporting `-` in `cbc.Code`. ### Added @@ -21,6 +21,8 @@ Pending release notes... ### Fixed +- none + ## [v0.71.0] - 2024-04-08 New number formatting support! Expect some possible breaking SDK changes with the `num` packages. No significant schema changes. diff --git a/data/regimes/pt.json b/data/regimes/pt.json index 57f64a35..0a14dcc7 100644 --- a/data/regimes/pt.json +++ b/data/regimes/pt.json @@ -65,31 +65,39 @@ "en": "Invoice-receipt", "pt": "Fatura-recibo" } - }, + } + ], + "extensions": [ { - "key": "azores", + "key": "pt-region", "name": { - "en": "Azores", - "pt": "Açores" + "en": "Region Code", + "pt": "Código da Região" }, - "desc": { - "en": "Tag for use when the invoice is issued in the Azores region with special local rates.", - "pt": "Tag para uso quando a fatura é emitida na região dos Açores com taxas locais especiais." - } + "codes": [ + { + "code": "PT", + "name": { + "en": "Mainland Portugal", + "pt": "Portugal Continental" + } + }, + { + "code": "PT-AC", + "name": { + "en": "Azores", + "pt": "Açores" + } + }, + { + "code": "PT-MA", + "name": { + "en": "Madeira", + "pt": "Madeira" + } + } + ] }, - { - "key": "madeira", - "name": { - "en": "Madeira", - "pt": "Madeira" - }, - "desc": { - "en": "Tag for use when the invoice is issued in the Madeira region with special local rates.", - "pt": "Tag para uso quando a fatura é emitida na região da Madeira com taxas locais especiais." - } - } - ], - "extensions": [ { "key": "pt-exemption-code", "name": { @@ -381,16 +389,16 @@ }, "values": [ { - "tags": [ - "azores" - ], + "ext": { + "pt-region": "PT-AC" + }, "since": "2011-01-01", "percent": "16.0%" }, { - "tags": [ - "madeira" - ], + "ext": { + "pt-region": "PT-MA" + }, "since": "2011-01-01", "percent": "22.0%" }, @@ -411,16 +419,16 @@ }, "values": [ { - "tags": [ - "azores" - ], + "ext": { + "pt-region": "PT-AC" + }, "since": "2011-01-01", "percent": "9.0%" }, { - "tags": [ - "madeira" - ], + "ext": { + "pt-region": "PT-MA" + }, "since": "2011-01-01", "percent": "12.0%" }, @@ -441,16 +449,16 @@ }, "values": [ { - "tags": [ - "azores" - ], + "ext": { + "pt-region": "PT-AC" + }, "since": "2011-01-01", "percent": "4.0%" }, { - "tags": [ - "madeira" - ], + "ext": { + "pt-region": "PT-MA" + }, "since": "2011-01-01", "percent": "5.0%" }, @@ -477,6 +485,9 @@ "at-tax-code": "ISE" } } + ], + "extensions": [ + "pt-region" ] } ] diff --git a/data/schemas/cbc/code.json b/data/schemas/cbc/code.json index 1ec51271..fe1c3076 100644 --- a/data/schemas/cbc/code.json +++ b/data/schemas/cbc/code.json @@ -7,7 +7,7 @@ "type": "string", "maxLength": 24, "minLength": 1, - "pattern": "^[A-Z0-9]+(\\.?[A-Z0-9]+)*$", + "pattern": "^[A-Z0-9]+([\\.\\-]?[A-Z0-9]+)*$", "title": "Code", "description": "Alphanumerical text identifier with upper-case letters, no whitespace, nor symbols." } diff --git a/data/schemas/tax/regime.json b/data/schemas/tax/regime.json index 870af8a3..bd3856a0 100644 --- a/data/schemas/tax/regime.json +++ b/data/schemas/tax/regime.json @@ -186,6 +186,11 @@ "title": "Tags", "description": "Only apply this rate if one of the tags is present in the invoice." }, + "ext": { + "$ref": "https://gobl.org/draft-0/tax/extensions", + "title": "Extensions", + "description": "Ext map of keys that can be used to filter to determine if the rate applies." + }, "since": { "$ref": "https://gobl.org/draft-0/cal/date", "title": "Since", diff --git a/version.go b/version.go index 27289b9c..e22ba74b 100644 --- a/version.go +++ b/version.go @@ -8,7 +8,7 @@ import ( type Version string // VERSION is the current version of the GOBL library. -const VERSION Version = "v0.71.0" +const VERSION Version = "v0.72.0" // Semver parses and returns semver func (v Version) Semver() *semver.Version {