[0000265] Changed Report List of Journal Entries to include balances.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 15 Oct 2010 15:30:39 +0000 (15:30 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 15 Oct 2010 15:30:39 +0000 (15:30 +0000)
CHANGELOG.txt
reporting/rep702.php

index 2d740ce8b7c2551a59a73460884e1cd98bdfd94e..fa846a1ce53a50803fd2054d1e6a9b0a9b659ccc 100644 (file)
@@ -20,8 +20,10 @@ Legend:
 $ -> Affected files
 
 15-Oct-2010 Joe Hunt
-# Customer Credit Note didn't update units when shifting items.
+# [0000263] Customer Credit Note didn't update units when shifting items.
 $ /sales/includes/ui/sales_credit_ui.inc
+! [0000265] Changed Report List of Journal Entries to include balances.
+$ /reporting/rep702.php
 
 14-Oct-2010 Joe Hunt
 # Check for empty class ID and better test for type/account id/name.
index 5a05470bb4dfa82954ee0e1b5cdf81a0cd6ce36e..c71daca67148071d24663c495f5ae6a153620df8 100644 (file)
@@ -71,13 +71,19 @@ function print_list_of_journal_entries()
     $trans = get_gl_transactions($from, $to, -1, null, 0, 0, $systype);
 
     $typeno = $type = 0;
+    $debit = $credit = 0.0;
     while ($myrow=db_fetch($trans))
     {
         if ($type != $myrow['type'] || $typeno != $myrow['type_no'])
         {
             if ($typeno != 0)
             {
-                $rep->Line($rep->row  + 4);
+                $rep->Line($rep->row += 6);
+                $rep->NewLine();
+               $rep->AmountCol(4, 5, $debit, $dec);
+               $rep->AmountCol(5, 6, abs($credit), $dec);
+               $debit = $credit = 0.0;
+                               $rep->Line($rep->row -= 4);
                 $rep->NewLine();
             }
             $typeno = $myrow['type_no'];
@@ -106,10 +112,14 @@ function print_list_of_journal_entries()
                $dim_str .= "/".$dim_str2;
         $rep->TextCol(2, 3, $dim_str);
         $rep->TextCol(3, 4, $myrow['memo_']);
-        if ($myrow['amount'] > 0.0)
+        if ($myrow['amount'] > 0.0) {
+               $debit += $myrow['amount'];
             $rep->AmountCol(4, 5, abs($myrow['amount']), $dec);
-        else
+        }    
+        else {
+               $credit += $myrow['amount'];
             $rep->AmountCol(5, 6, abs($myrow['amount']), $dec);
+        }    
         $rep->NewLine(1, 2);
     }
     $rep->Line($rep->row  + 4);