val balance = Balance.lookupBalance (Web.stoi ($"mod")) %>
<h3><b>Modify balance record</b></h3>
-<form action="balances">
+<form action="balances" method="post">
<input type="hidden" name="id" value="<% $"mod" %>">
<table>
<tr> <td align="right"><b>Name</b>:</td> <td><input name="name" value="<% #name balance %>"></td> </tr>
<% end %>
-<% if showNormal then %>
+<% if showNormal then
+ ref total = 0.0 %>
<h3><b>New balance</b></h3>
-<form action="balances">
+<form action="balances" method="post">
<table>
<tr> <td align="right"><b>Name</b>:</td> <td><input name="name"></td> </tr>
<tr> <td><input type="submit" name="cmd" value="Create"></td> </tr>
<h3><b>Manage current balances</b></h3>
<table>
-<% foreach balance in Balance.listBalances () do %>
+<% foreach balance in Balance.listBalances () do
+ total := Util.add (total, #amount balance) %>
<tr> <td><% Web.html (#name balance) %></td> <td><% #amount balance %></td> <td><a href="balances?mod=<% #id balance %>">[Modify]</a> <a href="balances?del=<% #id balance %>">[Delete]</a></td> </tr>
<% end %>
</table>
+<br><b>Total</b>: $<% total %>
+
<% end %>
<% @footer [] %>