ref showNormal = true;
-if $"cmd" = "list" then
+if $"hist" <> "" then
+ showNormal := false;
+ val id = Web.stoi ($"hist") %>
+<table>
+<tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> </tr>
+<% foreach (amount, trn) in Money.listUserTransactions id do %>
+<tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td><% amount %>/<% #amount trn %></td> </tr>
+<% end %>
+</table>
+
+<% elseif $"cmd" = "list" then
+ val admin = Group.inGroupName "money";
showNormal := false %>
<h3><b>Transactions</b></h3>
<% foreach trn in Money.listTransactions () do %>
<tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td><% #amount trn %></td> <td><% #stamp trn %></td>
<% switch Money.listChargesWithNames (#id trn) of
- [(name, cha)] => %><td><a href="user?id=<% #usr cha %>"><% name %></a></td> </tr><%
- | _ => %><td><i>multi</i></td> </tr><%
+ [(name, cha)] => %><td><a href="user?id=<% #usr cha %>"><% name %></a></td><%
+ | _ => %><td><i>multi</i></td><%
+end;
+if admin then
+ %><td><a href="money?modHosting=<% #id trn %>">[Hosting]</a> <a href="money?modPay=<% #id trn %>">[Payment]</a> <a href="money?modEven=<% #id trn %>">[Other]</a></td>
+ <td><a href="money?del=<% #id trn %>">[Delete]</a></td><%
end
+%></tr><%
end %>
</table>
<% 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 %>"><% Web.html (#name user) %></a><%
foreach user in users do
- %>, <a href="user?id=<% # id user %>"><% Web.html (#name user) %></a><%
+ %>, <a href="money?hist=<% # id user %>"><% Web.html (#name user) %></a><%
end
end %></td> </tr>
<% end %>
Money.deleteTransaction id %>
<h3><b><% Web.html (#descr trn) %> deleted!</b></h3>
+<% elseif $"cmd" = "equalize" then
+ Group.requireGroupName "money";
+ Money.equalizeBalances ();
+ %><h3><b>Balances equalized</b></h3>
+
<% elseif $"trn" <> "" then
showNormal := false;
val id = Web.stoi ($"trn");
<% if showNormal then %>
+<h3><b>Your balance:</b> $<% #amount (Balance.lookupBalance (#bal (Init.getUser ()))) %></h3>
+
<a href="money?cmd=list">List all transactions</a><br>
<a href="money?cmd=bals">List all balances</a><br>
<a href="money?cmd=hosting">Hosting bill</a><br>
<a href="money?cmd=pay">Payment from member</a><br>
<a href="money?cmd=evenForm">Generic/even</a><br>
+<br>
+<a href="money?cmd=equalize">Equalize balances</a><br>
<h3><b>Most recent transactions</b></h3>