Ledger is a financial reporting tool that takes a text file (journal) of transactions as its input to produce customized reports, registers, simple balances, and tons of other fun stuff for money nerds. It uses the double-entry methodology, which is a fancy way of saying it enforces one strict rule: "Assets must come from one account and go to another." Its free-form account naming conventions give the user great control over how their assets are managed. Some even use it to manage virtual currencies and assets!
This page can't replace the great documentation on Ledger, but instead aims to point out the gems hidden within the docs.
Typically one shouldn't have to do this, if they're 100% on top of their balances. Cash is the easiest thing to lose, so sometimes one needs to account for a discrepancy. You do that by creating an entry without any balances, but leave an assertion on the first line to reset an account's balance.
Imagine losing $27 in cash somewhere for months, and finally get tired of having to mentally account for it in your reports. So you take a business day (or for the poor folk, 5 minutes) to total your cash, then put that in your balance assignment.
This technique has the added bonus of baking in the date the adjustment took place, alleviating the need for a comment in an entry using a vaguer account. You still might want to add a comment (inside the entry, not above it) including a field name followed by a colon, then whatever value you want it to have. Two good ideas here are Amount-Lost
or Amount-Gained
.
2020-05-15 Adjustment ; Amount-Lost: $27 Assets:Cash = $200 Equity:Adjustments
The above means Assets:Cash
is now $200, and whatever difference it takes to get there is put into Equity:Adjustments
.