X-Git-Url: http://git.hcoop.net/hcoop/portal.git/blobdiff_plain/eca832d83526a0ebee0dc38195b3b99f8e4746c9..0142983cd82e445f507b08bffd39e6b6ce4a4c51:/money.mlt diff --git a/money.mlt b/money.mlt index 085c3aa..d92969b 100644 --- a/money.mlt +++ b/money.mlt @@ -7,7 +7,7 @@ ref showNormal = true; if $"hist" <> "" then showNormal := false; val id = Web.stoi ($"hist") %> - +
<% foreach (amount, trn) in Money.listUserTransactions id do %> @@ -20,7 +20,7 @@ if $"hist" <> "" then

Transactions

-
Date Description Amount
<% #d trn %> <% Web.html (#descr trn) %> <% amount %>/<% #amount trn %>
+
<% foreach trn in Money.listTransactions () do %> @@ -42,10 +42,10 @@ end %>

Primary Transactions

-
Date Description Amount Last modified Participants
<% #d trn %> <% Web.html (#descr trn) %> <% #amount trn %> <% #stamp trn %>
+
<% foreach (amt, trn) in Money.listUserTransactions (valOf (Init.userNameToId "hcoop")) do %> - + <% switch Money.listChargesWithNames (#id trn) of [(name, cha)] => %><% | _ => %><% @@ -63,7 +63,7 @@ end %>

Active Balances

-
Date Description Amount Last modified Participants
<% #d trn %> <% Web.html (#descr trn) %> <% #amount trn %> <% #stamp trn %>
<% #d trn %> <% Web.html (#descr trn) %> <% #amount trn %> <% #stamp trn %><% name %>multi
+
<% foreach bal in Balance.listOwnedBalances () do %>

Retired Balances

-
<% #name bal %> <% #amount bal %> <% switch Balance.listBalanceUsers (#id bal) of @@ -82,7 +82,7 @@ end %>
+
<% foreach bal in Balance.listUnownedBalances () do %>

Negative Active Balances (<% length bals %>)

-
<% #name bal %> <% #amount bal %> <% switch Balance.listBalanceUsers (#id bal) of @@ -102,7 +102,7 @@ end %>
+
<% foreach bal in bals do %>
<% #name bal %> <% #amount bal %> <% switch Balance.listBalanceUsers (#id bal) of @@ -258,7 +258,6 @@ 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; @@ -469,9 +488,6 @@ end %> <% switch #paypal appl of SOME s => %> - <% end; - switch #checkout appl of - SOME s => %> <% end %> @@ -543,9 +559,6 @@ elseif $"cmd" = "checkout" then <% switch #paypal appl of SOME s => %> - <% end; - switch #checkout appl of - SOME s => %> <% end %> @@ -574,7 +587,7 @@ elseif $"cmd" = "checkout" then elseif $"cmd" = "delinq" then showNormal := false; val dqs = Money.delinquentPledgers () %> -
Description:
E-mail address: <% #email appl %>
PayPal: <% s %>
Google Checkout: <% s %>
Forward e-mail? <% if #forward appl then %>yes<% else %>no<% end %>
Proposed uses: <% Web.htmlNl (#uses appl) %>
E-mail address: <% #email appl %>
PayPal: <% s %>
Google Checkout: <% s %>
Forward e-mail? <% if #forward appl then %>yes<% else %>no<% end %>
Proposed uses: <% Web.htmlNl (#uses appl) %>
+
<% foreach dq in dqs do %> @@ -591,10 +604,11 @@ elseif $"cmd" = "delinq" then elseif $"cmd" = "freezeworthy" then showNormal := false; val dqs = Money.freezeworthyPledgers () %> -
Member Pledge Balance
<% #name dq %> <% #shares dq %> $<% #balance dq %>
+
<% foreach dq in dqs do %> - + + <% if #joinedThisMonth dq then %><% end %> <% end %>
Member Balance
<% #name dq %> $<% #balance dq %>
<% #name dq %> $<% #balance dq %>[History](joined this month)
@@ -602,10 +616,10 @@ elseif $"cmd" = "freezeworthy" then <% elseif $"cmd" = "bootworthy" then showNormal := false; val dqs = Money.bootworthyPledgers () %> - +
<% foreach dq in dqs do %> - + <% if #joinedThisMonth dq then %><% end %> <% end %>
Member Balance
<% #name dq %> $<% #balance dq %>
<% #name dq %> $<% #balance dq %>[History](joined this month)
@@ -619,13 +633,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 %> - +
+

Financial Information

List all transactions
List primary transactions
List active balances
@@ -639,36 +652,81 @@ Co-op balance: $<% #amount (Balance.lookupBalance (valOf (Balance.balanceNameToI Drop pledges of delinquent members
Switch to regular member view
-
New transaction:
+<% end %> +
+ +<% if (Group.inGroupName "money" and $"lookback" = "") or $"audit" <> "" then %> +
+

New Transaction

Bill for the co-op
Payment from member
Monthly dues
New hosting bill (old style)
Generic/even

-Equalize balances
+
+
+
+

Look up a PayPal e-mail address

+
+ +

Look up a Real Name

+
+
+ +

Apply Stripe Payments

+ + + + + + +<% foreach stripePmt in Money.listAllPendingStripePayments () do %> + + + + + + + + + +<% end %> +
DateMemberName on CardAmount (After Fees)
<% #name (Init.lookupUser (#webuser_id stripePmt)) %><% #paid_on stripePmt %><% #card_name stripePmt %>$<% #net stripePmt %>
+ + + +
+
+ + + +
+

Most recent transactions

- + + +
<% foreach trn in Money.listTransactionsLimit 20 do %> - + <% switch Money.listChargesWithNames (#id trn) of [(name, cha)] => %><% | _ => %><% @@ -679,7 +737,10 @@ end %>
Date Description Amount Participants Replace Delete
<% #d trn %> <% Web.html (#descr trn) %> <% #amount trn %>
<% #d trn %> <% Web.html (#descr trn) %> <% #amount trn %><% name %>multi
<% else %> +
+

Switch to audit view
+

<% val lookback = case $"lookback" of "" => 20 | "inf" => 0 | lb => Web.stoi lb; @payment [] %> @@ -695,13 +756,13 @@ val trans = iff lookback = 0 then Money.listUserTransactions (Init.getUserId ()) else Money.listUserTransactionsLimit (Init.getUserId (), lookback) %> - +
<% foreach (amount, trn) in trans do %> - - - + + + <% running := Util.sub (running, amount) end %>
Date Description Debit Credit Balance
<% #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 %>
<% if Util.lt (amount, 0.0) then %><% amount %><% end %><% if Util.ge (amount, 0.0) then %><% amount %><% end %><% running %>