fix: print: ignore --depth entirely

Until now, a depth limit caused print to show only transactions referencing accounts as deep or deeper than that.
This commit is contained in:
Simon Michael 2024-12-09 13:42:11 -10:00
parent 207ff43d6b
commit b663822b88
2 changed files with 13 additions and 2 deletions

View File

@ -21,7 +21,7 @@ import Data.Ord (comparing)
import Data.Time (fromGregorian)
import Hledger.Data
import Hledger.Query (Query(..))
import Hledger.Query (Query(..), filterQuery, queryIsDepth)
import Hledger.Reports.ReportOptions
import Hledger.Utils
@ -37,7 +37,7 @@ entriesReport :: ReportSpec -> Journal -> EntriesReport
entriesReport rspec@ReportSpec{_rsReportOpts=ropts} =
sortBy (comparing $ transactionDateFn ropts) . jtxns
. journalApplyValuationFromOpts (setDefaultConversionOp NoConversionOp rspec)
. filterJournalTransactions (_rsQuery rspec)
. filterJournalTransactions (filterQuery (not.queryIsDepth) $ _rsQuery rspec)
tests_EntriesReport = testGroup "EntriesReport" [
testGroup "entriesReport" [

View File

@ -27,3 +27,14 @@ $ hledger -f- print -x
z 0 B
>=
# ** 3. --depth does not affect print.
<
2023-01-01
A:AA 0 A
$ hledger -f- print --depth 1
2023-01-01
A:AA 0 A
>=