web: show a count of postings in each account

This commit is contained in:
Simon Michael 2011-06-11 18:53:56 +00:00
parent fb9fb50cfd
commit 9a5e5da3aa
3 changed files with 5 additions and 1 deletions

View File

@ -24,6 +24,7 @@ body { backgroun
.balancereport .inacct { background-color:#eee; font-weight:bold; }
.notinacct, .notinacct :link, .notinacct :visited, .notinacct .negative { /*color:#aaa;*/ }
.balancereport .numpostings { padding-left:1em; color:#aaa; }
/*------------------------------------------------------------------------------------------*/
/* 2. font families & sizes */

View File

@ -3,3 +3,4 @@
#{indent}
<a href="@?{accturl}">#{adisplay}
<td.balance align=right>#{mixedAmountAsHtml abal}
<td.numpostings align=right>(#{numpostingsinacct acct})

View File

@ -62,7 +62,7 @@ postJournalR = handlePost
getRegisterR :: Handler RepHtml
getRegisterR = do
vd@VD{opts=opts,qopts=qopts,m=m,j=j} <- getViewData
let sidecontent = balanceReportAsHtml opts vd{q=""} $ balanceReport opts nullfilterspec j
let sidecontent = balanceReportAsHtml opts vd{q=""} $ balanceReport opts nullfilterspec j
maincontent =
case inAccountMatcher qopts of Just m' -> accountRegisterReportAsHtml opts vd $ accountRegisterReport opts j m m'
Nothing -> postingRegisterReportAsHtml opts vd $ postingRegisterReport opts nullfilterspec $ filterJournalPostings2 m j
@ -126,6 +126,8 @@ accountUrl a = "inacct:" ++ quoteIfSpaced a -- (accountNameToAccountRegex a)
balanceReportAsHtml :: [Opt] -> ViewData -> BalanceReport -> Hamlet AppRoute
balanceReportAsHtml _ vd@VD{here=here,q=q,m=m,qopts=qopts,j=j} (items,total) = $(Settings.hamletFile "balancereport")
where
l = journalToLedger nullfilterspec j
numpostingsinacct = length . apostings . ledgerAccount l
filtering = not $ null q
inacctmatcher = inAccountMatcher qopts
itemAsHtml :: ViewData -> BalanceReportItem -> Hamlet AppRoute