Skip to main content

Module report

Module report 

Source

Modules§

activity
balance
category_breakdown

Structs§

ChartParams
Chart-specific query parameters shared across report chart handlers. chart_kind maps to plotting::ChartKind; chart_series is a report-specific toggle (e.g. Activity: show Net or not) parsed in each handler. renderer picks between server-side SVG (default) and client-side canvas.
CommodityOption
SummaryCard
A single card in the top-of-report summary strip. is_net flags cards that show a signed net (e.g. Income − Expense) so templates can style them distinctly; highlight is a generic accent slot.
TableControlParams
Query-string fields shared by every report page to drive client-side table controls. The server only needs to read commodity_columns (which drives a template pivot) and forward collapsed_depth into the template for initial fold state; sort_by is consumed purely by the frontend WASM reorder logic, so the Rust handler does not parse it.

Enums§

SharedSort

Functions§

breakdown_row_amount_by_symbol
Breakdown equivalent of row_amount_by_symbol. Category Breakdown uses a flat row type (BreakdownRowView) rather than the tree ReportRowView.
build_report_filter
commodity_symbols_in_rows
Collect the set of commodity symbols present across all rows, in the order the row-data first mentions them. Drives the “Commodities as columns” pivot: a stable column ordering without depending on the user’s commodity list.
empty_string_as_none
encode_query
Minimal URL-query encoder for the (key, value) pairs the chart endpoints take. Avoids pulling in serde_urlencoded just to stringify a handful of params — keeps the handler simple.
load_commodities
month_start_string
parse_date_bound
Parse a YYYY-MM-DD string into UTC. end_of_day controls whether the resulting instant sits at 00:00 (range start) or 23:59:59 (range end / as-of cutoff).
parse_sort_order_shared
Parse the shared sort_order query param. Balance and Breakdown accept the same names; this keeps the URLs consistent between them. Unknown values fall back to AmountDesc so a stale URL still renders.
row_amount_by_symbol
Look up a row’s amount for the given commodity symbol. Called from the commodity-columns branch of the tree-table template.
sort_top_level_rows
Sort top-level rows in place according to order. Children ride with their parent — they’re adjacent in the flattened view and we preserve that adjacency by sorting on a key derived from each top-level row alone.
sum_top_level_amounts
Sum top-level rows’ amounts per commodity. Used by Balance to build its grand-total card(s).
today_string
wants_json