<% else %>
<a href="?audit=1">Switch to audit view</a><br>
-<% val lookback = case $"lookback" of "" => 20 | lb => Web.stoi lb;
+<% val lookback = case $"lookback" of "" => 20 | "inf" => 0 | lb => Web.stoi lb;
@payment [] %>
<h3>Your recent account activity</h3>
<form>
- Show <input name="lookback" size="5" value="<% lookback %>"> most recent transactions.
+ Show <input name="lookback" size="5" value="<% iff lookback = 0 then 20 else lookback %>"> most recent transactions.
<input type="submit" value="Show">
</form>
-<% ref running = showBal %>
+<% ref running = showBal;
+val trans = iff lookback = 0 then
+ Money.listUserTransactions (Init.getUserId ())
+ else
+ Money.listUserTransactionsLimit (Init.getUserId (), lookback) %>
<table>
-<tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> <td><b>Balance</b></td></tr>
-<% 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> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Debit</b></td> <td><b>Credit</b></td> <td><b>Balance</b></td></tr>
+<% foreach (amount, trn) in trans do %>
+<tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td>
+<td align="right"><% if Util.lt (amount, 0.0) then %><% amount %><% end %></td>
+<td align="right"><% if Util.ge (amount, 0.0) then %><% amount %><% end %></td>
<td><% running %></tr>
<% running := Util.sub (running, amount)
end %>
</table>
+<% if lookback <> 0 then %>
+<a href="?lookback=inf">Show all transactions</a><br>
+<% end %>
<% end
end %>
<% running := Util.sub (running, amount)
end %>
</table>
+<a href="money?lookback=inf">Show all transactions</a><br>
<b>Balance: $<% showBal %></b><br>
<b>Deposit: $<% deposit %></b> (3 months of dues at the minimal <a href="pledge">pledge level</a>)
val sub : real * real -> real
val mult : int * real -> real
+ val lt : real * real -> bool
+ val ge : real * real -> bool
+
val validHost : string -> bool
val validDomain : string -> bool
val validEmail : string -> bool
fun sub (r1 : real, r2) = r1 - r2
fun mult (r1, r2) = real r1 * r2
+fun lt (r1 : real, r2) = r1 < r2
+fun ge (r1 : real, r2) = r1 >= r2
+
fun isIdent ch = Char.isLower ch orelse Char.isDigit ch orelse ch = #"-"
fun validHost s =