mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-28 21:02:04 +03:00
web: show a count of postings in each account
This commit is contained in:
parent
fb9fb50cfd
commit
9a5e5da3aa
@ -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 */
|
||||
|
@ -3,3 +3,4 @@
|
||||
#{indent}
|
||||
<a href="@?{accturl}">#{adisplay}
|
||||
<td.balance align=right>#{mixedAmountAsHtml abal}
|
||||
<td.numpostings align=right>(#{numpostingsinacct acct})
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user