cln: print, close: Check the show_costs_ option instead of directly

checking the --show-costs flag.
This commit is contained in:
Stephen Morgan 2022-01-01 23:13:42 +01:00 committed by Simon Michael
parent ba0eec9132
commit 1d9be4c2de
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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