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:
parent
207ff43d6b
commit
b663822b88
@ -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" [
|
||||
|
||||
@ -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
|
||||
|
||||
>=
|
||||
|
||||
Loading…
Reference in New Issue
Block a user