Listing negative balances
[hcoop/zz_old/portal.git] / money.mlt
index 737d4b3..74bc1f6 100644 (file)
--- a/money.mlt
+++ b/money.mlt
@@ -64,9 +64,29 @@ end %></td> </tr>
 <% switch Balance.listBalanceUsers (#id bal) of
          [] =>
        | (user :: users) =>
-               %><a href="money?hist=<% #id user %>"><% Web.html (#name user) %></a><%
+               %><a href="user?id=<% #id user %>"><% Web.html (#name user) %></a> <a href="money?hist=<% #id user %>">[History]</a><%
                foreach user in users do
-                       %>, <a href="money?hist=<% # id user %>"><% Web.html (#name user) %></a><%
+                       %>, <a href="user?id=<% #id user %>"><% Web.html (#name user) %></a> <a href="money?hist=<% #id user %>">[History]</a><%
+               end
+end %></td> </tr>
+<% end %>
+</table>
+
+<% elseif $"cmd" = "nbals" then
+       showNormal := false;
+       val bals =  Balance.listNegativeOwnedBalances () %>
+
+<h3>Negative Active Balances (<% length bals %>)</h3>
+
+<table>
+<% foreach bal in bals do %>
+<tr><td><% #name bal %></td> <td><% #amount bal %></td> <td>
+<% switch Balance.listBalanceUsers (#id bal) of
+         [] =>
+       | (user :: users) =>
+               %><a href="user?id=<% #id user %>"><% Web.html (#name user) %></a> <a href="money?hist=<% #id user %>">[History]</a><%
+               foreach user in users do
+                       %>, <a href="user?id=<% #id user %>"><% Web.html (#name user) %></a> <a href="money?hist=<% #id user %>">[History]</a><%
                end
 end %></td> </tr>
 <% end %>
@@ -331,6 +351,7 @@ end %>
 
 <a href="money?cmd=list">List all transactions</a><br>
 <a href="money?cmd=bals">List active balances</a><br>
+<a href="money?cmd=nbals">List negative active balances</a><br>
 <a href="money?cmd=deadbals">List retired balances</a><br>
 
 <% if (Group.inGroupName "money" and $"lookback" = "") or $"audit" <> "" then %>