beancount / ledger2beancount

Ledger to Beancount text-based converter
GNU General Public License v3.0
84 stars 14 forks source link

Fixated prices -> cost conversion broken #224

Closed tbm closed 4 years ago

tbm commented 4 years ago

I was trying to figure out what this is there for:

if (!defined $i->[PRICE]->[AMOUNT]->[FIXATED]

clearly I put it there for a reason but I couldn't remember why and afaict no test case covers it.

Basically, the idea is this: if you have something like this:

2020-10-01 * Test
    Assets:Test      10.00 GBP @ =5.00 EUR
    Assets:Test

Normally, we'd convert this to a price in beancount since GBP and EUR are both currencies.

But beancount doesn't have fixated prices, so we're losing the fixated price, and the whole idea is that the price should stick around and not change. And how would you do this in beancount? With a cost of course.

So the idea was to convert fixated prices to costs.

But this isn't actually done right now.

I suspect this was working before and I broke it. And there's no test case so I never noticed.

tbm commented 4 years ago

I suspect this got broken in:

commit bf3e1761e3235c0238bcb041c00e9ec488fbd384 Author: Martin Michlmayr tbm@cyrius.com Date: Sat Jun 20 07:50:05 2020 +0800

Improve parsing of postings for accuracy and speed
tbm commented 4 years ago

Confirmed. This worked in 2.2. Broke in 2.3

Yet another fallout of the big rework...

tbm commented 4 years ago

Confirmed breakage at bf3e1761e3235c0238bcb041c00e9ec488fbd384