mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-18 17:57:11 +03:00
cln: print, close: Check the show_costs_ option instead of directly
checking the --show-costs flag.
This commit is contained in:
parent
ba0eec9132
commit
1d9be4c2de
@ -102,11 +102,10 @@ close CliOpts{rawopts_=rawopts, reportspec_=rspec'} j = do
|
||||
|
||||
-- should we show the amount(s) on the equity posting(s) ?
|
||||
explicit = boolopt "explicit" rawopts
|
||||
show_costs = boolopt "show-costs" rawopts
|
||||
|
||||
-- the balances to close
|
||||
(acctbals',_) = balanceReport rspec j
|
||||
acctbals = map (\(a,_,_,b) -> (a, if show_costs then b else mixedAmountStripPrices b)) acctbals'
|
||||
acctbals = map (\(a,_,_,b) -> (a, if show_costs_ ropts then b else mixedAmountStripPrices b)) acctbals'
|
||||
totalamt = maSum $ map snd acctbals
|
||||
|
||||
-- since balance assertion amounts are required to be exact, the
|
||||
|
@ -88,8 +88,8 @@ entriesReportAsText opts =
|
||||
-- By default, use the original as-written-in-the-journal txn.
|
||||
| otherwise = originalTransaction
|
||||
maybeStripPrices
|
||||
-- Strip prices when inferring equity, unless the show-costs option is set
|
||||
| opts ^. infer_equity && not (boolopt "show-costs" $ rawopts_ opts) =
|
||||
-- Strip prices when inferring equity, unless the show_costs_ is set
|
||||
| opts ^. infer_equity && not (opts ^. show_costs) =
|
||||
transactionTransformPostings postingStripPrices
|
||||
| otherwise = id
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user