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

Unbalanced transaction? #1947

Closed
alensiljak opened this issue Nov 5, 2022 · 4 comments
Closed

Unbalanced transaction? #1947

alensiljak opened this issue Nov 5, 2022 · 4 comments
Labels
journal The journal file format, and its features.

Comments

@alensiljak
Copy link

alensiljak commented Nov 5, 2022

Running hledger on my ledger book record:

2014-06-02 Sell XYZ
	; 0.95 AUD
	Assets:Investments:ANZ:Shares:XYZ  	       -5000 XYZ {0.47 AUD} [2013-02-25] @@ 4750.00 AUD
	Expenses:Commissions                           19.95 AUD
	Income:Investment:Capital Gains             -2400.00 AUD
	Assets:Investments:Cash  		     4730.05 AUD

gives me an error:

178 | 2014-06-02 Sell XYZ
    |     ; 0.95 AUD
    |     Assets:Investments:Shares:BYE      -5000 XYZ @@ 4,750.00 AUD
    |     Expenses:Commissions                               19.95 AUD
    |     Income:Investment:Capital Gains                -2,400.00 AUD
    |     Assets:Investments:Cash                         4,730.05 AUD

This multi-commodity transaction is unbalanced.
The real postings' sum should be 0 but is: -2,400.00 AUD
Consider adjusting this entry's amounts, adding missing postings,
or recording conversion price(s) with @, @@ or equity postings.

I see in the docs that the @ and @@ syntax is supported.
If I comment-out the Capital Gains line, ledger complains about the 2400 missing.
This is probably due to the price syntax not being supported?

@alensiljak alensiljak added the A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. label Nov 5, 2022
@alensiljak alensiljak reopened this Nov 5, 2022
@simonmichael
Copy link
Owner

Yes we ignore the {} syntax, I expect that's the reason. https://hledger.org/1.27/hledger.html#lot-prices-lot-dates

@alensiljak
Copy link
Author

alensiljak commented Nov 5, 2022

OK, seems that this is related to #1015 and #1018. Should I close the issue?

Edit: as well as https://hledger.org/investments.html#what-about-lots-

@alensiljak
Copy link
Author

Right. The 5000 of XYZ were paid 0.47, which is $2,350. Hence the $2,400 Capital Gain requirement.

@simonmichael
Copy link
Owner

Yes this one can be closed, F.A.D.

@simonmichael simonmichael added journal The journal file format, and its features. and removed A-BUG Something wrong, confusing or sub-standard in the software, docs, or user experience. labels Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
journal The journal file format, and its features.
Projects
None yet
Development

No branches or pull requests

2 participants