fivaldi

package module
v0.0.0-...-3c9efa7 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount float64

func (Amount) Abs

func (a Amount) Abs() Amount

func (Amount) MarshalFixedWidth

func (a Amount) MarshalFixedWidth(spec fixedwidth.FieldSpec) ([]byte, error)

func (Amount) MarshalText

func (a Amount) MarshalText() ([]byte, error)

used for csv export

func (Amount) Sign

func (a Amount) Sign() Sign

func (Amount) String

func (a Amount) String() string

type Date

type Date struct {
	time.Time
}

func (Date) IsEmpty

func (d Date) IsEmpty() bool

func (Date) MarshalFixedWidth

func (d Date) MarshalFixedWidth(spec fixedwidth.FieldSpec) ([]byte, error)

func (Date) MarshalText

func (d Date) MarshalText() ([]byte, error)

used for csv export

func (Date) String

func (d Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(text []byte) (err error)

type Decimal

type Decimal float64

func (Decimal) MarshalFixedWidth

func (d Decimal) MarshalFixedWidth(spec fixedwidth.FieldSpec) ([]byte, error)

func (Decimal) String

func (d Decimal) String() string

type GeneralJournalCSVLine

type GeneralJournalCSVLine struct {
	RecordDate        Date   // record date of the voucher, YYYYMMDD
	AccountNumber     string // account number
	VoucherNumber     string // Voucher number. If no voucher number exists, the date change will change to the next voucher
	CostCenter1       string // cost center/follow up code 1
	CostCenter2       string // cost center/follow up code 2
	CostCenter3       string // cost center/follow up code 3
	CostCenter4       string // cost center/follow up code 4
	Amount            Amount // The amount in the currency of the company with its sign (only if “-“)
	AmountInCents     int    // Amount in cents with sign
	Description       string // booking entry description
	VATCode           string // tax rate code
	VATAccountNumber  string // tax account number
	VATAccountNumber2 string // tax account number 2 (counter entry)
	VATAmount         Amount // The amount of tax in the company's currency with its sign
	VATAmountInCents  int    // The amount of tax in cents with sign
	Status            string // Special handling of entry
	NetDate           Date   // net date YYYYMMDD
	CustomerID        string // Customer ID in Fivaldi customer register
	ExportTypeID      string // export type id
	InvoiceNumber     string // invoice number
	FivaldiCompanyID  Int    // Fivaldi business id
	VoucherType       string // voucher type
}

func (GeneralJournalCSVLine) Headers

func (l GeneralJournalCSVLine) Headers() []string

func (GeneralJournalCSVLine) ToMap

func (l GeneralJournalCSVLine) ToMap() map[string]string

func (GeneralJournalCSVLine) ToStrings

func (l GeneralJournalCSVLine) ToStrings() []string

type GeneralJournalCSVLines

type GeneralJournalCSVLines []GeneralJournalCSVLine

func GeneralJournalEntryToCSVLines

func GeneralJournalEntryToCSVLines(entry GeneralJournalEntry) (GeneralJournalCSVLines, error)

type GeneralJournalEntry

type GeneralJournalEntry struct {
	RecordDate       Date   // record date of the voucher, YYYYMMDD
	FivaldiCompanyID Int    // Fivaldi business id
	VoucherType      string // voucher type
	VoucherNumber    string // Voucher number. If no voucher number exists, the date change will change to the next voucher
	Lines            GeneralJournalEntryLines
}

type GeneralJournalEntryLine

type GeneralJournalEntryLine struct {
	AccountNumber     string // account number
	CostCenter1       string // cost center/follow up code 1
	CostCenter2       string // cost center/follow up code 2
	CostCenter3       string // cost center/follow up code 3
	CostCenter4       string // cost center/follow up code 4
	Amount            Amount // The amount in the currency of the company with its sign (only if “-“)
	AmountInCents     int    // Amount in cents with sign
	Description       string // booking entry description
	VATCode           string // tax rate code
	VATAccountNumber  string // tax account number
	VATAccountNumber2 string // tax account number 2 (counter entry)
	VATAmount         Amount // The amount of tax in the company's currency with its sign
	VATAmountInCents  int    // The amount of tax in cents with sign
	Status            string // Special handling of entry
	NetDate           Date   // net date YYYYMMDD
	CustomerID        string // Customer ID in Fivaldi customer register
	ExportTypeID      string // export type id
	InvoiceNumber     string // invoice number
}

type GeneralJournalEntryLines

type GeneralJournalEntryLines []GeneralJournalEntryLine

type Int

type Int int

func (Int) MarshalFixedWidth

func (i Int) MarshalFixedWidth(spec fixedwidth.FieldSpec) ([]byte, error)

func (Int) String

func (i Int) String() string

type Invoice

type Invoice struct {
	FivaldiCompanyID        int
	CustomerNumber          int
	InvoiceNumber           int
	RefundableInvoiceNumber int
	AccountingPeriod        Period
	InvoiceDate             ShortDate
	PaymentTerms            string
	CashDiscountDate        ShortDate
	CashDiscountPercentage  int
	InvoiceDueDate          ShortDate
	GrossAmount             Amount
	Currency                string
	FCGrossAmount           Amount
	FCExchangeRate          string
	AccountReceivableLedger string
	Reference               string
	Description             string
	CustomerName1           string
	CustomerName2           string
	Address1                string
	Address2                string
	PostalCode              string
	Country                 string
	InvoiceLines            InvoiceLines
}

func (Invoice) MarshalFixedWidth

func (i Invoice) MarshalFixedWidth(spec fixedwidth.FieldSpec) ([]byte, error)

type InvoiceLine

type InvoiceLine struct {
	SalesLedger string
	CostCenter1 string
	CostCenter2 string
	CostCenter3 string
	NetAmount   Amount
	FCNetAmount Amount
	VATCode     string
	CostCenter4 string
	VATAmount   Amount
	FCVATAmount Amount
	VATLedger   string
}

type InvoiceLines

type InvoiceLines []InvoiceLine

type Period

type Period struct {
	time.Time
}

func (Period) MarshalFixedWidth

func (p Period) MarshalFixedWidth(spec fixedwidth.FieldSpec) ([]byte, error)

func (Period) String

func (p Period) String() string

func (*Period) UnmarshalJSON

func (p *Period) UnmarshalJSON(text []byte) (err error)

type Reslas

type Reslas struct {
	// fixed:"{startPos},{endPos}"
	FivaldiCompanyID        Int       `fixed:"1,6"`
	Type                    Type      `fixed:"7,12"`  // always RESLAS
	CustomerNumber          Int       `fixed:"13,22"` // Customer number in Fivaldi
	InvoiceNumber           Int       `fixed:"23,30"`
	RefundableInvoiceNumber Int       `fixed:"31,38"`
	AccountingPeriod        Period    `fixed:"39,44"`
	InvoiceDate             ShortDate `fixed:"45,50"`
	PaymentTerms            string    `fixed:"51,54"`
	CashDiscountDate        ShortDate `fixed:"55,60"`
	CashDiscountPercentage  Int       `fixed:"61,62"`
	InvoiceDueDate          ShortDate `fixed:"63,68"`
	GrossAmount             Amount    `fixed:"69,86"`
	Sign                    Sign      `fixed:"87,87"`
	Currency                string    `fixed:"88,90"`
	FCGrossAmount           Amount    `fixed:"91,108"`
	FCSign                  Sign      `fixed:"109,109"`
	FCExchangeRate          string    `fixed:"110,125"`
	AccountReceivableLedger string    `fixed:"126,133"`
	Reference               string    `fixed:"134,153"`
	Description             string    `fixed:"154,253"`
	CustomerName1           string    `fixed:"254,293"`
	CustomerName2           string    `fixed:"294,333"`
	Address1                string    `fixed:"334,413"`
	Address2                string    `fixed:"414,493"`
	PostalCode              string    `fixed:"494,495"`
	Country                 string    `fixed:"496,497"` // iso3166
}

type Restap

type Restap struct {
	// fixed:"{startPos},{endPos}"
	FivaldiCompanyID Int    `fixed:"1,6"`
	Type             Type   `fixed:"7,12"`  // always RESTAP
	CustomerNumber   Int    `fixed:"13,22"` // Customer number in Fivaldi
	InvoiceNumber    Int    `fixed:"23,30"`
	SalesLedger      string `fixed:"31,38"`
	CostCenter1      string `fixed:"39,46"`
	CostCenter2      string `fixed:"47,54"`
	CostCenter3      string `fixed:"55,62"`
	NetAmount        Amount `fixed:"63,80"`
	Sign             Sign   `fixed:"81,81"`
	FCNetAmount      Amount `fixed:"82,99"`
	FCSign           Sign   `fixed:"100,100"`
	VATCode          string `fixed:"101,101"`
	CostCenter4      string `fixed:"102,109"`
	VATAmount        Amount `fixed:"110,127"`
	VATSign          Sign   `fixed:"128,128"`
	FCVATAmount      Amount `fixed:"129,146"`
	FCVATSign        Sign   `fixed:"147,147"`
	VATLedger        string `fixed:"148,156"`
}

type ShortDate

type ShortDate struct {
	time.Time
}

func (ShortDate) IsEmpty

func (d ShortDate) IsEmpty() bool

func (ShortDate) MarshalFixedWidth

func (d ShortDate) MarshalFixedWidth(spec fixedwidth.FieldSpec) ([]byte, error)

func (ShortDate) String

func (d ShortDate) String() string

func (*ShortDate) UnmarshalJSON

func (d *ShortDate) UnmarshalJSON(text []byte) (err error)

type Sign

type Sign byte

func (Sign) MarshalText

func (s Sign) MarshalText() ([]byte, error)

type Type

type Type string

func (Type) MarshalFixedWidth

func (t Type) MarshalFixedWidth(spec fixedwidth.FieldSpec) ([]byte, error)

Jump to

Keyboard shortcuts

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