X-Git-Url: http://git.hcoop.net/hcoop/portal.git/blobdiff_plain/27e65914536e13f127861bd35ee3678c99872900..a0399d9eb81953e028a4a2a04f3ccecfe6ac087b:/money.mlt diff --git a/money.mlt b/money.mlt index 8ca3486..59b6d9b 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)] => %><% | _ => %><% @@ -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; @@ -348,7 +368,7 @@ end %>
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
- + @@ -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 () %> -
    Description:
    Description:
    Date:
    Amount/pledge:
    +
    <% foreach dq in dqs do %> @@ -588,7 +625,8 @@ elseif $"cmd" = "freezeworthy" then
    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 %>(joined this month)
    @@ -597,16 +635,18 @@ elseif $"cmd" = "freezeworthy" then <% if showNormal then val you = Init.getUser(); val bal = Balance.lookupBalance (#bal you); - val deposit = Balance.depositAmount (#id bal) %> + val deposit = Balance.depositAmount (#id bal); + val showBal = Util.sub (#amount bal, deposit) %> -

    Your balance: $<% Util.sub (#amount bal, deposit) %>
    -Deposit: $<% deposit %> (3 months of dues at the minimal pledge level)
    +

    Your balance: $<% showBal %>
    +Deposit: $<% deposit %> (3 months of dues at the minimal pledge level)
    Co-op balance: $<% #amount (Balance.lookupBalance (valOf (Balance.balanceNameToId "hcoop"))) %>

    <% 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
    @@ -620,7 +660,12 @@ 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
    @@ -629,27 +674,67 @@ Co-op balance: $<% #amount (Balance.lookupBalance (valOf (Balance.balanceNameToI
    Equalize balances

    +
    +
    +

    Look up a PayPal e-mail address

    +
    + -

    Look up a Google Checkout 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)] => %><% | _ => %><% @@ -660,23 +745,38 @@ 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 | lb => Web.stoi lb; +

    +<% val lookback = case $"lookback" of "" => 20 | "inf" => 0 | lb => Web.stoi lb; @payment [] %>

    Your recent account activity

    - Show most recent transactions. + Show most recent transactions.
    - - -<% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), lookback) do %> - -<% end %> +<% ref running = showBal; +val trans = iff lookback = 0 then + Money.listUserTransactions (Init.getUserId ()) + else + Money.listUserTransactionsLimit (Init.getUserId (), lookback) %> +
    Date Description Amount
    <% #d trn %> <% Web.html (#descr trn) %> <% amount %>/<% #amount trn %>
    + +<% 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 lookback <> 0 then %> +Show all transactions
    +<% end %> <% end end %>