Documentation ¶
Overview ¶
Package efactura provides a client for using the ANAF e-factura API.
Usage:
import "github.com/printesoi/e-factura-go"
Index ¶
- Constants
- Variables
- func MarshalIndentXML(v any, prefix, indent string) ([]byte, error)
- func MarshalIndentXMLWithHeader(v any, prefix, indent string) ([]byte, error)
- func MarshalXML(v any) ([]byte, error)
- func MarshalXMLWithHeader(v any) ([]byte, error)
- func Now() time.Time
- func TimeInRomania(t time.Time) time.Time
- func Transliterate(s string) string
- func UnmarshalInvoice(xmlData []byte, invoice *Invoice) error
- func UnmarshalXML(data []byte, v any) error
- type AmountWithCurrency
- type BuilderError
- type Client
- func (c *Client) DownloadInvoice(ctx context.Context, downloadID int64) (response *DownloadInvoiceResponse, err error)
- func (c *Client) DownloadInvoiceParseZip(ctx context.Context, downloadID int64) (response *DownloadInvoiceParseZipResponse, err error)
- func (c *Client) GetApiBaseURL() string
- func (c *Client) GetApiPublicBaseURL() string
- func (c *Client) GetMessageState(ctx context.Context, uploadIndex int64) (response *GetMessageStateResponse, err error)
- func (c *Client) GetMessagesList(ctx context.Context, cif string, numDays int, msgType MessageFilterType) (response *MessagesListResponse, err error)
- func (c *Client) GetMessagesListPagination(ctx context.Context, cif string, startTs, endTs time.Time, page int64, ...) (response *MessagesListPaginationResponse, err error)
- func (c *Client) InvoiceToPDF(ctx context.Context, invoice Invoice, noValidate bool) (response *GeneratePDFResponse, err error)
- func (c *Client) UploadInvoice(ctx context.Context, invoice Invoice, cif string, opts ...UploadOption) (response *UploadResponse, err error)
- func (c *Client) UploadRaspMessage(ctx context.Context, msg RaspMessage, cif string) (response *UploadResponse, err error)
- func (c *Client) UploadXML(ctx context.Context, xml io.Reader, st UploadStandard, cif string, ...) (response *UploadResponse, err error)
- func (c *Client) ValidateInvoice(ctx context.Context, invoice Invoice) (*ValidateResponse, error)
- func (c *Client) ValidateXML(ctx context.Context, xml io.Reader, st ValidateStandard) (*ValidateResponse, error)
- func (c *Client) XMLToPDF(ctx context.Context, xml io.Reader, st ValidateStandard, noValidate bool) (response *GeneratePDFResponse, err error)
- type ClientConfig
- type ClientConfigOption
- func ClientBasePublicURL(baseURL string) ClientConfigOption
- func ClientBaseURL(baseURL string) ClientConfigOption
- func ClientInsecureSkipVerify(skipVerify bool) ClientConfigOption
- func ClientOAuth2TokenSource(tokenSource xoauth2.TokenSource) ClientConfigOption
- func ClientProductionEnvironment(prod bool) ClientConfigOption
- func ClientSandboxEnvironment(sandbox bool) ClientConfigOption
- func ClientUserAgent(userAgent string) ClientConfigOption
- type Code
- type Country
- type CountryCodeType
- type CountrySubentityType
- type CurrencyCodeType
- type Date
- type Decimal
- func (d Decimal) Add(d2 Decimal) Decimal
- func (d Decimal) AsAmount() Decimal
- func (d Decimal) Cmp(d2 Decimal) int
- func (d Decimal) Div(d2 Decimal) Decimal
- func (d Decimal) DivRound(d2 Decimal, precision int32) Decimal
- func (d Decimal) Equal(d2 Decimal) bool
- func (d *Decimal) IsInitialized() bool
- func (d Decimal) MarshalText() (text []byte, err error)
- func (d *Decimal) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (d Decimal) Mod(d2 Decimal) Decimal
- func (d Decimal) Mul(d2 Decimal) Decimal
- func (d Decimal) Neg() Decimal
- func (d Decimal) Pow(d2 Decimal) Decimal
- func (d Decimal) Ptr() *Decimal
- func (d Decimal) Round(places int32) Decimal
- func (d Decimal) Sub(d2 Decimal) Decimal
- func (d Decimal) Truncate(precision int32) Decimal
- func (d *Decimal) UnmarshalText(text []byte) error
- func (d *Decimal) Value() Decimal
- type DownloadInvoiceParseZipResponse
- type DownloadInvoiceResponse
- type DownloadInvoiceResponseError
- type ErrorResponse
- type GeneratePDFResponse
- type GeneratePDFResponseError
- type GetMessageStateCode
- type GetMessageStateResponse
- func (r *GetMessageStateResponse) GetDownloadID() int64
- func (r *GetMessageStateResponse) GetFirstErrorMessage() string
- func (r *GetMessageStateResponse) IsInvalidXML() bool
- func (r *GetMessageStateResponse) IsNok() bool
- func (r *GetMessageStateResponse) IsOk() bool
- func (r *GetMessageStateResponse) IsProcessing() bool
- type IDNode
- type Invoice
- type InvoiceBillingReference
- type InvoiceBuilder
- func (b *InvoiceBuilder) AddTaxExemptionReason(taxCategoryCode TaxCategoryCodeType, reason string, ...) *InvoiceBuilder
- func (b *InvoiceBuilder) AppendAllowanceCharge(allowanceCharge InvoiceDocumentAllowanceCharge) *InvoiceBuilder
- func (b *InvoiceBuilder) AppendBillingReferences(billingReferences ...InvoiceDocumentReference) *InvoiceBuilder
- func (b *InvoiceBuilder) AppendInvoiceLines(lines ...InvoiceLine) *InvoiceBuilder
- func (b *InvoiceBuilder) AppendNotes(notes ...InvoiceNote) *InvoiceBuilder
- func (b InvoiceBuilder) Build() (retInvoice Invoice, err error)
- func (b *InvoiceBuilder) WithAccountingCost(accountingCost string) *InvoiceBuilder
- func (b *InvoiceBuilder) WithAllowancesCharges(allowancesCharges []InvoiceDocumentAllowanceCharge) *InvoiceBuilder
- func (b *InvoiceBuilder) WithBillingReferences(billingReferences []InvoiceDocumentReference) *InvoiceBuilder
- func (b *InvoiceBuilder) WithBuyerReference(buyerReference string) *InvoiceBuilder
- func (b *InvoiceBuilder) WithContractDocumentReference(contractDocumentReference string) *InvoiceBuilder
- func (b *InvoiceBuilder) WithCustomer(customer InvoiceCustomerParty) *InvoiceBuilder
- func (b *InvoiceBuilder) WithDocumentCurrencyCode(currencyID CurrencyCodeType) *InvoiceBuilder
- func (b *InvoiceBuilder) WithDocumentToTaxCurrencyExchangeRate(rate Decimal) *InvoiceBuilder
- func (b *InvoiceBuilder) WithDueDate(date Date) *InvoiceBuilder
- func (b *InvoiceBuilder) WithExpectedTaxInclusiveAmount(amount Decimal) *InvoiceBuilder
- func (b *InvoiceBuilder) WithID(id string) *InvoiceBuilder
- func (b *InvoiceBuilder) WithInvoiceLines(invoiceLines []InvoiceLine) *InvoiceBuilder
- func (b *InvoiceBuilder) WithInvoicePeriod(invoicePeriod InvoicePeriod) *InvoiceBuilder
- func (b *InvoiceBuilder) WithInvoiceTypeCode(invoiceType InvoiceTypeCodeType) *InvoiceBuilder
- func (b *InvoiceBuilder) WithIssueDate(date Date) *InvoiceBuilder
- func (b *InvoiceBuilder) WithNotes(notes []InvoiceNote) *InvoiceBuilder
- func (b *InvoiceBuilder) WithOrderReference(orderReference InvoiceOrderReference) *InvoiceBuilder
- func (b *InvoiceBuilder) WithPaymentMeans(paymentMeans InvoicePaymentMeans) *InvoiceBuilder
- func (b *InvoiceBuilder) WithPaymentTerms(paymentTerms InvoicePaymentTerms) *InvoiceBuilder
- func (b *InvoiceBuilder) WithSupplier(supplier InvoiceSupplierParty) *InvoiceBuilder
- func (b *InvoiceBuilder) WithTaxCurrencyCode(currencyID CurrencyCodeType) *InvoiceBuilder
- type InvoiceCustomer
- type InvoiceCustomerContact
- type InvoiceCustomerLegalEntity
- type InvoiceCustomerParty
- type InvoiceCustomerPostalAddress
- type InvoiceDelivery
- type InvoiceDeliveryAddress
- type InvoiceDeliveryLocation
- type InvoiceDocumentAllowanceCharge
- type InvoiceDocumentAllowanceChargeBuilder
- func NewInvoiceDocumentAllowanceBuilder(currencyID CurrencyCodeType, amount Decimal, taxCategory InvoiceTaxCategory) *InvoiceDocumentAllowanceChargeBuilder
- func NewInvoiceDocumentAllowanceChargeBuilder(chargeIndicator bool, currencyID CurrencyCodeType, amount Decimal, ...) *InvoiceDocumentAllowanceChargeBuilder
- func NewInvoiceDocumentChargeBuilder(currencyID CurrencyCodeType, amount Decimal, taxCategory InvoiceTaxCategory) *InvoiceDocumentAllowanceChargeBuilder
- func (b InvoiceDocumentAllowanceChargeBuilder) Build() (allowanceCharge InvoiceDocumentAllowanceCharge, err error)
- func (b *InvoiceDocumentAllowanceChargeBuilder) WithAllowanceChargeReason(allowanceChargeReason string) *InvoiceDocumentAllowanceChargeBuilder
- func (b *InvoiceDocumentAllowanceChargeBuilder) WithAllowanceChargeReasonCode(allowanceChargeReasonCode string) *InvoiceDocumentAllowanceChargeBuilder
- func (b *InvoiceDocumentAllowanceChargeBuilder) WithAmount(amount Decimal) *InvoiceDocumentAllowanceChargeBuilder
- func (b *InvoiceDocumentAllowanceChargeBuilder) WithBaseAmount(amount Decimal) *InvoiceDocumentAllowanceChargeBuilder
- func (b *InvoiceDocumentAllowanceChargeBuilder) WithChargeIndicator(charge bool) *InvoiceDocumentAllowanceChargeBuilder
- func (b *InvoiceDocumentAllowanceChargeBuilder) WithCurrencyID(currencyID CurrencyCodeType) *InvoiceDocumentAllowanceChargeBuilder
- func (b *InvoiceDocumentAllowanceChargeBuilder) WithTaxCategory(taxCategory InvoiceTaxCategory) *InvoiceDocumentAllowanceChargeBuilder
- type InvoiceDocumentReference
- type InvoiceErrorMessage
- type InvoiceLegalMonetaryTotal
- type InvoiceLine
- type InvoiceLineAllowanceCharge
- type InvoiceLineAllowanceChargeBuilder
- func NewInvoiceLineAllowanceBuilder(currencyID CurrencyCodeType, amount Decimal) *InvoiceLineAllowanceChargeBuilder
- func NewInvoiceLineAllowanceChargeBuilder(chargeIndicator bool, currencyID CurrencyCodeType, amount Decimal) *InvoiceLineAllowanceChargeBuilder
- func NewInvoiceLineChargeBuilder(currencyID CurrencyCodeType, amount Decimal) *InvoiceLineAllowanceChargeBuilder
- func (b InvoiceLineAllowanceChargeBuilder) Build() (allowanceCharge InvoiceLineAllowanceCharge, err error)
- func (b *InvoiceLineAllowanceChargeBuilder) WithAllowanceChargeReason(allowanceChargeReason string) *InvoiceLineAllowanceChargeBuilder
- func (b *InvoiceLineAllowanceChargeBuilder) WithAllowanceChargeReasonCode(allowanceChargeReasonCode string) *InvoiceLineAllowanceChargeBuilder
- func (b *InvoiceLineAllowanceChargeBuilder) WithAmount(amount Decimal) *InvoiceLineAllowanceChargeBuilder
- func (b *InvoiceLineAllowanceChargeBuilder) WithBaseAmount(amount Decimal) *InvoiceLineAllowanceChargeBuilder
- func (b *InvoiceLineAllowanceChargeBuilder) WithChargeIndicator(charge bool) *InvoiceLineAllowanceChargeBuilder
- func (b *InvoiceLineAllowanceChargeBuilder) WithCurrencyID(currencyID CurrencyCodeType) *InvoiceLineAllowanceChargeBuilder
- type InvoiceLineBuilder
- func (b *InvoiceLineBuilder) AppendAllowanceCharge(allowanceCharge InvoiceLineAllowanceCharge) *InvoiceLineBuilder
- func (b InvoiceLineBuilder) Build() (line InvoiceLine, err error)
- func (b *InvoiceLineBuilder) WithAllowancesCharges(allowancesCharges []InvoiceLineAllowanceCharge) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithBaseQuantity(quantity Decimal) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithCurrencyID(currencyID CurrencyCodeType) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithGrossPriceAmount(priceAmount Decimal) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithID(id string) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithInvoicePeriod(invoicePeriod *InvoiceLinePeriod) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithInvoicedQuantity(quantity Decimal) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithItemCommodityClassification(classification ItemCommodityClassification) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithItemDescription(description string) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithItemName(name string) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithItemSellerID(id string) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithItemStandardItemIdentification(identification ItemStandardIdentificationCode) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithItemTaxCategory(taxCategory InvoiceLineTaxCategory) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithNote(note string) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithPriceDeduction(deduction Decimal) *InvoiceLineBuilder
- func (b *InvoiceLineBuilder) WithUnitCode(unitCode UnitCodeType) *InvoiceLineBuilder
- type InvoiceLineItem
- type InvoiceLinePeriod
- type InvoiceLinePrice
- type InvoiceLinePriceAllowanceCharge
- type InvoiceLineTaxCategory
- type InvoiceNote
- type InvoiceNoteSubjectCodeType
- type InvoiceOrderReference
- type InvoicePartyIdentification
- type InvoicePartyName
- type InvoicePartyTaxScheme
- type InvoicePayee
- type InvoicePaymentMeans
- type InvoicePaymentTerms
- type InvoicePeriod
- type InvoiceSupplier
- type InvoiceSupplierContact
- type InvoiceSupplierLegalEntity
- type InvoiceSupplierParty
- type InvoiceSupplierPostalAddress
- type InvoiceTaxCategory
- type InvoiceTaxRepresentative
- type InvoiceTaxRepresentativePostalAddress
- type InvoiceTaxSubtotal
- type InvoiceTaxTotal
- type InvoiceTypeCodeType
- type InvoicedQuantity
- type ItemClassificationCode
- type ItemCommodityClassification
- type ItemStandardIdentificationCode
- type LimitExceededError
- type Message
- func (m Message) GetBuyerCIF() (buyerCIF string)
- func (m Message) GetCreationDate() (time.Time, bool)
- func (m Message) GetID() int64
- func (m Message) GetSellerCIF() (sellerCIF string)
- func (m Message) GetUploadIndex() int64
- func (m Message) IsBuyerMessage() bool
- func (m Message) IsError() bool
- func (m Message) IsReceivedInvoice() bool
- func (m Message) IsSelfBilledInvoice() bool
- func (m Message) IsSentInvoice() bool
- type MessageFilterType
- type MessagesListPaginationResponse
- type MessagesListResponse
- type PayeeFinancialAccount
- type PaymentMeansCode
- type PaymentMeansCodeType
- type PostalAddress
- type RaspMessage
- type RequestOption
- type TaxCategoryCodeType
- type TaxExemptionReasonCodeType
- type TaxScheme
- type TaxSchemeIDType
- type UnitCodeType
- type UploadOption
- type UploadResponse
- type UploadStandard
- type ValidateResponse
- type ValidateSignatureError
- type ValidateStandard
- type ValueWithAttrs
Constants ¶
const ( // VATEX-EU-79-C - Exceptie cf. Art. 79, lit c din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_79_C = "VATEX-EU-79-C" // VATEX-EU-132 - Exceptie cf. Art. 132 din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132 = "VATEX-EU-132" // VATEX-EU-132-1A - Exceptie cf. Art. 132 , alin. 1, lit (a) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1A = "VATEX-EU-132-1A" // VATEX-EU-132-1B - Exceptie cf. Art. 132 , alin. 1, lit (b) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1B = "VATEX-EU-132-1B" // VATEX-EU-132-1C - Exceptie cf. Art. 132 , alin. 1, lit (c) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1C = "VATEX-EU-132-1C" // VATEX-EU-132-1D - Exceptie cf. Art. 132 , alin. 1, lit (d) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1D = "VATEX-EU-132-1D" // VATEX-EU-132-1E - Exceptie cf. Art. 132 , alin. 1, lit (e) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1E = "VATEX-EU-132-1E" // VATEX-EU-132-1F - Exceptie cf. Art. 132 , alin. 1, lit (f) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1F = "VATEX-EU-132-1F" // VATEX-EU-132-1G - Exceptie cf. Art. 132 , alin. 1, lit (g) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1G = "VATEX-EU-132-1G" // VATEX-EU-132-1H - Exceptie cf. Art. 132 , alin. 1, lit (h) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1H = "VATEX-EU-132-1H" // VATEX-EU-132-1I - Exceptie cf. Art. 132 , alin. 1, lit (i) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1I = "VATEX-EU-132-1I" // VATEX-EU-132-1J - Exceptie cf. Art. 132 , alin. 1, lit (j) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1J = "VATEX-EU-132-1J" // VATEX-EU-132-1K - Exceptie cf. Art. 132 , alin. 1, lit (k) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1K = "VATEX-EU-132-1K" // VATEX-EU-132-1L - Exceptie cf. Art. 132 , alin. 1, lit (l) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1L = "VATEX-EU-132-1L" // VATEX-EU-132-1M - Exceptie cf. Art. 132 , alin. 1, lit (m) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1M = "VATEX-EU-132-1M" // VATEX-EU-132-1N - Exceptie cf. Art. 132 , alin. 1, lit (n) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1N = "VATEX-EU-132-1N" // VATEX-EU-132-1O - Exceptie cf. Art. 132 , alin. 1, lit (o) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1O = "VATEX-EU-132-1O" // VATEX-EU-132-1P - Exceptie cf. Art. 132 , alin. 1, lit (p) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1P = "VATEX-EU-132-1P" // VATEX-EU-132-1Q - Exceptie cf. Art. 132 , alin. 1, lit (q) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_132_1Q = "VATEX-EU-132-1Q" // VATEX-EU-143 - Exceptie cf. Art. 143 din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143 = "VATEX-EU-143" // VATEX-EU-143-1A - Exceptie cf. Art. 143, alin. 1, lit (a) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1A = "VATEX-EU-143-1A" // VATEX-EU-143-1B - Exceptie cf. Art. 143, alin. 1, lit (b) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1B = "VATEX-EU-143-1B" // VATEX-EU-143-1C - Exceptie cf. Art. 143, alin. 1, lit (c) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1C = "VATEX-EU-143-1C" // VATEX-EU-143-1D - Exceptie cf. Art. 143, alin. 1, lit (d) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1D = "VATEX-EU-143-1D" // VATEX-EU-143-1E - Exceptie cf. Art. 143, alin. 1, lit (e) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1E = "VATEX-EU-143-1E" // VATEX-EU-143-1F - Exceptie cf. Art. 143, alin. 1, lit (f) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1F = "VATEX-EU-143-1F" // VATEX-EU-143-1FA - Exceptie cf. Art. 143, alin. 1, lit (fa) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1FA = "VATEX-EU-143-1FA" // VATEX-EU-143-1G - Exceptie cf. Art. 143, alin. 1, lit (g) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1G = "VATEX-EU-143-1G" // VATEX-EU-143-1H - Exceptie cf. Art. 143, alin. 1, lit (h) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1H = "VATEX-EU-143-1H" // VATEX-EU-143-1I - Exceptie cf. Art. 143, alin. 1, lit (i) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1I = "VATEX-EU-143-1I" // VATEX-EU-143-1J - Exceptie cf. Art. 143, alin. 1, lit (j) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1J = "VATEX-EU-143-1J" // VATEX-EU-143-1K - Exceptie cf. Art. 143, alin. 1, lit (k) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1K = "VATEX-EU-143-1K" // VATEX-EU-143-1L - Exceptie cf. Art. 143, alin. 1, lit (l) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_143_1L = "VATEX-EU-143-1L" // VATEX-EU-148 - Exceptie cf. Art. 148 din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_148 = "VATEX-EU-148" // VATEX-EU-148-A - Exceptie cf. Art. 148, lit. (a) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_148_A = "VATEX-EU-148-A" // VATEX-EU-148-B - Exceptie cf. Art. 148, lit. (b) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_148_B = "VATEX-EU-148-B" // VATEX-EU-148-C - Exceptie cf. Art. 148, lit. (c) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_148_C = "VATEX-EU-148-C" // VATEX-EU-148-D - Exceptie cf. Art. 148, lit. (d) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_148_D = "VATEX-EU-148-D" // VATEX-EU-148-E - Exceptie cf. Art. 148, lit. (e) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_148_E = "VATEX-EU-148-E" // VATEX-EU-148-F - Exceptie cf. Art. 148, lit. (f) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_148_F = "VATEX-EU-148-F" // VATEX-EU-148-G - Exceptie cf. Art. 148, lit. (g) din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_148_G = "VATEX-EU-148-G" // VATEX-EU-151 - Exceptie cf. Art. 151 din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_151 = "VATEX-EU-151" // VATEX-EU-151-1A - Exceptie cf. Art. 151, alin. 1, lit (a). din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_151_1A = "VATEX-EU-151-1A" // VATEX-EU-151-1AA - Exceptie cf. Art. 151, alin. 1, lit (aa). din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_151_1AA = "VATEX-EU-151-1AA" // VATEX-EU-151-1B - Exceptie cf. Art. 151, alin. 1, lit (b). din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_151_1B = "VATEX-EU-151-1B" // VATEX-EU-151-1C - Exceptie cf. Art. 151, alin. 1, lit (c). din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_151_1C = "VATEX-EU-151-1C" // VATEX-EU-151-1D - Exceptie cf. Art. 151, alin. 1, lit (d). din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_151_1D = "VATEX-EU-151-1D" // VATEX-EU-151-1E - Exceptie cf. Art. 151, alin. 1, lit (e). din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_151_1E = "VATEX-EU-151-1E" // VATEX-EU-309 - Exceptie cf. Art. 309 din Directiva 2006/112/EC TaxExemptionCodeVATEX_EU_309 = "VATEX-EU-309" // VATEX-EU-AE - Taxare inversa TaxExemptionCodeVATEX_EU_AE = "VATEX-EU-AE" // VATEX-EU-D - Intra-Regim special pentru agentiile de turism TaxExemptionCodeVATEX_EU_D = "VATEX-EU-D" // VATEX-EU-F - Regim special pentru bunuri second hand TaxExemptionCodeVATEX_EU_F = "VATEX-EU-F" // VATEX-EU-G - Export in afara UE TaxExemptionCodeVATEX_EU_G = "VATEX-EU-G" // VATEX-EU-I - Regim special pentru obiecte de arta TaxExemptionCodeVATEX_EU_I = "VATEX-EU-I" // VATEX-EU-IC - Livrare intra-comunitara TaxExemptionCodeVATEX_EU_IC = "VATEX-EU-IC" // VATEX-EU-J - Regim special pentru obiecte de colectie si antichitati TaxExemptionCodeVATEX_EU_J = "VATEX-EU-J" // VATEX-EU-O - Nu face obiectul TVA TaxExemptionCodeVATEX_EU_O = "VATEX-EU-O" )
const ( CityNameROBSector1 = "SECTOR1" CityNameROBSector2 = "SECTOR2" CityNameROBSector3 = "SECTOR3" CityNameROBSector4 = "SECTOR4" CityNameROBSector5 = "SECTOR5" CityNameROBSector6 = "SECTOR6" )
If the country code for a postal address is RO-B, then the City name must be one of the following values.
const ( CodeOk Code = "ok" CodeNok Code = "nok" ValidateStandardFACT1 ValidateStandard = "FACT1" ValidateStandardFCN ValidateStandard = "FCN" GetMessageStateCodeOk GetMessageStateCode = "ok" GetMessageStateCodeNok GetMessageStateCode = "nok" GetMessageStateCodeInvalidXML GetMessageStateCode = "XML cu erori nepreluat de sistem" GetMessageStateCodeProcessing GetMessageStateCode = "in prelucrare" UploadStandardUBL UploadStandard = "UBL" UploadStandardCN UploadStandard = "CN" UploadStandardCII UploadStandard = "CII" UploadStandardRASP UploadStandard = "RASP" // A No-op filter that returns all messages MessageFilterAll MessageFilterType = iota // Filter that returns only the errors MessageFilterErrors // Filter that returns only the sent invoices MessageFilterSent // Filter that returns only the received invoices MessageFilterReceived // Filter that returns only the customer send or received messages MessageFilterBuyerMessage // MessageTypeError MessageTypeError = "ERORI FACTURA" MessageTypeSentInvoice = "FACTURA TRIMISA" MessageTypeReceivedInvoice = "FACTURA PRIMITA" MessageTypeBuyerMessage = "MESAJ CUMPARATOR PRIMIT / MESAJ CUMPARATOR TRANSMIS" )
const ( XMLNSInvoice2 = "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" XMLNSUBLcac = "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" XMLNSUBLcbc = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" // e-factura: Customization ID implemented CIUS-RO v1.0.1 CIUSRO_v101 = "urn:cen.eu:en16931:2017#compliant#urn:efactura.mfinante.ro:CIUS-RO:1.0.1" // e-factura: UBL Version implemented UBLVersionID = "2.1" XMLNSMsgErrorV1 = "mfp:anaf:dgti:efactura:mesajEroriFactuta:v1" )
Constants for namespaces and versions
const (
Version = "v0.0.1-alpha"
)
Variables ¶
var ( // For convenience CountryRO = Country{ Code: CountryCodeRO, } )
var ( // RoZoneLocation is the Romanian timezone location loaded in the init // function. This library does NOT load the time/tzdata package for the // embedded timezone database, so the user of this library is responsible // to ensure the Europe/Bucharest location is available, otherwise UTC is // used and may lead to unexpected results. RoZoneLocation *time.Location )
var ( TaxSchemeVAT = TaxScheme{ ID: TaxSchemeIDVAT, } )
Functions ¶
func MarshalIndentXML ¶
MarshalIndentXML works like MarshalXML, but each XML element begins on a new indented line that starts with prefix and is followed by one or more copies of indent according to the nesting depth. This method does NOT include the XML header declaration.
func MarshalIndentXMLWithHeader ¶
MarshalIndentXMLWithHeader same as MarshalIndentXML, but also add the XML header declaration.
func MarshalXML ¶
MarshalXML returns the XML encoding of v in Canonical XML form [XML-C14N]. This method must be used for marshaling objects from this library, instead of encoding/xml. This method does NOT include the XML header declaration.
func MarshalXMLWithHeader ¶
MarshalXMLWithHeader same as MarshalXML, but also add the XML header declaration.
func TimeInRomania ¶
TimeInRomania returns the time t in Romanian zone location (Europe/Bucharest).
func Transliterate ¶
Transliterate performs Unicode -> ASCII transliteration of the input text, basically transforms diacritics and characters from other alphabets to their ASCII variant (ă -> a, â -> a, é -> e, 池 -> Chi, ы -> y, etc). This method is useful for strings that may contain diacritics that must be used in an Invoice, like an Item name or Address line1, since ANAF discards non-ASCII characters.
func UnmarshalInvoice ¶
UnmarshalInvoice unmarshals an Invoice from XML data. Only use this method for unmarshaling an Invoice, since the standard encoding/xml cannot properly unmarshal a struct like Invoice due to namespace prefixes. This method does not check if the unmarshaled Invoice is valid.
func UnmarshalXML ¶
Unmarshal parses the XML-encoded data and stores the result in the value pointed to by v, which must be an arbitrary struct, slice, or string. Well-formed data that does not fit into v is discarded. This method must be used for unmarshaling objects from this library, instead of encoding/xml.
Types ¶
type AmountWithCurrency ¶
type AmountWithCurrency struct { Amount Decimal `xml:",chardata"` CurrencyID CurrencyCodeType `xml:"currencyID,attr,omitempty"` }
AmountWithCurrency represents an embeddable type that stores an amount as chardata and the currency ID as the currencyID attribute. The name of the node must be controlled by the parent type.
func (AmountWithCurrency) MarshalXML ¶
func (a AmountWithCurrency) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML implements the xml.Marshaler interface. We use a custom marshaling function for AmountWithCurrency to ensure two digits after the decimal point.
type BuilderError ¶
BuilderError is an error returned by the builders.
func (*BuilderError) Error ¶
func (e *BuilderError) Error() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client manages communication with the ANAF e-factura APIs using OAuth2 credentials.
func NewClient ¶
func NewClient(ctx context.Context, opts ...ClientConfigOption) (*Client, error)
NewClient creates a new client using the provided config options.
func (*Client) DownloadInvoice ¶
func (c *Client) DownloadInvoice( ctx context.Context, downloadID int64, ) (response *DownloadInvoiceResponse, err error)
DownloadInvoice downloads an invoice zip for a given download index.
func (*Client) DownloadInvoiceParseZip ¶
func (c *Client) DownloadInvoiceParseZip( ctx context.Context, downloadID int64, ) (response *DownloadInvoiceParseZipResponse, err error)
DownloadInvoiceParseZip same as DownloadInvoice but also parses the zip archive. If the response is not nil, the DownloadResponse will always be set. If there was an error parsing the zip archive, the response will contain the download response, and an error is returned. This method is not validating the signature.
func (*Client) GetApiBaseURL ¶
GetApiBaseURL returns the base URL as string used by this client.
func (*Client) GetApiPublicBaseURL ¶
GetApiPublicBaseURL returns the base URL as string used by this client.
func (*Client) GetMessageState ¶
func (c *Client) GetMessageState( ctx context.Context, uploadIndex int64, ) (response *GetMessageStateResponse, err error)
GetMessageState fetch the state of a message. The uploadIndex must a result from an upload operation.
func (*Client) GetMessagesList ¶
func (c *Client) GetMessagesList( ctx context.Context, cif string, numDays int, msgType MessageFilterType, ) (response *MessagesListResponse, err error)
GetMessages fetches the list of messages for a provided cif, number of days and a filter. For fetching all messages use MessageFilterAll as the value for msgType. NOTE: If there are no messages for the given interval, ANAF APIs return an error. For this case, the response.IsOk() returns true and the Messages slice is empty, since I don't think that no messages should result in an error.
func (*Client) GetMessagesListPagination ¶
func (c *Client) GetMessagesListPagination( ctx context.Context, cif string, startTs, endTs time.Time, page int64, msgType MessageFilterType, ) (response *MessagesListPaginationResponse, err error)
GetMessagesListPagination fetches the list of messages for a provided cif, start time (unix time in milliseconds), end time (unix time in milliseconds) and a filter. For fetching all messages use MessageFilterAll as the value for msgType. NOTE: If there are no messages for the given interval, ANAF APIs return an error. For this case, the response.IsOk() returns true, response.TotalRecords = 0, and the Messages slice is empty, since I don't think that no messages should result in an error.
func (*Client) InvoiceToPDF ¶
func (c *Client) InvoiceToPDF(ctx context.Context, invoice Invoice, noValidate bool) (response *GeneratePDFResponse, err error)
InvoiceToPDF convert the given Invoice to PDF. See XMLToPDF for return values.
func (*Client) UploadInvoice ¶
func (c *Client) UploadInvoice( ctx context.Context, invoice Invoice, cif string, opts ...UploadOption, ) (response *UploadResponse, err error)
UploadInvoice uploads the given Invoice with the provided optional options.
func (*Client) UploadRaspMessage ¶
func (c *Client) UploadRaspMessage( ctx context.Context, msg RaspMessage, cif string, ) (response *UploadResponse, err error)
UploadRaspMessage uploads the given RaspMessage.
func (*Client) UploadXML ¶
func (c *Client) UploadXML( ctx context.Context, xml io.Reader, st UploadStandard, cif string, opts ...UploadOption, ) (response *UploadResponse, err error)
UploadXML uploads and invoice or message XML. Optional upload options can be provided via call params.
func (*Client) ValidateInvoice ¶
ValidateInvoice validate the provided Invoice
func (*Client) ValidateXML ¶
func (c *Client) ValidateXML(ctx context.Context, xml io.Reader, st ValidateStandard) (*ValidateResponse, error)
ValidateXML call the validate endpoint with the given standard and XML body reader.
func (*Client) XMLToPDF ¶
func (c *Client) XMLToPDF(ctx context.Context, xml io.Reader, st ValidateStandard, noValidate bool) (response *GeneratePDFResponse, err error)
XMLToPDF converts the given XML to PDF. To check if the generation is indeed successful and no validation or other invalid request error occured, check if response.IsOk() == true.
type ClientConfig ¶
type ClientConfig struct { // TokenSource is the token source used for generating OAuth2 tokens. // Until this library will support authentication with the SPV certificate, // this must always be provided. TokenSource xoauth2.TokenSource // Unless BaseURL is set, Sandbox controlls whether to use production // endpoints (if set to false) or test endpoints (if set to true). Sandbox bool // User agent used when communicating with the ANAF API. UserAgent *string // Base URL of the ANAF e-factura protected APIs. It is only useful in // development/testing environments. BaseURL *string // Base URL of the ANAF e-factura public(unprotected) APIs. It is only // useful in development/testing environments. BasePublicURL *string // Whether to skip the verification of the SSL certificate (default false). // Since this is a security risk, it should only be use with a custom // BaseURL in development/testing environments. InsecureSkipVerify bool }
ClientConfig is the config used to create a Client
type ClientConfigOption ¶
type ClientConfigOption func(*ClientConfig)
ClientConfigOption allows gradually modifying a ClientConfig
func ClientBasePublicURL ¶
func ClientBasePublicURL(baseURL string) ClientConfigOption
ClientBasePublicURL sets the BaseURL to the given url. This should only be used when testing or using a custom endpoint for debugging.
func ClientBaseURL ¶
func ClientBaseURL(baseURL string) ClientConfigOption
ClientBaseURL sets the BaseURL to the given url. This should only be used when testing or using a custom endpoint for debugging.
func ClientInsecureSkipVerify ¶
func ClientInsecureSkipVerify(skipVerify bool) ClientConfigOption
ClientInsecureSkipVerify allows only setting InsecureSkipVerify. Please check the documentation for the InsecureSkipVerify field for a warning.
func ClientOAuth2TokenSource ¶
func ClientOAuth2TokenSource(tokenSource xoauth2.TokenSource) ClientConfigOption
ClientOAuth2TokenSource sets the token source to use.
func ClientProductionEnvironment ¶
func ClientProductionEnvironment(prod bool) ClientConfigOption
ClientProductionEnvironment(true) set the BaseURL to the production URL
func ClientSandboxEnvironment ¶
func ClientSandboxEnvironment(sandbox bool) ClientConfigOption
ClientSandboxEnvironment(true) set the BaseURL to the sandbox URL
func ClientUserAgent ¶
func ClientUserAgent(userAgent string) ClientConfigOption
ClientUserAgent sets the user agent used to communicate with the ANAF API.
type Country ¶
type Country struct {
Code CountryCodeType `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 IdentificationCode"`
}
type CountryCodeType ¶
type CountryCodeType string
const ( // RO - Romania CountryCodeRO CountryCodeType = "RO" // AD - Andorra CountryCodeAD CountryCodeType = "AD" // AE - United Arab Emirates CountryCodeAE CountryCodeType = "AE" // AF - Afghanistan CountryCodeAF CountryCodeType = "AF" // AG - Antigua and Barbuda CountryCodeAG CountryCodeType = "AG" // AI - Anguilla CountryCodeAI CountryCodeType = "AI" // AL - Albania CountryCodeAL CountryCodeType = "AL" // AM - Armenia CountryCodeAM CountryCodeType = "AM" // AO - Angola CountryCodeAO CountryCodeType = "AO" // AQ - Antarctica CountryCodeAQ CountryCodeType = "AQ" // AR - Argentina CountryCodeAR CountryCodeType = "AR" // AS - American Samoa CountryCodeAS CountryCodeType = "AS" // AT - Austria CountryCodeAT CountryCodeType = "AT" // AU - Australia CountryCodeAU CountryCodeType = "AU" // AW - Aruba CountryCodeAW CountryCodeType = "AW" // AX - Aland Islands CountryCodeAX CountryCodeType = "AX" // AZ - Azerbaijan CountryCodeAZ CountryCodeType = "AZ" // BA - Bosnia and Herzegovina CountryCodeBA CountryCodeType = "BA" // BB - Barbados CountryCodeBB CountryCodeType = "BB" // BD - Bangladesh CountryCodeBD CountryCodeType = "BD" // BE - Belgium CountryCodeBE CountryCodeType = "BE" // BF - Burkina Faso CountryCodeBF CountryCodeType = "BF" // BG - Bulgaria CountryCodeBG CountryCodeType = "BG" // BH - Bahrain CountryCodeBH CountryCodeType = "BH" // BI - Burundi CountryCodeBI CountryCodeType = "BI" // BJ - Benin CountryCodeBJ CountryCodeType = "BJ" // BL - Saint Barthélemy CountryCodeBL CountryCodeType = "BL" // BM - Bermuda CountryCodeBM CountryCodeType = "BM" // BN - Brunei Darussalam CountryCodeBN CountryCodeType = "BN" // BO - Bolivia, Plurinational State of CountryCodeBO CountryCodeType = "BO" // BQ - Bonaire, Sint Eustatius and Saba CountryCodeBQ CountryCodeType = "BQ" // BR - Brazil CountryCodeBR CountryCodeType = "BR" // BS - Bahamas CountryCodeBS CountryCodeType = "BS" // BT - Bhutan CountryCodeBT CountryCodeType = "BT" // BV - Bouvet Island CountryCodeBV CountryCodeType = "BV" // BW - Botswana CountryCodeBW CountryCodeType = "BW" // BY - Belarus CountryCodeBY CountryCodeType = "BY" // BZ - Belize CountryCodeBZ CountryCodeType = "BZ" // CA - Canada CountryCodeCA CountryCodeType = "CA" // CC - Cocos (Keeling) Islands CountryCodeCC CountryCodeType = "CC" // CD - Congo, the Democratic Republic of the CountryCodeCD CountryCodeType = "CD" // CF - Central African Republic CountryCodeCF CountryCodeType = "CF" // CG - Congo CountryCodeCG CountryCodeType = "CG" // CH - Switzerland CountryCodeCH CountryCodeType = "CH" // CI - Côte d'Ivoire CountryCodeCI CountryCodeType = "CI" // CK - Cook Islands CountryCodeCK CountryCodeType = "CK" // CL - Chile CountryCodeCL CountryCodeType = "CL" // CM - Cameroon CountryCodeCM CountryCodeType = "CM" // CN - China CountryCodeCN CountryCodeType = "CN" // CO - Colombia CountryCodeCO CountryCodeType = "CO" // CR - Costa Rica CountryCodeCR CountryCodeType = "CR" // CU - Cuba CountryCodeCU CountryCodeType = "CU" // CV - Cabo Verde CountryCodeCV CountryCodeType = "CV" // CW - Curaçao CountryCodeCW CountryCodeType = "CW" // CX - Christmas Island CountryCodeCX CountryCodeType = "CX" // CY - Cyprus CountryCodeCY CountryCodeType = "CY" // CZ - Czechia CountryCodeCZ CountryCodeType = "CZ" // DE - Germany CountryCodeDE CountryCodeType = "DE" // DJ - Djibouti CountryCodeDJ CountryCodeType = "DJ" // DK - Denmark CountryCodeDK CountryCodeType = "DK" // DM - Dominica CountryCodeDM CountryCodeType = "DM" // DO - Dominican Republic CountryCodeDO CountryCodeType = "DO" // DZ - Algeria CountryCodeDZ CountryCodeType = "DZ" // EC - Ecuador CountryCodeEC CountryCodeType = "EC" // EE - Estonia CountryCodeEE CountryCodeType = "EE" // EG - Egypt CountryCodeEG CountryCodeType = "EG" // EH - Western Sahara CountryCodeEH CountryCodeType = "EH" // ER - Eritrea CountryCodeER CountryCodeType = "ER" // ES - Spain CountryCodeES CountryCodeType = "ES" // ET - Ethiopia CountryCodeET CountryCodeType = "ET" // FI - Finland CountryCodeFI CountryCodeType = "FI" // FJ - Fiji CountryCodeFJ CountryCodeType = "FJ" // FK - Falkland Islands (Malvinas) CountryCodeFK CountryCodeType = "FK" // FM - Micronesia, Federated States of CountryCodeFM CountryCodeType = "FM" // FO - Faroe Islands CountryCodeFO CountryCodeType = "FO" // FR - France CountryCodeFR CountryCodeType = "FR" // GA - Gabon CountryCodeGA CountryCodeType = "GA" // GB - United Kingdom of Great Britain and Northern Ireland CountryCodeGB CountryCodeType = "GB" // GD - Grenada CountryCodeGD CountryCodeType = "GD" // GE - Georgia CountryCodeGE CountryCodeType = "GE" // GF - French Guiana CountryCodeGF CountryCodeType = "GF" // GG - Guernsey CountryCodeGG CountryCodeType = "GG" // GH - Ghana CountryCodeGH CountryCodeType = "GH" // GI - Gibraltar CountryCodeGI CountryCodeType = "GI" // GL - Greenland CountryCodeGL CountryCodeType = "GL" // GM - Gambia CountryCodeGM CountryCodeType = "GM" // GN - Guinea CountryCodeGN CountryCodeType = "GN" // GP - Guadeloupe CountryCodeGP CountryCodeType = "GP" // GQ - Equatorial Guinea CountryCodeGQ CountryCodeType = "GQ" // GR - Greece CountryCodeGR CountryCodeType = "GR" // GS - South Georgia and the South Sandwich Islands CountryCodeGS CountryCodeType = "GS" // GT - Guatemala CountryCodeGT CountryCodeType = "GT" // GU - Guam CountryCodeGU CountryCodeType = "GU" // GW - Gu inea-Bissau CountryCodeGW CountryCodeType = "GW" // GY - Guyana CountryCodeGY CountryCodeType = "GY" // HK - Hong Kong CountryCodeHK CountryCodeType = "HK" // HM - Heard Island and McDonald Islands CountryCodeHM CountryCodeType = "HM" // HN - Honduras CountryCodeHN CountryCodeType = "HN" // HR - Croatia CountryCodeHR CountryCodeType = "HR" // HT - Haiti CountryCodeHT CountryCodeType = "HT" // HU - Hungary CountryCodeHU CountryCodeType = "HU" // ID - Indonesia CountryCodeID CountryCodeType = "ID" // IE - Ireland CountryCodeIE CountryCodeType = "IE" // IL - Israel CountryCodeIL CountryCodeType = "IL" // IM - Isle of Man CountryCodeIM CountryCodeType = "IM" // IN - India CountryCodeIN CountryCodeType = "IN" // IO - British Indian Ocean Territory CountryCodeIO CountryCodeType = "IO" // IQ - Iraq CountryCodeIQ CountryCodeType = "IQ" // IR - Iran, Islamic Republic of CountryCodeIR CountryCodeType = "IR" // IS - Iceland CountryCodeIS CountryCodeType = "IS" // IT - Italy CountryCodeIT CountryCodeType = "IT" // JE - Jersey CountryCodeJE CountryCodeType = "JE" // JM - Jamaica CountryCodeJM CountryCodeType = "JM" // JO - Jordan CountryCodeJO CountryCodeType = "JO" // JP - Japan CountryCodeJP CountryCodeType = "JP" // KE - Kenya CountryCodeKE CountryCodeType = "KE" // KG - Kyrgyzstan CountryCodeKG CountryCodeType = "KG" // KH - Cambodia CountryCodeKH CountryCodeType = "KH" // KI - Kiribati CountryCodeKI CountryCodeType = "KI" // KM - Comoros CountryCodeKM CountryCodeType = "KM" // KN - Saint Kitts and Nevis CountryCodeKN CountryCodeType = "KN" // KP - Korea, Democratic People's Republic of CountryCodeKP CountryCodeType = "KP" // KR - Korea, Republic of CountryCodeKR CountryCodeType = "KR" // KW - Kuwait CountryCodeKW CountryCodeType = "KW" // KY - Cayman Islands CountryCodeKY CountryCodeType = "KY" // KZ - Kazakhstan CountryCodeKZ CountryCodeType = "KZ" // LA - Lao People's Democratic Republic CountryCodeLA CountryCodeType = "LA" // LB - Lebanon CountryCodeLB CountryCodeType = "LB" // LC - Saint Lucia CountryCodeLC CountryCodeType = "LC" // LI - Liechtenstein CountryCodeLI CountryCodeType = "LI" // LK - Sri Lanka CountryCodeLK CountryCodeType = "LK" // LR - Liberia CountryCodeLR CountryCodeType = "LR" // LS - Lesotho CountryCodeLS CountryCodeType = "LS" // LT - Lithuania CountryCodeLT CountryCodeType = "LT" // LU - Luxembourg CountryCodeLU CountryCodeType = "LU" // LV - Latvia CountryCodeLV CountryCodeType = "LV" // LY - Libya CountryCodeLY CountryCodeType = "LY" // MA - Morocco CountryCodeMA CountryCodeType = "MA" // MC - Monaco CountryCodeMC CountryCodeType = "MC" // MD - Moldova, Republic of CountryCodeMD CountryCodeType = "MD" // ME - Montenegro CountryCodeME CountryCodeType = "ME" // MF - Saint Martin (French part) CountryCodeMF CountryCodeType = "MF" // MG - Madagascar CountryCodeMG CountryCodeType = "MG" // MH - Marshall Islands CountryCodeMH CountryCodeType = "MH" // MK - Macedonia, the former Yugoslav Republic of CountryCodeMK CountryCodeType = "MK" // ML - Mali CountryCodeML CountryCodeType = "ML" // MM - Myanmar CountryCodeMM CountryCodeType = "MM" // MN - Mongolia CountryCodeMN CountryCodeType = "MN" // MO - Macao CountryCodeMO CountryCodeType = "MO" // MP - Northern Mariana Islands CountryCodeMP CountryCodeType = "MP" // MQ - Martinique CountryCodeMQ CountryCodeType = "MQ" // MR - Mauritania CountryCodeMR CountryCodeType = "MR" // MS - Montserrat CountryCodeMS CountryCodeType = "MS" // MT - Malta CountryCodeMT CountryCodeType = "MT" // MU - Mauritius CountryCodeMU CountryCodeType = "MU" // MV - Maldives CountryCodeMV CountryCodeType = "MV" // MW - Malawi CountryCodeMW CountryCodeType = "MW" // MX - Mexico CountryCodeMX CountryCodeType = "MX" // MY - Malaysia CountryCodeMY CountryCodeType = "MY" // MZ - Mozambique CountryCodeMZ CountryCodeType = "MZ" // NA - Namibia CountryCodeNA CountryCodeType = "NA" // NC - New Caledonia CountryCodeNC CountryCodeType = "NC" // NE - Niger CountryCodeNE CountryCodeType = "NE" // NF - Norfolk Island CountryCodeNF CountryCodeType = "NF" // NG - Nigeria CountryCodeNG CountryCodeType = "NG" // NI - Nicaragua CountryCodeNI CountryCodeType = "NI" // NL - Netherlands CountryCodeNL CountryCodeType = "NL" // NO - Norway CountryCodeNO CountryCodeType = "NO" // NP - Nepal CountryCodeNP CountryCodeType = "NP" // NR - Nauru CountryCodeNR CountryCodeType = "NR" // NU - Niue CountryCodeNU CountryCodeType = "NU" // NZ - New Zealand CountryCodeNZ CountryCodeType = "NZ" // OM - Oman CountryCodeOM CountryCodeType = "OM" // PA - Panama CountryCodePA CountryCodeType = "PA" // PE - Peru CountryCodePE CountryCodeType = "PE" // PF - French Polynesia CountryCodePF CountryCodeType = "PF" // PG - Papua New Guinea CountryCodePG CountryCodeType = "PG" // PH - Philippines CountryCodePH CountryCodeType = "PH" // PK - Pakistan CountryCodePK CountryCodeType = "PK" // PL - Poland CountryCodePL CountryCodeType = "PL" // PM - Saint Pierre and Miquelon CountryCodePM CountryCodeType = "PM" // PN - Pitcairn CountryCodePN CountryCodeType = "PN" // PR - Puerto Rico CountryCodePR CountryCodeType = "PR" // PS - Palestine, State of CountryCodePS CountryCodeType = "PS" // PT - Portugal CountryCodePT CountryCodeType = "PT" // PW - Palau CountryCodePW CountryCodeType = "PW" // PY - Paraguay CountryCodePY CountryCodeType = "PY" // QA - Qatar CountryCodeQA CountryCodeType = "QA" // RE - Réunion CountryCodeRE CountryCodeType = "RE" // RS - Serbia CountryCodeRS CountryCodeType = "RS" // RU - Russian Federation CountryCodeRU CountryCodeType = "RU" // RW - Rwanda CountryCodeRW CountryCodeType = "RW" // SA - Saudi Arabia CountryCodeSA CountryCodeType = "SA" // SB - Solomon Islands CountryCodeSB CountryCodeType = "SB" // SC - Seychelles CountryCodeSC CountryCodeType = "SC" // SD - Sudan CountryCodeSD CountryCodeType = "SD" // SE - Sweden CountryCodeSE CountryCodeType = "SE" // SG - Singapore CountryCodeSG CountryCodeType = "SG" // SH - Saint Helena, Ascension and Tristan da Cunha CountryCodeSH CountryCodeType = "SH" // SI - Slovenia CountryCodeSI CountryCodeType = "SI" // SJ - Svalbard and Jan Mayen CountryCodeSJ CountryCodeType = "SJ" // SK - Slovakia CountryCodeSK CountryCodeType = "SK" // SL - Sierra Leone CountryCodeSL CountryCodeType = "SL" // SM - San Marino CountryCodeSM CountryCodeType = "SM" // SN - Senegal CountryCodeSN CountryCodeType = "SN" // SO - Somalia CountryCodeSO CountryCodeType = "SO" // SR - Suriname CountryCodeSR CountryCodeType = "SR" // SS - South Sudan CountryCodeSS CountryCodeType = "SS" // ST - Sao Tome and Principe CountryCodeST CountryCodeType = "ST" // SV - El Salvador CountryCodeSV CountryCodeType = "SV" // SX - Sint Maarten (Dutch part) CountryCodeSX CountryCodeType = "SX" // SY - Syrian Arab Republic CountryCodeSY CountryCodeType = "SY" // SZ - Swaziland CountryCodeSZ CountryCodeType = "SZ" // TC - Turks and Caicos Islands CountryCodeTC CountryCodeType = "TC" // TD - Chad CountryCodeTD CountryCodeType = "TD" // TF - French Southern Territories CountryCodeTF CountryCodeType = "TF" // TG - Togo CountryCodeTG CountryCodeType = "TG" // TH - Thailand CountryCodeTH CountryCodeType = "TH" // TJ - Tajikistan CountryCodeTJ CountryCodeType = "TJ" // TK - Tokelau CountryCodeTK CountryCodeType = "TK" // TL - Timor-Leste CountryCodeTL CountryCodeType = "TL" // TM - Turkmenistan CountryCodeTM CountryCodeType = "TM" // TN - Tunisia CountryCodeTN CountryCodeType = "TN" // TO - Tonga CountryCodeTO CountryCodeType = "TO" // TR - Turkey CountryCodeTR CountryCodeType = "TR" // TT - Trinidad and Tobago CountryCodeTT CountryCodeType = "TT" // TV - Tuvalu CountryCodeTV CountryCodeType = "TV" // TW - Taiwan, Province of China CountryCodeTW CountryCodeType = "TW" // TZ - Tanzania, United Republic of CountryCodeTZ CountryCodeType = "TZ" // UA - Ukraine CountryCodeUA CountryCodeType = "UA" // UG - Uganda CountryCodeUG CountryCodeType = "UG" // UM - United States Minor Outlying Islands CountryCodeUM CountryCodeType = "UM" // US - United States of America CountryCodeUS CountryCodeType = "US" // UY - Uruguay CountryCodeUY CountryCodeType = "UY" // UZ - Uzbekistan CountryCodeUZ CountryCodeType = "UZ" // VA - Holy See CountryCodeVA CountryCodeType = "VA" // VC - Saint Vincent and the Grenadines CountryCodeVC CountryCodeType = "VC" // VE - Venezuela, Bolivarian Republic of CountryCodeVE CountryCodeType = "VE" // VG - Virgin Islands, British CountryCodeVG CountryCodeType = "VG" // VI - Virgin Islands, U.S. CountryCodeVI CountryCodeType = "VI" // VN - Viet Nam CountryCodeVN CountryCodeType = "VN" // VU - Vanuatu CountryCodeVU CountryCodeType = "VU" // WF - Wallis and Futuna CountryCodeWF CountryCodeType = "WF" // WS - Samoa CountryCodeWS CountryCodeType = "WS" // YE - Yemen CountryCodeYE CountryCodeType = "YE" // YT - Mayotte CountryCodeYT CountryCodeType = "YT" // ZA - South Africa CountryCodeZA CountryCodeType = "ZA" // ZM - Zambia CountryCodeZM CountryCodeType = "ZM" // ZW - Zimbabwe CountryCodeZW CountryCodeType = "ZW" // 1A - Kosovo CountryCode1A CountryCodeType = "1A" )
type CountrySubentityType ¶
type CountrySubentityType string
const ( // B - București CountrySubentityRO_B CountrySubentityType = "RO-B" // AB - Alba CountrySubentityRO_AB CountrySubentityType = "RO-AB" // AR - Arad CountrySubentityRO_AR CountrySubentityType = "RO-AR" // AG - Argeș CountrySubentityRO_AG CountrySubentityType = "RO-AG" // BC - Bacău CountrySubentityRO_BC CountrySubentityType = "RO-BC" // BH - Bihor CountrySubentityRO_BH CountrySubentityType = "RO-BH" // BN - Bistrița-Năsăud CountrySubentityRO_BN CountrySubentityType = "RO-BN" // BT - Botoșani CountrySubentityRO_BT CountrySubentityType = "RO-BT" // BR - Brăila CountrySubentityRO_BR CountrySubentityType = "RO-BR" // BV - Brașov CountrySubentityRO_BV CountrySubentityType = "RO-BV" // BZ - Buzău CountrySubentityRO_BZ CountrySubentityType = "RO-BZ" // CL - Călărași CountrySubentityRO_CL CountrySubentityType = "RO-CL" // CS - Caraș-Severin CountrySubentityRO_CS CountrySubentityType = "RO-CS" // CJ - Cluj CountrySubentityRO_CJ CountrySubentityType = "RO-CJ" // CT - Constanța CountrySubentityRO_CT CountrySubentityType = "RO-CT" // CV - Covasna CountrySubentityRO_CV CountrySubentityType = "RO-CV" // DB - Dâmbovița CountrySubentityRO_DB CountrySubentityType = "RO-DB" // DJ - Dolj CountrySubentityRO_DJ CountrySubentityType = "RO-DJ" // GL - Galați CountrySubentityRO_GL CountrySubentityType = "RO-GL" // GR - Giurgiu CountrySubentityRO_GR CountrySubentityType = "RO-GR" // GJ - Gorj CountrySubentityRO_GJ CountrySubentityType = "RO-GJ" // HR - Harghita CountrySubentityRO_HR CountrySubentityType = "RO-HR" // HD - Hunedoara CountrySubentityRO_HD CountrySubentityType = "RO-HD" // IL - Ialomița CountrySubentityRO_IL CountrySubentityType = "RO-IL" // IS - Iași CountrySubentityRO_IS CountrySubentityType = "RO-IS" // IF - Ilfov CountrySubentityRO_IF CountrySubentityType = "RO-IF" // MM - Maramureș CountrySubentityRO_MM CountrySubentityType = "RO-MM" // MH - Mehedinți CountrySubentityRO_MH CountrySubentityType = "RO-MH" // MS - Mureș CountrySubentityRO_MS CountrySubentityType = "RO-MS" // NT - Neamț CountrySubentityRO_NT CountrySubentityType = "RO-NT" // OT - Olt CountrySubentityRO_OT CountrySubentityType = "RO-OT" // PH - Prahova CountrySubentityRO_PH CountrySubentityType = "RO-PH" // SJ - Sălaj CountrySubentityRO_SJ CountrySubentityType = "RO-SJ" // SM - Satu Mare CountrySubentityRO_SM CountrySubentityType = "RO-SM" // SB - Sibiu CountrySubentityRO_SB CountrySubentityType = "RO-SB" // SV - Suceava CountrySubentityRO_SV CountrySubentityType = "RO-SV" // TR - Teleorman CountrySubentityRO_TR CountrySubentityType = "RO-TR" // TM - Timiș CountrySubentityRO_TM CountrySubentityType = "RO-TM" // TL - Tulcea CountrySubentityRO_TL CountrySubentityType = "RO-TL" // VS - Vaslui CountrySubentityRO_VS CountrySubentityType = "RO-VS" // VL - Vâlcea CountrySubentityRO_VL CountrySubentityType = "RO-VL" // VN - Vrancea CountrySubentityRO_VN CountrySubentityType = "RO-VN" )
func RoCountyNameToCountrySubentity ¶
func RoCountyNameToCountrySubentity(name string) (sub CountrySubentityType, ok bool)
RoCountyNameToCountrySubentity returns the country subentity code for a Romanian county name. "bucurești" -> "RO-B"
type CurrencyCodeType ¶
type CurrencyCodeType string
const ( CurrencyAED CurrencyCodeType = "AED" CurrencyAFN CurrencyCodeType = "AFN" CurrencyALL CurrencyCodeType = "ALL" CurrencyAMD CurrencyCodeType = "AMD" CurrencyANG CurrencyCodeType = "ANG" CurrencyAOA CurrencyCodeType = "AOA" CurrencyARS CurrencyCodeType = "ARS" CurrencyAUD CurrencyCodeType = "AUD" CurrencyAWG CurrencyCodeType = "AWG" CurrencyAZN CurrencyCodeType = "AZN" CurrencyBAM CurrencyCodeType = "BAM" CurrencyBBD CurrencyCodeType = "BBD" CurrencyBDT CurrencyCodeType = "BDT" CurrencyBGN CurrencyCodeType = "BGN" CurrencyBHD CurrencyCodeType = "BHD" CurrencyBIF CurrencyCodeType = "BIF" CurrencyBMD CurrencyCodeType = "BMD" CurrencyBND CurrencyCodeType = "BND" CurrencyBOB CurrencyCodeType = "BOB" CurrencyBOV CurrencyCodeType = "BOV" CurrencyBRL CurrencyCodeType = "BRL" CurrencyBSD CurrencyCodeType = "BSD" CurrencyBTN CurrencyCodeType = "BTN" CurrencyBWP CurrencyCodeType = "BWP" CurrencyBYN CurrencyCodeType = "BYN" CurrencyBZD CurrencyCodeType = "BZD" CurrencyCAD CurrencyCodeType = "CAD" CurrencyCDF CurrencyCodeType = "CDF" CurrencyCHE CurrencyCodeType = "CHE" CurrencyCHF CurrencyCodeType = "CHF" CurrencyCHW CurrencyCodeType = "CHW" CurrencyCLF CurrencyCodeType = "CLF" CurrencyCLP CurrencyCodeType = "CLP" CurrencyCNY CurrencyCodeType = "CNY" CurrencyCOP CurrencyCodeType = "COP" CurrencyCOU CurrencyCodeType = "COU" CurrencyCRC CurrencyCodeType = "CRC" CurrencyCUC CurrencyCodeType = "CUC" CurrencyCUP CurrencyCodeType = "CUP" CurrencyCVE CurrencyCodeType = "CVE" CurrencyCZK CurrencyCodeType = "CZK" CurrencyDJF CurrencyCodeType = "DJF" CurrencyDKK CurrencyCodeType = "DKK" CurrencyDOP CurrencyCodeType = "DOP" CurrencyDZD CurrencyCodeType = "DZD" CurrencyEGP CurrencyCodeType = "EGP" CurrencyERN CurrencyCodeType = "ERN" CurrencyETB CurrencyCodeType = "ETB" CurrencyEUR CurrencyCodeType = "EUR" CurrencyFJD CurrencyCodeType = "FJD" CurrencyFKP CurrencyCodeType = "FKP" CurrencyGBP CurrencyCodeType = "GBP" CurrencyGEL CurrencyCodeType = "GEL" CurrencyGHS CurrencyCodeType = "GHS" CurrencyGIP CurrencyCodeType = "GIP" CurrencyGMD CurrencyCodeType = "GMD" CurrencyGNF CurrencyCodeType = "GNF" CurrencyGTQ CurrencyCodeType = "GTQ" CurrencyGYD CurrencyCodeType = "GYD" CurrencyHKD CurrencyCodeType = "HKD" CurrencyHNL CurrencyCodeType = "HNL" CurrencyHRK CurrencyCodeType = "HRK" CurrencyHTG CurrencyCodeType = "HTG" CurrencyHUF CurrencyCodeType = "HUF" CurrencyIDR CurrencyCodeType = "IDR" CurrencyILS CurrencyCodeType = "ILS" CurrencyINR CurrencyCodeType = "INR" CurrencyIQD CurrencyCodeType = "IQD" CurrencyIRR CurrencyCodeType = "IRR" CurrencyISK CurrencyCodeType = "ISK" CurrencyJMD CurrencyCodeType = "JMD" CurrencyJOD CurrencyCodeType = "JOD" CurrencyJPY CurrencyCodeType = "JPY" CurrencyKES CurrencyCodeType = "KES" CurrencyKGS CurrencyCodeType = "KGS" CurrencyKHR CurrencyCodeType = "KHR" CurrencyKMF CurrencyCodeType = "KMF" CurrencyKPW CurrencyCodeType = "KPW" CurrencyKRW CurrencyCodeType = "KRW" CurrencyKWD CurrencyCodeType = "KWD" CurrencyKYD CurrencyCodeType = "KYD" CurrencyKZT CurrencyCodeType = "KZT" CurrencyLAK CurrencyCodeType = "LAK" CurrencyLBP CurrencyCodeType = "LBP" CurrencyLKR CurrencyCodeType = "LKR" CurrencyLRD CurrencyCodeType = "LRD" CurrencyLSL CurrencyCodeType = "LSL" CurrencyLYD CurrencyCodeType = "LYD" CurrencyMAD CurrencyCodeType = "MAD" CurrencyMDL CurrencyCodeType = "MDL" CurrencyMGA CurrencyCodeType = "MGA" CurrencyMKD CurrencyCodeType = "MKD" CurrencyMMK CurrencyCodeType = "MMK" CurrencyMNT CurrencyCodeType = "MNT" CurrencyMOP CurrencyCodeType = "MOP" CurrencyMRO CurrencyCodeType = "MRO" CurrencyMUR CurrencyCodeType = "MUR" CurrencyMVR CurrencyCodeType = "MVR" CurrencyMWK CurrencyCodeType = "MWK" CurrencyMXN CurrencyCodeType = "MXN" CurrencyMXV CurrencyCodeType = "MXV" CurrencyMYR CurrencyCodeType = "MYR" CurrencyMZN CurrencyCodeType = "MZN" CurrencyNAD CurrencyCodeType = "NAD" CurrencyNGN CurrencyCodeType = "NGN" CurrencyNIO CurrencyCodeType = "NIO" CurrencyNOK CurrencyCodeType = "NOK" CurrencyNPR CurrencyCodeType = "NPR" CurrencyNZD CurrencyCodeType = "NZD" CurrencyOMR CurrencyCodeType = "OMR" CurrencyPAB CurrencyCodeType = "PAB" CurrencyPEN CurrencyCodeType = "PEN" CurrencyPGK CurrencyCodeType = "PGK" CurrencyPHP CurrencyCodeType = "PHP" CurrencyPKR CurrencyCodeType = "PKR" CurrencyPLN CurrencyCodeType = "PLN" CurrencyPYG CurrencyCodeType = "PYG" CurrencyQAR CurrencyCodeType = "QAR" CurrencyRON CurrencyCodeType = "RON" CurrencyRSD CurrencyCodeType = "RSD" CurrencyRUB CurrencyCodeType = "RUB" CurrencyRWF CurrencyCodeType = "RWF" CurrencySAR CurrencyCodeType = "SAR" CurrencySBD CurrencyCodeType = "SBD" CurrencySCR CurrencyCodeType = "SCR" CurrencySDG CurrencyCodeType = "SDG" CurrencySEK CurrencyCodeType = "SEK" CurrencySGD CurrencyCodeType = "SGD" CurrencySHP CurrencyCodeType = "SHP" CurrencySLL CurrencyCodeType = "SLL" CurrencySOS CurrencyCodeType = "SOS" CurrencySRD CurrencyCodeType = "SRD" CurrencySSP CurrencyCodeType = "SSP" CurrencySTD CurrencyCodeType = "STD" CurrencySVC CurrencyCodeType = "SVC" CurrencySYP CurrencyCodeType = "SYP" CurrencySZL CurrencyCodeType = "SZL" CurrencyTHB CurrencyCodeType = "THB" CurrencyTJS CurrencyCodeType = "TJS" CurrencyTMT CurrencyCodeType = "TMT" CurrencyTND CurrencyCodeType = "TND" CurrencyTOP CurrencyCodeType = "TOP" CurrencyTRY CurrencyCodeType = "TRY" CurrencyTTD CurrencyCodeType = "TTD" CurrencyTWD CurrencyCodeType = "TWD" CurrencyTZS CurrencyCodeType = "TZS" CurrencyUAH CurrencyCodeType = "UAH" CurrencyUGX CurrencyCodeType = "UGX" CurrencyUSD CurrencyCodeType = "USD" CurrencyUSN CurrencyCodeType = "USN" CurrencyUYI CurrencyCodeType = "UYI" CurrencyUYU CurrencyCodeType = "UYU" CurrencyUZS CurrencyCodeType = "UZS" CurrencyVEF CurrencyCodeType = "VEF" CurrencyVND CurrencyCodeType = "VND" CurrencyVUV CurrencyCodeType = "VUV" CurrencyWST CurrencyCodeType = "WST" CurrencyXAF CurrencyCodeType = "XAF" CurrencyXAG CurrencyCodeType = "XAG" CurrencyXAU CurrencyCodeType = "XAU" CurrencyXBA CurrencyCodeType = "XBA" CurrencyXBB CurrencyCodeType = "XBB" CurrencyXBC CurrencyCodeType = "XBC" CurrencyXBD CurrencyCodeType = "XBD" CurrencyXCD CurrencyCodeType = "XCD" CurrencyXDR CurrencyCodeType = "XDR" CurrencyXOF CurrencyCodeType = "XOF" CurrencyXPD CurrencyCodeType = "XPD" CurrencyXPF CurrencyCodeType = "XPF" CurrencyXPT CurrencyCodeType = "XPT" CurrencyXSU CurrencyCodeType = "XSU" CurrencyXTS CurrencyCodeType = "XTS" CurrencyXUA CurrencyCodeType = "XUA" CurrencyXXX CurrencyCodeType = "XXX" CurrencyYER CurrencyCodeType = "YER" CurrencyZAR CurrencyCodeType = "ZAR" CurrencyZMW CurrencyCodeType = "ZMW" CurrencyZWL CurrencyCodeType = "ZWL" )
type Date ¶
Date is a wrapper of the time.Time type which marshals to XML in the YYYY-MM-DD format and is assumed to be in the Romanian timezone location.
func MakeDate ¶
MakeDate creates a date with the provided year, month and day in the Romanian time zone location.
func MakeDateFromTime ¶
MakeDateFromTime creates a Date in Romanian time zone location from the given time.Time.
func NewDateFromTime ¶
NewDateFromTime same as MakeDateFromTime, but returns a pointer to Date.
func (Date) IsInitialized ¶
IsInitialized checks if the Date is initialized (ie is created explicitly with a constructor or initialized by setting the Time, not implicitly via var declaration with no initialization).
func (Date) MarshalXML ¶
MarshalXML implements the xml.Marshaler interface.
func (*Date) UnmarshalXML ¶
UnmarshalXML implements the xml.Unmarshaler interface.
type Decimal ¶
Decimal is a wrapper of the github.com/shopspring/decimal.Decimal type in order to ensure type safety and lossless computation.
Zero constant, to make computations faster. Zero should never be compared with == or != directly, please use decimal.Equal or decimal.Cmp instead.
func NewFromDecimal ¶
NewFromDecimal converts a decimal.Decimal to Decimal.
func NewFromFloat ¶
NewFromFloat converts a float64 to Decimal.
func NewFromString ¶
NewFromString returns a new Decimal from a string representation. Trailing zeroes are not trimmed.
func (Decimal) AsAmount ¶
Returns the Decimal suitable to use as an amount, ie. rounds is to two decimal places.
func (Decimal) Cmp ¶
Cmp compares the numbers represented by d and d2 and returns:
-1 if d < d2 0 if d == d2 +1 if d > d2
func (Decimal) Div ¶
Div returns d / d2. If it doesn't divide exactly, the result will have DivisionPrecision digits after the decimal point.
func (Decimal) DivRound ¶
DivRound divides and rounds to a given precision i.e. to an integer multiple of 10^(-precision)
for a positive quotient digit 5 is rounded up, away from 0 if the quotient is negative then digit 5 is rounded down, away from 0
Note that precision<0 is allowed as input.
func (*Decimal) IsInitialized ¶
IsInitialized if the decimal is initialized (ie is created explicitly with a constructor, not implicitly via var declaration).
func (Decimal) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface. This is needed so we can use Decimal as chardata.
func (*Decimal) MarshalXML ¶
MarshalXML implements the xml.Marshaler interface.
func (Decimal) Round ¶
Round rounds the decimal to places decimal places. If places < 0, it will round the integer part to the nearest 10^(-places).
Example:
NewFromFloat(5.45).Round(1).String() // output: "5.5" NewFromFloat(545).Round(-1).String() // output: "550"
func (Decimal) Truncate ¶
Truncate truncates off digits from the number, without rounding.
NOTE: precision is the last digit that will not be truncated (must be >= 0). Example:
DD(decimal.NewFromString("123.456")).Truncate(2).String() // "123.45"
func (*Decimal) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface. This is needed so we can use Decimal as chardata.
type DownloadInvoiceParseZipResponse ¶
type DownloadInvoiceParseZipResponse struct { DownloadResponse *DownloadInvoiceResponse // InvoiceXML is the XML of the Invoice/InvoiceErrorMessage file from // the ZIP archive. This field is useful for storing the raw invoice // XML. InvoiceXML []byte // Signature is the XML of the Signature file from the ZIP archive. // This field is useful for manually parsing and verifying the // signature. SignatureXML []byte // Invoice is the parsed Invoice if the InvoiceXML is storing an // invoice. Invoice *Invoice // InvoiceError is the parse InvoiceErrorMessage if InvoiceXML is // storing an invoice error message. InvoiceError *InvoiceErrorMessage }
DownloadInvoiceParseZipResponse is the type returned by the DownloadInvoiceParseZip method. It includes the DownloadInvoiceResponse (the zip archive as a []byte), the invoice and signature XML (as []byte), and also a *Invoice or a *InvoiceErrorMessage (parsed Invoice or InvoiceErrorMessage from InvoiceXML).
func (*DownloadInvoiceParseZipResponse) IsOk ¶
func (r *DownloadInvoiceParseZipResponse) IsOk() bool
IsOk returns true if the response corresponding to a download was successful.
type DownloadInvoiceResponse ¶
type DownloadInvoiceResponse struct { Error *DownloadInvoiceResponseError Zip []byte }
DownloadInvoiceResponse is the parsed response from the download invoice endpoint.
func (*DownloadInvoiceResponse) IsOk ¶
func (r *DownloadInvoiceResponse) IsOk() bool
IsOk returns true if the response corresponding to a download was successful.
type DownloadInvoiceResponseError ¶
type DownloadInvoiceResponseError struct { Error string `json:"eroare"` Title string `json:"titlu,omitempty"` }
DownloadInvoiceResponseError is the error response from the download invoice endpoint.
type ErrorResponse ¶
type ErrorResponse struct { StatusCode int Status string Method string Url *url.URL ResponseBody []byte Err error TraceID *string Message *string }
ErrorResponse is an error returns if the HTTP requests was finished (we got a *http.Response from the HTTP client, but it was not a successful response, or it was an error parsing the response.
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type GeneratePDFResponse ¶
type GeneratePDFResponse struct { Error *GeneratePDFResponseError PDF []byte }
GeneratePDFResponse is the parsed response from the XML-To-PDF endpoint
func (*GeneratePDFResponse) GetError ¶
func (r *GeneratePDFResponse) GetError() *GeneratePDFResponseError
GetError is a getter for the Error field.
func (*GeneratePDFResponse) IsOk ¶
func (r *GeneratePDFResponse) IsOk() bool
IsOk returns true if the XML-To-PDF response was successful.
type GeneratePDFResponseError ¶
type GeneratePDFResponseError struct { State Code `json:"stare"` TraceID string `json:"trace_id"` Messages []struct { Message string `json:"message"` } `json:"Messages,omitempty"` }
GeneratePDFResponseError is the error response of the XML-To-PDF endpoint
func (*GeneratePDFResponseError) GetFirstMessage ¶
func (r *GeneratePDFResponseError) GetFirstMessage() string
GetFirstMessage returns the first message from the validate response. If no messages are set, empty string is returned.
type GetMessageStateCode ¶
type GetMessageStateCode string
type GetMessageStateResponse ¶
type GetMessageStateResponse struct { State GetMessageStateCode `xml:"stare,attr"` DownloadID int64 `xml:"id_descarcare,attr,omitempty"` Errors []struct { ErrorMessage string `xml:"errorMessage,attr"` } `xml:"Errors,omitempty"` // Hardcode the namespace here so we don't need a customer marshaling // method. XMLName xml.Name `xml:"mfp:anaf:dgti:efactura:stareMesajFactura:v1 header"` }
GetMessageStateResponse is the parsed response from the get message state endoint
func (*GetMessageStateResponse) GetDownloadID ¶
func (r *GetMessageStateResponse) GetDownloadID() int64
GetDownloadID returns the download ID (should only be called when IsOk() == true).
func (*GetMessageStateResponse) GetFirstErrorMessage ¶
func (r *GetMessageStateResponse) GetFirstErrorMessage() string
GetFirstErrorMessage returns the first error message. If no error messages are set for the response, empty string is returned.
func (*GetMessageStateResponse) IsInvalidXML ¶
func (r *GetMessageStateResponse) IsInvalidXML() bool
IsInvalidXML returns true if the message state is processing.
func (*GetMessageStateResponse) IsNok ¶
func (r *GetMessageStateResponse) IsNok() bool
IsNok returns true if the message state is nok (there was an error processing the invoice).
func (*GetMessageStateResponse) IsOk ¶
func (r *GetMessageStateResponse) IsOk() bool
IsOk returns true if the message state if ok (processed, and can be downloaded).
func (*GetMessageStateResponse) IsProcessing ¶
func (r *GetMessageStateResponse) IsProcessing() bool
IsProcessing returns true if the message state is processing.
type IDNode ¶
type IDNode struct {
ID string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID"`
}
IDNote is a struct that encodes a node that only has a cbc:ID property.
type Invoice ¶
type Invoice struct { // These need to be first fields, because apparently the validators care // about the order of xml nodes. // Conditional / Identifies the earliest version of the UBL 2 schema for // this document type that defines all of the elements that might be // encountered in the current instance. // NOTE: this field will be automatically set to efactura.CIUSRO_v101 when // marshaled. // Path: /Invoice/cbc:UBLVersionID UBLVersionID string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 UBLVersionID"` // ID: BT-24 // Term: Identificatorul specificaţiei // Description: O identificare a specificaţiei care conţine totalitatea // regulilor privind conţinutul semantic, cardinalităţile şi regulile // operaţionale cu care datele conţinute în instanţa de factură sunt // conforme. // NOTE: this field will be automatically set to efactura.UBLVersionID when // marshaled. // Cardinality: 1..1 CustomizationID string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CustomizationID"` // ID: BT-1 // Term: Numărul facturii // Description: O identificare unică a facturii. // Cardinality: 1..1 ID string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID"` // ID: BT-2 // Term: Data emiterii facturii // Description: Data la care a fost emisă factura. // Cardinality: 1..1 IssueDate Date `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 IssueDate"` // ID: BT-9 // Term: Data scadenţei // Description: Data până la care trebuie făcută plata. // Cardinality: 0..1 DueDate *Date `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 DueDate,omitempty"` // ID: BT-3 // Term: Codul tipului facturii // Description: Un cod care specifică tipul funcţional al facturii. // Cardinality: 1..1 InvoiceTypeCode InvoiceTypeCodeType `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 InvoiceTypeCode"` // ID: BT-5 // Term: Codul monedei facturii // Description: Moneda în care sunt exprimate toate sumele din factură, // cu excepţia sumei totale a TVA care este în moneda de contabilizare. // Cardinality: 1..1 DocumentCurrencyCode CurrencyCodeType `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 DocumentCurrencyCode"` // ID: BT-6 // Term: Codul monedei de contabilizare a TVA // Description: Moneda utilizată pentru contabilizarea şi declararea TVA // aşa cum se acceptă sau se cere în ţara Vânzătorului. // Cardinality: 0..1 TaxCurrencyCode CurrencyCodeType `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 TaxCurrencyCode,omitempty"` // ID: BT-19 // Term: Referinţa contabilă a cumpărătorului // Cardinality: 0..1 AccountingCost string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 AccountingCost,omitempty"` // ID: BT-10 // Term: Referinţa Cumpărătorului // Description: Un identificator atribuit de către Cumpărător utilizat // pentru circuitul intern al facturii. // Cardinality: 0..1 BuyerReference string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 BuyerReference,omitempty"` OrderReference *InvoiceOrderReference `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 OrderReference,omitempty"` // ID: BG-1 // Term: COMENTARIU ÎN FACTURĂ // Cardinality: 0..n Note []InvoiceNote `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Note,omitempty"` // ID: BG-14 // Term: Perioada de facturare // Description: Un grup de termeni operaţionali care furnizează informaţii // despre perioada de facturare. // Cardinality: 0..1 InvoicePeriod *InvoicePeriod `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 InvoicePeriod,omitempty"` // ID: BG-3 // Term: REFERINŢĂ LA O FACTURĂ ANTERIOARĂ // Cardinality: 0..n BillingReferences []InvoiceBillingReference `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 BillingReference,omitempty"` // ID: BT-16 // Term: Referinţa avizului de expediție // Cardinality: 0..1 DespatchDocumentReference *IDNode `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 DespatchDocumentReference,omitempty"` // ID: BT-15 // Term: Referinţa avizului de recepție // Cardinality: 0..1 ReceiptDocumentReference *IDNode `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 ReceiptDocumentReference,omitempty"` // ID: BT-17 // Term: Referinţa avizului de ofertă sau a lotului // Cardinality: 0..1 OriginatorDocumentReference *IDNode `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 OriginatorDocumentReference,omitempty"` // ID: BT-12 // Term: Referinţa contractului // Cardinality: 0..1 ContractDocumentReference *IDNode `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 ContractDocumentReference,omitempty"` // ID: BT-18 // Term: Identificatorul obiectului facturat // Cardinality: 0..1 // ID: BT-18-1 // Term: Identificatorul obiectului schemei // Cardinality: 0..1 AdditionalDocumentReference *ValueWithAttrs `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 AdditionalDocumentReference,omitempty"` // ID: BT-11 // Term: Referinţa proiectului // Cardinality: 0..1 ProjectReference *IDNode `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 ProjectReference,omitempty"` // ID: BG-4 // Term: VÂNZĂTOR // Description: Un grup de termeni operaţionali care furnizează informaţii // despre Vânzător. // Cardinality: 1..1 Supplier InvoiceSupplier `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 AccountingSupplierParty"` // ID: BG-7 // Term: CUMPĂRĂTOR // Description: Un grup de termeni operaţionali care furnizează informaţii // despre Cumpărător. // Cardinality: 1..1 Customer InvoiceCustomer `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 AccountingCustomerParty"` // ID: BG-10 // Term: BENEFICIAR // Cardinality: 0..1 Payee *InvoicePayee `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PayeeParty,omitempty"` // ID: BG-11 // Term: REPREZENTANTUL FISCAL AL VÂNZĂTORULUI // Cardinality: 0..1 TaxRepresentative *InvoiceTaxRepresentative `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxRepresentativeParty,omitempty"` // ID: BG-13 // Term: INFORMAȚII REFERITOARE LA LIVRARE // Cardinality: 0..1 Delivery *InvoiceDelivery `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Delivery,omitempty"` // ID: BG-16 // Term: INSTRUCŢIUNI DE PLATĂ // Description: Un grup de termeni operaţionali care furnizează informaţii // despre plată. // Cardinality: 0..1 PaymentMeans *InvoicePaymentMeans `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PaymentMeans,omitempty"` // ID: BT-20 // Term: Termeni de plată // Cardinality: 0..1 PaymentTerms *InvoicePaymentTerms `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PaymentTerms,omitempty"` // test[cbc:ChargeIndicator == false] => // ID: BG-20 // Term: DEDUCERI LA NIVELUL DOCUMENTULUI // Cardinality: 0..n // test[cbc:ChargeIndicator == true] => // ID: BG-21 // Term: TAXE SUPLIMENTARE LA NIVELUL DOCUMENTULUI // Cardinality: 0..n AllowanceCharges []InvoiceDocumentAllowanceCharge `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 AllowanceCharge,omitempty"` TaxTotal []InvoiceTaxTotal `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxTotal"` // ID: BG-22 // Term: TOTALURILE DOCUMENTULUI // Cardinality: 1..1 LegalMonetaryTotal InvoiceLegalMonetaryTotal `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 LegalMonetaryTotal"` // ID: BG-25 // Term: LINIE A FACTURII // Cardinality: 1..n InvoiceLines []InvoiceLine `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 InvoiceLine"` // Name of node. XMLName xml.Name `xml:"Invoice"` // xmlns attr. Will be automatically set in MarshalXML Namespace string `xml:"xmlns,attr"` // xmlns:cac attr. Will be automatically set in MarshalXML NamespaceCAC string `xml:"xmlns:cac,attr"` // xmlns:cbc attr. Will be automatically set in MarshalXML NamespaceCBC string `xml:"xmlns:cbc,attr"` // generated with... Will be automatically set in MarshalXML if empty. Comment string `xml:",comment"` }
Invoice is the object that represents an e-factura invoice. The invoice object aims to be a type safe invoice that serializes to the UBL 2.1 syntax with CUIS RO v1.0.1 customization ID.
func (Invoice) MarshalXML ¶
func (*Invoice) Prefill ¶
func (iv *Invoice) Prefill()
Prefill sets the NS, NScac, NScbc and Comment properties for ensuring that the required attributes and properties are set for a valid UBL XML.
type InvoiceBillingReference ¶
type InvoiceBillingReference struct {
InvoiceDocumentReference InvoiceDocumentReference `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 InvoiceDocumentReference"`
}
type InvoiceBuilder ¶
type InvoiceBuilder struct {
// contains filtered or unexported fields
}
InvoiceBuilder builds an Invoice object
func NewInvoiceBuilder ¶
func NewInvoiceBuilder(id string) (b *InvoiceBuilder)
func (*InvoiceBuilder) AddTaxExemptionReason ¶
func (b *InvoiceBuilder) AddTaxExemptionReason(taxCategoryCode TaxCategoryCodeType, reason string, exemptionCode TaxExemptionReasonCodeType) *InvoiceBuilder
func (*InvoiceBuilder) AppendAllowanceCharge ¶
func (b *InvoiceBuilder) AppendAllowanceCharge(allowanceCharge InvoiceDocumentAllowanceCharge) *InvoiceBuilder
func (*InvoiceBuilder) AppendBillingReferences ¶
func (b *InvoiceBuilder) AppendBillingReferences(billingReferences ...InvoiceDocumentReference) *InvoiceBuilder
func (*InvoiceBuilder) AppendInvoiceLines ¶
func (b *InvoiceBuilder) AppendInvoiceLines(lines ...InvoiceLine) *InvoiceBuilder
func (*InvoiceBuilder) AppendNotes ¶
func (b *InvoiceBuilder) AppendNotes(notes ...InvoiceNote) *InvoiceBuilder
func (InvoiceBuilder) Build ¶
func (b InvoiceBuilder) Build() (retInvoice Invoice, err error)
func (*InvoiceBuilder) WithAccountingCost ¶
func (b *InvoiceBuilder) WithAccountingCost(accountingCost string) *InvoiceBuilder
func (*InvoiceBuilder) WithAllowancesCharges ¶
func (b *InvoiceBuilder) WithAllowancesCharges(allowancesCharges []InvoiceDocumentAllowanceCharge) *InvoiceBuilder
func (*InvoiceBuilder) WithBillingReferences ¶
func (b *InvoiceBuilder) WithBillingReferences(billingReferences []InvoiceDocumentReference) *InvoiceBuilder
func (*InvoiceBuilder) WithBuyerReference ¶
func (b *InvoiceBuilder) WithBuyerReference(buyerReference string) *InvoiceBuilder
func (*InvoiceBuilder) WithContractDocumentReference ¶
func (b *InvoiceBuilder) WithContractDocumentReference(contractDocumentReference string) *InvoiceBuilder
func (*InvoiceBuilder) WithCustomer ¶
func (b *InvoiceBuilder) WithCustomer(customer InvoiceCustomerParty) *InvoiceBuilder
func (*InvoiceBuilder) WithDocumentCurrencyCode ¶
func (b *InvoiceBuilder) WithDocumentCurrencyCode(currencyID CurrencyCodeType) *InvoiceBuilder
func (*InvoiceBuilder) WithDocumentToTaxCurrencyExchangeRate ¶
func (b *InvoiceBuilder) WithDocumentToTaxCurrencyExchangeRate(rate Decimal) *InvoiceBuilder
func (*InvoiceBuilder) WithDueDate ¶
func (b *InvoiceBuilder) WithDueDate(date Date) *InvoiceBuilder
func (*InvoiceBuilder) WithExpectedTaxInclusiveAmount ¶
func (b *InvoiceBuilder) WithExpectedTaxInclusiveAmount(amount Decimal) *InvoiceBuilder
WithExpectedTaxInclusiveAmount sets the expected tax inclusive amount. This is useful in cases where the invoice was already generated and the rounding algorithm might differ from the way the rounding is done for e-factura. If the tax inclusive amount generated is different than the given amount, the BT-114 term will be set (Payable rounding amount) and Payable Amount (BT-115) is adjusted with the difference.
func (*InvoiceBuilder) WithID ¶
func (b *InvoiceBuilder) WithID(id string) *InvoiceBuilder
func (*InvoiceBuilder) WithInvoiceLines ¶
func (b *InvoiceBuilder) WithInvoiceLines(invoiceLines []InvoiceLine) *InvoiceBuilder
func (*InvoiceBuilder) WithInvoicePeriod ¶
func (b *InvoiceBuilder) WithInvoicePeriod(invoicePeriod InvoicePeriod) *InvoiceBuilder
func (*InvoiceBuilder) WithInvoiceTypeCode ¶
func (b *InvoiceBuilder) WithInvoiceTypeCode(invoiceType InvoiceTypeCodeType) *InvoiceBuilder
func (*InvoiceBuilder) WithIssueDate ¶
func (b *InvoiceBuilder) WithIssueDate(date Date) *InvoiceBuilder
func (*InvoiceBuilder) WithNotes ¶
func (b *InvoiceBuilder) WithNotes(notes []InvoiceNote) *InvoiceBuilder
func (*InvoiceBuilder) WithOrderReference ¶
func (b *InvoiceBuilder) WithOrderReference(orderReference InvoiceOrderReference) *InvoiceBuilder
func (*InvoiceBuilder) WithPaymentMeans ¶
func (b *InvoiceBuilder) WithPaymentMeans(paymentMeans InvoicePaymentMeans) *InvoiceBuilder
func (*InvoiceBuilder) WithPaymentTerms ¶
func (b *InvoiceBuilder) WithPaymentTerms(paymentTerms InvoicePaymentTerms) *InvoiceBuilder
func (*InvoiceBuilder) WithSupplier ¶
func (b *InvoiceBuilder) WithSupplier(supplier InvoiceSupplierParty) *InvoiceBuilder
func (*InvoiceBuilder) WithTaxCurrencyCode ¶
func (b *InvoiceBuilder) WithTaxCurrencyCode(currencyID CurrencyCodeType) *InvoiceBuilder
type InvoiceCustomer ¶
type InvoiceCustomer struct {
Party InvoiceCustomerParty `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Party"`
}
func MakeInvoiceCustomer ¶
func MakeInvoiceCustomer(party InvoiceCustomerParty) InvoiceCustomer
type InvoiceCustomerContact ¶
type InvoiceCustomerContact struct { // ID: BT-56 // Term: Punctul de contact al Cumpărătorului // Description: Un punct de contact pentru o entitate sau persoană // juridică, cum ar fi numele persoanei, identificarea unui contact, // departament sau serviciu. // Cardinality: 0..1 Name string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Name,omitempty"` // ID: BT-57 // Term: Numărul de telefon al contactului Cumpărătorului // Description: Un număr de telefon pentru punctul de contact. // Cardinality: 0..1 Phone string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Telephone,omitempty"` // ID: BT-58 // Term: Adresa de email a contactului Vânzătorului // Description: O adresă de e-mail pentru punctul de contact. // Cardinality: 0..1 Email string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ElectronicMail,omitempty"` }
type InvoiceCustomerLegalEntity ¶
type InvoiceCustomerLegalEntity struct { // ID: BT-44 // Term: Numele cumpărătorului // Description: Numele complet al Cumpărătorului. // Cardinality: 1..1 Name string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 RegistrationName"` // ID: BT-47 // Term: Identificatorul de înregistrare legală a Cumpărătorului // Description: Un identificator emis de un organism oficial de // înregistrare care identifică Cumpărătorul ca o entitate sau persoană // juridică. // Cardinality: 1..1 CompanyID *ValueWithAttrs `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CompanyID,omitempty"` }
type InvoiceCustomerParty ¶
type InvoiceCustomerParty struct { // ID: BT-46 // Term: Identificatorul Cumpărătorului // Cardinality: 0..n Identifications []InvoicePartyIdentification `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyIdentification,omitempty"` // ID: BT-45 // Term: Denumirea comercială a Cumpărătorului // Description: Un nume sub care este cunoscut Cumpărătorul, altul decât // numele Cumpărătorului (cunoscut, de asemenea, ca denumirea comercială). // Cardinality: 0..1 CommercialName *InvoicePartyName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyName,omitempty"` // ID: BG-8 // Term: Adresa poștală a Cumpărătorului // Description: Un grup de termeni operaţionali care furnizează informaţii // despre adresa Cumpărătorului. // Cardinality: 1..1 PostalAddress InvoiceCustomerPostalAddress `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PostalAddress"` // Field: TaxScheme.CompanyID // ID: BT-48 // Term: Identificatorul de TVA al Cumpărătorului // Description: Identificatorul de TVA al Cumpărătorului (cunoscut, de // asemenea, ca numărul de identificare de TVA al Cumpărătorului). // Cardinality: 0..1 TaxScheme *InvoicePartyTaxScheme `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyTaxScheme"` LegalEntity InvoiceCustomerLegalEntity `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyLegalEntity"` // ID: BG-9 // Term: Contactul Cumpărătorului // Description: Un grup de termeni operaţionali care furnizează informaţii // de contact despre Cumpărător. // Cardinality: 0..1 Contact *InvoiceCustomerContact `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Contact,omitempty"` }
type InvoiceCustomerPostalAddress ¶
type InvoiceCustomerPostalAddress struct { // Field: PostalAddress.Line1 // ID: BT-50 // Term: Adresa Cumpărătorului - Linia 1 // Cardinality: 0..1 // Field: PostalAddress.Line2 // ID: BT-51 // Term: Adresa Cumpărătorului - Linia 2 // Cardinality: 0..1 // Field: PostalAddress.Line3 // ID: BT-163 // Term: Adresa Cumpărătorului - Linia 3 // Field: PostalAddress.CityName // ID: BT-52 // Term: Localitatea Cumpărătorului // Cardinality: 0..1 // Field: PostalAddress.PostalZone // ID: BT-53 // Term: Codul poştal al Cumpărătorului // Cardinality: 0..1 // Field: PostalAddress.CountrySubentity // ID: BT-54 // Term: Subdiviziunea ţării Cumpărătorului // Cardinality: 0..1 // Feild: PostalAddress.CountryIdentificationCode // ID: BT-55 // Term: Codul ţării Cumpărătorului // Cardinality: 1..1 PostalAddress }
func MakeInvoiceCustomerPostalAddress ¶
func MakeInvoiceCustomerPostalAddress(postalAddress PostalAddress) InvoiceCustomerPostalAddress
type InvoiceDelivery ¶
type InvoiceDelivery struct { // ID: BT-70 // Term: Numele părţii către care se face livrarea // Cardinality: 0..1 Name *InvoicePartyName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 DeliveryParty,omitempty"` // ID: BT-72 // Term: Data reală a livrării // Cardinality: 0..1 ActualDeliveryDate *Date `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ActualDeliveryDate,omitempty"` }
type InvoiceDeliveryAddress ¶
type InvoiceDeliveryAddress struct { // Field: PostalAddress.Line1 // ID: BT-75 // Term: Adresa de livrare - Linia 1 // Cardinality: 0..1 // Field: PostalAddress.Line2 // ID: BT-76 // Term: Adresa de livrare - Linia 2 // Cardinality: 0..1 // Field: PostalAddress.Line3 // ID: BT-165 // Term: Adresa de livrare - Linia 3 // Cardinality: 0..1 // Field: PostalAddress.CityName // ID: BT-77 // Term: Localitatea de livrare // Cardinality: 0..1 // Field: PostalAddress.PostalZone // ID: BT-78 // Term: Codul poştal al de livrare // Cardinality: 0..1 // Field: PostalAddress.CountrySubentity // ID: BT-79 // Term: Subdiviziunea ţării de livrare // Cardinality: 0..1 // Feild: PostalAddress.CountryIdentificationCode // ID: BT-80 // Term: Codul țării de livrare // Cardinality: 1..1 PostalAddress }
func MakeInvoiceDeliveryAddress ¶
func MakeInvoiceDeliveryAddress(postalAddress PostalAddress) InvoiceDeliveryAddress
type InvoiceDeliveryLocation ¶
type InvoiceDeliveryLocation struct { // ID: BT-71 // Term: Identificatorul locului către care se face livrarea // Cardinality: 0..1 // ID: BT-71-1 // Term: Identificatorul schemei // Cardinality: 0..1 ID *ValueWithAttrs `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty"` // ID: BG-15 // Term: ADRESA DE LIVRARE // Cardinality: 0..1 DeliveryAddress *InvoiceDeliveryAddress `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Address,omitempty"` }
type InvoiceDocumentAllowanceCharge ¶
type InvoiceDocumentAllowanceCharge struct { // test[cbc:ChargeIndicator == false] => BG-20 deducere // test[cbc:ChargeIndicator == true ] => BG-21 taxă suplimentară ChargeIndicator bool `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ChargeIndicator"` // test[cbc:ChargeIndicator == false] => // ID: BT-98 // Term: Codul motivului deducerii la nivelul documentului // Cardinality: 0..1 // test[cbc:ChargeIndicator == true] => // ID: BT-105 // Term: Codul motivului taxei suplimentare la nivelul documentului // Cardinality: 0..1 AllowanceChargeReasonCode string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 AllowanceChargeReasonCode,omitempty"` // test[cbc:ChargeIndicator == false] => // ID: BT-97 // Term: Motivul deducerii la nivelul documentului // Cardinality: 0..1 // test[cbc:ChargeIndicator == true] => // ID: BT-104 // Term: Motivul taxei suplimentare la nivelul documentului // Cardinality: 0..1 AllowanceChargeReason string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 AllowanceChargeReason,omitempty"` // test[cbc:ChargeIndicator == false] => // ID: BT-92 // Term: Valoarea deducerii la nivelul documentului // Description: fără TVA // Cardinality: 1..1 // test[cbc:ChargeIndicator == true] => // ID: BT-99 // Term: Valoarea taxei suplimentare la nivelul documentului // Description: fără TVA // Cardinality: 1..1 Amount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Amount"` // test[cbc:ChargeIndicator == false] => // ID: BT-93 // Term: Valoarea de bază a deducerii la nivelul documentului // Description: Valoarea de bază care poate fi utilizată, împreună cu // procentajul deducerii la nivelul documentului, pentru a calcula // valoarea deducerii la nivelul documentului. // Cardinality: 0..1 // test[cbc:ChargeIndicator == true] => // ID: BT-100 // Term: Valoarea de bază a taxei suplimentare la nivelul documentului // Description: Valoarea de bază care poate fi utilizată, împreună cu // procentajul taxei suplimentare la nivelul documentului, pentru a // calcula valoarea taxei suplimentare la nivelul documentului. // Cardinality: 0..1 BaseAmount *AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 BaseAmount,omitempty"` // test[cbc:ChargeIndicator == false] => // ID: BT-94 // Term: Procentajul deducerii la nivelul documentului // Cardinality: 0..1 // Description: Procentajul care poate fi utilizat, împreună cu valoarea // deducerii la nivelul documentului, pentru a calcula valoarea // deducerii la nivelul documentului. // test[cbc:ChargeIndicator == true] => // ID: BT-101 // Term: Procentajul taxelor suplimentare la nivelul documentului // Description: Procentajul care poate fi utilizat, împreună cu valoarea // taxei suplimentare la nivelul documentului, pentru a calcula // valoarea taxei suplimentare la nivelul documentului. // Cardinality: 0..1 Percent *Decimal `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 MultiplierFactorNumeric,omitempty"` // Field: TaxCategory.ID // ID: BT-102 // Term: Codul categoriei de TVA pentru taxe suplimentare la nivelul // documentului // Cardinality: 1..1 // Field: TaxCategory.Percent // ID: BT-103 // Term: Cota TVA pentru taxe suplimentare la nivelul documentului // Cardinality: 0..1 // Field: TaxCategory.TaxExemptionReason // ID: BT-104 // Term: Motivul taxei suplimentare la nivelul documentului // Cardinality: 0..1 // Field: TaxCategory.TaxExemptionReasonCode // ID: BT-105 // Term: Codul motivului taxei suplimentare la nivelul documentului // Cardinality: 0..1 TaxCategory InvoiceTaxCategory `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxCategory"` }
InvoiceDocumentAllowanceCharge is a struct that encodes the cbc:AllowanceCharge objects at invoice document level.
type InvoiceDocumentAllowanceChargeBuilder ¶
type InvoiceDocumentAllowanceChargeBuilder struct {
// contains filtered or unexported fields
}
InvoiceDocumentAllowanceChargeBuilder builds an InvoiceDocumentAllowanceCharge object
func NewInvoiceDocumentAllowanceBuilder ¶
func NewInvoiceDocumentAllowanceBuilder(currencyID CurrencyCodeType, amount Decimal, taxCategory InvoiceTaxCategory) *InvoiceDocumentAllowanceChargeBuilder
NewInvoiceDocumentAllowanceBuilder creates a new InvoiceDocumentAllowanceChargeBuilder builder that will build InvoiceDocumentAllowanceCharge object correspoding to an allowance (ChargeIndicator = false)
func NewInvoiceDocumentAllowanceChargeBuilder ¶
func NewInvoiceDocumentAllowanceChargeBuilder(chargeIndicator bool, currencyID CurrencyCodeType, amount Decimal, taxCategory InvoiceTaxCategory) *InvoiceDocumentAllowanceChargeBuilder
NewInvoiceDocumentAllowanceChargeBuilder creates a new generic InvoiceDocumentAllowanceChargeBuilder.
func NewInvoiceDocumentChargeBuilder ¶
func NewInvoiceDocumentChargeBuilder(currencyID CurrencyCodeType, amount Decimal, taxCategory InvoiceTaxCategory) *InvoiceDocumentAllowanceChargeBuilder
NewInvoiceDocumentChargeBuilder creates a new InvoiceDocumentAllowanceChargeBuilder builder that will build InvoiceDocumentAllowanceCharge object correspoding to a charge (ChargeIndicator = true)
func (InvoiceDocumentAllowanceChargeBuilder) Build ¶
func (b InvoiceDocumentAllowanceChargeBuilder) Build() (allowanceCharge InvoiceDocumentAllowanceCharge, err error)
func (*InvoiceDocumentAllowanceChargeBuilder) WithAllowanceChargeReason ¶
func (b *InvoiceDocumentAllowanceChargeBuilder) WithAllowanceChargeReason(allowanceChargeReason string) *InvoiceDocumentAllowanceChargeBuilder
func (*InvoiceDocumentAllowanceChargeBuilder) WithAllowanceChargeReasonCode ¶
func (b *InvoiceDocumentAllowanceChargeBuilder) WithAllowanceChargeReasonCode(allowanceChargeReasonCode string) *InvoiceDocumentAllowanceChargeBuilder
func (*InvoiceDocumentAllowanceChargeBuilder) WithAmount ¶
func (b *InvoiceDocumentAllowanceChargeBuilder) WithAmount(amount Decimal) *InvoiceDocumentAllowanceChargeBuilder
func (*InvoiceDocumentAllowanceChargeBuilder) WithBaseAmount ¶
func (b *InvoiceDocumentAllowanceChargeBuilder) WithBaseAmount(amount Decimal) *InvoiceDocumentAllowanceChargeBuilder
func (*InvoiceDocumentAllowanceChargeBuilder) WithChargeIndicator ¶
func (b *InvoiceDocumentAllowanceChargeBuilder) WithChargeIndicator(charge bool) *InvoiceDocumentAllowanceChargeBuilder
func (*InvoiceDocumentAllowanceChargeBuilder) WithCurrencyID ¶
func (b *InvoiceDocumentAllowanceChargeBuilder) WithCurrencyID(currencyID CurrencyCodeType) *InvoiceDocumentAllowanceChargeBuilder
func (*InvoiceDocumentAllowanceChargeBuilder) WithTaxCategory ¶
func (b *InvoiceDocumentAllowanceChargeBuilder) WithTaxCategory(taxCategory InvoiceTaxCategory) *InvoiceDocumentAllowanceChargeBuilder
type InvoiceDocumentReference ¶
type InvoiceDocumentReference struct { // ID: BT-25 // Term: Identificatorul Vânzătorului // Cardinality: 1..1 ID string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID"` // ID: BT-26 // Term: Data de emitere a facturii anterioare // Description: Data emiterii facturii anterioare trebuie furnizată în // cazul în care identificatorul facturii anterioare nu este unic. // Cardinality: 0..1 IssueDate *Date `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 IssueDate,omitempty"` }
type InvoiceErrorMessage ¶
type InvoiceErrorMessage struct { UploadIndex int64 `xml:"Index_incarcare,attr,omitempty"` CIFSeller string `xml:"Cif_emitent,attr,omitempty"` Errors []struct { ErrorMessage string `xml:"errorMessage,attr"` } `xml:"Error,omitempty"` // Hardcode the namespace here so we don't need a customer marshaling // method. XMLName xml.Name `xml:"mfp:anaf:dgti:efactura:mesajEroriFactuta:v1 header"` }
DownloadInvoiceParseZip is the type corresponding to an Invoice message error from the download zip.
type InvoiceLegalMonetaryTotal ¶
type InvoiceLegalMonetaryTotal struct { // ID: BT-106 // Term: Suma valorilor nete ale liniilor facturii // Cardinality: 1..1 LineExtensionAmount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 LineExtensionAmount"` // ID: BT-109 // Term: Valoarea totală a facturii fără TVA // Cardinality: 1..1 TaxExclusiveAmount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 TaxExclusiveAmount"` // ID: BT-112 // Term: Valoarea totală a facturii cu TVA // Cardinality: 1..1 TaxInclusiveAmount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 TaxInclusiveAmount"` // ID: BT-107 // Term: Suma deducerilor la nivelul documentului // Cardinality: 0..1 AllowanceTotalAmount *AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 AllowanceTotalAmount"` // ID: BT-108 // Term: Suma taxelor suplimentare la nivelul documentului // Cardinality: 0..1 ChargeTotalAmount *AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ChargeTotalAmount"` // ID: BT-113 // Term: Sumă plătită // Cardinality: 0..1 PrepaidAmount *AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 PrepaidAmount,omitempty"` // ID: BT-114 // Term: Valoare de rotunjire // Description: Valoarea care trebuie adunată la totalul facturii pentru a // rotunji suma de plată. // Cardinality: 0..1 PayableRoundingAmount *AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 PayableRoundingAmount,omitempty"` // ID: BT-115 // Term: Suma de plată // Cardinality: 1..1 PayableAmount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 PayableAmount"` }
type InvoiceLine ¶
type InvoiceLine struct { // ID: BT-126 // Term: Identificatorul liniei facturii // Cardinality: 1..1 ID string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID"` // ID: BT-127 // Term: Nota liniei facturii // Description: O notă textuală care furnizează o informaţie nestructurată // care este relevantă pentru linia facturii. // Cardinality: 0..1 Note string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Note,omitempty"` // ID: BT-129 // Term: Cantitatea facturată // Description: Cantitatea articolelor (bunuri sau servicii) luate în // considerare în linia din factură. // Cardinality: 1..1 // ID: BT-130 // Term: Codul unităţii de măsură a cantităţii facturate // Cardinality: 1..1 InvoicedQuantity InvoicedQuantity `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 InvoicedQuantity"` // ID: BT-131 // Term: Valoarea netă a liniei facturii // Cardinality: 1..1 LineExtensionAmount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 LineExtensionAmount"` // ID: BG-26 // Term: Perioada de facturare a liniei // Cardinality: 0..1 InvoicePeriod *InvoiceLinePeriod `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 InvoicePeriod,omitempty"` // test[cbc:ChargeIndicator == false] => // ID: BG-27 // Term: DEDUCERI LA LINIA FACTURII // Cardinality: 0..n // test[cbc:ChargeIndicator == true] => // ID: BG-28 // Term: TAXE SUPLIMENTARE LA LINIA FACTURII // Cardinality: 0..n AllowanceCharges []InvoiceLineAllowanceCharge `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 AllowanceCharge,omitempty"` // ID: BG-31 // Term: INFORMAȚII PRIVIND ARTICOLUL Item InvoiceLineItem `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Item"` // ID: BG-29 // Term: DETALII ALE PREŢULUI // Cardinality: 1..1 Price InvoiceLinePrice `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Price"` }
type InvoiceLineAllowanceCharge ¶
type InvoiceLineAllowanceCharge struct { // test[cbc:ChargeIndicator == false] => BG-27 deducere // test[cbc:ChargeIndicator == true ] => BG-28 taxă suplimentară ChargeIndicator bool `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ChargeIndicator"` // test[cbc:ChargeIndicator == false] => // ID: BT-140 // Term: Codul motivului deducerii la linia facturii // Cardinality: 0..1 // test[cbc:ChargeIndicator == true] => // ID: BT-145 // Term: Codul motivului taxei suplimentare la linia facturii // Cardinality: 0..1 AllowanceChargeReasonCode string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 AllowanceChargeReasonCode,omitempty"` // test[cbc:ChargeIndicator == false] => // ID: BT-139 // Term: Motivul deducerii la linia facturii // Cardinality: 0..1 // test[cbc:ChargeIndicator == true] => // ID: BT-144 // Term: Motivul taxei suplimentare la linia facturii // Cardinality: 0..1 AllowanceChargeReason string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 AllowanceChargeReason,omitempty"` // test[cbc:ChargeIndicator == false] => // ID: BT-136 // Term: Valoarea deducerii la linia facturii // Description: fără TVA // Cardinality: 1..1 // test[cbc:ChargeIndicator == true] => // ID: BT-141 // Term: Valoarea taxei suplimentare la linia facturii // Description: fără TVA // Cardinality: 1..1 Amount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Amount"` // test[cbc:ChargeIndicator == false] => // ID: BT-137 // Term: Valoarea de bază a deducerii la linia facturii // Description: Valoarea de bază care poate fi utilizată, împreună cu // procentajul deducerii la linia facturii, pentru a calcula valoarea // deducerii la linia facturii. // Cardinality: 0..1 // test[cbc:ChargeIndicator == true] => // ID: BT-142 // Term: Valoarea de bază a taxei suplimentare la linia facturii // Description: Valoarea de bază care poate fi utilizată, împreună cu // procentajul taxei suplimentare la linia facturii, pentru a calcula // valoarea taxei suplimentare la linia facturii. // Cardinality: 0..1 BaseAmount *AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 BaseAmount"` }
InvoiceLineAllowanceCharge is a struct that encodes the cbc:AllowanceCharge objects at invoice line level.
type InvoiceLineAllowanceChargeBuilder ¶
type InvoiceLineAllowanceChargeBuilder struct {
// contains filtered or unexported fields
}
InvoiceLineAllowanceChargeBuilder builds an InvoiceLineAllowanceCharge object
func NewInvoiceLineAllowanceBuilder ¶
func NewInvoiceLineAllowanceBuilder(currencyID CurrencyCodeType, amount Decimal) *InvoiceLineAllowanceChargeBuilder
NewInvoiceLineAllowanceBuilder creates a new InvoiceLineAllowanceChargeBuilder builder that will build InvoiceLineAllowanceCharge object correspoding to an allowance (ChargeIndicator = false)
func NewInvoiceLineAllowanceChargeBuilder ¶
func NewInvoiceLineAllowanceChargeBuilder(chargeIndicator bool, currencyID CurrencyCodeType, amount Decimal) *InvoiceLineAllowanceChargeBuilder
NewInvoiceLineAllowanceChargeBuilder creates a new generic InvoiceLineAllowanceChargeBuilder.
func NewInvoiceLineChargeBuilder ¶
func NewInvoiceLineChargeBuilder(currencyID CurrencyCodeType, amount Decimal) *InvoiceLineAllowanceChargeBuilder
NewInvoiceLineChargeBuilder creates a new InvoiceLineAllowanceChargeBuilder builder that will build InvoiceLineAllowanceCharge object correspoding to a charge (ChargeIndicator = true)
func (InvoiceLineAllowanceChargeBuilder) Build ¶
func (b InvoiceLineAllowanceChargeBuilder) Build() (allowanceCharge InvoiceLineAllowanceCharge, err error)
func (*InvoiceLineAllowanceChargeBuilder) WithAllowanceChargeReason ¶
func (b *InvoiceLineAllowanceChargeBuilder) WithAllowanceChargeReason(allowanceChargeReason string) *InvoiceLineAllowanceChargeBuilder
func (*InvoiceLineAllowanceChargeBuilder) WithAllowanceChargeReasonCode ¶
func (b *InvoiceLineAllowanceChargeBuilder) WithAllowanceChargeReasonCode(allowanceChargeReasonCode string) *InvoiceLineAllowanceChargeBuilder
func (*InvoiceLineAllowanceChargeBuilder) WithAmount ¶
func (b *InvoiceLineAllowanceChargeBuilder) WithAmount(amount Decimal) *InvoiceLineAllowanceChargeBuilder
func (*InvoiceLineAllowanceChargeBuilder) WithBaseAmount ¶
func (b *InvoiceLineAllowanceChargeBuilder) WithBaseAmount(amount Decimal) *InvoiceLineAllowanceChargeBuilder
func (*InvoiceLineAllowanceChargeBuilder) WithChargeIndicator ¶
func (b *InvoiceLineAllowanceChargeBuilder) WithChargeIndicator(charge bool) *InvoiceLineAllowanceChargeBuilder
func (*InvoiceLineAllowanceChargeBuilder) WithCurrencyID ¶
func (b *InvoiceLineAllowanceChargeBuilder) WithCurrencyID(currencyID CurrencyCodeType) *InvoiceLineAllowanceChargeBuilder
type InvoiceLineBuilder ¶
type InvoiceLineBuilder struct {
// contains filtered or unexported fields
}
InvoiceLineBuilder builds an InvoiceLine object. The only (useful) role of this builder is to help build a complex InvoiceLine object while ensuring the amounts are calculated correctly.
func NewInvoiceLineBuilder ¶
func NewInvoiceLineBuilder(id string, currencyID CurrencyCodeType) (b *InvoiceLineBuilder)
NewInvoiceLineBuilder creates a new InvoiceLineBuilder
func (*InvoiceLineBuilder) AppendAllowanceCharge ¶
func (b *InvoiceLineBuilder) AppendAllowanceCharge(allowanceCharge InvoiceLineAllowanceCharge) *InvoiceLineBuilder
func (InvoiceLineBuilder) Build ¶
func (b InvoiceLineBuilder) Build() (line InvoiceLine, err error)
func (*InvoiceLineBuilder) WithAllowancesCharges ¶
func (b *InvoiceLineBuilder) WithAllowancesCharges(allowancesCharges []InvoiceLineAllowanceCharge) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithBaseQuantity ¶
func (b *InvoiceLineBuilder) WithBaseQuantity(quantity Decimal) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithCurrencyID ¶
func (b *InvoiceLineBuilder) WithCurrencyID(currencyID CurrencyCodeType) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithGrossPriceAmount ¶
func (b *InvoiceLineBuilder) WithGrossPriceAmount(priceAmount Decimal) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithID ¶
func (b *InvoiceLineBuilder) WithID(id string) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithInvoicePeriod ¶
func (b *InvoiceLineBuilder) WithInvoicePeriod(invoicePeriod *InvoiceLinePeriod) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithInvoicedQuantity ¶
func (b *InvoiceLineBuilder) WithInvoicedQuantity(quantity Decimal) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithItemCommodityClassification ¶
func (b *InvoiceLineBuilder) WithItemCommodityClassification(classification ItemCommodityClassification) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithItemDescription ¶
func (b *InvoiceLineBuilder) WithItemDescription(description string) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithItemName ¶
func (b *InvoiceLineBuilder) WithItemName(name string) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithItemSellerID ¶
func (b *InvoiceLineBuilder) WithItemSellerID(id string) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithItemStandardItemIdentification ¶
func (b *InvoiceLineBuilder) WithItemStandardItemIdentification(identification ItemStandardIdentificationCode) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithItemTaxCategory ¶
func (b *InvoiceLineBuilder) WithItemTaxCategory(taxCategory InvoiceLineTaxCategory) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithNote ¶
func (b *InvoiceLineBuilder) WithNote(note string) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithPriceDeduction ¶
func (b *InvoiceLineBuilder) WithPriceDeduction(deduction Decimal) *InvoiceLineBuilder
func (*InvoiceLineBuilder) WithUnitCode ¶
func (b *InvoiceLineBuilder) WithUnitCode(unitCode UnitCodeType) *InvoiceLineBuilder
type InvoiceLineItem ¶
type InvoiceLineItem struct { // ID: BT-153 // Term: Numele articolului // Cardinality: 1..1 Name string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Name"` // ID: BT-154 // Term: Descrierea articolului // Cardinality: 0..1 Description string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Description,omitempty"` // ID: BT-155 // Term: Identificatorul Vânzătorului articolului // Cardinality: 0..1 SellerItemID *IDNode `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 SellersItemIdentification,omitempty"` // ID: BT-157/BT-157-1 // Term: Identificatorul standard al articolului / Identificatorul schemei StandardItemIdentification *ItemStandardIdentificationCode `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 StandardItemIdentification,omitempty"` // ID: BT-158/BT-158-1 // Term: Identificatorul clasificării articolului / Identificatorul schemei CommodityClassification *ItemCommodityClassification `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 CommodityClassification,omitempty"` // ID: BG-30 // Term: INFORMAŢII PRIVIND TVA A LINIEI TaxCategory InvoiceLineTaxCategory `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 ClassifiedTaxCategory"` }
type InvoiceLinePeriod ¶
type InvoiceLinePeriod struct { // ID: BT-134 // Term: Data de început a perioadei de facturare a liniei facturii // Cardinality: 0..1 StartDate *Date `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 StartDate,omitempty"` // ID: BT-135 // Term: Data de sfârșit a perioadei de facturare // Cardinality: 0..1 EndDate *Date `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 EndDate,omitempty"` }
type InvoiceLinePrice ¶
type InvoiceLinePrice struct { // ID: BT-146 // Term: Preţul net al articolului // Description: Preţul unui articol, exclusiv TVA, după aplicarea reducerii // la preţul articolului. // Cardinality: 1..1 PriceAmount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 PriceAmount"` // ID: BT-149 // Term: Cantitatea de bază a preţului articolului // Cardinality: 0..1 // ID: BT-150 // Term: Codul unităţii de măsură a cantităţii de bază a preţului articolului // Cardinality: 0..1 BaseQuantity *InvoicedQuantity `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 BaseQuantity,omitempty"` AllowanceCharge *InvoiceLinePriceAllowanceCharge `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 AllowanceCharge,omitempty"` }
type InvoiceLinePriceAllowanceCharge ¶
type InvoiceLinePriceAllowanceCharge struct { // test[cbc:ChargeIndicator == false] => deducere // test[cbc:ChargeIndicator == true] => taxă suplimentară ChargeIndicator bool `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ChargeIndicator"` // ID: BT-147 // Term: Reducere la prețul articolului // Cardinality: 0..1 Amount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Amount"` // ID: BT-148 // Term: Preţul brut al articolului // Cardinality: 0..1 BaseAmount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 BaseAmount"` }
type InvoiceLineTaxCategory ¶
type InvoiceLineTaxCategory struct { // ID: BT-151 // Term: Codul categoriei de TVA a articolului facturat // Cardinality: 1..1 ID TaxCategoryCodeType `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID"` // ID: BT-152 // Term: Cota TVA pentru articolul facturat // Cardinality: 0..1 Percent Decimal `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Percent"` TaxScheme TaxScheme `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxScheme"` }
InvoiceTaxCategory is a struct that encodes a cac:ClassifiedTaxCategory node at invoice line level.
func (InvoiceLineTaxCategory) MarshalXML ¶
func (c InvoiceLineTaxCategory) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML implements the xml.Marshaler interface. We use a custom marshaling function for InvoiceLineTaxCategory since we want to keep the Percent a Decimal (not a pointer) for ease of use, be we want to ensure we remove the cbc:Percent node if the category code is "Not subject to VAT".
type InvoiceNote ¶
type InvoiceNote struct { // ID: BT-21 // Term: Codul subiectului comentariului din factură // Cardinality: 0..1 SubjectCode InvoiceNoteSubjectCodeType // ID: BT-22 // Term: Comentariu în factură // Cardinality: 1..1 Note string `xml:",chardata"` }
func (InvoiceNote) MarshalXML ¶
func (n InvoiceNote) MarshalXML(e *xml.Encoder, start xml.StartElement) error
func (InvoiceNote) UnmarshalXML ¶
func (n InvoiceNote) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type InvoiceOrderReference ¶
type InvoiceOrderReference struct { // ID: BT-13 // Term: Referinţa comenzii // Cardinality: 0..1 OrderID string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty"` // ID: BT-13 // Term: Referinţa comenzii // Cardinality: 0..1 SalesOrderID string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 SalesOrderID,omitempty"` }
type InvoicePartyIdentification ¶
type InvoicePartyIdentification struct {
ID ValueWithAttrs `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID"`
}
type InvoicePartyName ¶
type InvoicePartyName struct {
Name string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Name"`
}
type InvoicePartyTaxScheme ¶
type InvoicePayee ¶
type InvoicePayee struct { // ID: BT-59 // Term: Numele Beneficiarului // Cardinality: 1..1 Name InvoicePartyName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyName"` // ID: BT-60 / BT-60-1 // Term: Identificatorul Beneficiarului / Identificatorul schemei // Cardinality: 0..1 / 0..1 Identification *InvoicePartyIdentification `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyIdentification,omitempty"` // ID: BT-61 // Term: Identificatorul înregistrării legale a Beneficiarului // Cardinality: 0..1 // ID: BT-61-1 // Term: Identificatorul schemei // Cardinality: 0..1 CompanyID *ValueWithAttrs `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CompanyID,omitempty"` }
type InvoicePaymentMeans ¶
type InvoicePaymentMeans struct { // ID: BT-81 // Term: Codul tipului de instrument de plată // Description: Cod care indică modul în care o platătrebuie să fie sau a // fost efectuată. // Cardinality: 1..1 PaymentMeansCode PaymentMeansCode `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 PaymentMeansCode"` // ID: BT-83 // Term: Aviz de plată // Description: Valoare textuală utilizată pentru a stabili o legătură // între plată şi Factură, emisă de Vânzător. // Cardinality: 0..1 PaymentID string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 PaymentID,omitempty"` // ID: BG-17 // Term: VIRAMENT // Cardinality: 0..n PayeeFinancialAccounts []PayeeFinancialAccount `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PayeeFinancialAccount,omitempty"` }
type InvoicePaymentTerms ¶
type InvoicePaymentTerms struct {
Note string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Note"`
}
type InvoicePeriod ¶
type InvoicePeriod struct { // ID: BT-73 // Term: Data de început a perioadei de facturare // Description: Data la care începe perioada de facturare. // Cardinality: 0..1 StartDate *Date `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 StartDate,omitempty"` // ID: BT-74 // Term: Data de sfârșit a perioadei de facturare // Description: Data la care sfârșește perioada de facturare. // Cardinality: 0..1 EndDate *Date `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 EndDate,omitempty"` }
type InvoiceSupplier ¶
type InvoiceSupplier struct {
Party InvoiceSupplierParty `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Party"`
}
func MakeInvoiceSupplier ¶
func MakeInvoiceSupplier(party InvoiceSupplierParty) InvoiceSupplier
type InvoiceSupplierContact ¶
type InvoiceSupplierContact struct { // ID: BT-41 // Term: Punctul de contact al Vânzătorului // Description: Un punct de contact pentru o entitate sau persoană // juridică, cum ar fi numele persoanei, identificarea unui contact, // departament sau serviciu. // Cardinality: 0..1 Name string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Name,omitempty"` // ID: BT-42 // Term: Numărul de telefon al contactului Vânzătorului // Description: Un număr de telefon pentru punctul de contact. // Cardinality: 0..1 Phone string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Telephone,omitempty"` // ID: BT-43 // Term: Adresa de email a contactului Vânzătorului // Description: O adresă de e-mail pentru punctul de contact. // Cardinality: 0..1 Email string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ElectronicMail,omitempty"` }
type InvoiceSupplierLegalEntity ¶
type InvoiceSupplierLegalEntity struct { // ID: BT-27 // Term: Numele vânzătorului // Description: Denumirea oficială completă sub care Vânzătorul este // înscris în registrul naţional al persoanelor juridice sau în calitate // de Contribuabil sau îşi exercită activităţile în calitate de persoană // sau grup de persoane. // Cardinality: 1..1 Name string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 RegistrationName"` // ID: BT-30 // Term: Identificatorul de înregistrare legală a Vânzătorului // Description: Un identificator emis de un organism oficial de // înregistrare care identifică Vânzătorul ca o entitate sau persoană // juridică. // Cardinality: 1..1 CompanyID *ValueWithAttrs `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CompanyID,omitempty"` // ID: BT-33 // Term: Informaţii juridice suplimentare despre Vânzător // Cardinality: 0..1 CompanyLegalForm string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CompanyLegalForm,omitempty"` }
type InvoiceSupplierParty ¶
type InvoiceSupplierParty struct { // ID: BT-29 // Term: Identificatorul Vânzătorului // Cardinality: 0..n Identifications []InvoicePartyIdentification `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyIdentification,omitempty"` // ID: BT-28 // Term: Denumirea comercială a Vânzătorului // Description: Un nume sub care este cunoscut Vânzătorul, altul decât // numele Vânzătorului (cunoscut, de asemenea, ca denumirea comercială). // Cardinality: 0..1 CommercialName *InvoicePartyName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyName,omitempty"` // ID: BG-5 // Term: Adresa poștală a vânzătorului // Description: Un grup de termeni operaţionali care furnizează informaţii // despre adresa Vânzătorului. // Cardinality: 1..1 PostalAddress InvoiceSupplierPostalAddress `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PostalAddress"` // test[cac:PartyTaxScheme/cac:TaxScheme/cbc:ID == 'VAT'] ==> // Field: TaxScheme.CompanyID // ID: BT-31 // Term: Identificatorul de TVA al Vânzătorului // Description: Identificatorul de TVA al Vânzătorului (cunoscut, de // asemenea, ca numărul de identificare de TVA al Vânzătorului). // Cardinality: 0..1 // test[cac:PartyTaxScheme/cac:TaxScheme/cbc:ID == ”] ==> // Field: TaxScheme.CompanyID // ID: BT-32 // Term: Identificatorul de înregistrare fiscală a Vânzătorului // Description: Identificarea locală (definită prin adresa Vânzătorului) // a Vânzătorului pentru scopuri fiscale sau o referinţă care-i permite // Vânzătorului să demonstreze că este înregistrat la administraţia // fiscală. // Cardinality: 0..1 TaxScheme *InvoicePartyTaxScheme `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyTaxScheme,omitempty"` LegalEntity InvoiceSupplierLegalEntity `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyLegalEntity"` // TODO: // ID: BG-6 // Term: CONTACTUL VÂNZĂTORULUI // Description: Un grup de termeni operaţionali care furnizează informaţii // de contact despre Vânzător. // Cardinality: 0..1 Contact *InvoiceSupplierContact `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Contact,omitempty"` }
type InvoiceSupplierPostalAddress ¶
type InvoiceSupplierPostalAddress struct { // Field: PostalAddress.Line1 // ID: BT-35 // Term: Adresa Vânzătorului - Linia 1 // Cardinality: 0..1 // Field: PostalAddress.Line2 // ID: BT-36 // Term: Adresa Vânzătorului - Linia 2 // Cardinality: 0..1 // Field: PostalAddress.Line3 // ID: BT-162 // Term: Adresa Vânzătorului - Linia 3 // Cardinality: 0..1 // Field: PostalAddress.CityName // ID: BT-37 // Term: Localitatea Vânzătorului // Cardinality: 0..1 // Field: PostalAddress.PostalZone // ID: BT-38 // Term: Codul poştal al Vânzătorului // Cardinality: 0..1 // Field: PostalAddress.CountrySubentity // ID: BT-39 // Term: Subdiviziunea ţării Vânzătorului // Cardinality: 0..1 // Feild: PostalAddress.CountryIdentificationCode // ID: BT-40 // Term: Codul țării Vânzătorului // Cardinality: 1..1 PostalAddress }
func MakeInvoiceSupplierPostalAddress ¶
func MakeInvoiceSupplierPostalAddress(postalAddress PostalAddress) InvoiceSupplierPostalAddress
type InvoiceTaxCategory ¶
type InvoiceTaxCategory struct { ID TaxCategoryCodeType `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID"` Percent Decimal `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Percent"` TaxExemptionReason string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 TaxExemptionReason,omitempty"` TaxExemptionReasonCode TaxExemptionReasonCodeType `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 TaxExemptionReasonCode,omitempty"` TaxScheme TaxScheme `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxScheme"` }
InvoiceTaxCategory is a struct that encodes a cac:TaxCategory node.
func (InvoiceTaxCategory) MarshalXML ¶
func (c InvoiceTaxCategory) MarshalXML(e *xml.Encoder, start xml.StartElement) error
MarshalXML implements the xml.Marshaler interface. We use a custom marshaling function for InvoiceTaxCategory since we want to keep the Percent a Decimal (not a pointer) for ease of use, be we want to ensure we remove the cbc:Percent node if the category code is "Not subject to VAT".
type InvoiceTaxRepresentative ¶
type InvoiceTaxRepresentative struct { // ID: BT-62 // Term: Numele reprezentantului fiscal al Vânzătorului // Cardinality: 1..1 Name InvoicePartyName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyName"` // ID: BT-63 // Term: Identificatorul de TVA al reprezentantului fiscal al Vânzătorului // Cardinality: 1..1 TaxScheme InvoicePartyTaxScheme `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyTaxScheme"` // ID: BG-12 // Term: ADRESA POŞTALĂ A REPREZENTANTULUI FISCAL AL VÂNZĂTORULUI // Cardinality: 1..1 PostalAddress InvoiceTaxRepresentativePostalAddress `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PostalAddress"` }
type InvoiceTaxRepresentativePostalAddress ¶
type InvoiceTaxRepresentativePostalAddress struct { // Field: PostalAddress.Line1 // ID: BT-64 // Term: Adresa reprezentantului fiscal - Linia 1 // Cardinality: 0..1 // Field: PostalAddress.Line2 // ID: BT-64 // Term: Adresa reprezentantului fiscal - Linia 2 // Cardinality: 0..1 // Field: PostalAddress.Line3 // ID: BT-164 // Term: Adresa reprezentantului fiscal - Linia 3 // Cardinality: 0..1 // Field: PostalAddress.CityName // ID: BT-66 // Term: Localitatea reprezentantului fiscal // Cardinality: 0..1 // Field: PostalAddress.PostalZone // ID: BT-67 // Term: Codul poştal al reprezentantului fiscal // Cardinality: 0..1 // Field: PostalAddress.CountrySubentity // ID: BT-68 // Term: Subdiviziunea ţării reprezentantului fiscal // Cardinality: 0..1 // Feild: PostalAddress.CountryIdentificationCode // ID: BT-69 // Term: Codul ţării reprezentantului fiscal // Cardinality: 1..1 PostalAddress }
func MakeInvoiceTaxRepresentativePostalAddress ¶
func MakeInvoiceTaxRepresentativePostalAddress(postalAddress PostalAddress) InvoiceTaxRepresentativePostalAddress
type InvoiceTaxSubtotal ¶
type InvoiceTaxSubtotal struct { // ID: BT-116 // Term: Baza de calcul pentru categoria de TVA // Cardinality: 1..1 TaxableAmount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 TaxableAmount"` // ID: BT-117 // Term: Valoarea TVA pentru fiecare categorie de TVA // Cardinality: 1..1 TaxAmount AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 TaxAmount"` // Field: TaxCategory.ID // ID: BT-118 // Term: Codul categoriei de TVA // Cardinality: 1..1 // Field: TaxCategory.Percent // ID: BT-119 // Term: Cota categoriei de TVA // Cardinality: 0..1 // Field: TaxCategory.TaxExemptionReason // ID: BT-120 // Term: Motivul scutirii de TVA // Cardinality: 0..1 // Field: TaxCategory.TaxExemptionReasonCode // ID: BT-121 // Term: Codul motivului scutirii de TVA // Cardinality: 0..1 TaxCategory InvoiceTaxCategory `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxCategory"` }
type InvoiceTaxTotal ¶
type InvoiceTaxTotal struct { // ID: BT-110 // Term: Valoarea totală a TVA a facturii // Cardinality: 0..1 // ID: BT-111 // Term: Valoarea totală a TVA a facturii în moneda de contabilizare // Description: Trebuie utilizat când moneda de contabilizare a TVA (BT-6) // diferă de codul monedei facturii (BT-5) în conformitate cu articolul // 230 din Directiva 2006/112/CE referitoare la TVA. // Valoarea TVA în moneda de contabilizare nu este utilizată în // calcularea totalurilor facturii. // Cardinality: 0..1 TaxAmount *AmountWithCurrency `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 TaxAmount,omitempty"` // ID: BG-23 // Term: DETALIEREA TVA // Cardinality: 1..n TaxSubtotals []InvoiceTaxSubtotal `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxSubtotal"` }
type InvoiceTypeCodeType ¶
type InvoiceTypeCodeType string
https://unece.org/fileadmin/DAM/trade/untdid/d16b/tred/tred1001.htm
const ( // Commercial invoice (RO: Factură comercială) // (1334) Document/message claiming payment for goods or services supplied // under conditions agreed between seller and buyer. InvoiceTypeCommercialInvoice InvoiceTypeCodeType = "380" // Credit Note // (1113) Document/message for providing credit information to the // relevant party. InvoiceTypeCreditNote InvoiceTypeCodeType = "381" // Corrected invoice (RO: Factură corectată) // Commercial invoice that includes revised information differing from an // earlier submission of the same invoice. InvoiceTypeCorrectedInvoice InvoiceTypeCodeType = "384" // Self-billed invoice (RO: Autofactură) // An invoice the invoicee is producing instead of the seller. InvoiceTypeSelfBilledInvoice InvoiceTypeCodeType = "389" // Invoice information for accounting purposes (RO: Factură - informaţii în // scopuri contabile) // A document / message containing accounting related information such as // monetary summations, seller id and VAT information. This may not be a // complete invoice according to legal requirements. For instance the // line item information might be excluded. InvoiceTypeInvoiceInformationAccountingPurposes InvoiceTypeCodeType = "751" )
type InvoicedQuantity ¶
type InvoicedQuantity struct { Quantity Decimal `xml:",chardata"` // The unit of the quantity. UnitCode UnitCodeType `xml:"unitCode,attr"` // The quantity unit code list. UnitCodeListID string `xml:"unitCodeListID,attr,omitempty"` // The identification of the agency that maintains the quantity unit code // list. UnitCodeListAgencyID string `xml:"unitCodeListAgencyID,attr,omitempty"` // The name of the agency which maintains the quantity unit code list. UnitCodeListAgencyName string `xml:"unitCodeListAgencyName,attr,omitempty"` }
InvoicedQuantity represents the quantity (of items) on an invoice line.
type ItemClassificationCode ¶
type ItemCommodityClassification ¶
type ItemCommodityClassification struct {
ItemClassificationCode ItemClassificationCode `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ItemClassificationCode"`
}
ItemCommodityClassification is a struct that encodes the cac:CommodityClassification node at an invoice line level.
type LimitExceededError ¶
type LimitExceededError struct { // ErrorResponse has information about the HTTP response. *ErrorResponse // Limit stores the API limit that was hit for the day. Limit int64 }
LimitExceededError is an error returned if we hit an API limit.
func (*LimitExceededError) Error ¶
func (e *LimitExceededError) Error() string
type Message ¶
type Message struct { ID string `json:"id"` Type string `json:"tip"` UploadIndex string `json:"id_solicitare"` CIF string `json:"cif"` Details string `json:"detalii"` CreationDate string `json:"data_creare"` }
func (Message) GetBuyerCIF ¶
GetBuyerCIF parses message details and returns the buyer CIF.
func (Message) GetCreationDate ¶
GetCreationDate parsed CreationDate and returns a time.Time in RoZoneLocation.
func (Message) GetID ¶
GetID parses and returns the message ID as int64 (since the API returns it as string).
func (Message) GetSellerCIF ¶
GetSellerCIF parses message details and returns the seller CIF.
func (Message) GetUploadIndex ¶
GetUploadIndex parses and returns the upload index as int64 (since the API returns it as string).
func (Message) IsBuyerMessage ¶
IsBuyerMessage returns true if message type is MESAJ CUMPARATOR PRIMIT / MESAJ CUMPARATOR TRANSMIS
func (Message) IsReceivedInvoice ¶
IsReceivedInvoice returns true if message type is FACTURA PRIMITA
func (Message) IsSelfBilledInvoice ¶
IsSelfBilledInvoice returns true if the message represents a self-billed invoice.
func (Message) IsSentInvoice ¶
IsSentInvoice returns true if message type is FACTURA TRIMISA
type MessageFilterType ¶
type MessageFilterType int
func (MessageFilterType) String ¶
func (t MessageFilterType) String() string
type MessagesListPaginationResponse ¶
type MessagesListPaginationResponse struct { MessagesListResponse RecordsInPage int64 `json:"numar_inregistrari_in_pagina"` TotalRecordsPerPage int64 `json:"numar_total_inregistrari_per_pagina"` TotalRecords int64 `json:"numar_total_inregistrari"` TotalPages int64 `json:"numar_total_pagini"` CurrentPageIndex int64 `json:"index_pagina_curenta"` }
MessagesListPaginationResponse is the parsed response from the list messages with pagination endpoint.
type MessagesListResponse ¶
type MessagesListResponse struct { Error string `json:"eroare"` Title string `json:"titlu"` Serial string `json:"serial"` CUI string `json:"cui"` Messages []Message `json:"mesaje"` }
MessagesListResponse is the parsed response from the list messages endpoint.
func (*MessagesListResponse) IsOk ¶
func (r *MessagesListResponse) IsOk() bool
IsOk returns true if the response corresponding to fetching messages list was successful.
type PayeeFinancialAccount ¶
type PayeeFinancialAccount struct { // ID: BT-84 // Term: Identificatorul contului de plată // Description: Un identificator unic al contului bancar de plată, la un // furnizor de servicii de plată la care se recomandă să se facă plata // Cardinality: 1..1 ID string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID"` // ID: BT-85 // Term: Numele contului de plată // Cardinality: 0..1 Name string `xml:"bc:Name,omitempty"` // ID: BT-86 // Term: Identificatorul furnizorului de servicii de plată. // Cardinality: 0..1 FinancialInstitutionBranch *IDNode `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 FinancialInstitutionBranch,omitempty"` }
type PaymentMeansCode ¶
type PaymentMeansCode struct { Code PaymentMeansCodeType `xml:",chardata"` // ID: BT-82 // Term: Explicaţii privind instrumentul de plată // Description: Text care indică modul în care o plată trebuie să fie sau // a fost efectuată. // Cardinality: 0..1 Name string `xml:"name,attr,omitempty"` }
type PaymentMeansCodeType ¶
type PaymentMeansCodeType string
https://unece.org/fileadmin/DAM/trade/untdid/d16b/tred/tred4461.htm
const ( PaymentMeansInstrumentNotDefined PaymentMeansCodeType = "1" PaymentMeansAutomatedClearingHouseCredit PaymentMeansCodeType = "2" PaymentMeansAutomatedClearingHouseDebit PaymentMeansCodeType = "3" PaymentMeansACHDemandDebitReversal PaymentMeansCodeType = "4" PaymentMeansACHDemandCreditReversal PaymentMeansCodeType = "5" PaymentMeansACHDemandCredit PaymentMeansCodeType = "6" PaymentMeansACHDemandDebit PaymentMeansCodeType = "7" PaymentMeansHold PaymentMeansCodeType = "8" PaymentMeansNationalRegionalClearing PaymentMeansCodeType = "9" PaymentMeansInCash PaymentMeansCodeType = "10" PaymentMeansACHSavingsCreditReversal PaymentMeansCodeType = "11" PaymentMeansACHSavingsDebitReversal PaymentMeansCodeType = "12" PaymentMeansACHSavingsCredit PaymentMeansCodeType = "13" PaymentMeansACHSavingsDebit PaymentMeansCodeType = "14" PaymentMeansBookentryCredit PaymentMeansCodeType = "15" PaymentMeansBookentryDebit PaymentMeansCodeType = "16" PaymentMeansACHDemandCashCCDCredit PaymentMeansCodeType = "17" PaymentMeansACHDemandCashCCDDebit PaymentMeansCodeType = "18" PaymentMeansACHDemandCTPCredit PaymentMeansCodeType = "19" PaymentMeansCheque PaymentMeansCodeType = "20" PaymentMeansBankersDraft PaymentMeansCodeType = "21" PaymentMeansCertifiedBankersDraft PaymentMeansCodeType = "22" PaymentMeansBankCheque PaymentMeansCodeType = "23" PaymentMeansExchangeAwaitingAcceptanceBill PaymentMeansCodeType = "24" PaymentMeansCertifiedCheque PaymentMeansCodeType = "25" PaymentMeansLocalCheque PaymentMeansCodeType = "26" PaymentMeansACHDemandCTPDebit PaymentMeansCodeType = "27" PaymentMeansACHDemandCTXCredit PaymentMeansCodeType = "28" PaymentMeansACHDemandCTXDebit PaymentMeansCodeType = "29" PaymentMeansCreditTransfer PaymentMeansCodeType = "30" PaymentMeansDebitTransfer PaymentMeansCodeType = "31" PaymentMeansACHDemandCCDPlusCredit PaymentMeansCodeType = "32" PaymentMeansACHDemandCCDPlusDebit PaymentMeansCodeType = "33" PaymentMeansACHPPD PaymentMeansCodeType = "34" PaymentMeansACHSavingsCCDCredit PaymentMeansCodeType = "35" PaymentMeansACHSavingsCCDDebit PaymentMeansCodeType = "36" PaymentMeansACHSavingsCTPCredit PaymentMeansCodeType = "37" PaymentMeansACHSavingsCTPDebit PaymentMeansCodeType = "38" PaymentMeansACHSavingsCTXCredit PaymentMeansCodeType = "39" PaymentMeansACHSavingsCTXDebit PaymentMeansCodeType = "40" PaymentMeansACHSavingsCCDPlus PaymentMeansCodeType = "41" PaymentMeansPaymentToBankAccount PaymentMeansCodeType = "42" PaymentMeansACHSavingsCashCCDPlus PaymentMeansCodeType = "43" PaymentMeansAcceptedExchangeBill PaymentMeansCodeType = "44" PaymentMeansReferencedHomeBankingCreditTransfer PaymentMeansCodeType = "45" PaymentMeansInterbankDebitTransfer PaymentMeansCodeType = "46" PaymentMeansHomeBankingDebitTransfer PaymentMeansCodeType = "47" PaymentMeansBankCard PaymentMeansCodeType = "48" PaymentMeansDirectDebit PaymentMeansCodeType = "49" PaymentMeansPostgiro PaymentMeansCodeType = "50" PaymentMeansCFONBOptionA PaymentMeansCodeType = "51" PaymentMeansUrgentCommercialPayment PaymentMeansCodeType = "52" PaymentMeansUrgentTreasuryPayment PaymentMeansCodeType = "53" PaymentMeansCreditCard PaymentMeansCodeType = "54" PaymentMeansDebitCard PaymentMeansCodeType = "55" PaymentMeansBankgiro PaymentMeansCodeType = "56" PaymentMeansStandingAgreement PaymentMeansCodeType = "57" PaymentMeansSEPACreditTransfer PaymentMeansCodeType = "58" PaymentMeansSEPADirectDebit PaymentMeansCodeType = "59" PaymentMeansPromissoryNote PaymentMeansCodeType = "60" PaymentMeansPromissoryNoteSignedByDebtor PaymentMeansCodeType = "61" PaymentMeansPromissoryNoteSignedByDebtorEndorsedByBank PaymentMeansCodeType = "62" PaymentMeansPromissoryNoteSignedByDebtorEndorsedByThirdParty PaymentMeansCodeType = "63" PaymentMeansPromissoryNoteSignedByBank PaymentMeansCodeType = "64" PaymentMeansPromissoryNoteSignedByBankEndorsedByAnotherBank PaymentMeansCodeType = "65" PaymentMeansPromissoryNoteSignedByThirdParty PaymentMeansCodeType = "66" PaymentMeansPromissoryNoteSignedByThirdPartyEndorsedByBank PaymentMeansCodeType = "67" PaymentMeansOnlinePaymentService PaymentMeansCodeType = "68" PaymentMeansBillDrawnByCreditorOnDebtor PaymentMeansCodeType = "70" PaymentMeansBillDrawnByCreditorOnBank PaymentMeansCodeType = "74" PaymentMeansBillDrawnByCreditorEndorsedByAnotherBank PaymentMeansCodeType = "75" PaymentMeansBillDrawnByCreditorOnBankEndorsedByThirdParty PaymentMeansCodeType = "76" PaymentMeansBillDrawnByCreditorOnThirdParty PaymentMeansCodeType = "77" PaymentMeansBillDrawnByCreditorOnThirdPartyEndorsedByBank PaymentMeansCodeType = "78" PaymentMeansNotTransferableBankersDraft PaymentMeansCodeType = "91" PaymentMeansNotTransferableLocalCheque PaymentMeansCodeType = "92" PaymentMeansReferenceGiro PaymentMeansCodeType = "93" PaymentMeansUrgentGiro PaymentMeansCodeType = "94" PaymentMeansFreeFormatGiro PaymentMeansCodeType = "95" PaymentMeansRequestedPaymentMethodNotUsed PaymentMeansCodeType = "96" PaymentMeansClearingBetweenPartners PaymentMeansCodeType = "97" PaymentMeansMutuallyDefined PaymentMeansCodeType = "ZZZ" )
type PostalAddress ¶
type PostalAddress struct { // Adresă - Linia 1 Line1 string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 StreetName,omitempty"` // Adresă - Linia 2 Line2 string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 AdditionalStreetName,omitempty"` // Adresă - Linia 3 // Description: O linie suplimentară într-o adresă care poate fi utilizată // pentru informaţii suplimentare şi completări la linia principală. Line3 string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 AddressLine,omitempty"` // Numele uzual al municipiului, oraşului sau satului, în care se află adresa. CityName string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CityName,omitempty"` // Codul poştal PostalZone string `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 PostalZone,omitempty"` // Subdiviziunea ţării CountrySubentity CountrySubentityType `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CountrySubentity,omitempty"` // Codul țării Country Country `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Country"` }
PostalAddress represents a generic postal address
type RaspMessage ¶
type RequestOption ¶
RequestOption represents an option that can modify an http.Request.
type TaxCategoryCodeType ¶
type TaxCategoryCodeType string
Code specifying a duty or tax or fee category. https://unece.org/fileadmin/DAM/trade/untdid/d16b/tred/tred5305.htm
const ( // Standard rate. Code specifying the standard rate. TaxCategoryVATStandardRate TaxCategoryCodeType = "S" // Zero rated goods. Code specifying that the goods are at a zero rate. TaxCategoryVATZeroRate TaxCategoryCodeType = "Z" // Exempt from tax. Code specifying that taxes are not applicable. TaxCategoryVATExempt TaxCategoryCodeType = "E" // VAT Reverse Charge. Code specifying that the standard VAT rate is levied // from the invoicee. TaxCategoryVATReverseCharge TaxCategoryCodeType = "AE" // VAT exempt for EEA intra-community supply of goods and services. // A tax category code indicating the item is VAT exempt due to an // intra-community supply in the European Economic Area. TaxCategoryVATExemptIntraCommunitySupply TaxCategoryCodeType = "K" // Free export item, tax not charged. Code specifying that the item is free // export and taxes are not charged. TaxCategoryVATNotChargedFreeExportItem TaxCategoryCodeType = "G" // Services outside scope of tax. Code specifying that taxes are not // applicable to the services. TaxCategoryNotSubjectToVAT TaxCategoryCodeType = "O" // Canary Islands general indirect tax. Impuesto General Indirecto Canario // (IGIC) is an indirect tax levied on goods and services supplied in the // Canary Islands (Spain) by traders and professionals, as well as on // import of goods. TaxCategoryCanaryIslandsIGIC TaxCategoryCodeType = "L" // Tax for production, services and importation in Ceuta and Melilla. // Impuesto sobre la Producción, los Servicios y la Importación (IPSI) is // an indirect municipal tax, levied on the production, processing and // import of all kinds of movable tangible property, the supply of services // and the transfer of immovable property located in the cities of Ceuta // and Melilla. TaxCategoryCeutaMelillaIPSI TaxCategoryCodeType = "M" )
func (TaxCategoryCodeType) ExemptionReasonRequired ¶
func (c TaxCategoryCodeType) ExemptionReasonRequired() bool
ExemptionReasonRequired returns true if the receiver category code requires an exemption reason.
func (TaxCategoryCodeType) TaxRateExempted ¶
func (c TaxCategoryCodeType) TaxRateExempted() bool
TaxRateExempted returns true if the VAT rate must be 0 for the receiver category code.
type TaxExemptionReasonCodeType ¶
type TaxExemptionReasonCodeType string
type TaxScheme ¶
type TaxScheme struct {
ID TaxSchemeIDType `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty"`
}
type UploadOption ¶
type UploadOption func(*uploadOptions)
func UploadOptionForeign ¶
func UploadOptionForeign() UploadOption
UploadOptionForeign is an upload option specifiying that the buyer is not a Romanian entity (no CUI or NIF).
func UploadOptionSelfBilled ¶
func UploadOptionSelfBilled() UploadOption
UploadOptionSelfBilled is an upload option specifying that it's a self-billed invoice (the buyer is issuing the invoice on behalf of the supplier.
type UploadResponse ¶
type UploadResponse struct { ResponseDate string `xml:"dateResponse,attr,omitempty"` ExecutionStatus *int `xml:"ExecutionStatus,attr,omitempty"` UploadIndex *int64 `xml:"index_incarcare,attr,omitempty"` Errors []struct { ErrorMessage string `xml:"errorMessage,attr"` } `xml:"Errors,omitempty"` // Hardcode the namespace here so we don't need a customer marshaling // method. XMLName xml.Name `xml:"mfp:anaf:dgti:spv:respUploadFisier:v1 header"` }
UploadResponse is the parsed response from the upload endpoint
func (*UploadResponse) GetFirstErrorMessage ¶
func (r *UploadResponse) GetFirstErrorMessage() string
GetFirstErrorMessage returns the first error message. If no error messages are set for the upload response, empty string is returned.
func (*UploadResponse) GetUploadIndex ¶
func (r *UploadResponse) GetUploadIndex() int64
GetUploadIndex returns the upload index (should only be called when IsOk() == true).
func (*UploadResponse) IsOk ¶
func (r *UploadResponse) IsOk() bool
IsOk returns true if the response corresponding to an upload was successful.
type UploadStandard ¶
type UploadStandard string
func (UploadStandard) String ¶
func (s UploadStandard) String() string
type ValidateResponse ¶
type ValidateResponse struct { State Code `json:"stare"` TraceID string `json:"trace_id"` Messages []struct { Message string `json:"message"` } `json:"Messages,omitempty"` }
ValidateResponse is the parsed response from the validate XML endpoint
func (*ValidateResponse) GetFirstMessage ¶
func (r *ValidateResponse) GetFirstMessage() string
GetFirstMessage returns the first message from the validate response. If no messages are set, empty string is returned.
func (*ValidateResponse) IsOk ¶
func (r *ValidateResponse) IsOk() bool
IsOk returns true if the validate response was successful.
type ValidateSignatureError ¶
type ValidateSignatureError struct {
// contains filtered or unexported fields
}
ValidateSignatureError is an error returned if the signature cannot be succesfully validated.
type ValidateStandard ¶
type ValidateStandard string
func (ValidateStandard) String ¶
func (s ValidateStandard) String() string
type ValueWithAttrs ¶
type ValueWithAttrs struct { Value string `xml:",chardata"` Attributes []xml.Attr `xml:",any,attr,omitempty"` }
ValueWithAttrs represents and embeddable type that stores a string as chardata and a list of attributes. The name of the XML node must be controlled by the parent type.
func MakeValueWithAttrs ¶
func MakeValueWithAttrs(value string, attrs ...xml.Attr) ValueWithAttrs
MakeValueWithAttrs create a ValueWithAttrs using the provided chardata value and attributes.
func MakeValueWithScheme ¶
func MakeValueWithScheme(value string, schemeID string) ValueWithAttrs
MakeValueWithScheme creates ValueWithAttrs with the provided chardata value and an attribute named `schemeID` with the given scheme ID.
func NewValueWithAttrs ¶
func NewValueWithAttrs(value string, attrs ...xml.Attr) *ValueWithAttrs
NewValueWithAttrs same as MakeValueWithAttrs but a pointer is returned.
func (*ValueWithAttrs) GetAttrByName ¶
func (v *ValueWithAttrs) GetAttrByName(name string) (attr xml.Attr)
GetAttrByName returns the attribute by local name. If no attribute with the given name exists, an empty xml.Attr is returned.
func (ValueWithAttrs) Ptr ¶
func (v ValueWithAttrs) Ptr() *ValueWithAttrs
Ptr is a helper method to return a *ValueWithAttrs from the receiver in contexts where a pointer is needed.