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

Keeping price conversion syntax when using bean-report #725

Open
papageno opened this issue Jul 8, 2022 · 1 comment
Open

Keeping price conversion syntax when using bean-report #725

papageno opened this issue Jul 8, 2022 · 1 comment

Comments

@papageno
Copy link

papageno commented Jul 8, 2022

Price conversion syntax will be formatted as rate of conversion despite that the total cost syntax is used in the original posting.

For example, 691.00 JPY @@ 5.00 USD will become 691.00 JPY @ 0.007235890014471780028943560058 USD.

The command I originally used was bean-report [-f beancount] [-o OUTPUT] FILENAME.beancount {print}. I always use this command to 'prettify' my ledger file, i.e., to automatically add commas to amounts, or to re-order postings by their dates...

Is there a workaround to keep the original price conversion syntax used in the posting when using bean-report?

Thank you.

@dnicolodi
Copy link
Collaborator

This is not possible. The cost is stored as a price during parsing of the ledger. This is a known limitation of the current parser and it is been worked on.

The work-around I use is to replace the beancount ledger serializer with one that uses some heuristic to determine whether a price annotation or a cost annotation is more appropriate for a given posting. I have an implementation of this but I realize that I haven't published it anywhere. I'll try to remedy this ASAP. There isn't any possible work-around using only the command line tools provided by Beancount.

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

No branches or pull requests

2 participants