From 7df4926e4ca08f41c7326f8e6194e0de2d7b3c3b Mon Sep 17 00:00:00 2001 From: Sam Lown Date: Mon, 7 Oct 2024 10:03:44 +0000 Subject: [PATCH] Release 0.201.0 --- CHANGELOG.md | 4 +- data/addons/co-dian-v2.json | 238 ++++++++++++++++++++++++++++++++ data/regimes/co.json | 221 ----------------------------- data/schemas/bill/invoice.json | 4 + data/schemas/tax/addon-def.json | 8 ++ version.go | 2 +- 6 files changed, 253 insertions(+), 224 deletions(-) create mode 100644 data/addons/co-dian-v2.json diff --git a/CHANGELOG.md b/CHANGELOG.md index a9099428..04e8a4be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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] +## [v0.201.0] ### Fixed @@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p - `es`: moving invoice customer validation to the facturae and tbai addons. - `it-sdi-v1`: fixing validation issue for payment terms with no due dates. -### Updated +### Changed - `pt`: reduced rate category for PT-MA was updated to reflect latest value of 4% - `co-dian-v2`: moved from `co` tax regime into own addon. diff --git a/data/addons/co-dian-v2.json b/data/addons/co-dian-v2.json new file mode 100644 index 00000000..a5db931e --- /dev/null +++ b/data/addons/co-dian-v2.json @@ -0,0 +1,238 @@ +{ + "$schema": "https://gobl.org/draft-0/tax/addon-def", + "key": "co-dian-v2", + "name": { + "en": "Colombia DIAN UBL 2.X" + }, + "description": { + "en": "Extensions to support the Colombian DIAN (Dirección de Impuestos y Aduanas Nacionales)\nspecifications for electronic invoicing based on UBL 2.1." + }, + "extensions": [ + { + "key": "co-dian-municipality", + "name": { + "en": "DIAN Municipality Code", + "es": "Código de municipio DIAN" + }, + "desc": { + "en": "The municipality code as defined by the DIAN.\n\nFor further details on the list of possible codes, see:\n\n * https://www.dian.gov.co/atencionciudadano/formulariosinstructivos/Formularios/2007/Codigos_municipios_2007.pdf\n * https://github.com/ALAxHxC/MunicipiosDane" + }, + "pattern": "^\\d{5}$" + }, + { + "key": "co-dian-credit-code", + "name": { + "en": "Credit Code", + "es": "Código de Crédito" + }, + "desc": { + "en": "DIAN correction code for credit notes", + "es": "Código de corrección DIAN para notas de crédito" + }, + "values": [ + { + "value": "1", + "name": { + "en": "Partial refund", + "es": "Devolución parcial" + }, + "desc": { + "en": "Partial refund of part of the goods or services.", + "es": "Devolución de parte de los bienes; no aceptación de partes del servicio." + } + }, + { + "value": "2", + "name": { + "en": "Revoked", + "es": "Anulación" + }, + "desc": { + "en": "Previous document has been completely cancelled.", + "es": "Anulación de la factura anterior." + } + }, + { + "value": "3", + "name": { + "en": "Discount", + "es": "Descuento" + }, + "desc": { + "en": "Partial or total discount.", + "es": "Rebaja o descuento parcial o total." + } + }, + { + "value": "4", + "name": { + "en": "Adjustment", + "es": "Ajuste" + }, + "desc": { + "en": "Price adjustment.", + "es": "Ajuste de precio." + } + }, + { + "value": "5", + "name": { + "en": "Other", + "es": "Otros" + } + } + ] + }, + { + "key": "co-dian-debit-code", + "name": { + "en": "Debit Code", + "es": "Código de Débito" + }, + "desc": { + "en": "DIAN correction code for debit notes", + "es": "Código de corrección DIAN para notas de débito" + }, + "values": [ + { + "value": "1", + "name": { + "en": "Interest", + "es": "Intereses" + } + }, + { + "value": "2", + "name": { + "en": "Pending charges", + "es": "Gastos por cobrar" + } + }, + { + "value": "3", + "name": { + "en": "Change in value", + "es": "Cambio del valor" + } + }, + { + "value": "4", + "name": { + "en": "Other", + "es": "Otros" + } + } + ] + } + ], + "scenarios": null, + "identities": [ + { + "key": "co-civil-register", + "name": { + "en": "Civil Registry", + "es": "Registro Civil" + }, + "map": { + "dian-company-id": "11" + } + }, + { + "key": "co-id-card", + "name": { + "en": "Identity Card", + "es": "Tarjeta de Identidad" + }, + "map": { + "dian-company-id": "12" + } + }, + { + "key": "co-citizen-id", + "name": { + "en": "Citizen Identity Card", + "es": "Cédula de ciudadanía" + }, + "map": { + "dian-company-id": "13" + } + }, + { + "key": "co-foreigner-id-card", + "name": { + "en": "Foreigner Identity Card", + "es": "Tarjeta de Extranjería" + }, + "map": { + "dian-company-id": "21" + } + }, + { + "key": "co-foreigner-id", + "name": { + "en": "Foreigner Citizen Identity", + "es": "Cédula de extranjería" + }, + "map": { + "dian-company-id": "22" + } + }, + { + "key": "co-passport", + "name": { + "en": "Passport", + "es": "Pasaporte" + }, + "map": { + "dian-company-id": "41" + } + }, + { + "key": "co-foreign-id", + "name": { + "en": "Foreign Document", + "es": "Documento de identificación extranjero" + }, + "map": { + "dian-company-id": "42" + } + }, + { + "key": "co-pep", + "name": { + "en": "PEP - Special Permit to Stay", + "es": "PEP - Permiso Especial de Permanencia" + }, + "map": { + "dian-company-id": "47" + } + }, + { + "key": "co-nuip", + "name": { + "en": "NUIP - National Unique Personal Identification Number", + "es": "NUIP - Número Único de Identificación Personal" + }, + "map": { + "dian-company-id": "91" + } + } + ], + "corrections": [ + { + "schema": "bill/invoice", + "types": [ + "credit-note", + "debit-note" + ], + "extensions": [ + "co-dian-credit-code", + "co-dian-debit-code" + ], + "reason_required": true, + "stamps": [ + "dian-cude" + ] + } + ] +} \ No newline at end of file diff --git a/data/regimes/co.json b/data/regimes/co.json index 6ceee009..21271342 100644 --- a/data/regimes/co.json +++ b/data/regimes/co.json @@ -4,9 +4,6 @@ "en": "Colombia", "es": "Colombia" }, - "description": { - "en": "The Colombian tax regime is based on the DIAN (Dirección de Impuestos y Aduanas Nacionales)\nspecifications for electronic invoicing." - }, "time_zone": "America/Bogota", "country": "CO", "currency": "COP", @@ -68,230 +65,12 @@ ] } ], - "extensions": [ - { - "key": "co-dian-municipality", - "name": { - "en": "DIAN Municipality Code", - "es": "Código de municipio DIAN" - }, - "desc": { - "en": "The municipality code as defined by the DIAN.\n\nFor further details on the list of possible codes, see:\n\n * https://www.dian.gov.co/atencionciudadano/formulariosinstructivos/Formularios/2007/Codigos_municipios_2007.pdf\n * https://github.com/ALAxHxC/MunicipiosDane" - }, - "pattern": "^\\d{5}$" - }, - { - "key": "co-dian-credit-code", - "name": { - "en": "Credit Code", - "es": "Código de Crédito" - }, - "desc": { - "en": "DIAN correction code for credit notes", - "es": "Código de corrección DIAN para notas de crédito" - }, - "values": [ - { - "value": "1", - "name": { - "en": "Partial refund", - "es": "Devolución parcial" - }, - "desc": { - "en": "Partial refund of part of the goods or services.", - "es": "Devolución de parte de los bienes; no aceptación de partes del servicio." - } - }, - { - "value": "2", - "name": { - "en": "Revoked", - "es": "Anulación" - }, - "desc": { - "en": "Previous document has been completely cancelled.", - "es": "Anulación de la factura anterior." - } - }, - { - "value": "3", - "name": { - "en": "Discount", - "es": "Descuento" - }, - "desc": { - "en": "Partial or total discount.", - "es": "Rebaja o descuento parcial o total." - } - }, - { - "value": "4", - "name": { - "en": "Adjustment", - "es": "Ajuste" - }, - "desc": { - "en": "Price adjustment.", - "es": "Ajuste de precio." - } - }, - { - "value": "5", - "name": { - "en": "Other", - "es": "Otros" - } - } - ] - }, - { - "key": "co-dian-debit-code", - "name": { - "en": "Debit Code", - "es": "Código de Débito" - }, - "desc": { - "en": "DIAN correction code for debit notes", - "es": "Código de corrección DIAN para notas de débito" - }, - "values": [ - { - "value": "1", - "name": { - "en": "Interest", - "es": "Intereses" - } - }, - { - "value": "2", - "name": { - "en": "Pending charges", - "es": "Gastos por cobrar" - } - }, - { - "value": "3", - "name": { - "en": "Change in value", - "es": "Cambio del valor" - } - }, - { - "value": "4", - "name": { - "en": "Other", - "es": "Otros" - } - } - ] - } - ], - "identity_keys": [ - { - "key": "co-civil-register", - "name": { - "en": "Civil Registry", - "es": "Registro Civil" - }, - "map": { - "dian-company-id": "11" - } - }, - { - "key": "co-id-card", - "name": { - "en": "Identity Card", - "es": "Tarjeta de Identidad" - }, - "map": { - "dian-company-id": "12" - } - }, - { - "key": "co-citizen-id", - "name": { - "en": "Citizen Identity Card", - "es": "Cédula de ciudadanía" - }, - "map": { - "dian-company-id": "13" - } - }, - { - "key": "co-foreigner-id-card", - "name": { - "en": "Foreigner Identity Card", - "es": "Tarjeta de Extranjería" - }, - "map": { - "dian-company-id": "21" - } - }, - { - "key": "co-foreigner-id", - "name": { - "en": "Foreigner Citizen Identity", - "es": "Cédula de extranjería" - }, - "map": { - "dian-company-id": "22" - } - }, - { - "key": "co-passport", - "name": { - "en": "Passport", - "es": "Pasaporte" - }, - "map": { - "dian-company-id": "41" - } - }, - { - "key": "co-foreign-id", - "name": { - "en": "Foreign Document", - "es": "Documento de identificación extranjero" - }, - "map": { - "dian-company-id": "42" - } - }, - { - "key": "co-pep", - "name": { - "en": "PEP - Special Permit to Stay", - "es": "PEP - Permiso Especial de Permanencia" - }, - "map": { - "dian-company-id": "47" - } - }, - { - "key": "co-nuip", - "name": { - "en": "NUIP - National Unique Personal Identification Number", - "es": "NUIP - Número Único de Identificación Personal" - }, - "map": { - "dian-company-id": "91" - } - } - ], "corrections": [ { "schema": "bill/invoice", "types": [ "credit-note", "debit-note" - ], - "extensions": [ - "co-dian-credit-code", - "co-dian-debit-code" - ], - "reason_required": true, - "stamps": [ - "dian-cude" ] } ], diff --git a/data/schemas/bill/invoice.json b/data/schemas/bill/invoice.json index 90e07315..53dbb071 100644 --- a/data/schemas/bill/invoice.json +++ b/data/schemas/bill/invoice.json @@ -244,6 +244,10 @@ "items": { "$ref": "https://gobl.org/draft-0/cbc/key", "oneOf": [ + { + "const": "co-dian-v2", + "title": "Colombia DIAN UBL 2.X" + }, { "const": "es-facturae-v3", "title": "Spain FacturaE" diff --git a/data/schemas/tax/addon-def.json b/data/schemas/tax/addon-def.json index 32cd32b2..4d133765 100644 --- a/data/schemas/tax/addon-def.json +++ b/data/schemas/tax/addon-def.json @@ -44,6 +44,14 @@ "title": "Scenarios", "description": "Scenarios are applied to documents after normalization and before\nvalidation to ensure that form specific extensions have been added\nto the document." }, + "identities": { + "items": { + "$ref": "https://gobl.org/draft-0/cbc/key-definition" + }, + "type": "array", + "title": "Identities", + "description": "Identities that are specific for the add-on and may be validated against or\nused during conversion processes." + }, "inboxes": { "items": { "$ref": "https://gobl.org/draft-0/cbc/key-definition" diff --git a/version.go b/version.go index 46445b41..385544f9 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.200.1" +const VERSION Version = "v0.201.0" // Semver parses and returns semver func (v Version) Semver() *semver.Version {