saft

package module
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 46 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

GOBL ➡️ Portugal SAF-T

Portuguese SAF-T (PT) support for GOBL: the GOBL addon (extensions, normalizers, scenarios, and validation rules), the converter that turns GOBL documents into SAF-T (PT) structures and seals them (AT signature, ATCUD and QR code), and the client for the AT web services used to report documents in real time.

Released under the Apache 2.0 LICENSE, Copyright 2026 Invopop S.L..

Lint Test Go Go Report Card codecov GoDoc Latest Tag Ask DeepWiki

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. Documents must also be sealed by certified software: numbered in sequence, signed with an RSA key (whose hash is chained to the previous document), identified with an ATCUD code and printed with a QR code.

Layout

  • addon/ — the GOBL addon (pt-saft-v1): extensions, normalizers, scenarios, and validation rules that register into GOBL on import. This package is kept dependency-light so importing it never pulls in conversion tooling.
  • the module root — the converter that turns GOBL invoices, payments, orders and delivery documents into SAF-T (PT) structures (Convert), builds and streams complete SAF-T audit files (BuildAuditFile, StreamEncoder), and seals documents with the AT signature, ATCUD and QR code (Seal).
  • config/ — the configuration shared by the converter and the real-time reporting: certified software details and signing key.
  • goblwrap/ — wrappers that give the supported GOBL document types (invoices, payments, orders and deliveries) a common set of accessors.
  • atws/ — a generic client for the AT web services (series registration and real-time reporting of invoices, payments, work documents and stock movements), usable independently of the rest of the module.
  • realtime/ — builders that map SAF-T structures to the requests of the real-time reporting web services.
  • test/ — test helpers and the sample documents under test/data.
  • docs/ — reference material: SAF-T data structure, QR code specification and the AT's FAQ.

Usage

Addon

Unlike the converter, this is a true GOBL addon: it registers extensions, normalizers, and validation rules into GOBL's global registry. Add a blank import so it registers itself, then use GOBL as normal:

import (
	"github.com/invopop/gobl"
	_ "github.com/invopop/gobl.pt.saft/addon"
)

Declare the addon on a document (or let the regime/scenario add it) and Calculate + Validate will run the full SAF-T normalization and rules. The converter imports the addon automatically, so consumers that only convert do not need the blank import.

Note: the pt-saft-v1 key is listed in GOBL core's approved external-addon registry, so it is recognised as a valid $addons value in the JSON Schema. The runtime check stays strict, however: a document declaring the pt-saft-v1 addon will fail validation with add-on must be registered unless this module is imported. Any service that processes Portuguese SAF-T documents must import it.

Sealing

Before a document can be reported it must be sealed. Seal assigns the next sequence number of the series, signs the document chaining it to the previous signature, generates the ATCUD and QR code, and adds all of them as stamps to the GOBL envelope. The returned signature must be persisted and passed in when sealing the next document of the same series.

package main

import (
	"github.com/invopop/gobl"
	saft "github.com/invopop/gobl.pt.saft"
	"github.com/invopop/gobl.pt.saft/config"
	"github.com/invopop/gobl/cal"
)

func main() {
	env := new(gobl.Envelope) // a calculated, unsigned GOBL envelope
	// ...

	cfg := &config.Config{
		CertificateNumber: 1234,                 // software certificate number
		SigningKeyPath:    "./signing_key.pem",  // RSA private key
		SigningKeyVersion: "1",
	}

	var prev *saft.Signature            // last signature of the series, nil for the first document
	start := cal.MakeDate(2024, 1, 1) // start date registered with the AT for the series

	sig, err := saft.Seal(env, prev, start, "AAJFJHNC82", cfg) // series validation code
	if err != nil {
		panic(err)
	}

	// TODO: persist sig and sign the envelope
}
Converter

Convert maps a sealed GOBL envelope to the SAF-T structures it contributes to an audit file: the source document plus the customer, products and tax table entries it references. BuildAuditFile assembles a complete audit file from those, and StreamEncoder writes one incrementally from stored XML fragments.

res, err := saft.Convert(env, "SOURCE_ID", cfg)
if err != nil {
	panic(err)
}

af, err := saft.BuildAuditFile(&saft.AuditFileParams{
	Config:          *cfg,
	Issuer:          supplier,
	Period:          period,
	Customers:       []*saft.Customer{res.Customer},
	Products:        res.Products,
	TaxTableEntries: res.TaxTableEntries,
	SourceDocuments: []saft.SourceDocument{res.Document},
})
if err != nil {
	panic(err)
}

out, err := saft.MarshalXML(af, true) // Windows-1252 encoded, as required by the AT
if err != nil {
	panic(err)
}

// TODO: do something with the output
AT web services

The atws package is a generic client for the AT web services. It connects with the client certificate issued by the AT and the credentials of each taxpayer. The realtime package builds the requests for the real-time reporting services from a SAF-T audit file containing the document to report.

conn, err := atws.New(&atws.Config{
	Environment:         atws.EnvTesting,
	CertificatePath:     "./at-cert.pfx",
	CertificatePassword: "secret",
	PublicKeyPath:       "./at-public-key.pem",
	SWCertNum:           1234,
})
if err != nil {
	panic(err)
}

client := conn.NewClient("123456789/1", "password")

req, err := realtime.BuildRegisterInvoice(af)
if err != nil {
	panic(err)
}

res, err := client.Invoices().Register(req)
if err != nil {
	panic(err)
}

// TODO: handle res.Response

Limitations

Summary of unsupported features:

  • SAF-T for accounting
  • Invoice-level charges and discounts, except advance payment deductions (deduction key)
  • Discounts at the time of payment (Settlements)
  • Tax types:
    • IS – Imposto de Selo (Stamp duty)
    • Not subject to VAT/IS
  • Customs details
  • Self-billing and 3rd-party billing
Unsupported fields
  • QR Codes fields:
    • L: Não sujeito / não tributável em IVA / outras situações
    • M: Imposto do Selo
  • SAF-T:
    • Tables:
      • Accounts table (GeneralLedgerAccounts)
      • Account movements table GeneralLedgerEntries
      • Suppliers table (Supplier)
    • Header fields:
      • CompanyID other than the NIF
      • TaxAccountBasis other than F
      • TaxEntity other than Global
      • HeaderComment
      • Fax
    • Products table fields:
      • ProductGroup
      • CustomsDetails
    • Customers table fields:
      • ShipToAddress
      • SelfBillingIndicator other than 0
    • Invoices table fields:
      • DocumentStatus' InvoiceStatus other than N or A
      • DocumentStatus' SourceBilling other than P
      • SpecialRegimes' SelfBillingIndicator other than 0
      • SpecialRegimes' ThirdPartiesBillingIndicator other than 0
      • EACCode (business activity code)
      • TransactionID (for accounting)
      • ShipFrom
      • ShipTo
      • MovementEndTime
      • MovementStartTime
      • Line's TaxBase
      • Line's ProductSerialNumber
      • Line's CustomsInformation
      • Line Tax's TaxType other than IVA
      • Line Tax's TaxAmount (used for IS only)
      • DocumentTotals' Settlement
    • Stock movements table fields:
      • DocumentStatus' MovementStatus other than N or A
      • DocumentStatus' SourceBilling other than P
      • TransactionID (for accounting)
      • EACCode (business activity code)
      • ShippingPoint's DeliveryID
      • ShippingPoint's WarehouseID
      • ShippingPoint's LocationID
      • Line's ProductSerialNumber
      • Line's CustomsInformation
      • DocumentTotals' Currency (exchange rates)
    • Working documents table fields:
      • DocumentStatus' WorkStatus other than N or A
      • DocumentStatus' SourceBilling other than P
      • TransactionID (for accounting)
      • Line's TaxBase
      • Line's CustomsInformation
      • Line Tax's TaxType other than IVA
      • Line Tax's TaxAmount (used for IS only)
    • Payments table fields:
      • DocumentStatus' PaymentStatus other than N or A
      • DocumentStatus' SourcePayment other than P
      • TransactionID (for accounting)
      • Line's SettlementAmount (discount at the time of payment)
      • DocumentTotals' Settlement
      • DocumentTotals' Currency (exchange rates)

Development

The module tracks tagged releases of github.com/invopop/gobl. A commented-out replace directive sits at the bottom of go.mod for working against a local core checkout; uncomment it while developing against unreleased core changes, and re-comment it before merging.

go test ./...
Examples

examples/ holds sample documents for the addon, with their expected JSON envelopes under examples/out/. They are verified via GOBL's shared pkg/examples helpers.

test/data/ holds sample GOBL envelopes for the converter. TestConvertExamples seals all of them, builds a SAF-T audit file and compares it against test/data/out/saft.xml.

Regenerate the golden outputs after intentional changes with:

go test . -update

With -update, the audit file is also validated against the official XSD schema before being written.

Resources

License

Apache 2.0 — see LICENSE.

Documentation

Overview

Package saft implements the conversion of GOBL invoices, payments, orders and delivery documents into Portuguese SAF-T (PT) structures, as well as the sealing of those documents: the AT signature (hash), ATCUD and QR code.

The GOBL addon itself lives in the addon subpackage; the client for the AT web services in atws, and the builders of its real-time reporting requests in realtime.

Index

Constants

View Source
const (
	AuditFileVersion   = "1.04_01"
	CurrencyCode       = "EUR"
	TaxAccountingBasis = "F" // F - Faturação (Invoicing)
	TaxEntity          = "Global"
)

Header constants

View Source
const (
	GenericCustomerTaxID = "999999990"
	GenericCustomerID    = "Consumidor final"
	GenericCustomerHash  = "931747646aa67138f346d6ed06fc03"
	ValueUnknown         = "Desconhecido"
)

Final consumer constants

View Source
const (
	StatusNormal      = "N" // Normal
	StatusSelfInvoice = "S" // Autofaturação
	StatusCanceled    = "A" // Anulado
	StatusSummary     = "R" // Resumo
	StatusBilled      = "F" // Faturado
)

Status codes

View Source
const (
	// TimeLocation used as reference for SAF-T documents
	TimeLocation = "Europe/Lisbon"

	// TaxTypeVAT is the TaxType value for VAT
	TaxTypeVAT = "IVA"
)
View Source
const (
	LabelFax = "fax"
)

Other constants

View Source
const XMLNamespace = "urn:OECD:StandardAuditFile-Tax:PT_1.04_01"

XMLNamespace is the target namespace of the SAF-T PT XSD schema.

Variables

This section is empty.

Functions

func BuildATCUD

func BuildATCUD(doc SourceDocument, valCode string) string

BuildATCUD builds the ATCUD code for a given document and validation code.

func BuildQRCode

func BuildQRCode(qr *BuildQRCodeParams) string

BuildQRCode builds a QR code for a given document

func DecodeXML

func DecodeXML(r io.Reader, v any) error

DecodeXML decodes the given XML data into the given value according to the SAF-T specification. The input reader is assumed to be encoded in Windows-1252.

func DocNumber

func DocNumber(series, code cbc.Code) string

DocNumber generates a SAF-T document number from a GOBL series and a code

func DocNumberParts

func DocNumberParts(c string) (cbc.Code, cbc.Code, int)

DocNumberParts splits a SAF-T document number into its components: document type, series code and sequence number

func EncodeXML

func EncodeXML(v any, w io.Writer, root bool) error

EncodeXML encodes the given value to XML in Windows-1252 as required by SAF-T. If root is true, the XML header is prepended. Characters unsupported by Windows-1252 are normalized or escaped as HTML entities.

func HashCharacters

func HashCharacters(hash string) string

HashCharacters extracts a 4-char snippet from a full hash string

func IsWorkDocument

func IsWorkDocument(ginv *bill.Invoice) bool

IsWorkDocument returns whether a GOBL invoice represents a SAF-T work document

func MarshalXML

func MarshalXML(v any, root bool) ([]byte, error)

MarshalXML encodes the given value to XML according to the SAF-T specification and returns the resulting byte slice. If the root parameter is true, the value is considered a root document and the XML header is prepended to the output.

func Timestamp

func Timestamp() string

Timestamp returns the current timestamp in the SAF-T format

func UnmarshalXML

func UnmarshalXML(data []byte, v any) error

UnmarshalXML decodes the given XML data into the given value according to the SAF-T specification. The input byte slice is assumed to be encoded in Windows-1252.

func ValidateIssuer

func ValidateIssuer(val any) error

ValidateIssuer validates a GOBL party as a SAF-T issuer

func ValidatePeriod

func ValidatePeriod(per cal.Period) error

ValidatePeriod checks that a reporting period is complete and already elapsed.

Types

type Address

type Address struct {
	BuildingNumber string `xml:"BuildingNumber,omitempty"`
	StreetName     string `xml:"StreetName,omitempty"`
	AddressDetail  string `xml:"AddressDetail"`
	City           string `xml:"City"`
	PostalCode     string `xml:"PostalCode"`
	Region         string `xml:"Region,omitempty"`
	Country        string `xml:"Country"`
}

Address represents an address in the SAF-T file

func BuildAddress

func BuildAddress(gparty *org.Party) *Address

BuildAddress builds a SAF-T address from a GOBL address

type AuditFile

type AuditFile struct {
	XMLName struct{} `xml:"urn:OECD:StandardAuditFile-Tax:PT_1.04_01 AuditFile"`

	Header          *Header          `xml:"Header"`
	MasterFiles     *MasterFiles     `xml:"MasterFiles"`
	SourceDocuments *SourceDocuments `xml:"SourceDocuments,omitempty"`
}

AuditFile represents the root element of a SAF-T file

func BuildAuditFile

func BuildAuditFile(p *AuditFileParams) (*AuditFile, error)

BuildAuditFile builds a SAF-T audit file from the given input parameters

func (*AuditFile) ValidateXSD

func (af *AuditFile) ValidateXSD(ctx context.Context) []error

ValidateXSD validates the XML form of the audit file against the official SAF-T PT XSD schema. Returns the full list of validation errors or nil if none.

type AuditFileParams

type AuditFileParams struct {
	config.Config

	Issuer *org.Party
	Period cal.Period

	Products        []*Product
	Customers       []*Customer
	TaxTableEntries []*TaxTableEntry

	SourceDocuments []SourceDocument
}

AuditFileParams provides the parameters to build a SAF-T audit file

type BuildParams

type BuildParams struct {
	ATCUD             string
	Customer          *Customer
	Products          []*Product
	SourceID          string
	Hash              string
	SigningKeyVersion string
	SystemEntryDate   string
}

BuildParams are the parameters for building a source document

type BuildQRCodeParams

type BuildQRCodeParams struct {
	Supplier  *Supplier
	Customer  *Customer
	Document  SourceDocument
	ATCUD     string
	Signature *Signature
	SWCertNum int
}

BuildQRCodeParams is the parameters for building a QR code

type ClassTotals

type ClassTotals struct {
	Entries  int
	Lines    int
	Debit    string
	Credit   string
	Quantity string
}

ClassTotals holds the values of a document class wrapper element that must be known before the documents of that class are streamed.

type ConvertResult

type ConvertResult struct {
	Document        SourceDocument
	Supplier        *Supplier
	Customer        *Customer
	Products        []*Product
	TaxTableEntries []*TaxTableEntry
}

ConvertResult provides the SAF-T structures resulting from a conversion

func Convert

func Convert(env *gobl.Envelope, sourceID string, cfg *config.Config) (*ConvertResult, error)

Convert maps a GOBL envelope to SAF-T structures

func (*ConvertResult) ValidateXSD

func (r *ConvertResult) ValidateXSD(ctx context.Context) []error

ValidateXSD validates the XML against the official SAF-T PT XSD schema. Returns the full list of validations error or nil if none.

type Currency

type Currency struct {
	CurrencyCode   string `xml:"CurrencyCode"`
	CurrencyAmount string `xml:"CurrencyAmount"`
	ExchangeRate   string `xml:"ExchangeRate"`
}

Currency represents the currency information of an invoice

type Customer

type Customer struct {
	CustomerID           string     `xml:"CustomerID"`
	AccountID            string     `xml:"AccountID"`
	CustomerTaxID        string     `xml:"CustomerTaxID"`
	CompanyName          string     `xml:"CompanyName"`
	Contact              string     `xml:"Contact,omitempty"`
	BillingAddress       *Address   `xml:"BillingAddress"`
	ShipToAddresses      []*Address `xml:"ShipToAddress,omitempty"`
	Telephone            string     `xml:"Telephone,omitempty"`
	Fax                  string     `xml:"Fax,omitempty"`
	Email                string     `xml:"Email,omitempty"`
	Website              string     `xml:"Website,omitempty"`
	SelfBillingIndicator int        `xml:"SelfBillingIndicator"`
}

Customer represents a customer in a SAF-T report

func BuildCustomer

func BuildCustomer(gcus *org.Party) *Customer

BuildCustomer converts a GOBL party to a SAF-T customer

type CustomsDetails

type CustomsDetails struct {
	CNCode   string `xml:"CNCode,omitempty"`
	UNNumber string `xml:"UNNumber,omitempty"`
}

CustomsDetails represents the customs details of a product

type CustomsInformation

type CustomsInformation struct {
	ARCNo     []string `xml:"ARCNo,omitempty"`
	IECAmount string   `xml:"IECAmount,omitempty"`
}

CustomsInformation represents customs information for a line

type DocTotals

type DocTotals struct {
	Lines    int
	Debit    num.Amount
	Credit   num.Amount
	Quantity num.Amount
}

DocTotals holds the line count and line-amount sums of a single source document, computed with the same precision rules as the SAF-T report totals. Lines is counted for every class even though only MovementOfGoods reports it, as NumberOfMovementLines; the other three wrappers count documents, with NumberOfEntries.

func ComputeDocTotals

func ComputeDocTotals(doc SourceDocument) DocTotals

ComputeDocTotals sums the line amounts of a document.

func (DocTotals) Merge

func (t DocTotals) Merge(o DocTotals) DocTotals

Merge returns the result of adding the other document totals to these ones.

type DocumentClass

type DocumentClass string

DocumentClass represents the class of source document

const (
	DocumentClassInvoice   DocumentClass = "SI" // Faturas e documentos retificativos
	DocumentClassTransport DocumentClass = "MG" // Documentos de Transporte
	DocumentClassWork      DocumentClass = "WD" // Documentos de Conferência
	DocumentClassPayment   DocumentClass = "PY" // Recibos
)

Document class constants

type DocumentTotals

type DocumentTotals struct {
	TaxPayable  string           `xml:"TaxPayable"`
	NetTotal    string           `xml:"NetTotal"`
	GrossTotal  string           `xml:"GrossTotal"`
	Currency    *Currency        `xml:"Currency,omitempty"`
	Settlements []*Settlement    `xml:"Settlement,omitempty"`
	Payments    []*PaymentMethod `xml:"Payment,omitempty"`
}

DocumentTotals represents the totals of an invoice

type Header struct {
	AuditFileVersion          string   `xml:"AuditFileVersion"`
	CompanyID                 string   `xml:"CompanyID"`
	TaxRegistrationNumber     string   `xml:"TaxRegistrationNumber"`
	TaxAccountingBasis        string   `xml:"TaxAccountingBasis"`
	CompanyName               string   `xml:"CompanyName"`
	BusinessName              string   `xml:"BusinessName,omitempty"`
	CompanyAddress            *Address `xml:"CompanyAddress"`
	FiscalYear                string   `xml:"FiscalYear"`
	StartDate                 string   `xml:"StartDate"`
	EndDate                   string   `xml:"EndDate"`
	CurrencyCode              string   `xml:"CurrencyCode"`
	DateCreated               string   `xml:"DateCreated"`
	TaxEntity                 string   `xml:"TaxEntity"`
	ProductCompanyTaxID       string   `xml:"ProductCompanyTaxID"`
	SoftwareCertificateNumber int      `xml:"SoftwareCertificateNumber"`
	ProductID                 string   `xml:"ProductID"`
	ProductVersion            string   `xml:"ProductVersion"`
	HeaderComment             string   `xml:"HeaderComment,omitempty"`
	Telephone                 string   `xml:"Telephone,omitempty"`
	Fax                       string   `xml:"Fax,omitempty"`
	Email                     string   `xml:"Email,omitempty"`
	Website                   string   `xml:"Website,omitempty"`
}

Header represents the header of a SAF-T file

type Invoice

type Invoice struct {
	InvoiceNo        string            `xml:"InvoiceNo"`
	ATCUD            string            `xml:"ATCUD"`
	DocumentStatus   *InvoiceStatus    `xml:"DocumentStatus"`
	Hash             string            `xml:"Hash"`
	HashControl      string            `xml:"HashControl"`
	Period           int               `xml:"Period"`
	InvoiceDate      string            `xml:"InvoiceDate"`
	InvoiceType      string            `xml:"InvoiceType"`
	SpecialRegimes   *SpecialRegimes   `xml:"SpecialRegimes"`
	SourceID         string            `xml:"SourceID"`
	EACCode          string            `xml:"EACCode,omitempty"`
	SystemEntryDate  string            `xml:"SystemEntryDate"`
	CustomerID       string            `xml:"CustomerID"`
	Lines            []*Line           `xml:"Line"`
	DocumentTotals   *DocumentTotals   `xml:"DocumentTotals"`
	WithholdingTaxes []*WithholdingTax `xml:"WithholdingTax,omitempty"`

	// store the original tax total for QR code generation
	GOBLTaxTotal *tax.Total `xml:"-"`
}

Invoice represents an invoice in a SAF-T report

func BuildInvoice

func BuildInvoice(ginv *bill.Invoice, p *BuildParams) (*Invoice, error)

BuildInvoice converts a GOBL invoice to a SAF-T invoice

func (*Invoice) GetCustomerID

func (i *Invoice) GetCustomerID() string

GetCustomerID returns the customer ID of the invoice

func (*Invoice) GetDocumentClass

func (i *Invoice) GetDocumentClass() DocumentClass

GetDocumentClass returns the document class of the invoice

func (*Invoice) GetDocumentNo

func (i *Invoice) GetDocumentNo() string

GetDocumentNo returns the document number of the invoice

func (*Invoice) GetDocumentTotals

func (i *Invoice) GetDocumentTotals() *DocumentTotals

GetDocumentTotals returns the document totals of the invoice

func (*Invoice) GetDocumentType

func (i *Invoice) GetDocumentType() string

GetDocumentType returns the document type of the invoice

func (*Invoice) GetGrossTotal

func (i *Invoice) GetGrossTotal() string

GetGrossTotal returns the gross total of the invoice

func (*Invoice) GetIssueDate

func (i *Invoice) GetIssueDate() string

GetIssueDate returns the issue date of the invoice

func (*Invoice) GetStatus

func (i *Invoice) GetStatus() string

GetStatus returns the status of the invoice

func (*Invoice) GetStatusDate

func (i *Invoice) GetStatusDate() string

GetStatusDate returns the status date of the invoice

func (*Invoice) GetStatusReason

func (i *Invoice) GetStatusReason() string

GetStatusReason returns the status reason of the invoice

func (*Invoice) GetTaxPayable

func (i *Invoice) GetTaxPayable() string

GetTaxPayable returns the tax payable of the invoice

func (*Invoice) GetTaxTotal

func (i *Invoice) GetTaxTotal() *tax.Total

GetTaxTotal returns the tax total of the invoice

func (*Invoice) SetStatus

func (i *Invoice) SetStatus(status, reason, sourceID string)

SetStatus sets the status of the invoice

type InvoiceStatus

type InvoiceStatus struct {
	InvoiceStatus     string `xml:"InvoiceStatus"`
	InvoiceStatusDate string `xml:"InvoiceStatusDate"`
	Reason            string `xml:"Reason,omitempty"`
	SourceID          string `xml:"SourceID"`
	SourceBilling     string `xml:"SourceBilling"`
}

InvoiceStatus represents the status of an invoice

type Line

type Line struct {
	LineNumber          int                 `xml:"LineNumber"`
	OrderReferences     []*OrderReference   `xml:"OrderReferences,omitempty"`
	ProductCode         string              `xml:"ProductCode"`
	ProductDesc         string              `xml:"ProductDescription"`
	Quantity            string              `xml:"Quantity"`
	UnitOfMeasure       string              `xml:"UnitOfMeasure"`
	UnitPrice           string              `xml:"UnitPrice"`
	TaxBase             string              `xml:"TaxBase,omitempty"`
	TaxPointDate        string              `xml:"TaxPointDate,omitempty"`
	References          []*References       `xml:"References,omitempty"`
	Description         string              `xml:"Description"`
	DebitAmount         string              `xml:"DebitAmount,omitempty"`
	CreditAmount        string              `xml:"CreditAmount,omitempty"`
	Tax                 *Tax                `xml:"Tax"`
	TaxExemptionReason  string              `xml:"TaxExemptionReason,omitempty"`
	TaxExemptionCode    string              `xml:"TaxExemptionCode,omitempty"`
	SettlementAmount    string              `xml:"SettlementAmount,omitempty"`
	ProductSerialNumber string              `xml:"ProductSerialNumber,omitempty"`
	CustomsInformation  *CustomsInformation `xml:"CustomsInformation,omitempty"`
}

Line represents a line in an invoice

type MasterFiles

type MasterFiles struct {
	Customers []*Customer `xml:"Customer,omitempty"`
	Products  []*Product  `xml:"Product,omitempty"`
	TaxTable  *TaxTable   `xml:"TaxTable,omitempty"`
}

MasterFiles represents the master files of a SAF-T file

type MovementOfGoods

type MovementOfGoods struct {
	NumberOfMovementLines int              `xml:"NumberOfMovementLines"`
	TotalQuantityIssued   string           `xml:"TotalQuantityIssued"`
	StockMovements        []*StockMovement `xml:"StockMovement,omitempty"`
}

MovementOfGoods represents the movement of goods in a SAF-T file

type MovementStatus

type MovementStatus struct {
	MovementStatus     string `xml:"MovementStatus"`
	MovementStatusDate string `xml:"MovementStatusDate"`
	Reason             string `xml:"Reason,omitempty"`
	SourceID           string `xml:"SourceID"`
	SourceBilling      string `xml:"SourceBilling"`
}

MovementStatus represents the status of a stock movement

type OrderReference

type OrderReference struct {
	OriginatingON string `xml:"OriginatingON,omitempty"`
	OrderDate     string `xml:"OrderDate,omitempty"`
}

OrderReference represents an order reference in a line

type Payment

type Payment struct {
	PaymentRefNo     string            `xml:"PaymentRefNo"`
	ATCUD            string            `xml:"ATCUD"`
	Period           int               `xml:"Period,omitempty"`
	TransactionID    string            `xml:"TransactionID,omitempty"`
	TransactionDate  string            `xml:"TransactionDate"`
	PaymentType      string            `xml:"PaymentType"`
	Description      string            `xml:"Description,omitempty"`
	SystemID         string            `xml:"SystemID,omitempty"`
	DocumentStatus   *PaymentStatus    `xml:"DocumentStatus"`
	PaymentMethods   []*PaymentMethod  `xml:"PaymentMethod,omitempty"`
	SourceID         string            `xml:"SourceID"`
	SystemEntryDate  string            `xml:"SystemEntryDate"`
	CustomerID       string            `xml:"CustomerID"`
	Lines            []*PaymentLine    `xml:"Line"`
	DocumentTotals   *DocumentTotals   `xml:"DocumentTotals"`
	WithholdingTaxes []*WithholdingTax `xml:"WithholdingTax,omitempty"`

	// store the original tax total for QR code generation
	GOBLTaxTotal *tax.Total `xml:"-"`
}

Payment represents a payment in a SAF-T file

func BuildPayment

func BuildPayment(gpmt *bill.Payment, p *BuildParams) (*Payment, error)

BuildPayment builds a payment from a GOBL payment

func (*Payment) GetCustomerID

func (p *Payment) GetCustomerID() string

GetCustomerID returns the customer ID of the payment

func (*Payment) GetDocumentClass

func (p *Payment) GetDocumentClass() DocumentClass

GetDocumentClass returns the document class of the payment

func (*Payment) GetDocumentNo

func (p *Payment) GetDocumentNo() string

GetDocumentNo returns the document number of the payment

func (*Payment) GetDocumentTotals

func (p *Payment) GetDocumentTotals() *DocumentTotals

GetDocumentTotals returns the document totals of the payment

func (*Payment) GetDocumentType

func (p *Payment) GetDocumentType() string

GetDocumentType returns the document type of the payment

func (*Payment) GetGrossTotal

func (p *Payment) GetGrossTotal() string

GetGrossTotal returns the gross total of the payment

func (*Payment) GetIssueDate

func (p *Payment) GetIssueDate() string

GetIssueDate returns the issue date of the payment

func (*Payment) GetStatus

func (p *Payment) GetStatus() string

GetStatus returns the status of the payment

func (*Payment) GetStatusDate

func (p *Payment) GetStatusDate() string

GetStatusDate returns the status date of the payment

func (*Payment) GetStatusReason

func (p *Payment) GetStatusReason() string

GetStatusReason returns the status reason of the payment

func (*Payment) GetTaxPayable

func (p *Payment) GetTaxPayable() string

GetTaxPayable returns the tax payable of the payment

func (*Payment) GetTaxTotal

func (p *Payment) GetTaxTotal() *tax.Total

GetTaxTotal returns the tax total of the payment

func (*Payment) SetStatus

func (p *Payment) SetStatus(status string, reason string, sourceID string)

SetStatus sets the status of the payment

type PaymentLine

type PaymentLine struct {
	LineNumber         int                 `xml:"LineNumber"`
	SourceDocumentIDs  []*SourceDocumentID `xml:"SourceDocumentID"`
	SettlementAmount   string              `xml:"SettlementAmount,omitempty"`
	DebitAmount        string              `xml:"DebitAmount,omitempty"`
	CreditAmount       string              `xml:"CreditAmount,omitempty"`
	Tax                *PaymentTax         `xml:"Tax,omitempty"`
	TaxExemptionReason string              `xml:"TaxExemptionReason,omitempty"`
	TaxExemptionCode   string              `xml:"TaxExemptionCode,omitempty"`
}

PaymentLine represents a payment line

type PaymentMethod

type PaymentMethod struct {
	PaymentMechanism string `xml:"PaymentMechanism,omitempty"`
	PaymentAmount    string `xml:"PaymentAmount"`
	PaymentDate      string `xml:"PaymentDate"`
}

PaymentMethod represents a payment method

type PaymentStatus

type PaymentStatus struct {
	PaymentStatus     string `xml:"PaymentStatus"`
	PaymentStatusDate string `xml:"PaymentStatusDate"`
	Reason            string `xml:"Reason,omitempty"`
	SourceID          string `xml:"SourceID"`
	SourcePayment     string `xml:"SourcePayment"`
}

PaymentStatus represents the status of a payment

type PaymentTax

type PaymentTax struct {
	TaxType          string `xml:"TaxType"`
	TaxCountryRegion string `xml:"TaxCountryRegion"`
	TaxCode          string `xml:"TaxCode"`
	TaxPercentage    string `xml:"TaxPercentage,omitempty"`
	TaxAmount        string `xml:"TaxAmount,omitempty"`
}

PaymentTax represents the tax info of a payment line

type Payments

type Payments struct {
	NumberOfEntries int        `xml:"NumberOfEntries"`
	TotalDebit      string     `xml:"TotalDebit"`
	TotalCredit     string     `xml:"TotalCredit"`
	Payments        []*Payment `xml:"Payment,omitempty"`
}

Payments represents the payments of a SAF-T file

type Product

type Product struct {
	ProductType       string          `xml:"ProductType"`
	ProductCode       string          `xml:"ProductCode"`
	ProductGroup      string          `xml:"ProductGroup,omitempty"`
	ProductDesc       string          `xml:"ProductDescription"`
	ProductNumberCode string          `xml:"ProductNumberCode"`
	CustomsDetails    *CustomsDetails `xml:"CustomsDetails,omitempty"`
}

Product represents a product or service in the SAF-T file

func BuildDeductionProduct added in v0.0.12

func BuildDeductionProduct(d *bill.Discount) *Product

BuildDeductionProduct builds a product from an advance payment deduction, using the "other" product type that SAF-T reserves for received advances.

func BuildProduct

func BuildProduct(gline *bill.Line) *Product

BuildProduct builds a product from a GOBL invoice line

func BuildProducts

func BuildProducts(lines []*bill.Line, discounts []*bill.Discount) []*Product

BuildProducts builds the products of the GOBL lines followed by those of the advance payment deductions, in document order.

type References

type References struct {
	Reference string `xml:"Reference,omitempty"`
	Reason    string `xml:"Reason,omitempty"`
}

References represents a reference of a line

type SalesInvoices

type SalesInvoices struct {
	NumberOfEntries int        `xml:"NumberOfEntries"`
	TotalDebit      string     `xml:"TotalDebit"`
	TotalCredit     string     `xml:"TotalCredit"`
	Invoices        []*Invoice `xml:"Invoice,omitempty"`
}

SalesInvoices represents the sales invoices of a SAF-T file

type Settlement

type Settlement struct {
	SettlementDiscount string `xml:"SettlementDiscount,omitempty"`
	SettlementAmount   string `xml:"SettlementAmount,omitempty"`
	SettlementDate     string `xml:"SettlementDate,omitempty"`
	PaymentTerms       string `xml:"PaymentTerms,omitempty"`
}

Settlement represents a settlement of an invoice

type ShippingPoint

type ShippingPoint struct {
	DeliveryID   []string `xml:"DeliveryID,omitempty"`
	DeliveryDate string   `xml:"DeliveryDate,omitempty"`
	WarehouseID  string   `xml:"WarehouseID,omitempty"`
	LocationID   string   `xml:"LocationID,omitempty"`
	Address      *Address `xml:"Address,omitempty"`
}

ShippingPoint represents a shipping point in a SAF-T file

type Signature

type Signature struct {
	IssueDate       string
	SystemEntryDate string
	DocumentNo      string
	GrossTotal      string
	PreviousHash    string

	Hash string
}

Signature represents an invoice signature

func BuildSignature

func BuildSignature(doc SourceDocument, prevSig *Signature, pkey []byte) (*Signature, error)

BuildSignature builds a signature for a given document.

func Seal

func Seal(env *gobl.Envelope, prevSig *Signature, startDate cal.Date, valCode string, cfg *config.Config) (*Signature, error)

Seal generates the signature, ATCUD, and QR code for a GOBL invoice envelope and appends them as stamps to the envelope.

func (*Signature) HashCharacters

func (s *Signature) HashCharacters() string

HashCharacters extracts a 4-char snippet of the signature hash

func (*Signature) Msg

func (s *Signature) Msg() string

Msg returns the message to be signed

func (*Signature) SeqNo

func (s *Signature) SeqNo() int

SeqNo extracts the sequence number from the document number

func (*Signature) Series

func (s *Signature) Series() string

Series extracts the series from the document number

type SourceDocument

type SourceDocument interface {
	GetDocumentClass() DocumentClass
	GetDocumentType() string
	GetDocumentNo() string
	GetIssueDate() string
	GetCustomerID() string
	GetGrossTotal() string
	GetStatus() string
	GetStatusDate() string
	GetStatusReason() string
	SetStatus(status, reason, sourceID string)
	GetTaxTotal() *tax.Total
	GetTaxPayable() string
	GetDocumentTotals() *DocumentTotals
}

SourceDocument is the interface providing common accessors for SAFT source documents

func BuildSourceDocument

func BuildSourceDocument(doc any, params *BuildParams) (SourceDocument, error)

BuildSourceDocument builds a document from a given document and parameters.

func NewSourceDocument

func NewSourceDocument(docClass DocumentClass) SourceDocument

NewSourceDocument builds a new source document for a given document class.

type SourceDocumentID

type SourceDocumentID struct {
	OriginatingON string `xml:"OriginatingON"`
	InvoiceDate   string `xml:"InvoiceDate"`
	Description   string `xml:"Description,omitempty"`
}

SourceDocumentID represents a source document ID of a payment line

type SourceDocuments

type SourceDocuments struct {
	SalesInvoices    *SalesInvoices    `xml:"SalesInvoices,omitempty"`
	MovementOfGoods  *MovementOfGoods  `xml:"MovementOfGoods,omitempty"`
	WorkingDocuments *WorkingDocuments `xml:"WorkingDocuments,omitempty"`
	Payments         *Payments         `xml:"Payments,omitempty"`
}

SourceDocuments represents the source documents of a SAF-T file

type SpecialRegimes

type SpecialRegimes struct {
	SelfBillingIndicator         int `xml:"SelfBillingIndicator"`
	CashVATSchemeIndicator       int `xml:"CashVATSchemeIndicator"`
	ThirdPartiesBillingIndicator int `xml:"ThirdPartiesBillingIndicator"`
}

SpecialRegimes represents the special regimes of an invoice

type StockMovement

type StockMovement struct {
	DocumentNumber    string          `xml:"DocumentNumber"`
	ATCUD             string          `xml:"ATCUD"`
	DocumentStatus    *MovementStatus `xml:"DocumentStatus"`
	Hash              string          `xml:"Hash"`
	HashControl       string          `xml:"HashControl"`
	Period            int             `xml:"Period,omitempty"`
	MovementDate      string          `xml:"MovementDate"`
	MovementType      string          `xml:"MovementType"`
	SystemEntryDate   string          `xml:"SystemEntryDate"`
	TransactionID     string          `xml:"TransactionID,omitempty"`
	CustomerID        string          `xml:"CustomerID,omitempty"`
	SupplierID        string          `xml:"SupplierID,omitempty"`
	SourceID          string          `xml:"SourceID"`
	EACCode           string          `xml:"EACCode,omitempty"`
	MovementComments  string          `xml:"MovementComments,omitempty"`
	ShipTo            *ShippingPoint  `xml:"ShipTo,omitempty"`
	ShipFrom          *ShippingPoint  `xml:"ShipFrom,omitempty"`
	MovementEndTime   string          `xml:"MovementEndTime,omitempty"`
	MovementStartTime string          `xml:"MovementStartTime"`
	ATDocCodeID       string          `xml:"ATDocCodeID,omitempty"`
	Lines             []*Line         `xml:"Line"`
	DocumentTotals    *DocumentTotals `xml:"DocumentTotals"`

	// store the original tax total for QR code generation
	GOBLTaxTotal *tax.Total `xml:"-"`
}

StockMovement represents a stock movement in a SAF-T file

func BuildStockMovement

func BuildStockMovement(gdlv *bill.Delivery, p *BuildParams) (*StockMovement, error)

BuildStockMovement converts a GOBL delivery to a SAF-T stock movement

func (*StockMovement) GetCustomerID

func (sm *StockMovement) GetCustomerID() string

GetCustomerID returns the customer ID of the stock movement

func (*StockMovement) GetDocumentClass

func (sm *StockMovement) GetDocumentClass() DocumentClass

GetDocumentClass returns the document class of the stock movement

func (*StockMovement) GetDocumentNo

func (sm *StockMovement) GetDocumentNo() string

GetDocumentNo returns the document number of the stock movement

func (*StockMovement) GetDocumentTotals

func (sm *StockMovement) GetDocumentTotals() *DocumentTotals

GetDocumentTotals returns the document totals of the stock movement

func (*StockMovement) GetDocumentType

func (sm *StockMovement) GetDocumentType() string

GetDocumentType returns the document type of the stock movement

func (*StockMovement) GetGrossTotal

func (sm *StockMovement) GetGrossTotal() string

GetGrossTotal returns the gross total of the stock movement

func (*StockMovement) GetIssueDate

func (sm *StockMovement) GetIssueDate() string

GetIssueDate returns the issue date of the stock movement

func (*StockMovement) GetStatus

func (sm *StockMovement) GetStatus() string

GetStatus returns the status of the stock movement

func (*StockMovement) GetStatusDate

func (sm *StockMovement) GetStatusDate() string

GetStatusDate returns the status date of the stock movement

func (*StockMovement) GetStatusReason

func (sm *StockMovement) GetStatusReason() string

GetStatusReason returns the status reason of the stock movement

func (*StockMovement) GetTaxPayable

func (sm *StockMovement) GetTaxPayable() string

GetTaxPayable returns the tax payable of the stock movement

func (*StockMovement) GetTaxTotal

func (sm *StockMovement) GetTaxTotal() *tax.Total

GetTaxTotal returns the tax total of the stock movement

func (*StockMovement) SetStatus

func (sm *StockMovement) SetStatus(status, reason, sourceID string)

SetStatus sets the status of the stock movement

type StreamEncoder

type StreamEncoder struct {
	// contains filtered or unexported fields
}

StreamEncoder writes a SAF-T audit file incrementally to an output writer.

func NewStreamEncoder

func NewStreamEncoder(w io.Writer, cfg config.Config, issuer *org.Party, per cal.Period) *StreamEncoder

NewStreamEncoder prepares a stream encoder. The issuer and period are expected to have been validated by the caller with ValidateIssuer and ValidatePeriod.

func (*StreamEncoder) Begin

func (e *StreamEncoder) Begin() error

Begin writes the XML declaration, the audit file root element and its header.

func (*StreamEncoder) BeginClass

func (e *StreamEncoder) BeginClass(dc DocumentClass, t ClassTotals) error

BeginClass opens the wrapper element of a document class, writing its entry count and total amounts. Classes must be written in the SAF-T schema order: SI, MG, WD, PY.

func (*StreamEncoder) End

func (e *StreamEncoder) End() error

End closes all open sections and the audit file root element.

func (*StreamEncoder) WriteDocument

func (e *StreamEncoder) WriteDocument(frag []byte) error

WriteDocument writes a stored source document XML fragment into the currently open document class.

func (*StreamEncoder) WriteMasterFile

func (e *StreamEncoder) WriteMasterFile(frag []byte) error

WriteMasterFile writes a stored customer or product XML fragment, which both sit directly inside the master files. The caller is responsible for the order the SAF-T schema fixes: customers, then products, then tax table entries.

func (*StreamEncoder) WriteTaxTableEntry

func (e *StreamEncoder) WriteTaxTableEntry(frag []byte) error

WriteTaxTableEntry writes a stored tax table entry XML fragment, one level deeper than the other master files as it is wrapped in a tax table of its own.

type Supplier

type Supplier struct {
	SupplierTaxID string `xml:"SupplierTaxID"`
}

Supplier represents a supplier in a SAF-T document

func BuildSupplier

func BuildSupplier(gsup *org.Party) *Supplier

BuildSupplier converts a GOBL party to a SAF-T supplier

type Tax

type Tax struct {
	TaxType          string `xml:"TaxType"`
	TaxCountryRegion string `xml:"TaxCountryRegion,omitempty"`
	TaxCode          string `xml:"TaxCode,omitempty"`
	TaxPercentage    string `xml:"TaxPercentage"`
}

Tax represents the tax information of a line

type TaxTable

type TaxTable struct {
	TaxTableEntries []*TaxTableEntry `xml:"TaxTableEntry"`
}

TaxTable represents the tax table in the SAF-T file

type TaxTableEntry

type TaxTableEntry struct {
	TaxType          string `xml:"TaxType"`
	TaxCountryRegion string `xml:"TaxCountryRegion"`
	TaxCode          string `xml:"TaxCode"`
	Description      string `xml:"Description"`
	TaxPercentage    string `xml:"TaxPercentage,omitempty"`
	TaxAmount        string `xml:"TaxAmount,omitempty"`

	TaxTableEntryID string `xml:"-"` // Auxiliary field for unique identification
}

TaxTableEntry represents an entry of that SAF-T tax table

func BuildTaxTableEntries

func BuildTaxTableEntries(gts *bill.Totals) []*TaxTableEntry

BuildTaxTableEntries builds the tax table entries from GOBL tax totals

func BuildTaxTableEntry

func BuildTaxTableEntry(rt *tax.RateTotal) *TaxTableEntry

BuildTaxTableEntry builds a tax table entry from a GOBL tax rate

type WithholdingTax

type WithholdingTax struct {
	WithholdingTaxType        string `xml:"WithholdingTaxType,omitempty"`
	WithholdingTaxDescription string `xml:"WithholdingTaxDescription,omitempty"`
	WithholdingTaxAmount      string `xml:"WithholdingTaxAmount"`
}

WithholdingTax represents a withholding tax of a payment

type WorkDocument

type WorkDocument struct {
	DocumentNumber  string              `xml:"DocumentNumber"`
	ATCUD           string              `xml:"ATCUD"`
	DocumentStatus  *WorkStatus         `xml:"DocumentStatus"`
	Hash            string              `xml:"Hash,omitempty"`
	HashControl     string              `xml:"HashControl,omitempty"`
	Period          int                 `xml:"Period"`
	WorkDate        string              `xml:"WorkDate"`
	WorkType        string              `xml:"WorkType"`
	SourceID        string              `xml:"SourceID"`
	EACCode         string              `xml:"EACCode,omitempty"`
	SystemEntryDate string              `xml:"SystemEntryDate"`
	TransactionID   string              `xml:"TransactionID,omitempty"`
	CustomerID      string              `xml:"CustomerID"`
	Lines           []*Line             `xml:"Line"`
	DocumentTotals  *WorkDocumentTotals `xml:"DocumentTotals"`

	// store the original tax total for QR code generation
	GOBLTaxTotal *tax.Total `xml:"-"`
}

WorkDocument represents a working document in a SAF-T report

func BuildWorkDocumentFromInvoice

func BuildWorkDocumentFromInvoice(ginv *bill.Invoice, p *BuildParams) (*WorkDocument, error)

BuildWorkDocumentFromInvoice converts a GOBL invoice to a SAF-T work document

func BuildWorkDocumentFromOrder

func BuildWorkDocumentFromOrder(gord *bill.Order, p *BuildParams) (*WorkDocument, error)

BuildWorkDocumentFromOrder converts a GOBL order to a SAF-T work document

func (*WorkDocument) GetCustomerID

func (w *WorkDocument) GetCustomerID() string

GetCustomerID returns the customer ID of the work document

func (*WorkDocument) GetDocumentClass

func (w *WorkDocument) GetDocumentClass() DocumentClass

GetDocumentClass returns the document class of the work document

func (*WorkDocument) GetDocumentNo

func (w *WorkDocument) GetDocumentNo() string

GetDocumentNo returns the document number of the work document

func (*WorkDocument) GetDocumentTotals

func (w *WorkDocument) GetDocumentTotals() *DocumentTotals

GetDocumentTotals returns the document totals of the work document

func (*WorkDocument) GetDocumentType

func (w *WorkDocument) GetDocumentType() string

GetDocumentType returns the document type of the work document

func (*WorkDocument) GetGrossTotal

func (w *WorkDocument) GetGrossTotal() string

GetGrossTotal returns the gross total of the work document

func (*WorkDocument) GetIssueDate

func (w *WorkDocument) GetIssueDate() string

GetIssueDate returns the issue date of the work document

func (*WorkDocument) GetStatus

func (w *WorkDocument) GetStatus() string

GetStatus returns the status of the work document

func (*WorkDocument) GetStatusDate

func (w *WorkDocument) GetStatusDate() string

GetStatusDate returns the status date of the work document

func (*WorkDocument) GetStatusReason

func (w *WorkDocument) GetStatusReason() string

GetStatusReason returns the status reason of the work document

func (*WorkDocument) GetTaxPayable

func (w *WorkDocument) GetTaxPayable() string

GetTaxPayable returns the tax payable of the work document

func (*WorkDocument) GetTaxTotal

func (w *WorkDocument) GetTaxTotal() *tax.Total

GetTaxTotal returns the tax total of the work document

func (*WorkDocument) SetStatus

func (w *WorkDocument) SetStatus(status, reason, sourceID string)

SetStatus sets the status of the work document

type WorkDocumentTotals

type WorkDocumentTotals struct {
	TaxPayable string    `xml:"TaxPayable"`
	NetTotal   string    `xml:"NetTotal"`
	GrossTotal string    `xml:"GrossTotal"`
	Currency   *Currency `xml:"Currency,omitempty"`
}

WorkDocumentTotals represents the totals of a working document

type WorkStatus

type WorkStatus struct {
	WorkStatus     string `xml:"WorkStatus"`
	WorkStatusDate string `xml:"WorkStatusDate"`
	Reason         string `xml:"Reason,omitempty"`
	SourceID       string `xml:"SourceID"`
	SourceBilling  string `xml:"SourceBilling"`
}

WorkStatus represents the status of a working document

type WorkingDocuments

type WorkingDocuments struct {
	NumberOfEntries int             `xml:"NumberOfEntries"`
	TotalDebit      string          `xml:"TotalDebit"`
	TotalCredit     string          `xml:"TotalCredit"`
	WorkDocuments   []*WorkDocument `xml:"WorkDocument,omitempty"`
}

WorkingDocuments represents the working documents of a SAF-T file

Directories

Path Synopsis
Package addon provides the SAF-T addon for Portuguese invoices.
Package addon provides the SAF-T addon for Portuguese invoices.
Package atws provides a client for the AT Web Services.
Package atws provides a client for the AT Web Services.
soap
Package soap provides types and functions to work with SOAP messages.
Package soap provides types and functions to work with SOAP messages.
Package config provides the configuration for the other gobl.pt.saft packages
Package config provides the configuration for the other gobl.pt.saft packages
Package goblwrap provides wrappers to handle GOBL types generically.
Package goblwrap provides wrappers to handle GOBL types generically.
Package realtime implements conversion from GOBL documents to the AT web service requests for realtime reporting.
Package realtime implements conversion from GOBL documents to the AT web service requests for realtime reporting.
Package test provides common functions for testing.
Package test provides common functions for testing.

Jump to

Keyboard shortcuts

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