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

SF.net SVN: ledger-smb:[3112] trunk/LedgerSMB/AA.pm



Revision: 3112
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3112&view=rev
Author:   einhverfr
Date:     2011-01-06 20:33:32 +0000 (Thu, 06 Jan 2011)

Log Message:
-----------
Correcting fractional cent handling with outstanding report to make safe for configured precisions

Modified Paths:
--------------
    trunk/LedgerSMB/AA.pm

Modified: trunk/LedgerSMB/AA.pm
===================================================================
--- trunk/LedgerSMB/AA.pm	2011-01-06 18:07:15 UTC (rev 3111)
+++ trunk/LedgerSMB/AA.pm	2011-01-06 20:33:32 UTC (rev 3112)
@@ -809,6 +809,7 @@
     my $query;
     if ($form->{outstanding}){
         # $form->{ARAP} is safe since it is set in calling scripts and not passed from the UA
+        my $p = $LedgerSMB::Sysconfig::decimal_places;
         if ($form->{transdateto} eq ''){
             delete $form->{transdateto};
         }
@@ -818,8 +819,8 @@
 		          min(a.duedate) as duedate, 
 		          sum(a.netamount) as netamount, 
 		          sum(a.amount) as amount, 
-		          sum(a.amount::numeric(20,2)) 
-                             - sum(acs.amount::numeric(20,2)) AS paid,
+		          sum(a.amount::numeric(20,$p)) 
+                             - sum(acs.amount::numeric(20,$p)) AS paid,
 		          vce.name, vc.meta_number,
 		          a.entity_id, 
 		          d.description AS department, 
@@ -846,8 +847,8 @@
             $query = qq|
 		   SELECT a.id, a.invnumber, a.ordnumber, a.transdate,
 		          a.duedate, a.netamount, a.amount, 
-                          a.amount::numeric(20,2) 
-                          - sum(acs.amount::numeric(20,2)) AS paid,
+                          a.amount::numeric(20,$p) 
+                          - sum(acs.amount::numeric(20,$p)) AS paid,
 		          a.invoice, a.datepaid, a.terms, a.notes,
 		          a.shipvia, a.shippingpoint, 
 		          vce.name, vc.meta_number,


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