Documentation ¶
Index ¶
- type AccountTypeEnum
- type Amount
- type Code
- type Code10
- type Code20
- type Code30
- type CountryCode
- type Credit
- type CreditRefType
- type Credits
- type CurrencyType
- type Date
- type Decimal
- type DeliveryOptionType
- type Invoice
- type InvoiceAccount
- type InvoiceActionType
- type Invoices
- type Ledger
- type Line
- type Lines
- type NonEmptyCode20
- type Percentage
- type PositiveAmount
- type RequiredDate
- type SaveAttribType
- type Text10
- type Text150
- type Text20
- type Text30
- type Text50
- type Text80
- type UnitAmount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountTypeEnum ¶
type AccountTypeEnum int
Type of invoice account 1 – Unique Account 2 – Shared Account
type Amount ¶
type Amount float64
Amount with (maximum) 2 digits Ex. 100.48 0.1 48
func (Amount) MarshalXML ¶
type Code10 ¶
type Code10 string
String with upper characters. Valid characters: A-Z, 0-9, ÅÄÖ, -_ Max Length 10 characters
type Code20 ¶
type Code20 string
String with upper characters. Valid characters: A-Z, 0-9, ÅÄÖ, -_ Max Length 20 characters
type Code30 ¶
type Code30 string
String with upper characters. Valid characters: A-Z, 0-9, ÅÄÖ, -_ Max Length 30 characters
type CountryCode ¶
type CountryCode string
ISO 3166 Formatted Country Code (http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm)
type Credit ¶
type Credit struct { // Client Number in Asitis Finance, ask your contact at the Finance company. // 0050, C001 ClientNo NonEmptyCode20 `xml:"ClientNo,omitempty"` // Customers Legal No. // 1234561234 CustLegalNo Code20 `xml:"CustLegalNo"` // Customers No. // C00002 CustNo NonEmptyCode20 `xml:"CustNo,omitempty"` // Customers Name // Albert Nobel Name Text50 `xml:"Name,omitempty"` // Customers postal Adress. // Dynamic road 2 Adress Text30 `xml:"Adress"` // Customers postal Adress, second line. Adress2 Text30 `xml:"Adress2,omitempty"` // Customers Postal code. // 54130 PostCode Text20 `xml:"PostCode"` // Customers postal city. // Skövde City Text30 `xml:"City"` // Credit Note No. // F002110 CreditNo NonEmptyCode20 `xml:"CreditNo,omitempty"` // Credit Note Date // 2010-02-14 CreditDate RequiredDate `xml:"CreditDate"` // Due Date for the Credit // 2010-03-14 CreditDueDate RequiredDate `xml:"CreditDueDate"` // Ref type // 0 CreditRefType CreditRefType `xml:"CreditRefType"` // Ref Identifier // 12354 CreditRefNo Code30 `xml:"CreditRefNo"` // Total Sum of Invoice. Always positive. // 34521 Amount PositiveAmount `xml:"Amount,omitempty"` // Total VAT Amount. Always positive. // 8630.25 VATAmount PositiveAmount `xml:"VATAmount"` // Currency of Invoice // SEK Currency CurrencyType `xml:"Currency,omitempty"` // "Our Reference" on the document // Salesperson Xy OurRef Text30 `xml:"OurRef,omitempty"` // description: // "Your Reference" on the document // John Doe YourRef Text30 `xml:"YourRef,omitempty"` // description: // The Customers Email // john@some.where Email Text80 `xml:"Email,omitempty"` // description: // See Lines Lines Lines `xml:"Line,omitempty"` }
type CreditRefType ¶
type CreditRefType int
Reference type of CreditNote. Valid is 0-3. 0 – Non connected credit 1 - References a previous InvoiceNo 2 - References a previous OrderNo 3 - References a previous PackageNo
const ( CreditRefTypeNotConnected CreditRefType = 0 CreditRefTypeInvoiceNo CreditRefType = 1 CreditRefTypeOrderNo CreditRefType = 2 CreditRefTypePackageNo CreditRefType = 3 )
type CurrencyType ¶
Currency Used in Invoice/CreditNote. Valid format is 3 uppercase characters. Should follow ISO 4217 (http://wikipedia.org/wiki/ISO_4217)
func (CurrencyType) MarshalJSON ¶
func (c CurrencyType) MarshalJSON() ([]byte, error)
func (CurrencyType) MarshalXML ¶
func (c CurrencyType) MarshalXML(e *xml.Encoder, start xml.StartElement) error
func (*CurrencyType) UnmarshalJSON ¶
func (c *CurrencyType) UnmarshalJSON(data []byte) error
func (*CurrencyType) UnmarshalXML ¶
func (c *CurrencyType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type DeliveryOptionType ¶
type DeliveryOptionType int
How a document should be sent 0 – no preference / use system setting 1 – Email preferred (if available) 2 – Mail Prioritaire (“A-Post” in Swedish) 3 – Mail (normal) (“B-Post” in Swedish) 4 – E-Invoice 5 – Autogiro
type Invoice ¶
type Invoice struct { // Client Number in Asitis Finance, ask your contact at the Finance company. ClientNo NonEmptyCode20 `xml:"ClientNo,omitempty"` // Customers Legal No. // 1234561234 CustLegalNo Code20 `xml:"CustLegalNo"` // Customers No. // C00002 CustNo NonEmptyCode20 `xml:"CustNo,omitempty"` // Customers Name // Albert Nobel Name Text50 `xml:"Name,omitempty"` // Customers postal Adress. // Dynamic road 2 Adress Text30 `xml:"Adress"` // Customers postal Adress, second line. Adress2 Text30 `xml:"Adress2,omitempty"` // Customers Postal code. // 54130 PostCode Text20 `xml:"PostCode"` // Customers postal city. // Skövde City Text30 `xml:"City"` // Invoice No. // F002110 InvoiceNo NonEmptyCode20 `xml:"InvoiceNo,omitempty"` // Invoice Date // 2010-02-14 InvoiceDate RequiredDate `xml:"InvoiceDate"` // Due Date for the Invoice // 2010-03-14 InvoiceDueDate RequiredDate `xml:"InvoiceDueDate"` // description: Due Date for the Invoice // Total Sum of Invoice. Always positive. // 34521 Amount PositiveAmount `xml:"Amount,omitempty"` // description: // Total VAT Amount. Always positive. // 8630.25 VATAmount PositiveAmount `xml:"VATAmount"` // description: // Currency of Invoice // SEK Currency CurrencyType `xml:"Currency,omitempty"` // description: // Payment reference number or code. // 0021108 PaymentRefNo Code30 `xml:"PaymentRefNo,omitempty"` // description: // "Our Reference" on the document // Salesperson Xy OurRef Text30 `xml:"OurRef,omitempty"` // description: // "Your Reference" on the document // John Doe YourRef Text30 `xml:"YourRef,omitempty"` // description: // The Customers Email // john@some.where Email Text80 `xml:"Email,omitempty"` // description: // See Lines Lines Lines `xml:"Line,omitempty"` // description: }
type InvoiceAccount ¶
type InvoiceAccount struct { Type int `xml:"type,attr"` InterestStartDate Date `xml:"InterestStartDate,omitempty"` PaymentStartDate Date `xml:"PaymentStartDate,omitempty"` }
func (InvoiceAccount) MarshalXML ¶
func (i InvoiceAccount) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type Ledger ¶
type Ledger struct { XMLName xml.Name `xml:"Ledger,omitempty"` ProductionDate RequiredDate `xml:"productionDate,attr"` Invoices Invoices `xml:"Invoice,omitempty"` Credits Credits `xml:"Credit,omitempty"` }
type Line ¶
type Line struct { // Item No, Article No. // 001220 ItemNo Text20 `xml:"ItemNo"` // Description of Item. // Black Pencil Description Text80 `xml:"Description,omitempty"` // Description of Item, Second line. // With red line. Description2 Text80 `xml:"Description2,omitempty"` // Measurement Unit // M, kg, Hour UnitOfMeasure Text10 `xml:"UnitOfMeasure,omitempty"` // Quantity // 10 Quantity Decimal `xml:"Quantity,omitempty"` // The price for one item. Excluding VAT. // 2.9805 UnitPrice UnitAmount `xml:"UnitPrice,omitempty"` // VAT Percent for item // 25 VATPct Percentage `xml:"VATPct,omitempty"` // VAT Amount for all Items. 7.45 Quantity * UnitPrice * (VATPct/100) // 7.45 VATAmount Amount `xml:"VATAmount"` // Discount in percent. // 0 DiscountPct Percentage `xml:"DiscountPct,omitempty"` // Line Amount, Quantity * UnitPrice // 29.8 LineAmountExclVAT Amount `xml:"LineAmountExclVAT,omitempty"` // LineAmountExclVAT + VATAmount // 37.25 LineAmountInclVAT Amount `xml:"LineAmountInclVAT,omitempty"` }
If the ‘DiscountPct’ is used, then it should be together with ‘UnitPrice’ in all formulas. (i.e. a positive ‘DiscountPct’ reduces the value of the ‘UnitPrice’ that is used in the calculation. It does not reduce the actual ‘UnitPrice’-value) Any numeric field can be negative, as long as the formulas are still valid. The sum of all ‘LineAmountInclVAT’ must always be positive.
type PositiveAmount ¶
type PositiveAmount float64
Positive Decimal
func (PositiveAmount) MarshalXML ¶
func (a PositiveAmount) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type RequiredDate ¶
Date in format YYYY-MM-DD. After 1800-01-01. Ex. 2010-02-24
func (RequiredDate) MarshalXML ¶
func (d RequiredDate) MarshalXML(e *xml.Encoder, start xml.StartElement) error
func (RequiredDate) MarshalXMLAttr ¶
type SaveAttribType ¶
type SaveAttribType int
Save the ‘DeliveryOptionType’ to the system or not 0 – Don’t save (default) 1 – Save as preferred value for future documents
type UnitAmount ¶
type UnitAmount float64
Amount with (maximum) 5 digits Ex. 100.4805 0.1 48
func (UnitAmount) MarshalXML ¶
func (a UnitAmount) MarshalXML(e *xml.Encoder, start xml.StartElement) error