mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-27 12:24:43 +03:00
fix: balance-assigned amounts affect styles again (fix #2091)
This commit is contained in:
parent
dadb904b04
commit
e8da1f9f25
@ -22,6 +22,7 @@ module Hledger.Data.Journal (
|
||||
addPeriodicTransaction,
|
||||
addTransaction,
|
||||
journalInferMarketPricesFromTransactions,
|
||||
journalInferCommodityStyles,
|
||||
journalApplyCommodityStyles,
|
||||
commodityStylesFromAmounts,
|
||||
journalCommodityStyles,
|
||||
|
@ -332,7 +332,9 @@ journalFinalise iopts@InputOpts{..} f txt pj = do
|
||||
-- >>= Right . dbg0With (concatMap (T.unpack.showTransaction).jtxns)
|
||||
-- >>= \j -> deepseq (concatMap (T.unpack.showTransaction).jtxns $ j) (return j)
|
||||
>>= journalMarkRedundantCosts -- Mark redundant costs, to help journalBalanceTransactions ignore them
|
||||
>>= journalBalanceTransactions balancingopts_ -- Balance all transactions and maybe check balance assertions.
|
||||
>>= journalBalanceTransactions balancingopts_ -- infer balance assignments and missing amounts and maybe check balance assertions.
|
||||
>>= journalInferCommodityStyles -- infer commodity styles once more now that all posting amounts are present (XXX or journalApplyCommodityStyles ?)
|
||||
-- >>= Right . dbg0With (pshow.journalCommodityStyles)
|
||||
>>= (if infer_costs_ then journalInferCostsFromEquity else pure) -- Maybe infer costs from equity postings where possible
|
||||
<&> (if infer_equity_ then journalInferEquityFromCosts verbose_tags_ else id) -- Maybe infer equity postings from costs where possible
|
||||
<&> journalInferMarketPricesFromTransactions -- infer market prices from commodity-exchanging transactions
|
||||
|
@ -121,7 +121,7 @@ $ hledger -f- print --explicit
|
||||
>= 0
|
||||
|
||||
|
||||
## 8. Here the price should be displayed with precision 7
|
||||
# 8. Here the price should be displayed with precision 7
|
||||
# (E's precision 4 + F's precision 3).
|
||||
<
|
||||
2015/1/1
|
||||
@ -135,3 +135,13 @@ $ hledger -f- print --explicit
|
||||
f F -320.000
|
||||
|
||||
>= 0
|
||||
|
||||
# 9. Posting amounts inferred from balance assignments also affect commodity styles. (#2091)
|
||||
<
|
||||
2023-01-01
|
||||
(a) 1 A
|
||||
2023-01-02
|
||||
(a) = 2.2 A
|
||||
$ hledger -f- reg
|
||||
2023-01-01 (a) 1.0 A 1.0 A
|
||||
2023-01-02 (a) 1.2 A 2.2 A
|
||||
|
Loading…
Reference in New Issue
Block a user