asix

package
v0.0.0-...-df0347f Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2017 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Index

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

func (a Amount) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type Code

type Code string

String with upper characters. Valid characters: A-Z, 0-9, ÅÄÖ, -_

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 Credits

type Credits []Credit

type CurrencyType

type CurrencyType struct {
	currency.Unit
}

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 Date

type Date struct {
	date.Date
}

Same as RequiredDate, but blank values are allowed

func (Date) MarshalXML

func (d Date) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type Decimal

type Decimal float64

func (Decimal) MarshalXML

func (d Decimal) MarshalXML(e *xml.Encoder, 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 InvoiceActionType

type InvoiceActionType int

Not in use today.

type Invoices

type Invoices []Invoice

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"`
}

func NewLedger

func NewLedger() *Ledger

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 Lines

type Lines []Line

type NonEmptyCode20

type NonEmptyCode20 string

Same as Code20. Cannot be empty.

type Percentage

type Percentage float64

Decimal entry

type PositiveAmount

type PositiveAmount float64

Positive Decimal

func (PositiveAmount) MarshalXML

func (a PositiveAmount) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type RequiredDate

type RequiredDate struct {
	date.Date
}

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

func (d RequiredDate) MarshalXMLAttr(name xml.Name) (xml.Attr, error)

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 Text10

type Text10 string

Textstring with max length 10 characters.

type Text150

type Text150 string

Textstring with max length 150 characters.

type Text20

type Text20 string

Textstring with max length 20 characters.

type Text30

type Text30 string

Textstring with max length 30 characters.

type Text50

type Text50 string

Textstring with max length 50 characters.

type Text80

type Text80 string

Textstring with max length 80 characters.

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

Jump to

Keyboard shortcuts

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