X-Git-Url: https://git.hcoop.net/hcoop/portal.git/blobdiff_plain/b5dc79cabf7afd0adc34746aa0a050714cfe0eb4..573def24c0220a72beff4e3f5739a450d83de170:/money.mlt
diff --git a/money.mlt b/money.mlt
index 5977d09..de5fdb5 100644
--- a/money.mlt
+++ b/money.mlt
@@ -7,7 +7,7 @@ ref showNormal = true;
if $"hist" <> "" then
showNormal := false;
val id = Web.stoi ($"hist") %>
-
+
Date | Description | Amount |
<% foreach (amount, trn) in Money.listUserTransactions id do %>
<% #d trn %> | <% Web.html (#descr trn) %> | <% amount %>/<% #amount trn %> |
@@ -20,7 +20,7 @@ if $"hist" <> "" then
Transactions
-
+
Date | Description | Amount | Last modified | Participants |
<% foreach trn in Money.listTransactions () do %>
<% #d trn %> | <% Web.html (#descr trn) %> | <% #amount trn %> | <% #stamp trn %> |
@@ -42,10 +42,10 @@ end %>
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 %> |
+
<% #d trn %> | <% Web.html (#descr trn) %> | <% #amount trn %> | <% #stamp trn %> |
<% switch Money.listChargesWithNames (#id trn) of
[(name, cha)] => %><% name %> | <%
| _ => %>multi | <%
@@ -63,7 +63,7 @@ end %>
Active Balances
-
+
<% foreach bal in Balance.listOwnedBalances () do %>
<% #name bal %> | <% #amount bal %> |
<% switch Balance.listBalanceUsers (#id bal) of
@@ -82,7 +82,7 @@ end %> |
Retired Balances
-
+
<% foreach bal in Balance.listUnownedBalances () do %>
<% #name bal %> | <% #amount bal %> |
<% switch Balance.listBalanceUsers (#id bal) of
@@ -102,7 +102,7 @@ end %> |
Negative Active Balances (<% length bals %>)
-
+
<% foreach bal in bals do %>
<% #name bal %> | <% #amount bal %> |
<% switch Balance.listBalanceUsers (#id bal) of
@@ -285,6 +285,26 @@ end %> |
%>Payment transaction added.
+<% elseif $"cmd" = "stripeApply" then
+ val stripePmt = Money.lookupStripePayment ($"stripeId");
+ val txid = Money.applyStripePayment stripePmt;
+%>Stripe Payment Processed (Transaction <% txid %>)
+
+<% elseif $"cmd" = "stripeRejected" then
+%>Stripe Payment Rejected!
+
+<% elseif $"cmd" = "stripeReject" then
+ Group.requireGroupName "money";
+ showNormal := false;
+%>
+Are you sure you want to reject Stripe Payment <% $"stripeChargeId" %>?
+
+
<% elseif $"modPay" <> "" then
Group.requireGroupName "money";
showNormal := false;
@@ -497,6 +517,23 @@ end %>
(nil, nil) => %>No matches.<%
end
+elseif $"cmd" = "realname" then
+ showNormal := false;
+ val users = Init.searchRealName ($"rname");
+
+ switch users of
+ _ :: _ =>
+ %>Members
+
+ <% foreach user in users do %>
+ <% #name user %> [add payment]
+ <% end
+ end;
+
+ switch users of
+ nil => %>No matches.<%
+ end
+
elseif $"cmd" = "checkout" then
showNormal := false;
val apps = App.searchCheckout ($"email");
@@ -557,7 +594,7 @@ elseif $"cmd" = "checkout" then
elseif $"cmd" = "delinq" then
showNormal := false;
val dqs = Money.delinquentPledgers () %>
-
+
Member | Pledge | Balance |
<% foreach dq in dqs do %>
<% #name dq %> | <% #shares dq %> | $<% #balance dq %> |
@@ -574,10 +611,11 @@ elseif $"cmd" = "delinq" then
elseif $"cmd" = "freezeworthy" then
showNormal := false;
val dqs = Money.freezeworthyPledgers () %>
-
+
Member | Balance |
<% foreach dq in dqs do %>
- <% #name dq %> | $<% #balance dq %> |
+
<% #name dq %> | $<% #balance dq %> |
+[History] |
<% if #joinedThisMonth dq then %>(joined this month) | <% end %>
<% end %>
@@ -585,10 +623,10 @@ elseif $"cmd" = "freezeworthy" then
<% elseif $"cmd" = "bootworthy" then
showNormal := false;
val dqs = Money.bootworthyPledgers () %>
-
+
Member | Balance |
<% foreach dq in dqs do %>
- <% #name dq %> | $<% #balance dq %> |
+
<% #name dq %> | $<% #balance dq %> | [History] |
<% if #joinedThisMonth dq then %>(joined this month) | <% end %>
<% end %>
@@ -602,13 +640,12 @@ elseif $"cmd" = "freezeworthy" then
val showBal = Util.sub (#amount bal, deposit) %>
Your balance: $<% showBal %>
-Deposit: $<% deposit %> (3 months of dues at the minimal pledge level)
-Co-op balance: $<% #amount (Balance.lookupBalance (valOf (Balance.balanceNameToId "hcoop"))) %>
-
-
+Deposit: $<% deposit %> (3 months of dues at the minimal pledge level)
+
<% if (iff Group.inGroupName "money" then $"lookback" = "" else $"audit" <> "") then %>Sum of all active balances: $<% Balance.sumOwnedBalances () %>
<% end %>
-
+
+
+<% if (Group.inGroupName "money" and $"lookback" = "") or $"audit" <> "" then %>
+
+
+
Look up a PayPal e-mail address
+
-
Look up a Google Checkout e-mail address
+
+
+
Look up a Real Name
+
+
+
+Apply Stripe Payments
+
+
+Date | Member |
+ Name on Card |
+ Amount (After Fees) | | |
+
+<% foreach stripePmt in Money.listAllPendingStripePayments () do %>
+
+
+ <% #name (Init.lookupUser (#webuser_id stripePmt)) %> |
+ <% #paid_on stripePmt %> |
+ <% #card_name stripePmt %> |
+ $<% #net stripePmt %> |
+
+ |
+
+ |
+
+<% end %>
+
Most recent transactions
-
+
+
+
Date | Description | Amount | Participants | Replace | Delete |
<% foreach trn in Money.listTransactionsLimit 20 do %>
- <% #d trn %> | <% Web.html (#descr trn) %> | <% #amount trn %> |
+
<% #d trn %> | <% Web.html (#descr trn) %> | <% #amount trn %> |
<% switch Money.listChargesWithNames (#id trn) of
[(name, cha)] => %><% name %> | <%
| _ => %>multi | <%
@@ -662,26 +744,38 @@ end %>
<% else %>
+
+<% val lookback = case $"lookback" of "" => 20 | "inf" => 0 | lb => Web.stoi lb;
@payment [] %>
Your recent account activity
-<% ref running = showBal %>
-
- Date | Description | Amount | Balance |
-<% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), lookback) do %>
- <% #d trn %> | <% Web.html (#descr trn) %> | <% amount %>/<% #amount trn %> |
-<% running %> |
+<% ref running = showBal;
+val trans = iff lookback = 0 then
+ Money.listUserTransactions (Init.getUserId ())
+ else
+ Money.listUserTransactionsLimit (Init.getUserId (), lookback) %>
+
+ 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 %>