print: sort by date, like register
This commit is contained in:
parent
71cc41da1a
commit
eb0d7ea06c
@ -17,11 +17,12 @@ print' :: [Opt] -> [String] -> Ledger -> IO ()
|
|||||||
print' opts args l = putStr $ showLedgerTransactions opts args l
|
print' opts args l = putStr $ showLedgerTransactions opts args l
|
||||||
|
|
||||||
showLedgerTransactions :: [Opt] -> [String] -> Ledger -> String
|
showLedgerTransactions :: [Opt] -> [String] -> Ledger -> String
|
||||||
showLedgerTransactions opts args l = concatMap showLedgerTransaction $ filteredtxns
|
showLedgerTransactions opts args l = concatMap showLedgerTransaction txns
|
||||||
where
|
where
|
||||||
filteredtxns = ledger_txns $
|
txns = sortBy (comparing ltdate) $
|
||||||
filterRawLedgerPostingsByDepth depth $
|
ledger_txns $
|
||||||
filterRawLedgerTransactionsByAccount apats $
|
filterRawLedgerPostingsByDepth depth $
|
||||||
rawledger l
|
filterRawLedgerTransactionsByAccount apats $
|
||||||
|
rawledger l
|
||||||
depth = depthFromOpts opts
|
depth = depthFromOpts opts
|
||||||
(apats,_) = parsePatternArgs args
|
(apats,_) = parsePatternArgs args
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user