X-Git-Url: https://git.hcoop.net/hcoop/zz_old/portal.git/blobdiff_plain/1fe415e08e00c6d35d0561f8213914d3c15532a4..bde01dd3ce0444d75da0f3837bede5a037a18f3d:/money.mlt diff --git a/money.mlt b/money.mlt index 2293821..74bc1f6 100644 --- a/money.mlt +++ b/money.mlt @@ -37,7 +37,7 @@ end %> <% elseif $"cmd" = "bals" then showNormal := false %> -

Balances

+

Active Balances

<% foreach bal in Balance.listOwnedBalances () do %> @@ -53,6 +53,45 @@ end %> <% end %>
+<% elseif $"cmd" = "deadbals" then + showNormal := false %> + +

Retired Balances

+ + +<% foreach bal in Balance.listUnownedBalances () do %> + +<% end %> +
<% #name bal %> <% #amount bal %> +<% switch Balance.listBalanceUsers (#id bal) of + [] => + | (user :: users) => + %><% Web.html (#name user) %> [History]<% + foreach user in users do + %>, <% Web.html (#name user) %> [History]<% + end +end %>
+ +<% elseif $"cmd" = "nbals" then + showNormal := false; + val bals = Balance.listNegativeOwnedBalances () %> + +

Negative Active Balances (<% length bals %>)

+ + +<% foreach bal in bals do %> + +<% end %> +
<% #name bal %> <% #amount bal %> +<% switch Balance.listBalanceUsers (#id bal) of + [] => + | (user :: users) => + %><% Web.html (#name user) %> [History]<% + foreach user in users do + %>, <% Web.html (#name user) %> [History]<% + end +end %>
+ <% elseif $"cmd" = "hosting" then Group.requireGroupName "money"; showNormal := false %> @@ -140,7 +179,13 @@ end %>
- + <% elseif $"cmd" = "pay2" then Group.requireGroupName "money"; val amount = Web.stor ($"amount"); + val descr = $"descr"; + val descr = iff descr = "" then $"descr2" else descr; val id = Money.addTransaction ($"descr", amount, $"d"); Money.addCharge {trn = id, usr = Web.stoi ($"usr"), amount = amount}; Money.applyCharges id; @@ -283,7 +330,7 @@ end %> -x + <% ref first = true; foreach (name, cha) in Money.listChargesWithNames id do if first then @@ -299,12 +346,17 @@ end %> <% if showNormal then %> -

Your balance: $<% #amount (Balance.lookupBalance (#bal (Init.getUser ()))) %>

+

Your balance: $<% #amount (Balance.lookupBalance (#bal (Init.getUser ()))) %>

+<% if (iff Group.inGroupName "money" then $"lookback" = "" else $"audit" <> "") then %>

Sum of all active balances: $<% Balance.sumOwnedBalances () %>

<% end %> List all transactions
-List all balances
+List active balances
+List negative active balances
+List retired balances
+ +<% if (Group.inGroupName "money" and $"lookback" = "") or $"audit" <> "" then %> -<% if Group.inGroupName "money" then %> +Switch to regular member view

New transaction:
Hosting bill
@@ -329,12 +381,20 @@ end %>
Description:
Description:
Date:
Amount:
Member:
Date: <% #d trn %>
Amount: $<% #amount trn %>
Distribution:
<% else %> +Switch to audit view
+<% val lookback = case $"lookback" of "" => 20 | lb => Web.stoi lb; + @payment [] %>

Your recent account activity

+ + Show most recent transactions. + +
+ -<% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), 20) do %> +<% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), lookback) do %> <% end %>
Date Description Amount
<% #d trn %> <% Web.html (#descr trn) %> <% amount %>/<% #amount trn %>