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

SF.net SVN: ledger-smb:[3096] trunk



Revision: 3096
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3096&view=rev
Author:   einhverfr
Date:     2010-10-12 22:45:28 +0000 (Tue, 12 Oct 2010)

Log Message:
-----------
Correcting discrepancy in payment summary due to partial cents handling

Modified Paths:
--------------
    trunk/UI/payments/payments_detail.html
    trunk/scripts/payment.pl

Modified: trunk/UI/payments/payments_detail.html
===================================================================
--- trunk/UI/payments/payments_detail.html	2010-10-12 18:55:11 UTC (rev 3095)
+++ trunk/UI/payments/payments_detail.html	2010-10-12 22:45:28 UTC (rev 3096)
@@ -227,7 +227,7 @@
 		ELSE ; 'name_has_no_vouchers' ; 
 		END
 		?>"><?lsmb r.contact_name ?></span></td>
-	<td class="invoice"><?lsmb r.total_due ?> 
+	<td class="invoice"><?lsmb r.to_pay ?> 
 		<?lsmb currency ?></td>
         <td>
 		<span class="details_select">

Modified: trunk/scripts/payment.pl
===================================================================
--- trunk/scripts/payment.pl	2010-10-12 18:55:11 UTC (rev 3095)
+++ trunk/scripts/payment.pl	2010-10-12 22:45:28 UTC (rev 3096)
@@ -422,6 +422,7 @@
     $payment->{grand_total} = 0;
     for (@{$payment->{contact_invoices}}){
         my $contact_total = 0;
+        my $contact_to_pay = 0;
         for my $invoice (@{$_->{invoices}}){
             if (($payment->{action} ne 'update_payments') 
                   or (defined $payment->{"id_$_->{contact_id}"})){
@@ -443,6 +444,7 @@
                     $payment->parse_amount(amount => $invoice->[3]) 
                     - $payment->parse_amount(amount => $invoice->[4])),
                                                     money  => 1);
+            $contact_to_pay +=  $payment->parse_amount(amount => $invoice[6]);
             my $fld = "payment_" . $invoice->[0];
             if (!defined $payment->{"$fld"} ){
                 $payment->{"$fld"} = $invoice->[6];
@@ -454,6 +456,7 @@
         if (($payment->{action} ne 'update_payments') 
                   or (defined $payment->{"id_$_->{contact_id}"})){
             $_->{contact_total} = $contact_total;
+            $_->{to_pay} = $contact_to_pay;
             $payment->{grand_total} += $contact_total;
         }
         $_->{total_due} = $payment->format_amount(amount =>  $_->{total_due},


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