handle multiple account patterns for balance report
This commit is contained in:
parent
1e1c819f4e
commit
dd202d3113
@ -108,9 +108,8 @@ ledgerAccountTreeMatching l showsubs [] =
|
|||||||
ledgerAccountTreeMatching l showsubs [".*"]
|
ledgerAccountTreeMatching l showsubs [".*"]
|
||||||
ledgerAccountTreeMatching l showsubs acctpats =
|
ledgerAccountTreeMatching l showsubs acctpats =
|
||||||
addDataToAccountNameTree l $
|
addDataToAccountNameTree l $
|
||||||
filterAccountNameTree acctpat $
|
filterAccountNameTree acctpats $
|
||||||
ledgerAccountNameTree l
|
ledgerAccountNameTree l
|
||||||
where acctpat = head acctpats
|
|
||||||
|
|
||||||
showLedgerAccounts :: Ledger -> Bool -> [String] -> String
|
showLedgerAccounts :: Ledger -> Bool -> [String] -> String
|
||||||
showLedgerAccounts l showsubs acctpats =
|
showLedgerAccounts l showsubs acctpats =
|
||||||
|
|||||||
@ -82,7 +82,10 @@ showAccountNameTree t =
|
|||||||
where
|
where
|
||||||
topacct = indentAccountName 0 $ root t
|
topacct = indentAccountName 0 $ root t
|
||||||
|
|
||||||
filterAccountNameTree :: String -> Tree AccountName -> Tree AccountName
|
filterAccountNameTree :: [String] -> Tree AccountName -> Tree AccountName
|
||||||
filterAccountNameTree s = treefilter ((matchAccountName s) . accountLeafName)
|
filterAccountNameTree pats =
|
||||||
--any (flip matchAccountName . accountLeafName) acctpats
|
treefilter matchany
|
||||||
|
where
|
||||||
|
matchany a = any (match a) pats
|
||||||
|
match a pat = matchAccountName pat $ accountLeafName a
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user