[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2473] trunk/scripts/payment.pl



Revision: 2473
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2473&view=rev
Author:   einhverfr
Date:     2009-03-04 21:05:53 +0000 (Wed, 04 Mar 2009)

Log Message:
-----------
Correcting number formatting safety issues on payment screen.

Modified Paths:
--------------
    trunk/scripts/payment.pl

Modified: trunk/scripts/payment.pl
===================================================================
--- trunk/scripts/payment.pl	2009-03-04 19:06:39 UTC (rev 2472)
+++ trunk/scripts/payment.pl	2009-03-04 21:05:53 UTC (rev 2473)
@@ -374,8 +374,6 @@
     $payment->{grand_total} = 0;
     for (@{$payment->{contact_invoices}}){
         my $contact_total = 0;
-        $_->{total_due} = $payment->format_amount(amount =>  $_->{total_due},
-                                                  money  => 1);
         for my $invoice (@{$_->{invoices}}){
             if (($payment->{action} ne 'update_payments') 
                   or (defined $payment->{"id_$_->{contact_id}"})){
@@ -406,7 +404,14 @@
             $_->{contact_total} = $contact_total;
             $payment->{grand_total} += $contact_total;
         }
+        $_->{total_due} = $payment->format_amount(amount =>  $_->{total_due},
+                                                  money  => 1);
+        $_->{contact_total} = $payment->format_amount(amount =>  $_->{contact_total},
+                                                  money  => 1);
     }
+    $payment->{grand_total} = $payment->format_amount(
+			amount =>  $payment->{grand_total},
+			money  => 1);
     @{$payment->{media_options}} = (
             {text  => $request->{_locale}->text('Screen'), 
              value => 'screen'});


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.