Financial audit mode for anyone
[hcoop/zz_old/portal.git] / money.mlt
index bd532be..737d4b3 100644 (file)
--- a/money.mlt
+++ b/money.mlt
@@ -327,13 +327,15 @@ end %>
 <% if showNormal then %>
 
 <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 %>
+<% if (iff Group.inGroupName "money" then $"lookback" = "" else $"audit" <> "") 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 active balances</a><br>
 <a href="money?cmd=deadbals">List retired balances</a><br>
 
-<% if Group.inGroupName "money" then %>
+<% if (Group.inGroupName "money" and $"lookback" = "") or $"audit" <> "" then %>
+
+<a href="?lookback=20">Switch to regular member view</a><br>
 
 <br><b><u>New transaction:</u></b><br>
 <a href="money?cmd=hosting">Hosting bill</a><br>
@@ -358,14 +360,20 @@ end %>
 </table>
 
 <% else %>
-
-<h3><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=payment@hcoop.net&item_name=Member+payment+for+<% Init.getUserName () %>">Add to your balance with PayPal</a></h3>
+<a href="?audit=1">Switch to audit view</a><br>
+<% val lookback = case $"lookback" of "" => 20 | lb => Web.stoi lb;
+   @payment [] %>
 
 <h3>Your recent account activity</h3>
 
+<form>
+      Show <input name="lookback" size="5" value="<% lookback %>"> most recent transactions.
+      <input type="submit" value="Show">
+</form>
+
 <table>
 <tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> </tr>
-<% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), 20) do %>
+<% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), lookback) 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>