sie

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 12 Imported by: 0

README

sie

This is a basic parser for the Swedish SIE financial interchange format.

Installation

go get kastelo.dev/sie

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResultXLSX added in v1.1.0

func ResultXLSX(doc *Document) ([]byte, error)

Types

type Account

type Account struct {
	ID          string
	Type        string
	Description string
	InBalance   Decimal
	OutBalance  Decimal
}

func (*Account) IDInt added in v1.1.0

func (a *Account) IDInt() int

type Annotation added in v1.1.0

type Annotation struct {
	Tag         int
	Text        string
	Description string
}

func (Annotation) Equals added in v1.1.0

func (a Annotation) Equals(other Annotation) bool

func (Annotation) String added in v1.1.0

func (a Annotation) String() string

type Decimal added in v1.1.0

type Decimal int64 // "cents"

func ParseDecimal added in v1.1.0

func ParseDecimal(s string) (Decimal, error)

func (Decimal) Float64 added in v1.1.0

func (d Decimal) Float64() float64

func (Decimal) FloatString added in v1.1.0

func (d Decimal) FloatString(decimals int) string

func (Decimal) MarshalJSON added in v1.1.0

func (d Decimal) MarshalJSON() ([]byte, error)

func (Decimal) String added in v1.1.0

func (d Decimal) String() string

type Document

type Document struct {
	Flag           int
	ProgramName    string
	ProgramVersion string
	Format         string
	GeneratedAt    time.Time
	GeneratedBy    string
	Type           string
	OrgNo          string
	CompanyName    string
	AccountPlan    string
	Accounts       []Account
	Entries        []Entry
	Starts         time.Time
	Ends           time.Time
	Annotations    []Annotation
}

func Parse

func Parse(r io.Reader) (*Document, error)

func (*Document) CopyForAnnotation added in v1.1.0

func (d *Document) CopyForAnnotation(ann Annotation) *Document

func (*Document) CopyWithoutAnnotations added in v1.1.0

func (d *Document) CopyWithoutAnnotations() *Document

type Entry

type Entry struct {
	ID           string
	Type         string
	Date         time.Time
	Description  string
	Transactions []Transaction
}

type Transaction

type Transaction struct {
	Account     string
	Annotations []Annotation
	Amount      Decimal
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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