Documentation
¶
Overview ¶
Package fatturapa implements the conversion from GOBL to FatturaPA XML.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶ added in v0.33.0
type Address struct {
Street string `xml:"Indirizzo"` // Street
Number string `xml:"NumeroCivico,omitempty"` // Number
Code string `xml:"CAP"` // Post Code
Locality string `xml:"Comune"` // Locality
Region string `xml:"Provincia,omitempty"` // Region
Country string `xml:"Nazione"` // Country Code
}
Address from IndirizzoType
type Config ¶
type Config struct {
Certificate *xmldsig.Certificate
WithTimestamp bool
Transmitter *Transmitter
}
Config contains the configuration for the Converter
type Contact ¶ added in v0.33.0
type Contact struct {
Telephone string `xml:"Telefono,omitempty"`
Email string `xml:"Email,omitempty"`
}
Contact describes how the party can be contacted
type Converter ¶
type Converter struct {
Config *Config
}
Converter contains information related to the entity using this library to submit invoices to SDI.
func NewConverter ¶
NewConverter returns a new GOBL to XML Converter with the given options
type Customer ¶ added in v0.33.0
Customer contains the details about who the invoice is addressed to.
type Document ¶
type Document struct {
XMLName xml.Name `xml:"p:FatturaElettronica"`
FPANamespace string `xml:"xmlns:p,attr"`
DSigNamespace string `xml:"xmlns:ds,attr"`
XSINamespace string `xml:"xmlns:xsi,attr"`
Versione string `xml:"versione,attr"`
SchemaLocation string `xml:"xsi:schemaLocation,attr"`
FatturaElettronicaHeader *fatturaElettronicaHeader
FatturaElettronicaBody []*fatturaElettronicaBody
Signature *xmldsig.Signature `xml:"ds:Signature,omitempty"`
// contains filtered or unexported fields
}
Document is a pseudo-model for containing the XML document being created.
type Identity ¶ added in v0.33.0
type Identity struct {
TaxID *TaxID `xml:"IdFiscaleIVA,omitempty"` // nolint:revive
FiscalCode string `xml:"CodiceFiscale,omitempty"`
Profile *Profile `xml:"Anagrafica"`
// FiscaleRegime identifies the tax system to be applied
// Has the form RFXX where XX is numeric; required only for the supplier
FiscalRegime string `xml:"RegimeFiscale,omitempty"`
}
Identity (DatiAnagrafici) contains information related to an individual or company
type Option ¶
type Option func(*Converter)
Option is a function that can be passed to NewConverter to configure it
func WithCertificate ¶
func WithCertificate(cert *xmldsig.Certificate) Option
WithCertificate will ensure the XML document is signed with the given certificate
func WithTimestamp ¶
func WithTimestamp() Option
WithTimestamp will ensure the XML document is timestamped
func WithTransmitterData ¶
func WithTransmitterData(transmitter *Transmitter) Option
WithTransmitterData will ensure the XML document contains the given transmitter data
type PermanentEstablishment ¶ added in v0.33.0
type PermanentEstablishment struct {
Street string `xml:"Indirizzo"`
Number string `xml:"NumeroCivico,omitempty"`
PostCode string `xml:"CAP"`
Locality string `xml:"Comune"`
Region string `xml:"Provincia,omitempty"` // Province initials (2 characters) for IT country
Country string `xml:"Nazione"` // Country code ISO alpha-2
}
PermanentEstablishment (StabileOrganizzazione) to be filled in if the seller/provider is not resident, but has a permanent establishment in Italy
type Profile ¶ added in v0.33.0
type Profile struct {
// Name of the organization
Name string `xml:"Denominazione,omitempty"`
// Natural person's first or given name if no "Denominazione" is provided
Given string `xml:"Name,omitempty"`
// Surname of the person
Surname string `xml:"Cognome,omitempty"`
// Title of the person
Title string `xml:"Titolo,omitempty"`
// EORI (Economic Operator Registration and Identification) code
EORI string `xml:"CodEORI,omitempty"`
}
Profile contains identity data of the seller/provider
type Registration ¶ added in v0.33.0
type Registration struct {
// Initials of the province where the company's Registry Office is located
Office string `xml:"Ufficio,omitempty"`
// Company's REA registration number
Entry string `xml:"NumeroREA,omitempty"`
// Company's share capital
Capital string `xml:"CapitaleSociale,omitempty"`
// Indication of whether the Company is in liquidation or not.
// Possible values: LS (in liquidation), LN (not in liquidation)
LiquidationState string `xml:"StatoLiquidazione,omitempty"`
}
Registration contains information related to the company registration details (REA)
type Supplier ¶ added in v0.33.0
type Supplier struct {
Identity *Identity `xml:"DatiAnagrafici"`
Address *Address `xml:"Sede"`
PermanentEstablishment *PermanentEstablishment `xml:"StabileOrganizzazione,omitempty"`
Registration *Registration `xml:"IscrizioneREA,omitempty"`
Contact *Contact `xml:"Contatti,omitempty"`
}
Supplier describes the seller/provider of the invoice.
type TaxID ¶ added in v0.33.0
type TaxID struct {
Country string `xml:"IdPaese"` // ISO 3166-1 alpha-2 country code
Code string `xml:"IdCodice"`
}
TaxID is the VAT identification number consisting of a country code and the actual VAT number.
type Transmitter ¶
Transmitter contains information about the entity integrating directly with the SDI to submit and receive invoices
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
gobl.fatturapa
command
Package main implements the CLI as well as mage commands (toplevel mage.go)
|
Package main implements the CLI as well as mage commands (toplevel mage.go) |
|
Package test provides tools for testing the library both manually as well as helpers for writing test code.
|
Package test provides tools for testing the library both manually as well as helpers for writing test code. |