I know in general the order of records in a beancount input file doesn't
matter, but if I have an asset acquisition and a transfer of that asset
later on the same day, things get confused if the transfer record appears
first.

E.g., this works:

2020-01-01 pad      Assets:BrokerA:USD  Equity:Opening-Balances
2020-01-02 balance  Assets:BrokerA:USD  100.00 USD

2020-02-01 * "Buy some ASSET"
  Assets:BrokerA:ASSET                  10.00 ASSET {10.00 USD}
  Assets:BrokerA:USD                  -100.00 USD

2020-02-01 * "Transfer ASSET"
  Assets:BrokerA:ASSET                  -5.00 ASSET {USD}
  Assets:BrokerB:ASSET                   5.00 ASSET {USD}

(using the "{USD}" cost marker workaround to transfer cost basis)

However, if I reverse the order of the two records, I get the error:

  Too many missing numbers for currency group 'USD'

and if I remove the {USD} cost markers on the transfer, I get the booking
error:

  No position matches "Posting(account='Assets:BrokerA:ASSET', units=10.00
ASSET, cost=CostSpec(number_per=Decimal('10.00'), number_total=None,
currency='USD', date=None, label=None, merge=False), price=None, flag=None,
meta={...})" against balance (-5.00 ASSET)

I've seen some discussion of these errors in the context of tracking cost
basis among transfers, but I don't fully understand where things are at.

Brainstorming workarounds:
- hack the physical ordering to respect original tx timestamps
- artificially book transfers a day late (but that will break if there are
further actions on that asset on the same day as the actual transfer)
- ....?

thanks,
eric

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAFXPr0sbHcONVU9R7b9PMFxoDoiDaFxB4O%2BJqOOsJVpJO8M2oQ%40mail.gmail.com.

Reply via email to