Documentation ¶
Overview ¶
Package xrechnung - Library for processing electronic invoices - german xrechnung 2.0 **/
Index ¶
- Constants
- Variables
- func StructureToJson(xInvoice Invoice2) (jsonData string, err error)
- func StructureToXML(xInvoice Invoice2) (xmlData string, err error)
- type AccountingCost
- type AccountingCustomerParty
- type AccountingSupplierParty
- type ActualDeliveryDate
- type AdditionalDocumentReference
- type AdditionalStreetName
- type Address
- type AllowanceCharge
- type AllowanceChargeReason
- type Amount
- type Attachment
- type BaseAmount
- type BuildingNumber
- type BuyerReference
- type ChargeIndicator
- type CityName
- type ClassifiedTaxCategory
- type CommodityClassification
- type CompanyID
- type CompanyLegalForm
- type Contact
- type ContractDocumentReference
- type Country
- type CountrySubentity
- type CountrySubentityCode
- type CustomizationID
- type Delivery
- type DeliveryLocation
- type Department
- type Description
- type DocumentCurrencyCode
- type DocumentType
- type ElectronicMail
- type EmbeddedDocumentBinaryObject
- type EndDate
- type EndpointID
- type ExternalReference
- type FamilyName
- type FirstName
- type ID
- type IdentificationCode
- type Invoice2
- type InvoiceDataElement
- type InvoiceLine
- type InvoicePeriod
- type InvoiceTypeCode
- type InvoicedQuantity
- type IssueDate
- type Item
- type ItemClassificationCode
- type JobTitle
- type LegalMonetaryTotal
- type LineExtensionAmount
- type LineID
- type MiddleName
- type MultiplierFactorNumeric
- type Name
- type Note
- type OrderLineReference
- type OrderReference
- type Party
- type PartyIdentification
- type PartyLegalEntity
- type PartyName
- type PartyTaxScheme
- type PayableAmount
- type PayeeFinancialAccount
- type PayeeParty
- type PaymentMeans
- type PaymentMeansCode
- type PaymentTerms
- type Percent
- type Person
- type PostalAddress
- type PostalZone
- type Postbox
- type Price
- type PriceAmount
- type RegistrationName
- type SellersItemIdentification
- type StartDate
- type StreetName
- type TCode
- type TCurrencyElement
- type TaxAmount
- type TaxCategory
- type TaxCurrencyCode
- type TaxExclusiveAmount
- type TaxInclusiveAmount
- type TaxPointDate
- type TaxScheme
- type TaxSubtotal
- type TaxTotal
- type TaxableAmount
- type Telefax
- type Telephone
- type UBLVersionID
- type URI
Constants ¶
View Source
const (
//Tasks
CheckAndConvert = "CheckAndConvert"
)
Variables ¶
View Source
var CCurrency = [279]TCurrencyElement{}/* 279 elements not displayed */
CCurrency the currencies according to DIN ISO 4217 from https://www.iso.org/iso-4217-currency-codes.html
View Source
var CInvoiceCypeCode = [8]TCode{
{"326", "Partial invoice"},
{"380", "Commercial invoice"},
{"384", "Corrected invoice"},
{"389", "Self-billed invoice"},
{"381", "Credit note"},
{"875", "Partial construction invoice"},
{"876", "Partial final construction invoice"},
{"877", "Final construction invoice"},
}
CInvoiceCypeCode Catalogue of incoming invoice types
View Source
var CValueAddedTaxPointDateCode = [3]TCode{
{"3", "Invoice document issue date time"},
{"35", "Delivery date/time, actual"},
{"432", "Paid to date"},
}
Functions ¶
func StructureToJson ¶
StructureToJson returns the Json of the xcalculation from the structure
func StructureToXML ¶
StructureToXML returns the XML of the xcalculation from the structure
Types ¶
type AccountingCost ¶
type AccountingCustomerParty ¶
type AccountingSupplierParty ¶
type ActualDeliveryDate ¶
type AdditionalDocumentReference ¶
type AdditionalDocumentReference struct { XMLName xml.Name `xml:"AdditionalDocumentReference,omitempty" json:"AdditionalDocumentReference,omitempty"` Attachment Attachment `` /* 127-byte string literal not displayed */ DocumentType DocumentType `` /* 127-byte string literal not displayed */ ID ID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty" json:"ID,omitempty"` }
type AdditionalStreetName ¶
type Address ¶
type Address struct { XMLName xml.Name `xml:"Address,omitempty" json:"Address,omitempty"` AdditionalStreetName AdditionalStreetName `` /* 143-byte string literal not displayed */ BuildingNumber BuildingNumber `` /* 131-byte string literal not displayed */ CityName CityName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CityName,omitempty" json:"CityName,omitempty"` CountrySubentity CountrySubentity `` /* 135-byte string literal not displayed */ Country Country `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Country,omitempty" json:"Country,omitempty"` PostalZone PostalZone `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 PostalZone,omitempty" json:"PostalZone,omitempty"` StreetName StreetName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 StreetName,omitempty" json:"StreetName,omitempty"` }
type AllowanceCharge ¶
type AllowanceCharge struct { XMLName xml.Name `xml:"AllowanceCharge,omitempty" json:"AllowanceCharge,omitempty"` AllowanceChargeReason AllowanceChargeReason `` /* 145-byte string literal not displayed */ Amount Amount `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Amount,omitempty" json:"Amount,omitempty"` BaseAmount BaseAmount `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 BaseAmount,omitempty" json:"BaseAmount,omitempty"` ChargeIndicator ChargeIndicator `` /* 133-byte string literal not displayed */ MultiplierFactorNumeric MultiplierFactorNumeric `` /* 149-byte string literal not displayed */ }
type AllowanceChargeReason ¶
type Attachment ¶
type Attachment struct { XMLName xml.Name `xml:"Attachment,omitempty" json:"Attachment,omitempty"` EmbeddedDocumentBinaryObject EmbeddedDocumentBinaryObject `` /* 159-byte string literal not displayed */ ExternalReference ExternalReference `` /* 141-byte string literal not displayed */ }
type BaseAmount ¶
type BuildingNumber ¶
type BuyerReference ¶
type ChargeIndicator ¶
type ClassifiedTaxCategory ¶
type ClassifiedTaxCategory struct { XMLName xml.Name `xml:"ClassifiedTaxCategory,omitempty" json:"ClassifiedTaxCategory,omitempty"` ID ID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty" json:"ID,omitempty"` Percent Percent `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Percent,omitempty" json:"Percent,omitempty"` TaxScheme TaxScheme `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxScheme,omitempty" json:"TaxScheme,omitempty"` }
type CommodityClassification ¶
type CommodityClassification struct { XMLName xml.Name `xml:"CommodityClassification,omitempty" json:"CommodityClassification,omitempty"` ItemClassificationCode ItemClassificationCode `` /* 147-byte string literal not displayed */ }
type CompanyLegalForm ¶
type Contact ¶
type Contact struct { XMLName xml.Name `xml:"Contact,omitempty" json:"Contact,omitempty"` Name Name `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Name,omitempty" json:"Name,omitempty"` Telephone Telephone `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Telephone,omitempty" json:"Telephone,omitempty"` ElectronicMail ElectronicMail `` /* 131-byte string literal not displayed */ Telefax Telefax `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Telefax,omitempty" json:"Telefax,omitempty"` }
type ContractDocumentReference ¶
type ContractDocumentReference struct { XMLName xml.Name `xml:"ContractDocumentReference,omitempty" json:"ContractDocumentReference,omitempty"` DocumentType DocumentType `` /* 127-byte string literal not displayed */ ID ID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty" json:"ID,omitempty"` }
type Country ¶
type Country struct { XMLName xml.Name `xml:"Country,omitempty" json:"Country,omitempty"` IdentificationCode IdentificationCode `` /* 139-byte string literal not displayed */ }
type CountrySubentity ¶
type CountrySubentityCode ¶
type CustomizationID ¶
type Delivery ¶
type Delivery struct { XMLName xml.Name `xml:"Delivery,omitempty" json:"Delivery,omitempty"` ActualDeliveryDate ActualDeliveryDate `` /* 139-byte string literal not displayed */ DeliveryLocation DeliveryLocation `` /* 139-byte string literal not displayed */ }
type DeliveryLocation ¶
type DeliveryLocation struct { XMLName xml.Name `xml:"DeliveryLocation,omitempty" json:"DeliveryLocation,omitempty"` Address Address `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Address,omitempty" json:"Address,omitempty"` ID ID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty" json:"ID,omitempty"` }
type Department ¶
type Description ¶
type DocumentCurrencyCode ¶
type DocumentType ¶
type ElectronicMail ¶
type EndpointID ¶
type ExternalReference ¶
type FamilyName ¶
type IdentificationCode ¶
type Invoice2 ¶
type Invoice2 struct { XMLName xml.Name `xml:"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 Invoice,omitempty" json:"Invoice,omitempty"` CustomizationID CustomizationID `` /* 133-byte string literal not displayed */ ID ID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty" json:"ID,omitempty"` IssueDate IssueDate `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 IssueDate,omitempty" json:"IssueDate,omitempty"` InvoiceTypeCode InvoiceTypeCode `` /* 133-byte string literal not displayed */ Note Note `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Note,omitempty" json:"Note,omitempty"` DocumentCurrencyCode DocumentCurrencyCode `` /* 143-byte string literal not displayed */ BuyerReference BuyerReference `` /* 131-byte string literal not displayed */ AccountingSupplierParty AccountingSupplierParty `` /* 153-byte string literal not displayed */ AccountingCustomerParty AccountingCustomerParty `` /* 153-byte string literal not displayed */ PaymentMeans PaymentMeans `` /* 131-byte string literal not displayed */ PaymentTerms PaymentTerms `` /* 131-byte string literal not displayed */ TaxTotal TaxTotal `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxTotal,omitempty" json:"TaxTotal,omitempty"` LegalMonetaryTotal LegalMonetaryTotal `` /* 143-byte string literal not displayed */ InvoiceLine []InvoiceLine `` /* 129-byte string literal not displayed */ AccountingCost AccountingCost `` /* 131-byte string literal not displayed */ AdditionalDocumentReference []AdditionalDocumentReference `` /* 161-byte string literal not displayed */ AllowanceCharge []AllowanceCharge `` /* 137-byte string literal not displayed */ ContractDocumentReference ContractDocumentReference `` /* 157-byte string literal not displayed */ Delivery Delivery `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Delivery,omitempty" json:"Delivery,omitempty"` InvoicePeriod InvoicePeriod `` /* 133-byte string literal not displayed */ OrderReference OrderReference `` /* 135-byte string literal not displayed */ PayeeParty PayeeParty `` /* 127-byte string literal not displayed */ TaxCurrencyCode TaxCurrencyCode `` /* 133-byte string literal not displayed */ TaxPointDate TaxPointDate `` /* 127-byte string literal not displayed */ UBLVersionID UBLVersionID `` /* 127-byte string literal not displayed */ // contains filtered or unexported fields }
func JsonToStructure ¶
JsonToStructure returns the structure of the xcalculation from Json string
func XMLToStructure ¶
XMLToStructure returns the structure of the xcalculation from XML string
func (Invoice2) XMLConvertStructure ¶
func (me Invoice2) XMLConvertStructure() (HeadFields []InvoiceDataElement, err error)
XMLConvertStructure Converts the XML string data into structural data and checks fields
type InvoiceDataElement ¶
type InvoiceLine ¶
type InvoiceLine struct { XMLName xml.Name `xml:"InvoiceLine,omitempty" json:"InvoiceLine,omitempty"` ID ID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty" json:"ID,omitempty"` Note Note `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Note,omitempty" json:"Note,omitempty"` InvoicedQuantity InvoicedQuantity `` /* 135-byte string literal not displayed */ LineExtensionAmount LineExtensionAmount `` /* 141-byte string literal not displayed */ InvoicePeriod InvoicePeriod `` /* 133-byte string literal not displayed */ OrderLineReference OrderLineReference `` /* 143-byte string literal not displayed */ Item Item `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Item,omitempty" json:"Item,omitempty"` Price Price `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Price,omitempty" json:"Price,omitempty"` }
type InvoicePeriod ¶
type InvoicePeriod struct { XMLName xml.Name `xml:"InvoicePeriod,omitempty" json:"InvoicePeriod,omitempty"` StartDate StartDate `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 StartDate,omitempty" json:"StartDate,omitempty"` EndDate EndDate `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 EndDate,omitempty" json:"EndDate,omitempty"` }
type InvoiceTypeCode ¶
type InvoicedQuantity ¶
type Item ¶
type Item struct { XMLName xml.Name `xml:"Item,omitempty" json:"Item,omitempty"` Description Description `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Description,omitempty" json:"Description,omitempty"` Name Name `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Name,omitempty" json:"Name,omitempty"` SellersItemIdentification SellersItemIdentification `` /* 157-byte string literal not displayed */ CommodityClassification CommodityClassification `` /* 153-byte string literal not displayed */ ClassifiedTaxCategory ClassifiedTaxCategory `` /* 149-byte string literal not displayed */ }
type ItemClassificationCode ¶
type LegalMonetaryTotal ¶
type LegalMonetaryTotal struct { XMLName xml.Name `xml:"LegalMonetaryTotal,omitempty" json:"LegalMonetaryTotal,omitempty"` LineExtensionAmount LineExtensionAmount `` /* 141-byte string literal not displayed */ TaxExclusiveAmount TaxExclusiveAmount `` /* 139-byte string literal not displayed */ TaxInclusiveAmount TaxInclusiveAmount `` /* 139-byte string literal not displayed */ PayableAmount PayableAmount `` /* 129-byte string literal not displayed */ }
type LineExtensionAmount ¶
type MiddleName ¶
type MultiplierFactorNumeric ¶
type OrderLineReference ¶
type OrderReference ¶
type Party ¶
type Party struct { XMLName xml.Name `xml:"Party,omitempty" json:"Party,omitempty"` EndpointID EndpointID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 EndpointID,omitempty" json:"EndpointID,omitempty"` PartyName PartyName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyName,omitempty" json:"PartyName,omitempty"` PartyIdentification PartyIdentification `` /* 145-byte string literal not displayed */ PostalAddress PostalAddress `` /* 133-byte string literal not displayed */ Person Person `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Person,omitempty" json:"Person,omitempty"` PartyTaxScheme PartyTaxScheme `` /* 135-byte string literal not displayed */ PartyLegalEntity PartyLegalEntity `` /* 139-byte string literal not displayed */ Contact Contact `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Contact,omitempty" json:"Contact,omitempty"` }
type PartyIdentification ¶
type PartyLegalEntity ¶
type PartyLegalEntity struct { XMLName xml.Name `xml:"PartyLegalEntity,omitempty" json:"PartyLegalEntity,omitempty"` RegistrationName RegistrationName `` /* 135-byte string literal not displayed */ CompanyID CompanyID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CompanyID,omitempty" json:"CompanyID,omitempty"` CompanyLegalForm CompanyLegalForm `` /* 135-byte string literal not displayed */ }
type PartyTaxScheme ¶
type PartyTaxScheme struct { XMLName xml.Name `xml:"PartyTaxScheme,omitempty" json:"PartyTaxScheme,omitempty"` CompanyID CompanyID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CompanyID,omitempty" json:"CompanyID,omitempty"` TaxScheme TaxScheme `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxScheme,omitempty" json:"TaxScheme,omitempty"` }
type PayableAmount ¶
type PayeeFinancialAccount ¶
type PayeeParty ¶
type PayeeParty struct { XMLName xml.Name `xml:"PayeeParty,omitempty" json:"PayeeParty,omitempty"` PartyIdentification PartyIdentification `` /* 145-byte string literal not displayed */ PartyLegalEntity PartyLegalEntity `` /* 139-byte string literal not displayed */ PartyName PartyName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 PartyName,omitempty" json:"PartyName,omitempty"` }
type PaymentMeans ¶
type PaymentMeans struct { XMLName xml.Name `xml:"PaymentMeans,omitempty" json:"PaymentMeans,omitempty"` PaymentMeansCode PaymentMeansCode `` /* 135-byte string literal not displayed */ PayeeFinancialAccount PayeeFinancialAccount `` /* 149-byte string literal not displayed */ }
type PaymentMeansCode ¶
type PaymentTerms ¶
type Person ¶
type Person struct { XMLName xml.Name `xml:"Person,omitempty" json:"Person,omitempty"` FamilyName FamilyName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 FamilyName,omitempty" json:"FamilyName,omitempty"` FirstName FirstName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 FirstName,omitempty" json:"FirstName,omitempty"` JobTitle JobTitle `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 JobTitle,omitempty" json:"JobTitle,omitempty"` MiddleName MiddleName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 MiddleName,omitempty" json:"MiddleName,omitempty"` }
type PostalAddress ¶
type PostalAddress struct { XMLName xml.Name `xml:"PostalAddress,omitempty" json:"PostalAddress,omitempty"` StreetName StreetName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 StreetName,omitempty" json:"StreetName,omitempty"` CityName CityName `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 CityName,omitempty" json:"CityName,omitempty"` PostalZone PostalZone `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 PostalZone,omitempty" json:"PostalZone,omitempty"` Country Country `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 Country,omitempty" json:"Country,omitempty"` AdditionalStreetName AdditionalStreetName `` /* 143-byte string literal not displayed */ BuildingNumber BuildingNumber `` /* 131-byte string literal not displayed */ CountrySubentityCode CountrySubentityCode `` /* 143-byte string literal not displayed */ CountrySubentity CountrySubentity `` /* 135-byte string literal not displayed */ Department Department `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Department,omitempty" json:"Department,omitempty"` ID ID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty" json:"ID,omitempty"` Postbox Postbox `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Postbox,omitempty" json:"Postbox,omitempty"` }
type PostalZone ¶
type Price ¶
type Price struct { XMLName xml.Name `xml:"Price,omitempty" json:"Price,omitempty"` PriceAmount PriceAmount `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 PriceAmount,omitempty" json:"PriceAmount,omitempty"` }
type PriceAmount ¶
type RegistrationName ¶
type StreetName ¶
type TCurrencyElement ¶
type TaxCategory ¶
type TaxCategory struct { XMLName xml.Name `xml:"TaxCategory,omitempty" json:"TaxCategory,omitempty"` ID ID `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 ID,omitempty" json:"ID,omitempty"` Percent Percent `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 Percent,omitempty" json:"Percent,omitempty"` TaxScheme TaxScheme `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2 TaxScheme,omitempty" json:"TaxScheme,omitempty"` }
type TaxCurrencyCode ¶
type TaxExclusiveAmount ¶
type TaxInclusiveAmount ¶
type TaxPointDate ¶
type TaxSubtotal ¶
type TaxSubtotal struct { XMLName xml.Name `xml:"TaxSubtotal,omitempty" json:"TaxSubtotal,omitempty"` TaxableAmount TaxableAmount `` /* 129-byte string literal not displayed */ TaxAmount TaxAmount `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 TaxAmount,omitempty" json:"TaxAmount,omitempty"` TaxCategory TaxCategory `` /* 129-byte string literal not displayed */ }
type TaxTotal ¶
type TaxTotal struct { XMLName xml.Name `xml:"TaxTotal,omitempty" json:"TaxTotal,omitempty"` TaxAmount TaxAmount `xml:"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2 TaxAmount,omitempty" json:"TaxAmount,omitempty"` TaxSubtotal TaxSubtotal `` /* 129-byte string literal not displayed */ }
type TaxableAmount ¶
type UBLVersionID ¶
Click to show internal directories.
Click to hide internal directories.