better SS payment process UI for negative balances, RT12728
authorlevinse <levinse>
Thu, 5 May 2011 02:26:59 +0000 (02:26 +0000)
committerlevinse <levinse>
Thu, 5 May 2011 02:26:59 +0000 (02:26 +0000)
fs_selfservice/FS-SelfService/cgi/make_payment.html

index 3bce674..bec37ca 100644 (file)
   <TD COLSPAN=7>
     <TABLE><TR><TD BGCOLOR="#ffffff">
 <%=
-    $amt = $balance;
-    $amt += $amt * $credit_card_surcharge_percentage/100
-       if $credit_card_surcharge_percentage > 0;
+    $amt = '';
+    if ( $balance > 0 ) {
+        $amt = $balance;
+        $amt += $amt * $credit_card_surcharge_percentage/100
+                                    if $credit_card_surcharge_percentage > 0;
+        $amt = sprintf("%.2f",$amt);
+    }
     '';
 %>
-      $<INPUT TYPE="text" NAME="amount" SIZE=8 VALUE="<%=sprintf("%.2f",$amt)%>">
+      $<INPUT TYPE="text" NAME="amount" SIZE=8 VALUE="<%=$amt%>">
     </TD></TR></TABLE>
   </TD>
 </TR>