val balanceNameToId : string -> int option
val sumOwnedBalances : unit -> real
+ val isNegative : balance -> bool
end
[amt] => C.realFromSql amt
| _ => raise Fail "sumOwnedBalance: no rows"
+fun isNegative (bal : balance) = #amount bal < 0.0
+
end
<% elseif $"cmd" = "unmigrated" then
showNormal := false;
+ ref negative = 0;
val users = Init.unmigratedUsers () %>
<h3>Unmigrated members (<% length users %>)</h3>
<table>
<% foreach user in users do %>
- <tr> <td><a href="user?id=<% #id user %>"><% Web.html (#name user) %></a></td> <td>
+ <tr> <td><a href="user?id=<% #id user %>"><% Web.html (#name user) %></a></td>
<% val bal = Balance.lookupBalance (#bal user);
-if #name bal <> #name user then %>
-<i><% Web.html (#name bal) %></i>
+if Balance.isNegative bal then
+ negative := negative + 1
+end %>
+<td><% #amount bal %></td><td>
+<%if #name bal <> #name user then %>
+ <i><% Web.html (#name bal) %></i>
<% end %>
- </td> </tr>
+</td> </tr>
<% end %>
</table>
+<p><% negative %> have negative balances.</p>
+
<% end %>
<% if showNormal then %>