Documentation
¶
Overview ¶
Package es provides tax regime support for Spain.
Index ¶
Constants ¶
const ( TaxCategoryIRPF cbc.Code = "IRPF" TaxCategoryIGIC cbc.Code = "IGIC" TaxCategoryIPSI cbc.Code = "IPSI" )
Local tax category definitions which are not considered standard.
const ( // IRPF non-standard Rates (usually for self-employed) TaxRatePro cbc.Key = "pro" // Professional Services TaxRateProStart cbc.Key = "pro-start" // Professionals, first 2 years TaxRateModules cbc.Key = "modules" // Module system TaxRateAgriculture cbc.Key = "agriculture" // Agricultural TaxRateAgricultureSpecial cbc.Key = "agriculture-special" // Agricultural special TaxRateCapital cbc.Key = "capital" // Rental or Interest // Special tax rate surcharge extension TaxRateEquivalence cbc.Key = "eqs" )
Specific tax rate codes.
const ( // TicketBAI (Basque Country) codes used for stamps. StampProviderTBAICode cbc.Key = "tbai-code" StampProviderTBAIQR cbc.Key = "tbai-qr" )
Official stamps or codes validated by government agencies
const ( InboxKeyFACE cbc.Key = "face" // Main roles defined in FACE InboxRoleFiscal cbc.Key = "fiscal" // Fiscal / 01 InboxRoleRecipient cbc.Key = "recipient" // Receptor / 02 InboxRolePayer cbc.Key = "payer" // Pagador / 03 InboxRoleCustomer cbc.Key = "customer" // Comprador / 04 )
Inbox key and role definitions
const ( KeyAddressCode cbc.Key = "post" KeyFacturaE cbc.Key = "facturae" KeyFacturaETaxTypeCode cbc.Key = "facturae-tax-type-code" KeyTicketBAICausaExencion cbc.Key = "ticketbai-causa-exencion" KeyTicketBAIIDType cbc.Key = "ticketbai-id-type" )
Custom keys used typically in meta information.
const ( ExtKeyTBAIExemption = "es-tbai-exemption" ExtKeyTBAIProduct = "es-tbai-product" ExtKeyTBAICorrection = "es-tbai-correction" ExtKeyFacturaECorrection = "es-facturae-correction" ExtKeyFacturaEDocType = "es-facturae-doc-type" ExtKeyFacturaEInvoiceClass = "es-facturae-invoice-class" )
Spanish regime extension codes for local electronic formats.
const ( IdentityKeyPassport cbc.Key = "es-passport" IdentityKeyForeignID cbc.Key = "es-foreign-id" IdentityKeyResident cbc.Key = "es-resident" IdentityKeyOther cbc.Key = "es-other" )
The tax identity type is required for TicketBAI documents in the Basque Country.
const ( TagCopy cbc.Key = "copy" TagSummary cbc.Key = "summary" TagSimplifiedScheme cbc.Key = "simplified-scheme" TagCustomerIssued cbc.Key = "customer-issued" TagTravelAgency cbc.Key = "travel-agency" TagSecondHandGoods cbc.Key = "second-hand-goods" TagArt cbc.Key = "art" TagAntiques cbc.Key = "antiques" TagCashBasis cbc.Key = "cash-basis" TagFacturaE cbc.Key = "facturae" TagTicketBAI cbc.Key = "ticketbai" )
Universal tax tags
Variables ¶
var ( ErrTaxCodeNoMatch = errors.New("no match") ErrTaxCodeUnknownType = errors.New("unknown type") ErrTaxCodeInvalidCheck = errors.New("check letter is invalid") )
Standard simplified errors messages
var InvoiceLegalNoteExamples = map[string]*cbc.Note{ "exempt": { Key: cbc.NoteKeyLegal, Text: "Operación exenta por aplicación del artículo [indicar el articulo] de la Ley 37/1992, del 28 de diciembre, del Impuesto sobre el Valor Añadido.", }, "transport": { Key: cbc.NoteKeyLegal, Text: "Medio de transporte [describir el medio, por ejemplo automóvil turismo Seat Ibiza TDI 2.0] fecha 1ª puesta en servicio [indicar la fecha] distancias/horas recorridas [indicar la distancia o las horas, por ejemplo, 5.900 km o 48 horas].", }, }
InvoiceLegalNoteExamples defines a list of notes which may be required by Spanish law. These are expected to be used in user interfaces as examples that can be modified according to the details of the invoice. Most of this data has now been moved to scheme definitions, but some examples require a bit more effort from the user side.
Functions ¶
Types ¶
type BillInvoiceLineMeta ¶
type BillInvoiceLineMeta struct { // When true, this line should be considered as being sourced from a provider // under a "Equivalence Surcharge VAT" regime. Supplied bool `json:"supplied,omitempty" jsonschema:"title=Supplied"` // Message that explains why this line is exempt of taxes. Exempt string `json:"exempt,omitempty" jsonschema:"title=Exempt"` }
BillInvoiceLineMeta defines additional fields that may be added and used in an invoice line.
type TaxCodeType ¶
type TaxCodeType string
TaxCodeType represents the types of tax code which are issued in Spain. The same general format with variations is used for national individuals, foreigners, and legal organizations.
const ( NationalTaxCode TaxCodeType = "N" ForeignTaxCode TaxCodeType = "X" OrganizationTaxCode TaxCodeType = "B" OtherTaxCode TaxCodeType = "O" UnknownTaxCode TaxCodeType = "NA" )
Supported tax code types, from code itself.
func DetermineTaxCodeType ¶
func DetermineTaxCodeType(code cbc.Code) (TaxCodeType, error)
DetermineTaxCodeType takes a valid code and determines the type. If the code is not valid, the `UnknownTaxCode` type will be returned.