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

hledger add doesn't work when combining @@ and conversion equity accounts #2056

Open
javalasers opened this issue Jul 5, 2023 · 1 comment
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. add impact3 Affects just a few users. severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate.

Comments

@javalasers
Copy link

javalasers commented Jul 5, 2023

Version: hledger 1.30, mac-x86_64

I'm recording commodity conversions using both the @@ mechanism and also the equity conversion accounts, as mentioned here. ("Conversion with equity postings and explicit cost"). However, "hledger add" doesn't see this as balanced, even though if I manually input in the journal, it is seen as balanced and works exactly as expected.

Small example:

Date [2023-07-04]:
Description: Test 2
Using this similar transaction for defaults:
2023-07-04 Test
    assets:eth                            1 ETH
    equity:conversion:$-ETH:ETH          -1 ETH
    equity:conversion:$-ETH:$             $2000
    revenue:staking                      $-2000

Account 1 [assets:eth]:
Amount  1 [1 ETH]: 1 ETH @@ $2000
Account 2 [equity:conversion:$-ETH:ETH]:
Amount  2 [-1 ETH @@ $2000]: -1 ETH
Account 3 [equity:conversion:$-ETH:$]:
Amount  3 [1 ETH]: $2000
Account 4 [revenue:staking]:
Amount  4 [$-2000]:
Account 5: .
Please enter more postings to balance the transaction.

If I continue adding accounts to the hledger add entry to try to determine what it is looking for to accept that the transaction is balanced, it is clear that it wants an entry that literally says "-1 ETH @@ $2000". However, if I try to use such an entry for the Amount 2 above, then hledger itself rejects that journal entry when I try to run "bse" or similar afterward.

Basically there is a divergence in what hledger sees as a balanced journal entry vs. what "hledger add" sees as a balanced journal entry, when both the @@ syntax and the conversion equity account methods are in use.

@javalasers javalasers added the A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. label Jul 5, 2023
@simonmichael
Copy link
Owner

Thanks for the report. I agree add should accept this, as the journal reader does.

@simonmichael simonmichael added severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate. impact3 Affects just a few users. labels Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. add impact3 Affects just a few users. severity2 Minor to moderate usability/doc bug, reasonably easy to avoid or tolerate.
Projects
None yet
Development

No branches or pull requests

2 participants