<% elseif $"cmd" = "bals" then
showNormal := false %>
-<h3>Balances</h3>
+<h3>Active Balances</h3>
<table>
<% foreach bal in Balance.listOwnedBalances () do %>
<% end %>
</table>
+<% elseif $"cmd" = "deadbals" then
+ showNormal := false %>
+
+<h3>Retired Balances</h3>
+
+<table>
+<% foreach bal in Balance.listUnownedBalances () do %>
+<tr><td><% #name bal %></td> <td><% #amount bal %></td> <td>
+<% switch Balance.listBalanceUsers (#id bal) of
+ [] =>
+ | (user :: users) =>
+ %><a href="money?hist=<% #id user %>"><% Web.html (#name user) %></a><%
+ foreach user in users do
+ %>, <a href="money?hist=<% # id user %>"><% Web.html (#name user) %></a><%
+ end
+end %></td> </tr>
+<% end %>
+</table>
+
<% elseif $"cmd" = "hosting" then
Group.requireGroupName "money";
showNormal := false %>
<% if showNormal then %>
-<h3>Your balance:</b> $<% #amount (Balance.lookupBalance (#bal (Init.getUser ()))) %></h3>
+<h3>Your balance: $<% #amount (Balance.lookupBalance (#bal (Init.getUser ()))) %></h3>
+<% if Group.inGroupName "money" then %><h3>Sum of all active balances: $<% Balance.sumOwnedBalances () %></h3><% end %>
<a href="money?cmd=list">List all transactions</a><br>
-<a href="money?cmd=bals">List all balances</a><br>
+<a href="money?cmd=bals">List active balances</a><br>
+<a href="money?cmd=deadbals">List retired balances</a><br>
<% if Group.inGroupName "money" then %>