pt

package
v0.63.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2023 License: Apache-2.0 Imports: 15 Imported by: 1

README

🇵🇹 GOBL Portugal Tax Regime

Portugal doesn't have an e-invoicing format per se. Tax information is reported electronically to the AT (Autoridade Tributária e Aduaneira) either periodically in batches via a SAF-T (PT) report or individually in real time via a web service.

Example PT GOBL files can be found in the examples (YAML uncalculated documents) and examples/out (JSON calculated envelopes) subdirectories.

Public Documentation

Local Codes

InvoiceType (Tipo de documento)

AT's InvoiceType (Tipo de documento) specifies the type of a Portuguese tax document. The following table lists all the supported invoice types and how GOBL will map them with a combination of invoice type and tax tags:

Code Name GOBL Type GOBL Tax Tag
FT Fatura, emitida nos termos do artigo 36.o do Código do IVA standard
FS Fatura simplificada, emitida nos termos do artigo 40.o do Código do IVA standard simplified
FR Fatura-recibo standard invoice-receipt
ND Nota de débito credit-note
NC Nota de crédito debit-note
TaxCountryRegion (País ou região do imposto)

AT's TaxCountryRegion (País ou região do imposto) specifies the region of taxation (Portugal mainland, Açores or Madeira) in a Portuguese invoice. GOBL will map them using the supplier's tax identity zone (ISO 3166-2:PT codes) as per the following table:

Code Name GOBL Tax Identity Zone
PT Aveiro 01
PT Beja 02
PT Braga 03
PT Bragança 04
PT Castelo Branco 05
PT Coimbra 06
PT Évora 07
PT Faro 08
PT Guarda 09
PT Leiria 10
PT Lisboa 11
PT Portalegre 12
PT Porto 13
PT Santarém 14
PT Setúbal 15
PT Viana do Castelo 16
PT Vila Real 17
PT Viseu 18
PT-AC Região Autónoma dos Açores 20
PT-MA Região Autónoma da Madeira 30
VAT Tax Rates

The AT TaxCode (Código do imposto) is required for invoice items that apply VAT. GOBL helps determine this code using the rate field, which in Portuguese invoices is required. The following table lists the supported tax codes and how GOBL will map them:

Code  Name GOBL Tax Rate
NOR Tipo Geral standard
INT Taxa Intermédia intermediate
RED Taxa Reduzida reduced
ISE Isenta exempt + extension code (see below)

AT's TaxExemptionCode (Código do motivo de isenção de imposto) is a code that specifies the reason the VAT tax is exempt in a Portuguese invoice. When the exempt tag is used, one of the following must be defined in the ext map's pt-exemption-code property:

Code Description
M01 Artigo 16.°, n.° 6 do CIVA
M02 Artigo 6.° do Decreto-Lei n.° 198/90, de 19 de junho
M04 Isento artigo 13.° do CIVA
M05 Isento artigo 14.° do CIVA
M06 Isento artigo 15.° do CIVA
M07 Isento artigo 9.° do CIVA
M09 IVA - não confere direito a dedução / Artigo 62.° alínea b) do CIVA
M10 IVA - regime de isenção / Artigo 57.° do CIVA
M11 Regime particular do tabaco / Decreto-Lei n.° 346/85, de 23 de agosto
M12 Regime da margem de lucro - Agências de viagens / Decreto-Lei n.° 221/85, de 3 de julho
M13 Regime da margem de lucro - Bens em segunda mão / Decreto-Lei n.° 199/96, de 18 de outubro
M14 Regime da margem de lucro - Objetos de arte / Decreto-Lei n.° 199/96, de 18 de outubro
M15 Regime da margem de lucro - Objetos de coleção e antiguidades / Decreto-Lei n.° 199/96, de 18 de outubro
M16 Isento artigo 14.° do RITI
M19 Outras isenções - Isenções temporárias determinadas em diploma próprio
M20 IVA - regime forfetário / Artigo 59.°-D n.°2 do CIVA
M21 IVA - não confere direito à dedução (ou expressão similar) - Artigo 72.° n.° 4 do CIVA
M25 Mercadorias à consignação - Artigo 38.° n.° 1 alínea a) do CIVA
M30 IVA - autoliquidação / Artigo 2.° n.° 1 alínea i) do CIVA
M31 IVA - autoliquidação / Artigo 2.° n.° 1 alínea j) do CIVA
M32 IVA - autoliquidação / Artigo 2.° n.° 1 alínea I) do CIVA
M33 IVA - autoliquidação / Artigo 2.° n.° 1 alínea m) do CIVA
M40 IVA - autoliquidação / Artigo 6.° n.° 6 alínea a) do CIVA, a contrário
M41 IVA - autoliquidação / Artigo 8.° n.° 3 do RITI
M42 IVA - autoliquidação / Decreto-Lei n.° 21/2007, de 29 de janeiro
M43 IVA - autoliquidação / Decreto-Lei n.° 362/99, de 16 de setembro
M99 Não sujeito ou não tributado

For example, you could define an invoice line exempt of tax as follows:

{
  "$schema": "https://gobl.org/draft-0/bill/invoice",
  // [...]
  "lines": [
    {
      // [...]
      "item": {
        "name": "Some service exempt of tax",
        "price": "25.00"
      },
      "tax": [
        {
            "cat": "VAT",
            "rate": "exempt",
            "ext": {
              "pt-exemption-code": "M19"
            }
        }
      ]
    }
  ]
}

Documentation

Overview

Package pt provides models for dealing with the Portuguese tax regime.

Index

Constants

View Source
const (
	TaxRateExempt        cbc.Key = "exempt"
	TaxRateOutlay        cbc.Key = "outlay"
	TaxRateIntrastate    cbc.Key = "intrastate-export"
	TaxRateImports       cbc.Key = "imports"
	TaxRateExports       cbc.Key = "exports"
	TaxRateSuspension    cbc.Key = "suspension-scheme"
	TaxRateInternalOps   cbc.Key = "internal-operations"
	TaxRateSmallRetail   cbc.Key = "small-retail-scheme"
	TaxRateExemptScheme  cbc.Key = "exempt-scheme"
	TaxRateTobacco       cbc.Key = "tobacco-scheme"
	TaxRateMargin        cbc.Key = "margin-scheme"
	TaxRateTravel        cbc.Key = "travel"
	TaxRateSecondHand    cbc.Key = "second-hand"
	TaxRateArt           cbc.Key = "art"
	TaxRateAntiques      cbc.Key = "antiques"
	TaxRateTransmission  cbc.Key = "goods-transmission"
	TaxRateOther         cbc.Key = "other"
	TaxRateFlatRate      cbc.Key = "flat-rate-scheme"
	TaxRateNonDeductible cbc.Key = "non-deductible"
	TaxRateConsignment   cbc.Key = "consignment-goods"
	TaxRateReverseCharge cbc.Key = "reverse-charge"
	TaxRateWaste         cbc.Key = "waste"
	TaxRateCivilEng      cbc.Key = "civil-eng"
	TaxRateGreenhouse    cbc.Key = "greenhouse"
	TaxRateWoods         cbc.Key = "woods"
	TaxRateB2B           cbc.Key = "b2b"
	TaxRateIntraEU       cbc.Key = "intraeu"
	TaxRateRealEstate    cbc.Key = "real-estate"
	TaxRateGold          cbc.Key = "gold"
	TaxRateNonTaxable    cbc.Key = "non-taxable"
)

Tax rate exemption tags

View Source
const (
	KeyATTaxCountryRegion cbc.Key = "at-tax-country-region"
	KeyATTaxCode          cbc.Key = "at-tax-code"
	KeyATTaxExemptionCode cbc.Key = "at-tax-exemption-code"
	KeyATInvoiceType      cbc.Key = "at-invoice-type"
)

Custom keys used typically in meta information

View Source
const (
	ZoneAveiro         l10n.Code = "01"
	ZoneBeja           l10n.Code = "02"
	ZoneBraga          l10n.Code = "03"
	ZoneBraganca       l10n.Code = "04"
	ZoneCasteloBranco  l10n.Code = "05"
	ZoneCoimbra        l10n.Code = "06"
	ZoneEvora          l10n.Code = "07"
	ZoneFaro           l10n.Code = "08"
	ZoneGuarda         l10n.Code = "09"
	ZoneLeiria         l10n.Code = "10"
	ZoneLisboa         l10n.Code = "11"
	ZonePortalegre     l10n.Code = "12"
	ZonePorto          l10n.Code = "13"
	ZoneSantarem       l10n.Code = "14"
	ZoneSetubal        l10n.Code = "15"
	ZoneVianaDoCastelo l10n.Code = "16"
	ZoneVilaReal       l10n.Code = "17"
	ZoneViseu          l10n.Code = "18"
	ZoneAzores         l10n.Code = "20" // Autonomous Region
	ZoneMadeira        l10n.Code = "30" // Autonomous Region
)

Zone code definitions for Portugal based on districts and autonomous regions based on ISO 3166-2:PT.

View Source
const (
	StampProviderATATCUD cbc.Key = "at-atcud"
	StampProviderATQR    cbc.Key = "at-qr"
)

AT official codes to include in stamps.

View Source
const (
	TaxCodeStandard     cbc.Code = "NOR"
	TaxCodeIntermediate cbc.Code = "INT"
	TaxCodeReduced      cbc.Code = "RED"
	TaxCodeExempt       cbc.Code = "ISE"
	TaxCodeOther        cbc.Code = "OUT"
)

AT Tax Map

View Source
const (
	TaxCountryRegionPT = "PT"
	TaxCountryRegionAC = "PT-AC"
	TaxCountryRegionMA = "PT-MA"
)

AT Tax Country Regions

View Source
const (
	ExtKeyExemptionCode = "pt-exemption-code"
)

Special codes to be used inside rates.

View Source
const (
	TagInvoiceReceipt cbc.Key = "invoice-receipt"
)

Invoice type tags

Variables

This section is empty.

Functions

func Calculate

func Calculate(doc interface{}) error

Calculate will attempt to clean the object passed to it.

func New

func New() *tax.Regime

New instantiates a new Portugal regime for the given zone.

func Validate

func Validate(doc interface{}) error

Validate checks the document type and determines if it can be validated.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL