Recued
Menu
← Back to recipes

How a budget is doing

by recued-core v3 9 views

Use “How a budget is doing” in Recued. What a budget has left, counting everything under its tag at any depth.

Complete workflow

Ledger book 16 pinned recipes

Use Ledger book in Recued for accounting, double entry, budget, and records. It includes 44 built-in actions and 15 ready-to-run workflows. Actions that change data use Recued's approval controls.

You are viewing one recipe in this workflow. Installing it opens the complete pack so its other recipes and background automations arrive together.

How a budget is doing
This recipe

Use “How a budget is doing” in Recued. What a budget has left, counting everything under its tag at any depth.

pack:ledger-bookaccountingbudgetrecords
by recued-core pinned v3

Use “The accounts” in Recued. Every account with its id — what you post to, and what anything else in this workflow needs before it can name one.

pack:ledger-bookaccountingaccountsrecords
by recued-core pinned v3

Use “The tags” in Recued. Every tag with its id and how deep it sits — the trees you can spend against, and the ids the rest of the pack takes.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “What it all comes to” in Recued. Each currency's balance read exactly, then converted at rates you give and added up.

pack:ledger-bookaccountingcurrencyrecords
by recued-core pinned v3

Use “Every budget at once” in Recued. All your budgets for a period, each counting everything under its tag — in four queries, however many budgets you have.

pack:ledger-bookaccountingbudgetrecords
by recued-core pinned v3
Show all 16 recipes

Use “What went under a tag” in Recued. Everything spent under one tag, including every tag beneath it, at any depth.

pack:ledger-bookaccountingtagsbudget
by recued-core pinned v3

Use “The lines under a tag” in Recued. Every transaction line under a tag and everything beneath it — the lines themselves, not a total. With a CSV to copy.

pack:ledger-bookaccountingtagsexport
by recued-core pinned v3

Use “Open an account” in Recued. Adds an account to your chart. Its currency is fixed here and every line posted to it inherits it.

pack:ledger-bookaccountingrecordsv2
by recued-core pinned v2

Use “Post an entry” in Recued. One entry, any number of legs, written in a single all-or-nothing transaction. It will not post unless the legs sum to zero.

pack:ledger-bookaccountingdouble-entryrecords
by recued-core pinned v3

Use “Add a tag” in Recued. Adds a tag anywhere in your tree, at any depth. The tag and its place in the tree are written together or not at all.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “Tag a month of lines” in Recued. One tree at a time: every line in a period on one page, with a picker in the tag cell.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “Tag a transaction line” in Recued. Sets which tags a line belongs to, one per tree. Each tag and every tag above it counts the full amount.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “Set a budget” in Recued. A cap on a tag for one period. It counts everything under that tag, at any depth.

pack:ledger-bookaccountingbudgetrecords
by recued-core pinned v3

Use “Move a tag” in Recued. Puts a tag inside a different one. Everything recorded under it follows automatically — no transaction is rewritten.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3

Use “Delete a tag” in Recued. Removes a tag and everything beneath it. Refuses while anything is still tagged with it.

pack:ledger-bookaccountingtagsrecords
by recued-core pinned v3
View pack details, dependencies, and permissions →

It counts everything underneath

A budget on home counts home, home/kitchen, home/kitchen/appliances and anything you add beneath them later. There is no separate rolled-up figure and nothing to recompute when you reorganise the tree — the subtree is read at the moment you ask.

What is left is worked out in whole units, not decimals. 0.30 − 0.10 in floating point is 0.19999999999999998, and 8.70 − 5.80 is 2.8999999999999995 — a remaining balance is a subtraction, and that is exactly where decimals go wrong. Both figures are multiplied out to whole units first, so what is left is what is left.

⚠ The over-or-under verdict does not need that and would be right either way: comparing two stored figures is exact whichever form they are in. It is done in whole units for consistency with the number beside it, not because the comparison is at risk — a survived mutant made me check rather than assume.

Spent, remaining and the cap are all in the budget's own currency, which is stored on it. Nothing here converts — combined-balance is the recipe that does that, and it is explicit about being an estimate.

One budget at a time — and why that is fine

This answers for ONE budget. budget-board does every budget for a period in three queries, so this is the detail view rather than the only way to ask.

Use this one when the budget is scoped to an ACCOUNT. The board's grouped read is not split by account, so it leaves those budgets off the page on purpose; this is the recipe that honours the scope.

Limits

At most 100 tags beneath the budget's tag, and it refuses rather than answering short. A budget you are told you are under, because half your spending was not counted, is worse than no answer.

How it works 32 steps

Inspect the data fetches, transforms, gates, and output this recipe runs.

Process (32 steps)
budget_id trim
Trim whitespace from setting budget id
has_id compare
Check if budget id has data
id_guard guard
Stop if has id equals
budget ?
found compare
Check if budget record id has data
found_guard guard
Stop if found equals
edges ?
edge_rows default
Apply default
descendant_count count
Count items in edge rows
within_cap compare
Check if descendant count is at most 100
cap_guard guard
Stop if within cap equals
any_tags compare
Check if descendant count is greater than 0
tag_missing_guard guard
Stop if any tags equals
tag_refs pluck
Extract descendant from each item
account_ref default
Apply default
has_account compare
Check if account ref has data
spend_any_account ?
skip: step.has_account equal true
spend_one_account ?
skip: step.has_account equal false
rollup coalesce
Use the first available value from: spend one account aggregate, spend any account aggregate
spent_pennies math
Calculate: round({{step.rollup.spent}} * 100)
cap_pennies math
Calculate: round({{step.budget.record.cap}} * 100)
left_pennies math
Calculate: {{step.cap_pennies}} - {{step.spent_pennies}}
is_over compare
Check if spent pennies is greater than cap pennies
spent math
Calculate: {{step.spent_pennies}} / 100
remaining math
Calculate: {{step.left_pennies}} / 100
cap_is_positive compare
Check if cap pennies is greater than 0
used_raw math
Calculate: {{step.spent_pennies}} * 100 / max({{step.cap_pennies}}, 1)
used_number round
Round used raw to 1 decimal places
used_pct ternary
Apply ternary
verdict ternary
Apply ternary
table to_table
Format results as a data table
card to_summary
Format results as a summary card
Settings 1 configurable

Configurable at install. Defaults shown — change them anytime in Recued.

budget id setting = [object Object]

About

Tags

pack:ledger-bookaccountingbudgetrecordsv3

Details

32 steps 1 configurable settings recipe_id: budget-status