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; }
 | 
					.balancereport .inacct                                               { background-color:#eee; font-weight:bold; }
 | 
				
			||||||
.notinacct, .notinacct :link, .notinacct :visited, .notinacct .negative  { /*color:#aaa;*/ }
 | 
					.notinacct, .notinacct :link, .notinacct :visited, .notinacct .negative  { /*color:#aaa;*/ }
 | 
				
			||||||
 | 
					.balancereport .numpostings                                          { padding-left:1em; color:#aaa; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*------------------------------------------------------------------------------------------*/
 | 
					/*------------------------------------------------------------------------------------------*/
 | 
				
			||||||
/* 2. font families & sizes */
 | 
					/* 2. font families & sizes */
 | 
				
			||||||
 | 
				
			|||||||
@ -3,3 +3,4 @@
 | 
				
			|||||||
  #{indent}
 | 
					  #{indent}
 | 
				
			||||||
  <a href="@?{accturl}">#{adisplay}
 | 
					  <a href="@?{accturl}">#{adisplay}
 | 
				
			||||||
 <td.balance align=right>#{mixedAmountAsHtml abal}
 | 
					 <td.balance align=right>#{mixedAmountAsHtml abal}
 | 
				
			||||||
 | 
					 <td.numpostings align=right>(#{numpostingsinacct acct})
 | 
				
			||||||
 | 
				
			|||||||
@ -126,6 +126,8 @@ accountUrl a = "inacct:" ++ quoteIfSpaced a -- (accountNameToAccountRegex a)
 | 
				
			|||||||
balanceReportAsHtml :: [Opt] -> ViewData -> BalanceReport -> Hamlet AppRoute
 | 
					balanceReportAsHtml :: [Opt] -> ViewData -> BalanceReport -> Hamlet AppRoute
 | 
				
			||||||
balanceReportAsHtml _ vd@VD{here=here,q=q,m=m,qopts=qopts,j=j} (items,total) = $(Settings.hamletFile "balancereport")
 | 
					balanceReportAsHtml _ vd@VD{here=here,q=q,m=m,qopts=qopts,j=j} (items,total) = $(Settings.hamletFile "balancereport")
 | 
				
			||||||
 where
 | 
					 where
 | 
				
			||||||
 | 
					   l = journalToLedger nullfilterspec j
 | 
				
			||||||
 | 
					   numpostingsinacct = length . apostings . ledgerAccount l
 | 
				
			||||||
   filtering = not $ null q
 | 
					   filtering = not $ null q
 | 
				
			||||||
   inacctmatcher = inAccountMatcher qopts
 | 
					   inacctmatcher = inAccountMatcher qopts
 | 
				
			||||||
   itemAsHtml :: ViewData -> BalanceReportItem -> Hamlet AppRoute
 | 
					   itemAsHtml :: ViewData -> BalanceReportItem -> Hamlet AppRoute
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user