Use fritz volumes instead of deleuze volumes for disk space stats
[hcoop/portal.git] / money.mlt
index 5977d09..dbad9a9 100644 (file)
--- a/money.mlt
+++ b/money.mlt
@@ -663,25 +663,34 @@ end %>
 
 <% 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 %>