X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=b17c9277ad788dc9d1448db3ec90207ba24abc24;hb=c00273147a2d400779fcdaf34f171b2180faa453;hp=d43575a9af6ca4a2e0029f738e08422833c4b924;hpb=29a315f2dc4187e5558315f76c3d27d11e287620;p=freeside.git diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index d43575a9a..b17c9277a 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw ( $cgi $query $custnum $cust_main $hashref $agent $referral @@ -470,6 +470,8 @@ foreach $item (sort keyfield_numerically @history) { $refund ||= 0; $balance += $charge - $payment; $balance -= $credit - $refund; + $balance = sprintf("%.2f", $balance); + $balance =~ s/^\-0\.00$/0.00/; #yay ieee fp print "",time2str("%D",$date),"", "$desc", @@ -485,7 +487,7 @@ foreach $item (sort keyfield_numerically @history) { "", ( $refund ? "\$".sprintf("%.2f",$refund) : '' ), "", - "\$" . sprintf("%.2f",$balance), + "\$" . $balance, "", "\n"; }