Closed alensiljak closed 5 years ago
In the second image, I only removed one "0.00 IPE" part to balance the transaction. The implementation, though, would adjust both lines since they both use 0 quantity. I think this would be correct but need to clean up the remaining transactions to see if it actually works.
There might be a different way to record these in the first place:
https://groups.google.com/d/msg/ledger-cli/Y9jwyiBi97E/oEY1OkRoCwAJ
I'll try it out. Perhaps a change in code might not be needed.
I've tried the suggested modification by applying it manually on a few transactions in the ledger.
2018/04/09 return of capital
Assets:Investments:Broker:Cash 79.61 AUD
Trading:ASX:IPE 79.61 AUD
Assets:Investments:Broker:Shares:IPE -79.61 AUD
Trading:CURRENCY:AUD -79.61 AUD
However, this (correctly) produces a
Warning: line 10659: Transaction check failed: (commodity == "IPE")
So the suggested change is not really a solution as it creates incorrect ledger records. Well, they are incorrect generally but that is something I need to work out with the GnuCash community or find a way to record this event in a way that is simple yet effective.
I'll have to solve this by manually adjusting the records. My original solution does not balance as it mixes $ amounts in the fund account. GnuCash's way of calculating the Return of Capital and Capital Gains/Losses is not compatible with other tools.
I've tried the suggested modification by applying it manually on a few transactions in the ledger.
2018/04/09 return of capital Assets:Investments:Broker:Cash 79.61 AUD Trading:ASX:IPE 79.61 AUD Assets:Investments:Broker:Shares:IPE -79.61 AUD Trading:CURRENCY:AUD -79.61 AUD
However, this (correctly) produces a
Warning: line 10659: Transaction check failed: (commodity == "IPE")
So the suggested change is not really a solution as it creates incorrect ledger records. Well, they are incorrect generally but that is something I need to work out with the GnuCash community or find a way to record this event in a way that is simple yet effective.
After going myself through this issue, I have noticed that the Warning you mentioned is not caused by the transaction being incorrect (that is not) but due to the fact that piecash set a check on the commodity when declaring the accounts at the beginning of the ledger file.
Trading:ASX:IPE
check commodity == "IPE"
In the transaction you posted, there is a split is not IPE, but AUD (due to the capital gain). Because ledger is checking the currency using for that account, it throws the error.
In principle this warning should go away either by removing the check commodity line or adding the extra option:
Trading:ASX:IPE
check commodity == "IPE" or "AUD"
Technically, you are right, of course. But, since I never deposited AUD into Assets:Investments:Broker:Shares:IPE
, that would mean that this account would end up with a negative AUD balance and would still contain all the shares, which would still have the same base value.
The real problem here is correctly booking the Return of Capital, not so much the issue stated in the title. And that has been resolved elsewhere (I think reddit and/or stackexchange), by correctly repricing the lots, and withdrawing the cash value in the same transaction.
See here.
I see now. I was focusing on the Capital Gains/Losses part of the story but as you said, this seems to be particular issue for the Return o Capital. As for the "Capital Gains", I think the GnuCash way should be compatible with ledger, with only a small modification in piecash. (Basically treat the transactions with 0 shares as normal currency ones...). I am testing that at the moment.
True, at this point I was still a bit confused as to how to translate the concepts from GnuCash into ledger. But, thanks to a few good people from the community, I've learned how to properly create double-entry records for these types of events. To be honest, I no longer remember how exactly GnuCash stores Capital Gains records (I think it is a simple cash transaction out of the share account?) but in ledger this is best done by tracking lots. Which means that the GnuCash transactions will not be fully compatible. I went back and re-entered the lot information on most of my purchases, in order to get a properly-calculated Capital Gains values when the shares are sold.
I have problems with Return-of-Capital transactions (and Capital Gains) exported from GnuCash. These are recorded with 0 quantity in shares, and just the currency amount that goes out of the share account.
This syntax, in GnuCash, is a way (a workaround) to accommodate for Return of Capital.
In ledger export, this results in the following syntax:
Unfortunately, this does not balance in ledger. There is a discussion here. I think I've found a solution, though, and would like some feedback.
The syntax: balances in ledger. This implies, or requires, changes in export process. Since 0-quantity splits in share accounts are not meaningful share transactions, perhaps we should simply not include the "0.0000 IPE @@ 79.61 AUD" part but only "-79.61 AUD"?
This seems fairly harmless and resolves the original problem. Looking forward to some brainstorming.