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

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



Revision: 3126
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3126&view=rev
Author:   einhverfr
Date:     2011-03-12 00:13:48 +0000 (Sat, 12 Mar 2011)

Log Message:
-----------
Correcting subtotal bug and outstanding summary/detail mismatch

Modified Paths:
--------------
    trunk/LedgerSMB/AA.pm
    trunk/bin/aa.pl

Modified: trunk/LedgerSMB/AA.pm
===================================================================
--- trunk/LedgerSMB/AA.pm	2011-03-11 17:58:50 UTC (rev 3125)
+++ trunk/LedgerSMB/AA.pm	2011-03-12 00:13:48 UTC (rev 3126)
@@ -820,7 +820,7 @@
 		   SELECT count(a.id) as invnumber, min(a.transdate) as transdate,
 		          min(a.duedate) as duedate, 
 		          sum(a.netamount) as netamount, 
-		          sum(a.amount) as amount, 
+		          sum(a.amount::numeric(20,$p)) as amount, 
 		          sum(a.amount::numeric(20,$p)) 
                              - (sum(acs.amount::numeric(20,$p)) 
                                 * CASE WHEN '$table' = 'ar' THEN -1 ELSE 1 END)
@@ -851,7 +851,7 @@
         } else {
             $query = qq|
 		   SELECT a.id, a.invnumber, a.ordnumber, a.transdate,
-		          a.duedate, a.netamount, a.amount, 
+		          a.duedate, a.netamount, a.amount::numeric(20,$p), 
                           a.amount::numeric(20,$p) 
                           - sum(acs.amount::numeric(20,$p)) AS paid,
 		          a.invoice, a.datepaid, a.terms, a.notes,

Modified: trunk/bin/aa.pl
===================================================================
--- trunk/bin/aa.pl	2011-03-11 17:58:50 UTC (rev 3125)
+++ trunk/bin/aa.pl	2011-03-12 00:13:48 UTC (rev 3126)
@@ -1725,6 +1725,7 @@
 sub transactions {
     # it shouldn't be putting it into vendor_id or customer_id, but into 
     # entity_id, conforming to the new entity tables.
+    my $total_due = 0;
     if ( $form->{ $form->{vc} } ) {
         $form->{ $form->{vc} } = $form->unescape( $form->{ $form->{vc} } );
         ( $form->{ $form->{vc} }, $form->{"$form->{vc}_id"} ) =
@@ -2110,6 +2111,7 @@
             $ref->{amount} - $ref->{netamount},
             2, " " )
           . "</td>";
+        $total_due += $ref->{amount} - $ref->{paid};
         $column_data{due} = "<td align=right>"
           . $form->format_amount( \%myconfig, $ref->{amount} - $ref->{paid},
             2, "&nbsp;" )
@@ -2183,6 +2185,7 @@
         <td>&nbsp</td>|;
     my $total_data;
     for (@column_index){ $total_data->{$_} = "&nbsp;"; }
+    $total_data->{due} = $form->format_amount(\%myconfig, $total_due, $LedgerSMB::Sysconfig::decimal_places);
     $total_data->{netamount} = $form->format_amount(\%myconfig, $totalnetamount, $LedgerSMB::Sysconfig::decimal_places);
     $total_data->{amount} = $form->format_amount(\%myconfig, $totalamount, $LedgerSMB::Sysconfig::decimal_places);
     $total_data->{paid} = $form->format_amount(\%myconfig, $totalpaid, $LedgerSMB::Sysconfig::decimal_places);


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