1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
use crateDate;
use crateDecimal;
use Comment;
use Located;
/// A single posting line inside a transaction — one debit or credit.
///
/// `amount` is `None` for the "omitted amount" posting whose value is
/// inferred later by the balancer. `costs` and `balance_assertion` are
/// optional Ledger annotations (`@`/`@@` and `=`).
///
/// `lot_cost` carries the Ledger `{COST}` annotation (cost basis per
/// unit, e.g. `{BTC 0.0904}`). When present, the booker uses the lot
/// cost — not the `@` market cost — to compute the balance effective
/// amount, which matches Ledger's sell-from-lot semantics. The `@`
/// market cost still participates in rebalance/reports.
/// A numeric value paired with a commodity symbol (e.g. `$100.50`, `10 AAPL`).
///
/// `decimals` records how many fractional digits the user wrote in the
/// source — e.g. `5.00` has `decimals = 2` even though the `Decimal`
/// value is `5`. This drives display precision: reports maximise
/// `decimals` over all observed amounts per commodity.
///
/// Price annotation attached to a posting: either per unit (`@`) or
/// for the total (`@@`).
/// Ledger lot-cost annotation captured from `{...}` / `{{...}}`.
///
/// - per-unit `{COST}` — `amount` is the cost of one unit (`total == false`).
/// - total `{{TOTAL}}` — `amount` is the cost of the whole lot
/// (`total == true`), like `@@` is to `@`.
/// - the `=` prefix (`{=COST}` / `{{=TOTAL}}`) locks the cost in; acc
/// records it in `fixed` but treats locked and floating the same for
/// balance and gain computation (there is no `--revalued` report).