amounts

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amounts

type Amounts map[CommodityAccount]decimal.Decimal

Amounts keeps track of amounts by account and commodity.

func (Amounts) Amount

Amount returns the amount for the given account and commodity.

func (Amounts) Book

func (am Amounts) Book(cr, dr *journal.Account, a decimal.Decimal, c *journal.Commodity)

Book books the given amount.

func (Amounts) Clone

func (am Amounts) Clone() Amounts

Clone clones these amounts.

func (Amounts) Minus

func (am Amounts) Minus(a Amounts) Amounts

Minus mutably subtracts.

type CommodityAccount

type CommodityAccount struct {
	Account   *journal.Account
	Commodity *journal.Commodity
}

CommodityAccount represents a position.

func (CommodityAccount) Less

Less establishes a partial ordering of commodity accounts.

Jump to

Keyboard shortcuts

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