Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / fs_selfservice / FS-SelfService / cgi / small_custview.html
index 8d6e073..bcbdbda 100644 (file)
@@ -1,7 +1,7 @@
 <DIV ID="fs_small_custview">
   
-Customer #<B><%= $custnum %></B>
- - <B><FONT COLOR="#<%= $statuscolor %>"><%= ucfirst($status)%></FONT></B>
+Customer #<B><%= $display_custnum %></B>
+ - <B><FONT COLOR="#<%= $statuscolor %>"><%= $status_label %></FONT></B>
 
 <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="<%= $box_bgcolor ||= '#c0c0c0' %>">
   <TR>
@@ -10,10 +10,10 @@ Customer #<B><%= $custnum %></B>
             ? '<I><FONT SIZE="-1">Billing Address</FONT></I><BR>'
             : ''
       %>
-      <%= $first %> <%= $last %><BR>
-      <%= $company ? $company.'<BR>' : '' %>
-      <%= $address1 %><BR>
-      <%= $address2 ? $address2.'<BR>' : '' %>
+      <%= encode_entities($first) %> <%= encode_entities($last) %><BR>
+      <%= $company ? encode_entities($company).'<BR>' : '' %>
+      <%= encode_entities($address1) %><BR>
+      <%= $address2 ? encode_entities($address2).'<BR>' : '' %>
       <%= $city %>, <%= $state %> <%= $zip %><BR>
       <%= $country && $country ne ($countrydefault||'US')
             ? $country.'<BR>'
@@ -59,10 +59,17 @@ Customer #<B><%= $custnum %></B>
 
 </TR></TABLE>
 
-<%= unless ( $access_pkgnum ) {
-      $OUT .= '<BR>Balance: <B>$'. $balance. '</B><BR>';
-    }
-    '';
+<%= 
+unless ( $access_pkgnum ) {
+  if ($balance >= 0) {
+    $OUT .= '<BR>Balance: <B>'. $balance_pretty . '</B><BR>';
+  } else {
+    my $credit_balance_pretty = $balance_pretty;
+    $credit_balance_pretty =~ s/-//;
+    $OUT .= '<BR>Credit Balance: <B>'. $credit_balance_pretty . '</B><BR>';
+  }
+}
+'';
 %>
 
 </DIV>