hledger-web displays a wrong price for amounts with differently-priced lots #114

Closed
tphyahoo opened this Issue May 30, 2013 · 1 comment

Projects

None yet

2 participants

@tphyahoo

Scenario: You are a cow dealer, and the price of cows climbs from 100 USD/COW to 250 USD/COW over 2 years.

With journal

2009/1/1
assets:cows COW1 ; one cow at 100USD
assets:usd USD-100

2011/7/4
assets:cows COW4 ; buy more cows, price around $250/btc
assets:usd USD-1000

The resulting web display shows


Accounts

COW5 @@ USD100
USD-1100


This would be fine, if you ignore the @@USD100 part.

But the way the information is presented, it would seem that you bought 5 cows for 100 apiece, ignoring the 4 cows that cost 250.

Suggested fixes. Either:
-- don't display the stuff after the @@ in the web ledger.
-- or for the stuff after the @@, divide 1100 by 5, to show the price of cows over the period being queried

For simplicities sake, I would suggest the former.

As a side note, possibly this type of transaction should be disallowed, because it doesn't satisfy the accounting equation. That is to say, each transaction should zero out for both units. I'll file that as a separate issue.

The resulting web display shows


Accounts

COW5 @@ USD100
USD-1100


This would be fine, if you ignore the @@USD100 part.

But the way the information is presented, it would seem that you bought 5 cows for 100 apiece, ignoring the 4 cows that cost 250.

Suggested fix: don't display the stuff after the @@ in the web ledger.

I'm curious how this behaves in command line mode, but I have been using only web ledger so far.

Should I bug this up, and what's the "official" bug tracker now, google groups or github?

@simonmichael
Owner

I'm pretty sure it's using the right prices internally - it's just displaying them wrongly. Removing prices from hledger-web's accounts sidebar seems a good quick fix. The balance command doesn't show prices either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment