X-Git-Url: https://git.hcoop.net/bpt/portal.git/blobdiff_plain/d5f8418bc9167e9597c463175b38830ba17624b6..60465e67fb55c6fddb458407d5b10adafd6e214f:/money.mlt
diff --git a/money.mlt b/money.mlt
index 34002dd..dbad9a9 100644
--- a/money.mlt
+++ b/money.mlt
@@ -29,7 +29,29 @@ if $"hist" <> "" then
| _ => %>
multi | <%
end;
if admin then
- %>[Hosting] [Payment] [Other] |
+ %>[Bill] [Payment] [Other] |
+ [Delete] | <%
+end
+%><%
+end %>
+
+
+<% elseif $"cmd" = "primary" then
+ val admin = Group.inGroupName "money";
+ showNormal := false %>
+
+Primary Transactions
+
+
+ Date | Description | Amount | Last modified | Participants |
+<% foreach (amt, trn) in Money.listUserTransactions (valOf (Init.userNameToId "hcoop")) do %>
+ <% #d trn %> | <% Web.html (#descr trn) %> | <% #amount trn %> | <% #stamp trn %> |
+<% switch Money.listChargesWithNames (#id trn) of
+ [(name, cha)] => %><% name %> | <%
+ | _ => %>multi | <%
+end;
+if admin then
+ %>[Bill] [Payment] [Other] |
[Delete] | <%
end
%>
<%
@@ -47,7 +69,7 @@ end %>
<% switch Balance.listBalanceUsers (#id bal) of
[] =>
| (user :: users) =>
- %><% Web.html (#name user) %><%
+ %><% Web.html (#name user) %> [History]<%
foreach user in users do
%>, <% Web.html (#name user) %><%
end
@@ -153,6 +175,58 @@ end %>
%>Hosting transaction modified.
+<% elseif $"cmd" = "bill" then
+ Group.requireGroupName "money";
+ showNormal := false %>
+
+New bill for the co-op
+
+
+<% elseif $"cmd" = "dues" then
+ Group.requireGroupName "money";
+ showNormal := false %>
+
+Monthly dues
+
+
<% else %>
Switch to audit view
-<% val lookback = case $"lookback" of "" => 20 | lb => Web.stoi lb;
+<% val lookback = case $"lookback" of "" => 20 | "inf" => 0 | lb => Web.stoi lb;
@payment [] %>
Your recent account activity
+<% ref running = showBal;
+val trans = iff lookback = 0 then
+ Money.listUserTransactions (Init.getUserId ())
+ else
+ Money.listUserTransactionsLimit (Init.getUserId (), lookback) %>
- Date | Description | Amount |
-<% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), lookback) do %>
- <% #d trn %> | <% Web.html (#descr trn) %> | <% amount %>/<% #amount trn %> |
-<% end %>
+ Date | Description | Debit | Credit | Balance |
+<% foreach (amount, trn) in trans do %>
+ <% #d trn %> | <% Web.html (#descr trn) %> |
+<% if Util.lt (amount, 0.0) then %><% amount %><% end %> |
+<% if Util.ge (amount, 0.0) then %><% amount %><% end %> |
+<% running %> |
+<% running := Util.sub (running, amount)
+end %>
+<% if lookback <> 0 then %>
+Show all transactions
+<% end %>
<% end
end %>