mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-08 07:09:28 +03:00
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 acctpats =
|
||||
addDataToAccountNameTree l $
|
||||
filterAccountNameTree acctpat $
|
||||
filterAccountNameTree acctpats $
|
||||
ledgerAccountNameTree l
|
||||
where acctpat = head acctpats
|
||||
|
||||
showLedgerAccounts :: Ledger -> Bool -> [String] -> String
|
||||
showLedgerAccounts l showsubs acctpats =
|
||||
|
@ -82,7 +82,10 @@ showAccountNameTree t =
|
||||
where
|
||||
topacct = indentAccountName 0 $ root t
|
||||
|
||||
filterAccountNameTree :: String -> Tree AccountName -> Tree AccountName
|
||||
filterAccountNameTree s = treefilter ((matchAccountName s) . accountLeafName)
|
||||
--any (flip matchAccountName . accountLeafName) acctpats
|
||||
filterAccountNameTree :: [String] -> Tree AccountName -> Tree AccountName
|
||||
filterAccountNameTree pats =
|
||||
treefilter matchany
|
||||
where
|
||||
matchany a = any (match a) pats
|
||||
match a pat = matchAccountName pat $ accountLeafName a
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user