balance

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balance

type Balance struct {
	Date                   time.Time
	Positions              map[CommodityAccount]amount.Amount
	Account                map[*accounts.Account]bool
	Prices                 prices.Prices
	Valuation              *commodities.Commodity
	NormalizedPrices       prices.NormalizedPrices
	CloseIncomeAndExpenses bool
}

Balance represents a balance for accounts at the given date.

func Diffs

func Diffs(bals []*Balance) []*Balance

Diffs creates the difference balances for the given slice of balances. The returned slice is one element smaller than the input slice. The balances are mutated.

func New

func New(valuation *commodities.Commodity) *Balance

New creates a new balance.

func (*Balance) Copy

func (b *Balance) Copy() *Balance

Copy deeply copies the balance

func (*Balance) Minus

func (b *Balance) Minus(bo *Balance)

Minus mutably subtracts the given balance from the receiver.

func (*Balance) Update

func (b *Balance) Update(day *ledger.Day) error

Update updates the balance with the given Day

type CommodityAccount added in v0.0.7

type CommodityAccount struct {
	Account   *accounts.Account
	Commodity *commodities.Commodity
}

CommodityAccount represents a position.

func (CommodityAccount) Less added in v0.0.7

Less establishes a partial ordering of commodity accounts.

type Error added in v0.0.6

type Error struct {
	// contains filtered or unexported fields
}

Error is an error.

func (Error) Error added in v0.0.6

func (be Error) Error() string

Jump to

Keyboard shortcuts

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