report

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render added in v0.0.7

func Render(config Config, r *Report) *table.Table

Render renders a report.

Types

type Collapse

type Collapse struct {
	Level int
	Regex *regexp.Regexp
}

Collapse is a rule for collapsing (shortening) accounts.

type Config added in v0.0.3

type Config struct {
	Commodities bool
}

Config configures a Renderer.

type Options

type Options struct {
	Value    bool
	Collapse []Collapse
}

Options contains configuration options to create a report.

type Position added in v0.0.7

type Position struct {
	balance.CommodityAccount
	Amounts amount.Vec
}

Position is a position.

type Report

type Report struct {
	Dates       []time.Time
	Options     Options
	Segments    map[accounts.AccountType]*Segment
	Commodities []*commodities.Commodity
	Positions   map[*commodities.Commodity]amount.Vec
}

Report is a balance report for a range of dates.

func NewReport

func NewReport(options Options, bal []*balance.Balance) (*Report, error)

NewReport creates a new report.

type Segment

type Segment struct {
	Key         string
	Positions   map[*commodities.Commodity]amount.Vec
	Subsegments []*Segment
}

Segment is a hierarchical segment of a report.

func NewSegment

func NewSegment(k string) *Segment

NewSegment creates a new segment.

Jump to

Keyboard shortcuts

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