From 2f27bc01a01f89f0817b1206fde4928763cfecbd Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Wed, 15 Jul 2009 09:06:30 +0000 Subject: [PATCH] Removed some warnings and madeAudit Trail report MySql 3.23 compatible. --- CHANGELOG.txt | 3 ++- includes/date_functions.inc | 2 ++ reporting/rep710.php | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 86fdad7c..48bc5722 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/includes/date_functions.inc b/includes/date_functions.inc index 227a0b34..089eeb7e 100644 --- a/includes/date_functions.inc +++ b/includes/date_functions.inc @@ -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) diff --git a/reporting/rep710.php b/reporting/rep710.php index 76f232b7..605c343d 100644 --- a/reporting/rep710.php +++ b/reporting/rep710.php @@ -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"); -- 2.30.2