abo

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	Payer struct {
		AccountNumPrefix int
		AccountNum       int
	}
	DueDate time.Time

	Items []*Item
}

Group groups payment order items to be made from a single fund source

func (*Group) AddItem

func (gr *Group) AddItem(recpAccPrefix, recpAccNum, recpBankCode int, amount float64, vs, ks, ss int, msgForRecp string) *Item

AddItem adds a payment order to the group

func (*Group) AddItemSimple

func (gr *Group) AddItemSimple(recpAccPrefix, recpAccNum, recpBankCode int, amount float64, vs int, msgForRecp string) *Item

AddItemSimple is shorter version of AddItem. Adds a payment order to the group

func (*Group) Write

func (gr *Group) Write(inWr io.Writer) error

Write writes the order group to a writer

type Item

type Item struct {
	Recipient struct {
		AccountNumPrefix int
		AccountNum       int
		BankCode         int
	}
	Amount              float64
	VS                  int
	KS                  int
	SS                  int
	MessageForRecipient string
}

Item is a payment order item

func (*Item) Write

func (it *Item) Write(inWr io.Writer) error

Write writes an item to a writer

type Order

type Order struct {
	CreationDate time.Time
	Client       struct {
		Name          string
		AccountNumber int
		BankCode      int
	}
	Groups []*Group
}

Order is an order in ABO/KPC format

func (*Order) AddGroup

func (or *Order) AddGroup(payerAccountPrefix, payerAccountNum int, dueDate time.Time) *Group

AddGroup adds a payment group. It is a group of payment orders sent from a single source of funds.

func (*Order) Write

func (or *Order) Write(inWr io.Writer) error

Write writes the order to a writer

func (*Order) WriteToFile

func (or *Order) WriteToFile(path string) error

WriteToFile writes the order to a .kpc file

type Statement

type Statement struct {
	Info struct {
		AccountNumber   int
		AccountName     string
		StartDate       time.Time
		EndDate         time.Time
		OpeningBalance  float64
		ClosingBalance  float64
		IncomeSum       float64
		ExpenseSum      float64
		StatementNumber int
	}

	Transactions []*Transaction
}

Statement with transactions in ABO/GPC format

func FromReader

func FromReader(rdr io.Reader) (*Statement, error)

FromReader parses ABO statement from io.Reader

func (*Statement) Read

func (s *Statement) Read(inRdr io.Reader) error

Read reads ABO/GPC statement from a reader

func (*Statement) String

func (s *Statement) String() string

String formats the statement as a human-readable summary string

type Transaction

type Transaction struct {
	OwnerAccountNumber int
	Recipient          struct {
		Name             string
		AccountNumPrefix int
		AccountNum       int
		BankCode         int
	}
	ID       int
	Amount   float64
	Currency currency.Currency
	Type     int // 1-debet, 2-credit, 4-storno-debet, 5-storno-credit
	VS       int
	KS       int
	SS       int
	DueDate  time.Time
}

Transaction single transaction

func (*Transaction) Read

func (txn *Transaction) Read(inRdr io.Reader) error

Parse parses a single transaction from the input stream

func (*Transaction) String

func (txn *Transaction) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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