Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accrual ¶ added in v0.0.7
type Accrual struct { Pos model.Range Period date.Period T0, T1 time.Time Account *accounts.Account Transaction *Transaction }
Accrual represents an accrual.
func (*Accrual) Expand ¶ added in v0.0.7
func (a *Accrual) Expand() ([]*Transaction, error)
Expand expands an accrual transaction.
type Assertion ¶ added in v0.0.7
type Assertion struct { Pos model.Range Date time.Time Account *accounts.Account Amount decimal.Decimal Commodity *commodities.Commodity }
Assertion represents a balance assertion.
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder maps dates to days
func (*Builder) AddAssertion ¶
AddAssertion adds an assertion directive.
func (*Builder) AddClosing ¶
AddClosing adds a close directive.
func (*Builder) AddOpening ¶
AddOpening adds an open directive.
func (*Builder) AddTransaction ¶
func (b *Builder) AddTransaction(t *Transaction)
AddTransaction adds a transaction directive.
type Day ¶ added in v0.0.7
type Day struct { Date time.Time Prices []*Price Assertions []*Assertion Values []*Value Openings []*Open Transactions []*Transaction Closings []*Close }
Day groups all commands for a given date.
type Ledger ¶
type Ledger []*Day
Ledger is a ledger.
func FromDirectives ¶ added in v0.0.8
FromDirectives reads directives from the given channel and builds a Ledger if successful.
type Posting ¶ added in v0.0.7
type Posting struct {
Amount, Value decimal.Decimal
Credit, Debit *accounts.Account
Commodity *commodities.Commodity
Lot *Lot
}
Posting represents a posting.
func NewPosting ¶ added in v0.0.7
func NewPosting(crAccount, drAccount *accounts.Account, commodity *commodities.Commodity, amt decimal.Decimal) *Posting
NewPosting creates a new posting from the given parameters. If amount is negative, it will be inverted and the accounts reversed.
type Price ¶ added in v0.0.7
type Price struct { Pos model.Range Date time.Time Commodity *commodities.Commodity Target *commodities.Commodity Price decimal.Decimal }
Price represents a price command.
type Transaction ¶ added in v0.0.7
type Transaction struct { Pos model.Range Date time.Time Description string Tags []Tag Postings []*Posting }
Transaction represents a transaction.
func (Transaction) Position ¶ added in v0.0.7
func (t Transaction) Position() model.Range
Position returns the Position.