mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-26 03:42:25 +03:00
more small stuff
This commit is contained in:
parent
0542e2f2f6
commit
dabc30e115
@ -1,5 +1,7 @@
|
||||
module Ledger
|
||||
where
|
||||
import qualified Data.Map as Map
|
||||
|
||||
import Utils
|
||||
import AccountName
|
||||
import BasicTypes
|
||||
@ -32,6 +34,9 @@ ledgerTransactionsMatching (acctregexps,descregexps) l =
|
||||
(concat [filter (matchTransactionDescription r) ts | r <- descregexps])
|
||||
where ts = ledgerTransactions l
|
||||
|
||||
ledgerTransactionsInAccount :: Ledger -> AccountName -> [EntryTransaction]
|
||||
ledgerTransactionsInAccount l a = ledgerTransactionsMatching (["^" ++ a ++ "$"], []) l
|
||||
|
||||
accountNamesFromTransactions :: [EntryTransaction] -> [AccountName]
|
||||
accountNamesFromTransactions ts = nub $ map account ts
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user