Removed some warnings and madeAudit Trail report MySql 3.23 compatible.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 15 Jul 2009 09:06:30 +0000 (09:06 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 15 Jul 2009 09:06:30 +0000 (09:06 +0000)
CHANGELOG.txt
includes/date_functions.inc
reporting/rep710.php

index 86fdad7c9b7a7cad83aa036bd927b37419a53e72..48bc5722cb4c2692e42d2591d0953457eb4a04ef 100644 (file)
@@ -35,7 +35,8 @@ $ /reporting/rep710.php
   /reporting/reports_main.php
   /reporting/includes/reports_classes.inc
 # Removed warning from COA report
-$ /gl/includes/db/gl_db_accounts.inc 
+$ /gl/includes/db/gl_db_accounts.inc
+  /includes/date_functions.inc
   /reporting/rep701.php
   
 13-Jul-2009 Joe Hunt
index 227a0b3472cdf7eced7cc660ed8e494e55ce67c0..089eeb7e3fbc3c730ff0906ee53b677f1caa4920 100644 (file)
@@ -360,6 +360,8 @@ and converts to a yyyy/mm/dd format */
                        $year = substr($date_,0,4);
                }
        }
+       else
+               $year = $month = $day = 0;
 
 //to modify assumption in 2030
        if ($date_system == 0)
index 76f232b71d4fc67d1b8e020002ef6bb66a611aa1..605c343d6cffed82c330910dbb7b6b231b010f1c 100644 (file)
@@ -30,8 +30,8 @@ print_audit_trail();
 
 function getTransactions($from, $to, $type, $user)
 {
-       $fromdate = date2sql($from);
-       $todate = date2sql($to);
+       $fromdate = date2sql($from) . " 00:00:00";
+       $todate = date2sql($to). " 23:59.59";
 
        $sql = "SELECT a.*, 
                SUM(IF(ISNULL(g.amount), NULL, IF(g.amount > 0, g.amount, 0))) AS amount,
@@ -45,8 +45,8 @@ function getTransactions($from, $to, $type, $user)
                $sql .= "AND a.type=$type ";
        if ($user != -1)        
                $sql .= "AND a.user='$user' ";
-       $sql .= "AND DATE(a.stamp) >= '$fromdate'
-                       AND DATE(a.stamp) <= '$todate'
+       $sql .= "AND a.stamp >= '$fromdate'
+                       AND a.stamp <= '$todate'
                GROUP BY a.trans_no,a.gl_seq,a.stamp    
                ORDER BY a.stamp,a.gl_seq";
     return db_query($sql,"No transactions were returned");