print: sort by date, like register

This commit is contained in:
Simon Michael 2009-07-08 00:52:54 +00:00
parent 71cc41da1a
commit eb0d7ea06c

View File

@ -17,9 +17,10 @@ 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) $
ledger_txns $
filterRawLedgerPostingsByDepth depth $ filterRawLedgerPostingsByDepth depth $
filterRawLedgerTransactionsByAccount apats $ filterRawLedgerTransactionsByAccount apats $
rawledger l rawledger l