From c8abf2d9dff72d41e340aa0f6948c0c7583d736e Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 1 Mar 2008 19:30:52 +0000 Subject: [PATCH] Putting new balance stuff into action --- balance.sml | 6 +----- money.mlt | 6 +++--- portal.mlt | 6 +++--- remind/remind.sml | 11 ++++------- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/balance.sml b/balance.sml index 505cf47..05f6c3d 100644 --- a/balance.sml +++ b/balance.sml @@ -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 diff --git a/money.mlt b/money.mlt index 9c50d10..8e6f24c 100644 --- a/money.mlt +++ b/money.mlt @@ -483,10 +483,10 @@ end %> 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)

-

Your balance: $<% #amount bal %>

+ <% if (iff Group.inGroupName "money" then $"lookback" = "" else $"audit" <> "") then %>

Sum of all active balances: $<% Balance.sumOwnedBalances () %>

<% end %> diff --git a/portal.mlt b/portal.mlt index 2875bc2..8f0f553 100644 --- a/portal.mlt +++ b/portal.mlt @@ -13,10 +13,10 @@ val deposit = Balance.depositAmount (#id bal); <% #d trn %> <% Web.html (#descr trn) %> <% amount %>/<% #amount trn %> <% end %> - +Balance: $<% Util.sub (#amount bal, deposit) %>
+Deposit: $<% deposit %> (3 months of dues at the minimal pledge level) -Balance: $<% #amount bal %> + <% val polls = Poll.listCurrentPolls (); switch polls of diff --git a/remind/remind.sml b/remind/remind.sml index 64afa0c..61470ca 100644 --- a/remind/remind.sml +++ b/remind/remind.sml @@ -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 -- 2.20.1