Expand description
Beancount booking engine with interpolation.
This crate provides:
- Transaction interpolation (filling in missing amounts)
- Transaction balancing verification
- Tolerance calculation
§Interpolation
When a transaction has exactly one posting per currency without an amount, that amount can be calculated to make the transaction balance.
ⓘ
use rustledger_booking::interpolate;
// Transaction with one missing amount
// 2024-01-15 * "Groceries"
// Expenses:Food 50.00 USD
// Assets:Cash <- amount inferred as -50.00 USDStructs§
- Booked
Transaction - Result of booking a single transaction.
- Booking
Engine - Booking engine that tracks inventory across transactions.
- Capital
Gain - A capital gain or loss from a lot sale.
- Interpolation
Result - Result of interpolation.
- Ledger
Book Result - Outcome of booking an entire ledger in one shot — see
book. - PadError
- Error during pad processing.
- PadResult
- Result of processing pad directives.
Enums§
- Booking
Error - Errors that can occur during booking.
- Interpolation
Error - Errors that can occur during interpolation.
Constants§
- SYNTH_
PAD_ NARRATION_ PREFIX - Prefix of the narration carried by every synth pad transaction
produced by this crate (the format string used inside the
private
create_padding_transactionconstructor).
Functions§
- book
- Book and interpolate every transaction in a ledger in one shot.
- book_
transactions - Book and interpolate a list of transactions.
- calculate_
residual - Calculate the residual (imbalance) of a transaction.
- calculate_
residual_ precise - Calculate the residual of a transaction using arbitrary-precision arithmetic.
- calculate_
tolerance - Calculate the tolerance for a set of amounts.
- interpolate
- Interpolate missing amounts in a transaction.
- is_
balanced - Check if a transaction is balanced within tolerance.
- is_
synthesized_ pad - Returns
trueifftxnis a pad-synth transaction produced by this crate. - merge_
with_ padding - Merge original directives with padding transactions, maintaining date order.
- normalize_
prices - Normalize total prices (
@@) to per-unit prices (@) on a transaction. - process_
pads - Process pad directives and generate synthetic transactions.