Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added additional expansion formats #368

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daudi
Copy link

@daudi daudi commented Aug 12, 2023

Added expansion formats for amount1 and amount2, and date1 and date2. These can be used to find transactions with exact amounts or on exact dates, or in ranges. For example, to show transactions between two dates, in the ledger reports you can use:

%(binary) -f %(ledger-file) reg %(account) --display 'd>= [%(date1)] and d <= [%(date2)]'

Added expansion formats for amount1 and amount2, and date1 and date2.
These can be used to find transactions with exact amounts or on exact
dates, or in ranges. For example, to show transactions between two
dates, in the ledger reports you can use:

%(binary) -f %(ledger-file) reg %(account) --display 'd>= [%(date1)] and d <= [%(date2)]'
@bcc32
Copy link
Collaborator

bcc32 commented Mar 18, 2024

It seems like it would be nicer for the date format specifier to prompt for the date using ledger-read-date, instead of making the user just type a string.

I'm a little confused by the proposed "amount" format specifier---is it just supposed to be some number, or a commoditized amount, or something else?

Also, it seems a little weird to define date1 and date2 with the expectation that any reports that only use a single date should use %(date1)? FWIW, you can just use the same format specifier twice in one report. You'll get prompted with the same string each time, but otherwise it works okay, and I feel it would make the defaults a little cleaner.

@daudi
Copy link
Author

daudi commented Mar 19, 2024

All good points - I'm very much as the lower end of the elisp learning curve.

  1. Yes, ledger-read-date is better
  2. Yes, just an amount. In my report definition I have %(binary) -f %(ledger-file) reg %(account) --display 'amount == %(amount1) GBP' so the commodity is hard-coded there, but now I realise that is somewhat limiting. I'll have a go at making it possible to specify the commodity
  3. My misunderstanding, yes, I see that it can just use one version of date

Thanks for your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants