Hello,
I've recently discovered expansion formats in ledger-mode [1] and have
used them to easily create and run some reports that I find useful. I
have found this to have really made the reports (C-c C-o C-R) so much
more useful.
One expansion format that doesn't exist, but I thought would be
useful, is "amount" to help searching for records by amount, either an
exact amount or an amount between ranges.
It turned out to be very easy to add amount1 and amount2 with my
limited knowledge of elisp. In report definitions, I can then use
either amount1 on its own to search for transactions that match an
exact amount, e.g.:
%(binary) -f %(ledger-file) reg %(account) --display 'amount == %(amount1) GBP'
or amount1 and amount2 to search for transactions with amounts between
two values:
%(binary) -f %(ledger-file) reg %(account) --display 'amount >=
%(amount1) GBP and amount < %(amount2) GBP'
If this is seen as potentially useful for others, I'll submit a pull request.
[1]
https://ledger-cli.org/doc/ledger-mode.html#Expansion-Formats
David
--
David Whiting