diff --git a/data/regimes/at.json b/data/regimes/at.json index 507d6468..527e0fd4 100644 --- a/data/regimes/at.json +++ b/data/regimes/at.json @@ -64,6 +64,15 @@ ] } ], + "identity_keys": [ + { + "key": "at-tax-number", + "name": { + "de": "Steuernummer", + "en": "Tax Number" + } + } + ], "scenarios": [ { "schema": "bill/invoice", diff --git a/data/regimes/fr.json b/data/regimes/fr.json index 4eb9fa60..8eac6ad1 100644 --- a/data/regimes/fr.json +++ b/data/regimes/fr.json @@ -68,6 +68,15 @@ ] } ], + "identity_keys": [ + { + "key": "fr-tax-number", + "name": { + "en": "Tax Number", + "fr": "Numéro fiscal de référence" + } + } + ], "scenarios": [ { "schema": "bill/invoice", diff --git a/data/regimes/gb.json b/data/regimes/gb.json index 898b5736..dc305fa7 100644 --- a/data/regimes/gb.json +++ b/data/regimes/gb.json @@ -68,6 +68,20 @@ ] } ], + "identity_keys": [ + { + "key": "gb-utr", + "name": { + "en": "Unique Taxpayer Reference" + } + }, + { + "key": "gb-nino", + "name": { + "en": "National Insurance Number" + } + } + ], "scenarios": [ { "schema": "bill/invoice", diff --git a/data/regimes/ie.json b/data/regimes/ie.json new file mode 100644 index 00000000..29751f87 --- /dev/null +++ b/data/regimes/ie.json @@ -0,0 +1,172 @@ +{ + "$schema": "https://gobl.org/draft-0/tax/regime-def", + "name": { + "en": "Ireland" + }, + "time_zone": "Europe/Dublin", + "country": "IE", + "currency": "EUR", + "tags": [ + { + "schema": "bill/invoice", + "list": [ + { + "key": "simplified", + "name": { + "de": "Vereinfachte Rechnung", + "en": "Simplified Invoice", + "es": "Factura Simplificada", + "it": "Fattura Semplificata" + }, + "desc": { + "de": "Wird für B2C-Transaktionen verwendet, wenn die Kundendaten nicht verfügbar sind. Bitte wenden Sie sich an die örtlichen Behörden, um die Grenzwerte zu ermitteln.", + "en": "Used for B2C transactions when the client details are not available, check with local authorities for limits.", + "es": "Usado para transacciones B2C cuando los detalles del cliente no están disponibles, consulte con las autoridades locales para los límites.", + "it": "Utilizzato per le transazioni B2C quando i dettagli del cliente non sono disponibili, controllare con le autorità locali per i limiti." + } + }, + { + "key": "reverse-charge", + "name": { + "de": "Umkehr der Steuerschuld", + "en": "Reverse Charge", + "es": "Inversión del Sujeto Pasivo", + "it": "Inversione del soggetto passivo" + } + }, + { + "key": "self-billed", + "name": { + "de": "Rechnung durch den Leistungsempfänger", + "en": "Self-billed", + "es": "Facturación por el destinatario", + "it": "Autofattura" + } + }, + { + "key": "customer-rates", + "name": { + "de": "Kundensätze", + "en": "Customer rates", + "es": "Tarifas aplicables al destinatario", + "it": "Aliquote applicabili al destinatario" + } + }, + { + "key": "partial", + "name": { + "de": "Teilweise", + "en": "Partial", + "es": "Parcial", + "it": "Parziale" + } + } + ] + } + ], + "scenarios": [ + { + "schema": "bill/invoice", + "list": [ + { + "tags": [ + "reverse-charge" + ], + "note": { + "key": "legal", + "src": "reverse-charge", + "text": "Reverse charge: Customer to account for VAT to the relevant tax authority." + } + } + ] + } + ], + "corrections": [ + { + "schema": "bill/invoice", + "types": [ + "credit-note" + ] + } + ], + "categories": [ + { + "code": "VAT", + "name": { + "en": "VAT" + }, + "title": { + "en": "Value Added Tax" + }, + "rates": [ + { + "key": "zero", + "name": { + "en": "Zero Rate" + }, + "values": [ + { + "percent": "0.0%" + } + ] + }, + { + "key": "standard", + "name": { + "en": "Standard Rate" + }, + "values": [ + { + "since": "2021-02-28", + "percent": "23%" + }, + { + "since": "2020-09-01", + "percent": "21%" + }, + { + "since": "2012-01-01", + "percent": "23%" + } + ] + }, + { + "key": "reduced", + "name": { + "en": "Reduced Rate" + }, + "values": [ + { + "since": "2003-01-01", + "percent": "13.5%" + } + ] + }, + { + "key": "super-reduced", + "name": { + "en": "Reduced Rate" + }, + "values": [ + { + "since": "2011-07-01", + "percent": "9%" + } + ] + }, + { + "key": "special", + "name": { + "en": "Reduced Rate" + }, + "values": [ + { + "since": "2005-01-01", + "percent": "4.8%" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/data/regimes/pl.json b/data/regimes/pl.json index 4b9ff349..5e3212e5 100644 --- a/data/regimes/pl.json +++ b/data/regimes/pl.json @@ -165,6 +165,15 @@ ] } ], + "identity_keys": [ + { + "key": "pl-tax-number", + "name": { + "en": "Tax Number", + "pl": "Numer podatkowy" + } + } + ], "payment_means_keys": [ { "key": "cash", diff --git a/data/schemas/bill/invoice.json b/data/schemas/bill/invoice.json index 50122c1e..76d8b62a 100644 --- a/data/schemas/bill/invoice.json +++ b/data/schemas/bill/invoice.json @@ -217,6 +217,10 @@ "const": "GB", "title": "United Kingdom" }, + { + "const": "IE", + "title": "Ireland" + }, { "const": "IT", "title": "Italy" diff --git a/regimes/at/identitites.go b/regimes/at/identitites.go index f3440966..205d78ac 100644 --- a/regimes/at/identitites.go +++ b/regimes/at/identitites.go @@ -19,6 +19,8 @@ const ( IdentityKeyTaxNumber cbc.Key = "at-tax-number" ) +// https://www.oecd.org/content/dam/oecd/en/topics/policy-issue-focus/aeoi/austria-tin.pdf + var badCharsRegexPattern = regexp.MustCompile(`[^\d]`) var identityKeyDefinitions = []*cbc.KeyDefinition{ @@ -46,12 +48,12 @@ func validateTaxNumber(id *org.Identity) error { } return validation.ValidateStruct(id, - validation.Field(&id.Code, validation.By(validateTaxIdCode)), + validation.Field(&id.Code, validation.By(validateTaxIDCode)), ) } // validateAustrianTaxIdCode validates the normalized tax ID code. -func validateTaxIdCode(value interface{}) error { +func validateTaxIDCode(value interface{}) error { code, ok := value.(cbc.Code) if !ok || code == "" { return nil diff --git a/regimes/fr/identities.go b/regimes/fr/identities.go index 0ec43ebe..c685677a 100644 --- a/regimes/fr/identities.go +++ b/regimes/fr/identities.go @@ -16,6 +16,8 @@ const ( IdentityKeyTaxNumber cbc.Key = "fr-tax-number" ) +// https://www.oecd.org/content/dam/oecd/en/topics/policy-issue-focus/aeoi/france-tin.pdf + var badCharsRegexPattern = regexp.MustCompile(`[^\d]`) var identityKeyDefinitions = []*cbc.KeyDefinition{ @@ -35,12 +37,12 @@ func validateTaxNumber(id *org.Identity) error { } return validation.ValidateStruct(id, - validation.Field(&id.Code, validation.By(validateTaxIdCode)), + validation.Field(&id.Code, validation.By(validateTaxIDCode)), ) } -// validateTaxIdCode validates the normalized tax ID code. -func validateTaxIdCode(value interface{}) error { +// validateTaxIDCode validates the normalized tax ID code. +func validateTaxIDCode(value interface{}) error { code, ok := value.(cbc.Code) if !ok || code == "" { return nil diff --git a/regimes/gb/identities.go b/regimes/gb/identities.go index ec13ce3f..cffec6e5 100644 --- a/regimes/gb/identities.go +++ b/regimes/gb/identities.go @@ -23,6 +23,9 @@ var badCharsRegexPattern = regexp.MustCompile(`[^\d]`) var ninoPattern = `^[A-CEGHJ-PR-TW-Z]{2}\d{6}[A-D]$` var utrPattern = `^[1-9]\d{9}$` +// https://design.tax.service.gov.uk/hmrc-design-patterns/unique-taxpayer-reference/ +// https://www.gov.uk/hmrc-internal-manuals/national-insurance-manual/nim39110 + var identityKeyDefinitions = []*cbc.KeyDefinition{ { Key: IdentityUTR, diff --git a/regimes/ie/ie.go b/regimes/ie/ie.go index cdc42e84..db63f50b 100644 --- a/regimes/ie/ie.go +++ b/regimes/ie/ie.go @@ -1,4 +1,4 @@ -// Package gb provides the United Kingdom tax regime. +// Package ie provides the United Kingdom tax regime. package ie import ( diff --git a/regimes/ie/tax_identity.go b/regimes/ie/tax_identity.go index ab3c0ded..5838bef3 100644 --- a/regimes/ie/tax_identity.go +++ b/regimes/ie/tax_identity.go @@ -15,6 +15,8 @@ var ( taxCodeRegexp = `^(\d{7}[A-Z]{1,2}|\d{1}[A-Z]{1}\d{5}[A-Z]{1})$` ) +// https://euipo.europa.eu/tunnel-web/secure/webdav/guest/document_library/Documents/COSME/VAT%20numbers%20EU.pdf + // validateTaxIdentity checks to ensure the NIT code looks okay. func validateTaxIdentity(tID *tax.Identity) error { return validation.ValidateStruct(tID, diff --git a/regimes/pl/identities.go b/regimes/pl/identities.go index fbbbce92..cd3068e5 100644 --- a/regimes/pl/identities.go +++ b/regimes/pl/identities.go @@ -34,11 +34,11 @@ func validateTaxNumber(id *org.Identity) error { } return validation.ValidateStruct(id, - validation.Field(&id.Code, validation.By(validateTaxIdCode)), + validation.Field(&id.Code, validation.By(validateTaxIDCode)), ) } -func validateTaxIdCode(value interface{}) error { +func validateTaxIDCode(value interface{}) error { code, ok := value.(cbc.Code) if !ok || code == "" { return nil