diff --git a/hledger/Hledger/Cli/Commands/Print.hs b/hledger/Hledger/Cli/Commands/Print.hs index 5756c1a32..cd60a601f 100644 --- a/hledger/Hledger/Cli/Commands/Print.hs +++ b/hledger/Hledger/Cli/Commands/Print.hs @@ -66,8 +66,15 @@ printEntries opts@CliOpts{reportopts_=ropts} j = do entriesReportAsText :: CliOpts -> EntriesReport -> String entriesReportAsText opts = concatMap (showTransactionUnelided . gettxn) where - gettxn | boolopt "explicit" $ rawopts_ opts = id -- use the fully inferred/explicit txn - | otherwise = originalTransaction -- use the original txn (more or less) + gettxn | useexplicittxn = id -- use the fully inferred/explicit txn + | otherwise = originalTransaction -- use the original as-written txn, more or less + -- Original vs inferred transactions/postings were causing problems here, disabling -B (#551). + -- Use the explicit one if -B or -x are active. + -- This passes tests; does it also mean -B sometimes shows missing amounts unnecessarily ? + useexplicittxn = or + [ boolopt "explicit" $ rawopts_ opts + , cost_ $ reportopts_ opts + ] -- Replace this transaction's postings with the original postings if any, but keep the -- current possibly rewritten account names. diff --git a/hledger/hledger_commands.m4.md b/hledger/hledger_commands.m4.md index 2395bd109..23bc6e2f5 100644 --- a/hledger/hledger_commands.m4.md +++ b/hledger/hledger_commands.m4.md @@ -548,7 +548,7 @@ Note, `-x` will cause postings with a multi-commodity amount will be split into multiple single-commodity postings, for valid journal output. With `-B`/`--cost`, amounts with [transaction prices](/journal.html#transaction-prices) -are converted to cost using that price. +are converted to cost using that price. This can be used for troubleshooting. With `-m`/`--match` and a STR argument, print will show at most one transaction: the one one whose description is most similar to STR, and is most recent. STR should contain at