Hi Martin et al,I'm still trying to understand how to reliably book transactions without explicitly specifying the cost basis on every leg (e.g. with FIFO booking)Here is a test case with everything explicit, that passes bean-check. I buy 1 BTC for 1000 AUD from an account initialised with a positive AUD balance. Then I transfer a sum to a cold wallet and back to the hot wallet, incurring a fee on each transaction which I book to a BTC-denominated expenses account.option "operating_currency" "AUD"2014-01-01 open Equity:Opening-Balances2014-01-01 open Assets:AU:Cash AUD2014-01-01 open Expenses:Financial:TransactionFees:BTC BTC2014-01-01 open Assets:AU:Hotwallet BTC "FIFO"2014-01-01 open Assets:AU:Coldwallet BTC "FIFO"2014-01-01 * "Initial cash balance"Assets:AU:Cash 1000.00 AUDEquity:Opening-Balances2014-01-02 * "Initial hotwallet balance"Assets:AU:Hotwallet 1.00 BTC {1000 AUD}Assets:AU:Cash -1000.00 AUD2014-01-03 * "Deposit Cold storage"Assets:AU:Hotwallet -0.050000000 BTC {1000 AUD}Assets:AU:Coldwallet 0.049000000 BTC {1000 AUD}Expenses:Financial:TransactionFees:BTC 0.001000000 BTC {1000 AUD}2014-01-04 * "Withdraw Cold storage"Assets:AU:Coldwallet -0.049000000 BTC {1000 AUD}Assets:AU:Hotwallet 0.048000000 BTC {1000 AUD}Expenses:Financial:TransactionFees:BTC 0.001000000 BTC {1000 AUD}
However, despite making my wallet accounts "FIFO", whenever I try to remove the explicit {1000 AUD} cost basis in my reducing postings, I start getting errors.For example, if I use {} in the first transaction:2014-01-03 * "Deposit Cold storage"Assets:AU:Hotwallet -0.050000000 BTC {}Assets:AU:Coldwallet 0.049000000 BTC {}Expenses:Financial:TransactionFees:BTC 0.001000000 BTC {}I would be hoping that as FIFO is specified for the Coldwallet account, the lot is inferred.
However, bean-check now complains: Failed to categorize posting.
Furthermore, attempting to debug with bean-doctor doesn't quite work for me. The transaction in question starts at line 17. But beandoctor context <filename> 17 returns the context for the previous transaction at line 13.
If I try amending the second transaction to use {} (instead of the first which I set back to {AUD 1000}), bean-check replies "Too many missing numbers for currency group 'AUD".
And bean-doctor ... 13 shows the expected balances after the first transaction but beandoctor ... 17 doesn't show any opening balances even though it directly follows the tx at 13.
Any idea what I may have done wrong here? I'm using beancount==2.0rc1 as installed by the latest package on PyPI. I've read the Inventory and Trading docs several times, but obviously I'm still learning so if I've wasted your time I apologise. Still excited by beancount!
--Dave
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/d559299b-9f6e-45f6-bec4-996d2b52b4ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dave
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/d559299b-9f6e-45f6-bec4-996d2b52b4ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/bMKLxoWJb04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhM3rQdqZ_k1LmY6XLWoGfgm0SpYMNicVHcUxzcOfyv%2Bgg%40mail.gmail.com.
However, I had a further surprise: the cost basis in the Coldwallet becomes 2014-01-03. I presumed that once a cost basis had been attached to a lot, it would be preserved unless overridden explicitly.
To take another example: I have two stockbroking accounts. One has my margin loan so I normally buy shares with that account. However when I come to sell I often transfer them to another account which has lower brokerage. It's not relevant to my cost basis which account I hold the shares in; I can move them around as I choose but I'd need my cost basis to reflect the reality of when I bought and sold a specific share. I presumed that the <Position> objects created on the augmenting leg(s) would inherit the cost basis of the reducing leg(s) where FIFO is used and unless I explicitly reset the cost basis.
Effectively, it seems the safe way to proceed is to use STRICT and to specify the cost basis explicitly on each tx.
But as you noted in our previous thread, these txs are quite small and frequent. But that would also realistically mean running bean-doctor before every entry I write to establish what my inventory is, and rely on my not making mistakes. If I had to correct an historical tx, I'd have to update the cost basis of every subsequent tx.If this is true, I'd probably write a helper script to 'do FIFO' for me, but before I start going too far down that road it may be that I am still just a bit confused about how beancount's FIFO behaviour works.
Any thoughts on this?
Thanks again,Dave
Dave
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/d559299b-9f6e-45f6-bec4-996d2b52b4ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/bMKLxoWJb04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhM3rQdqZ_k1LmY6XLWoGfgm0SpYMNicVHcUxzcOfyv%2Bgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscribe@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAHkYY6W-DdPB8n5WS7b%3DB4SiM%3DiOjy%3D67JukaR6%3Dc03bikU5rg%40mail.gmail.com.