Putting new balance stuff into action
authorAdam Chlipala <adamc@hcoop.net>
Sat, 1 Mar 2008 19:30:52 +0000 (19:30 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sat, 1 Mar 2008 19:30:52 +0000 (19:30 +0000)
balance.sml
money.mlt
portal.mlt
remind/remind.sml

index 505cf47..05f6c3d 100644 (file)
@@ -113,11 +113,7 @@ fun depositAmount bal =
                              [n] => C.intFromSql n
                            | row => Init.rowError ("Bad depositAmount share count result", row)
     in
-       case C.oneRow db ($`SELECT 3.0 * 900.0 * SUM(shares) / ^(C.intToSql totalShares)
-                           FROM WebUserPaying
-                           WHERE bal = ^(C.intToSql bal)`) of
-           [amount] => C.realFromSql amount
-         | row => Init.rowError ("Bad depositAmount result", row)
+       3.0 * 900.0 / real totalShares
     end
 
 end
index 9c50d10..8e6f24c 100644 (file)
--- a/money.mlt
+++ b/money.mlt
@@ -483,10 +483,10 @@ end %>
    val bal = Balance.lookupBalance (#bal you);
    val deposit = Balance.depositAmount (#id bal) %>
 
-<!--h3>Your balance: $<% Util.sub (#amount bal, deposit) %><br>
-Deposit: $<% deposit %></b> (3 months of dues at your current <a href="pledge">pledge level</a>)</h3-->
+<h3>Your balance: $<% Util.sub (#amount bal, deposit) %><br>
+Deposit: $<% deposit %></b> (3 months of dues at the minimal <a href="pledge">pledge level</a>)</h3>
 
-<h3>Your balance: $<% #amount bal %></h3>
+<!--h3>Your balance: $<% #amount bal %></h3-->
 
 <% if (iff Group.inGroupName "money" then $"lookback" = "" else $"audit" <> "") then %><h3>Sum of all active balances: $<% Balance.sumOwnedBalances () %></h3><% end %>
 
index 2875bc2..8f0f553 100644 (file)
@@ -13,10 +13,10 @@ val deposit = Balance.depositAmount (#id bal);
 <tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td><% amount %>/<% #amount trn %></td> </tr>
 <% end %>
 </table>
-<!--b>Balance: $<% Util.sub (#amount bal, deposit) %></b><br>
-<b>Deposit: $<% deposit %></b> (3 months of dues at your current <a href="pledge">pledge level</a>)-->
+<b>Balance: $<% Util.sub (#amount bal, deposit) %></b><br>
+<b>Deposit: $<% deposit %></b> (3 months of dues at the minimal <a href="pledge">pledge level</a>)
 
-<b>Balance: $<% #amount bal %></b>
+<!--b>Balance: $<% #amount bal %></b-->
 
 <% val polls = Poll.listCurrentPolls ();
 switch polls of
index 64afa0c..61470ca 100644 (file)
@@ -27,8 +27,8 @@ fun main _ =
                val amount = C.realFromSql amount
 
                val perMonth = 900.0 * real shares / real totalShares
-               val deposit = perMonth * 3.0
-               val headsUp = perMonth * 5.0
+               val deposit = 900.0 / real totalShares * 3.0
+               val headsUp = deposit + perMonth * 2.0
            in
                if amount >= headsUp then
                    ()
@@ -76,9 +76,8 @@ fun main _ =
                        write (printReal (headsUp - amount));
 
                        write "\n\nYour deposit requirement was calculated by dividing our total monthly expenses\n";
-                       write "($900) by the sum of all members' pledge amounts, multiplying by your pledge amount,\n";
-                       write "and then multiplying by 3.  That is, the amount covers your share of three months'\n";
-                       write "expenses.\n\n";
+                       write "($900) by the sum of all members' pledge amounts and then multiplying by 3.  That\n";
+                       write "is, the amount covers a minimal share of three months' expenses.\n\n";
 
                        write "To make a payment, visit:\n";
                        write "     https://members.hcoop.net/\n";
@@ -86,8 +85,6 @@ fun main _ =
 
                        write "\nIf for whatever reason you don't plan to pay the amount suggested in this e-mail,\n";
                        write "_please_ don't stay silent.  Reply to this message explaining your circumstances.\n";
-                       write "We are doing limited-time monetary grants on request, due to the extra costs\n";
-                       write "associated with setting up our new servers.\n";
 
                        ignore (Mail.mclose m)
                    end