X-Git-Url: http://git.hcoop.net/bpt/portal.git/blobdiff_plain/96662fd840ac70afa131ec2579d7ae5c8f02a091..e38fe5b0e18be227d05b0071de8773d4b8c02236:/money.mlt diff --git a/money.mlt b/money.mlt index 737d4b3..8e6f24c 100644 --- a/money.mlt +++ b/money.mlt @@ -1,5 +1,7 @@ <% @header [("title", ["MoneyMatters"])]; +val root = Group.inGroupNum 0; + ref showNormal = true; if $"hist" <> "" then @@ -64,9 +66,29 @@ 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) %><% + %>, <% Web.html (#name user) %> [History]<% + end +end %> +<% end %> + + +<% elseif $"cmd" = "nbals" then + showNormal := false; + val bals = Balance.listNegativeOwnedBalances () %> + +

Negative Active Balances (<% length bals %>)

+ + +<% foreach bal in bals do %> + <% end %> @@ -152,6 +174,7 @@ end %> <% elseif $"cmd" = "pay" then Group.requireGroupName "money"; + val uid = (case $"user" of "" => ~1 | s => Web.stoi s); showNormal := false %>

New member payment

@@ -160,17 +183,17 @@ 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 %>
- + @@ -322,19 +345,159 @@ foreach (name, cha) in Money.listChargesWithNames id do end %>
Description:
Date:
Date: ">
Amount:
Member:
+<% elseif $"cmd" = "paypal" then + showNormal := false; + val apps = App.searchPaypal ($"email"); + val users = Init.searchPaypal ($"email"); + + switch apps of + _ :: _ => + %>

Approved applications

+ + <% foreach appl in apps do %> +


+ + + + + + + <% switch #paypal appl of + SOME s => %> + <% end; + switch #checkout appl of + SOME s => %> + <% end %> + + + +
Received: <% #applied appl %>
Approved by: <% + ref first = true; + ref found = false; + foreach (id, name) in App.votes (#id appl) do + if first then + first := false + else + %>, <% + end + %><% name %><% + end %>
Username: <% #name appl %>
Real name: <% Web.html (#rname 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) %>
Other information: <% Web.htmlNl (#other appl) %>
+ + <% if root then %> + Add this member.
+ <% end + end + end; + + switch users of + _ :: _ => + %>

Members

+ + <% foreach user in users do %> +
  • <% #name user %> [add payment]
  • + <% end + end; + + switch (apps, users) of + (nil, nil) => %>No matches.<% + end + +elseif $"cmd" = "checkout" then + showNormal := false; + val apps = App.searchCheckout ($"email"); + val users = Init.searchCheckout ($"email"); + + switch apps of + _ :: _ => + %>

    Approved applications

    + + <% foreach appl in apps do %> +


    + + + + + + + <% switch #paypal appl of + SOME s => %> + <% end; + switch #checkout appl of + SOME s => %> + <% end %> + + + +
    Received: <% #applied appl %>
    Approved by: <% + ref first = true; + ref found = false; + foreach (id, name) in App.votes (#id appl) do + if first then + first := false + else + %>, <% + end + %><% name %><% + end %>
    Username: <% #name appl %>
    Real name: <% Web.html (#rname 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) %>
    Other information: <% Web.htmlNl (#other appl) %>
    + + <% if root then %> + Add this member.
    + <% end + end + end; + + switch users of + _ :: _ => + %>

    Members

    + + <% foreach user in users do %> +
  • <% #name user %> [add payment]
  • + <% end + end; + + switch (apps, users) of + (nil, nil) => %>No matches.<% + end + +elseif $"cmd" = "delinq" then + showNormal := false; + val dqs = Money.delinquentPledgers () %> + + +<% foreach dq in dqs do %> + <% end %> +
    Member Pledge Balance
    <% #name dq %> <% #shares dq %> $<% #balance dq %>
    + + Int.toString (#id dq)) dqs) %>">Lower these pledges to 1 + +<% elseif $"lower" <> "" then + Money.resetPledges (List.map Web.stoi (String.tokens (fn ch => ch = #",") ($"lower"))) + + %>

    Pledges reset.

    <% + +end %> + +<% if showNormal then + val you = Init.getUser(); + val bal = Balance.lookupBalance (#bal you); + val deposit = Balance.depositAmount (#id bal) %> + +

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

    -<% if showNormal then %> + -

    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 active balances
    +List negative active balances
    List retired balances
    <% if (Group.inGroupName "money" and $"lookback" = "") or $"audit" <> "" then %> +Drop pledges of delinquent members
    Switch to regular member view

    New transaction:
    @@ -343,6 +506,21 @@ end %> Generic/even

    Equalize balances
    +
    + +

    Look up a PayPal e-mail address

    + +
    + + +
    + +

    Look up a Google Checkout e-mail address

    + +
    + + +

    Most recent transactions