Documentation
¶
Overview ¶
Package roefactura is the root of the Romanian e-Factura module for GOBL. The GOBL addon itself lives in the addon subpackage; this root package holds the converter and the ANAF tooling built on top of it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidDocument means the envelope does not carry a GOBL invoice // declaring the Romanian addon. ErrInvalidDocument = NewError("invalid_document") // ErrUnsupported means Romania does not accept a document of this kind. ErrUnsupported = NewError("unsupported") // ErrSkipped means the document is never reported to ANAF. ErrSkipped = NewError("skipped") // ErrConversion means the document could not be rendered. ErrConversion = NewError("conversion") // ErrUnreadable means a received document is not a UBL or CII invoice. ErrUnreadable = NewError("unreadable") )
var ( KindInvoice = Kind{Name: "invoice", Code: efactura.DocumentTypeInvoice, Status: StatusAccepted} KindCreditNote = Kind{Name: "credit-note", Code: efactura.DocumentTypeCreditNote, Status: StatusAccepted} KindCorrective = Kind{Name: "corrective", Code: efactura.DocumentTypeCorrective, Status: StatusAccepted} KindSelfBilled = Kind{Name: "self-billed", Code: efactura.DocumentTypeSelfBilled, Status: StatusAccepted} KindAccounting = Kind{Name: "accounting", Code: efactura.DocumentTypeAccounting, Status: StatusAccepted} )
Documents ANAF accepts, each with the UNTDID 1001 code the addon files it under.
var ( KindProforma = Kind{Name: "proforma", Status: StatusSkipped} KindDebitNote = Kind{Name: "debit-note", Status: StatusUnsupported} KindOther = Kind{Name: "other", Status: StatusUnsupported} )
Documents ANAF never receives.
var FormatCIUSRO = ubl.Format{ Key: "ubl+cius-ro-v1", Name: i18n.NewString("UBL CIUS-RO"), Countries: []l10n.Code{l10n.RO}, Import: []schema.ID{invoiceSchema}, Export: []schema.ID{invoiceSchema}, CustomizationID: specificationCIUSRO, Addons: []cbc.Key{efactura.V1}, VESIDs: ubl.VESIDMapping{ Invoice: "ro.gov.mfinante.cius-ro:ubl-invoice:1.0.9", CreditNote: "ro.gov.mfinante.cius-ro:ubl-creditnote:1.0.9", }, ExportFuncs: []ubl.ExportFunc{ exportSchemaLocation, exportOrderReference, exportOutsideScope, exportSelfBillingNote, }, ImportFuncs: []ubl.ImportFunc{ importDocumentType, importOutsideScope, importParties, importPaymentMeans, importAttachmentNames, importTaxCurrency, importSelfBillingNote, }, }
FormatCIUSRO is the UBL format of the Romanian CIUS: the specification identifier, the addon that has to be declared to produce it, the schematrons published for it, and the export and import funcs, in export.go and import.go, that handle what gobl.ubl cannot decide on its own.
var FormatCIUSROCII = cii.Format{ Key: "cii+cius-ro-v1", Name: i18n.NewString("CII CIUS-RO"), Countries: []l10n.Code{l10n.RO}, Import: []schema.ID{invoiceSchema}, GuidelineID: specificationCIUSRO, Version: cii.VersionD16B, Addons: []cbc.Key{efactura.V1}, ImportFuncs: []cii.ImportFunc{ importCIIDocumentType, importCIIOutsideScope, importCIIParties, importCIIPaymentMeans, importCIITaxCurrency, importCIISelfBillingNote, }, }
FormatCIUSROCII is the CII format of the Romanian CIUS, so the invoices read from CII declare the Romanian addon and get the same import funcs as UBL.
Functions ¶
func CIF ¶
CIF returns the tax number as the ANAF API wants it: the bare code, without the RO fiscal attribute. A party with no tax number, such as an enforcement body named by its legal registration identifier (BR-RO-130), gives that code instead, unless it is a personal number.
func ForwardConvert ¶
ForwardConvert renders the CIUS-RO document of a GOBL envelope. The envelope has to declare the Romanian addon and come calculated and validated with it, as a silo entry does, so it is converted as it is. Like any GOBL converter, rendering adjusts the envelope in place, such as rounding its amounts.
func Issuer ¶
Issuer returns the party ANAF files a document under: the enforcement body named as payee for an enforcement invoice, the buyer for a self-billed one, and the supplier otherwise.
func ReverseConvert ¶
ReverseConvert reads a CIUS-RO document ANAF delivered, in UBL or CII, into a GOBL invoice with the addon applied. The import funcs of FormatCIUSRO and FormatCIUSROCII restore what the generic readers cannot know about Romania.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is the standard error type of the converter.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package efactura implements the Romanian e-Factura rules as a GOBL addon, adding the RO_CIUS national rules (BR-RO) on top of the EU EN 16931 addon.
|
Package efactura implements the Romanian e-Factura rules as a GOBL addon, adding the RO_CIUS national rules (BR-RO) on top of the EU EN 16931 addon. |