Let admins view their personal financial history; let anyone specify how many entries...
[hcoop/zz_old/portal.git] / money.mlt
index bd532be..3c504da 100644 (file)
--- a/money.mlt
+++ b/money.mlt
@@ -333,7 +333,9 @@ end %>
 <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" = "" 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>
@@ -357,15 +359,20 @@ end %>
 <% 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>
+<% else
+   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>