Fix reminder deposit calculation
authorAdam Chlipala <adamc@hcoop.net>
Sun, 11 May 2008 00:40:10 +0000 (00:40 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sun, 11 May 2008 00:40:10 +0000 (00:40 +0000)
remind/remind.sml

index c7e3f77..bb55f75 100644 (file)
@@ -12,6 +12,7 @@ fun printReal n =
        Real.fmt (StringCvt.FIX (SOME 2)) n
 
 val basePerMonth = 5.0
+val deposit = basePerMonth * 3.0
 
 fun main _ =
     let
@@ -29,7 +30,6 @@ fun main _ =
                val amount = C.realFromSql amount
 
                val perMonth = basePerMonth * real shares
-               val deposit = perMonth * 3.0
                val headsUp = deposit + perMonth * 2.0
            in
                if amount >= headsUp then
@@ -52,6 +52,9 @@ fun main _ =
                        write "\nCc: payment@hcoop.net";
                        write "\n\n";
 
+                       write "(This e-mail supercedes the one sent a few hours ago, which may have had an\n";
+                       write "incorrect deposit amount.)\n\n";
+
                        if amount < deposit then
                            (write "Your HCoop balance is negative.  This means that you've paid less than you've\n";
                             write "been charged to date, excluding your required deposit.  If your account hasn't\n";