Recued
Menu
← Back to recipes

Post an entry

by recued-core v3 11 views

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.

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.

Post an entry
This recipe

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 “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 “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 “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 “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 →

The legs must sum to zero

That is the whole of double entry, and it is checked before anything is written. £81.30 on the card, £61.30 to food, £25.00 to travel, £5.00 back in cash — four legs, one entry, one transaction.

All of it lands or none of it does. The entry and its legs go through core.records.batch, so there is no moment where the entry exists and its legs do not. Written one at a time, a crash halfway leaves a half-posted entry that looks posted and does not balance — and nothing downstream can tell that from an entry that never balanced in the first place.

Why the check is in pennies

Adding the amounts as decimals would refuse valid entries. -100.10 + 30.20 + 69.90 is 0.0000000000000142 in floating point, not zero. So every amount is multiplied by 100 and rounded to a whole penny first, and the sum of those integers is what has to be zero. Integer arithmetic is exact well past any amount you will ever type.

More than two decimal places is refused, not rounded. Otherwise the check would pass on the rounded figure while the stored amount said something else — a balanced entry made of unbalanced numbers. If you need thirds of a penny, decide where the odd one goes before you post.

The refusal has a tolerance, and it has to. 69.90 × 100 is 6990.000000000001, so an exact test would reject a perfectly ordinary amount. A genuine third decimal is out by at least 0.0999; float noise is out by around 1e-12. The line sits between them, four orders of magnitude clear of both.

Ids, and posting the same thing twice

Every leg needs its own id, and the entry's ref is its id. That is what makes re-posting safe: create is replay-safe, so sending the identical entry again writes nothing rather than duplicating it. Without stable leg ids a retry would replay the entry and duplicate its legs, which is the worst of both.

A ref already used by a DIFFERENT entry is refused — same id, different content, so the write conflicts. That is a uniqueness check you get for free rather than one this recipe has to remember to do.

One currency per entry

The currency comes from each leg's ACCOUNT, and every leg must agree. It is not something you type — a typed currency is a second source of truth that can quietly disagree with the account the money actually sits in.

All legs must be in one currency. -100 GBP and +100 USD sums to zero and balances nothing: a zero-sum check across currencies is arithmetic coincidence, not an invariant, and it would wave through an entry that is wrong in both books. A currency exchange is TWO entries through a clearing account — one in each currency — which is what double entry does anyway, and it leaves the rate visible as the difference between them rather than buried in a conversion.

What it does not do

⚠ It does not tag anything. Legs carry tags through leg_tag, which is a separate step — an entry is about money moving between accounts, and what you call it afterwards is a different decision.

How it works 60 steps

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

Process (60 steps)
ref trim
Trim whitespace from setting ref
memo trim
Trim whitespace from setting memo
now_iso date_add
Add 0 seconds to
today_parts split
Split now iso into parts
today default
Apply default
dated_in trim
Trim whitespace from setting booked on
booked_on default
Apply default
period_parts split
Split booked on into parts
period template
Generate text from a template
inputs_ok all
Check if all conditions are true
inputs_guard guard
Stop if inputs ok equals
legs json_parse
Apply json_parse
leg_count count
Count items in legs
enough_legs compare
Check if leg count is at least 2
legs_guard guard
Stop if enough legs equals
with_id filter
Filter by condition
with_account filter
Filter by condition
with_amount filter
Filter by condition
complete_count count
Count items in with amount
all_complete compare
Check if complete count equals leg count
fields_guard guard
Stop if all complete equals
leg_ids pluck
Extract id from each item
distinct_leg_ids unique
Remove duplicates from
distinct_leg_count count
Count items in distinct leg ids
leg_ids_unique compare
Check if distinct leg count equals leg count
leg_id_guard guard
Stop if leg ids unique equals
batch_fits compare
Check if leg count is at most 99
size_guard guard
Stop if batch fits equals
priced map
Extract from each item
drifted map
Extract from each item
drift_total sum
Sum values in
two_dp compare
Check if drift total is less than 0.0001
precision_guard guard
Stop if two dp equals
account_ids pluck
Extract account from each item
distinct_account_ids unique
Remove duplicates from
accounts ?
account_rows map
Extract from each item
enriched enrich_by
Apply enrich_by
with_known_account filter
Filter by condition
known_accounts count
Count items in with known account
all_accounts compare
Check if known accounts equals leg count
account_guard guard
Stop if all accounts equals
with_active_account filter
Filter by condition
active_accounts count
Count items in with active account
all_active compare
Check if active accounts equals leg count
active_guard guard
Stop if all active equals
currencies pluck
Extract currency from each item
distinct_currencies unique
Remove duplicates from
currency_count count
Count items in distinct currencies
one_currency compare
Check if currency count equals 1
currency_guard guard
Stop if one currency equals
currency default
Apply default
net_pennies sum
Sum values in
balanced compare
Check if net pennies equals 0
balance_guard guard
Stop if balanced equals
batch_op default
Apply default
leg_ops map
Extract from each item
ops flatten
Flatten nested lists in
post ?
card to_summary
Format results as a summary card
Settings 4 configurable

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

ref setting = [object Object]
memo setting =
booked on setting =
legs json setting = []

About

Tags

pack:ledger-bookaccountingdouble-entryrecordsv3

Details

60 steps 4 configurable settings recipe_id: post-batch