mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-08 15:14:49 +03:00
lib: fix balance --budget in the presence of --value
This commit is contained in:
parent
ef5e7511c2
commit
8c79d6529d
@ -400,9 +400,7 @@ canonicaliseAmount styles a@Amount{acommodity=c, astyle=s} = a{astyle=s'}
|
|||||||
amountValue :: Journal -> Day -> Amount -> Amount
|
amountValue :: Journal -> Day -> Amount -> Amount
|
||||||
amountValue j d a =
|
amountValue j d a =
|
||||||
case commodityValue j d (acommodity a) of
|
case commodityValue j d (acommodity a) of
|
||||||
Just v -> v{aquantity=aquantity v * aquantity a
|
Just v -> v{aquantity=aquantity v * aquantity a}
|
||||||
,aprice=aprice a
|
|
||||||
}
|
|
||||||
Nothing -> a
|
Nothing -> a
|
||||||
|
|
||||||
-- This is here not in Commodity.hs to use the Amount Show instance above for debugging.
|
-- This is here not in Commodity.hs to use the Amount Show instance above for debugging.
|
||||||
|
@ -316,3 +316,31 @@ Budget performance in 2018/01/01:
|
|||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
# 15. respect --sort-amount
|
# 15. respect --sort-amount
|
||||||
|
|
||||||
|
# 16. respect --value
|
||||||
|
<
|
||||||
|
P 2018/01/26 SHARE €10
|
||||||
|
|
||||||
|
2018/05/17 Dividend
|
||||||
|
revenue:dividend €-10
|
||||||
|
assets:pension €10
|
||||||
|
|
||||||
|
2018/05/17 Buy
|
||||||
|
assets:pension:shares 1 SHARE @ €10
|
||||||
|
assets:pension €-10
|
||||||
|
|
||||||
|
~ monthly from 2018/06 to 2018/07
|
||||||
|
assets:pension €1
|
||||||
|
assets:bank
|
||||||
|
|
||||||
|
$ hledger -f - bal -M --budget --cumulative --forecast --value
|
||||||
|
Budget performance in 2018/05/01-2018/06/30:
|
||||||
|
|
||||||
|
|| May Jun
|
||||||
|
================++====================================================
|
||||||
|
<unbudgeted> || €-10 €-10
|
||||||
|
assets:bank || 0 €-1 [ 100% of €-1]
|
||||||
|
assets:pension || €10 €11 [1100% of €1]
|
||||||
|
----------------++----------------------------------------------------
|
||||||
|
|| 0 0 [ 0]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user