report

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package report implements all ledger-cli style reports against an in-memory model.Project. Local-mode `bw ledger <report>` calls these directly; cloud mode delegates to gl-svc, which produces the same outputs server-side.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accounts

func Accounts(w io.Writer, p *model.Project, f Filter) error

Accounts prints declared + observed accounts.

func Balance

func Balance(w io.Writer, p *model.Project, f Filter) error

Balance prints account balances tree-style. Native commodities are summed per-commodity; if a posting has @ pricing, it also contributes to the base currency total via the unit-price.

func CSVPrint

func CSVPrint(w io.Writer, p *model.Project, f Filter) error

CSVPrint emits the postings as CSV (date,payee,account,amount,commodity).

func Cleared

func Cleared(w io.Writer, p *model.Project) error

Cleared prints only cleared entries.

func Commodities

func Commodities(w io.Writer, p *model.Project) error

Commodities prints distinct commodities. Declared commodities (with their note / format / flags) are listed first, then any observed-but-undeclared symbols. The output is one symbol per line for declared rows that have no metadata; declared rows with metadata get an inline `; ...` annotation.

func Equity

func Equity(w io.Writer, p *model.Project, f Filter) error

Equity prints an equity-style snapshot — a single synthetic entry that would zero out every account if posted.

func Payees

func Payees(w io.Writer, p *model.Project) error

Payees prints distinct payees.

func Prices

func Prices(w io.Writer, p *model.Project) error

Prices prints all P-directives. Timestamped prices render with their timezone offset; date-only prices render with date precision.

func Print

func Print(w io.Writer, p *model.Project, f Filter) error

Print emits the project in canonical ledger format (filtered).

func Register

func Register(w io.Writer, p *model.Project, f Filter) error

Register prints postings chronologically with a running balance per commodity for the matched account.

func Stats

func Stats(w io.Writer, p *model.Project) error

Stats prints summary counts.

Types

type Filter

type Filter struct {
	From         time.Time
	To           time.Time
	AccountMatch string // substring match on account names
	ClearedOnly  bool
}

Filter narrows reports to a date range, account prefix, and/or cleared status. Zero-value fields mean "no filter".

Jump to

Keyboard shortcuts

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