misc support
This commit is contained in:
parent
bf89f7ac7a
commit
6bc4f5f72d
@ -181,3 +181,5 @@ interestingAccountsFrom =
|
|||||||
hasbalance = (/= 0) . abalance
|
hasbalance = (/= 0) . abalance
|
||||||
hastxns = (> 0) . length . atransactions
|
hastxns = (> 0) . length . atransactions
|
||||||
|
|
||||||
|
ledgerAccountTree :: Ledger -> Tree Account
|
||||||
|
ledgerAccountTree l = addDataToAccountNameTree l (ledgerAccountNameTree l)
|
||||||
|
|||||||
@ -34,8 +34,8 @@ ledgerTransactionsMatching (acctregexps,descregexps) l =
|
|||||||
(concat [filter (matchTransactionDescription r) ts | r <- descregexps])
|
(concat [filter (matchTransactionDescription r) ts | r <- descregexps])
|
||||||
where ts = ledgerTransactions l
|
where ts = ledgerTransactions l
|
||||||
|
|
||||||
ledgerTransactionsInAccount :: Ledger -> AccountName -> [EntryTransaction]
|
ledgerAccountTransactions :: Ledger -> AccountName -> [EntryTransaction]
|
||||||
ledgerTransactionsInAccount l a = ledgerTransactionsMatching (["^" ++ a ++ "$"], []) l
|
ledgerAccountTransactions l a = ledgerTransactionsMatching (["^" ++ a ++ "$"], []) l
|
||||||
|
|
||||||
accountNamesFromTransactions :: [EntryTransaction] -> [AccountName]
|
accountNamesFromTransactions :: [EntryTransaction] -> [AccountName]
|
||||||
accountNamesFromTransactions ts = nub $ map account ts
|
accountNamesFromTransactions ts = nub $ map account ts
|
||||||
|
|||||||
1
Utils.hs
1
Utils.hs
@ -57,3 +57,4 @@ treeany f t = (f $ root t) || (any (treeany f) $ branches t)
|
|||||||
-- treedrop -- remove the leaves which do fulfill predicate.
|
-- treedrop -- remove the leaves which do fulfill predicate.
|
||||||
-- treedropall -- do this repeatedly.
|
-- treedropall -- do this repeatedly.
|
||||||
|
|
||||||
|
strace a = trace (show a) a
|
||||||
@ -1,10 +1,10 @@
|
|||||||
|
#!/usr/bin/env runhaskell
|
||||||
{-
|
{-
|
||||||
hledger - ledger-compatible money management tool (& haskell study)
|
hledger - ledger-compatible money management tool (& haskell study)
|
||||||
GPLv3, (c) Simon Michael & contributors
|
GPLv3, (c) Simon Michael & contributors
|
||||||
A port of John Wiegley's ledger at http://newartisans.com/ledger.html
|
A port of John Wiegley's ledger at http://newartisans.com/ledger.html
|
||||||
|
|
||||||
The module/model hierarchy is roughly like this; each layer can only
|
Here is a rough overview of the module/model hierarchy:
|
||||||
reference things below it:
|
|
||||||
|
|
||||||
hledger
|
hledger
|
||||||
Options
|
Options
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user