X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep710.php;h=06485b2c2b20b828c103703bf93ab236763cad15;hb=c5dc92bf60148463852a81f74284117ce3fd1e92;hp=76f232b71d4fc67d1b8e020002ef6bb66a611aa1;hpb=11861a415cd5166003ee6b150096ccfe2540d138;p=fa-stable.git diff --git a/reporting/rep710.php b/reporting/rep710.php index 76f232b7..06485b2c 100644 --- a/reporting/rep710.php +++ b/reporting/rep710.php @@ -9,12 +9,12 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -$page_security = 15; +$page_security = 'SA_GLANALYTIC'; // ---------------------------------------------------------------- // $ Revision: 2.0 $ // Creator: Joe Hunt // date_: 2005-05-19 -// Title: List of Journal Entries +// Title: Audit Trail // ---------------------------------------------------------------- $path_to_root=".."; @@ -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"); @@ -55,7 +55,7 @@ function getTransactions($from, $to, $type, $user) function print_audit_trail() { - global $path_to_root; + global $path_to_root, $systypes_array; $from = $_POST['PARAM_0']; $to = $_POST['PARAM_1']; @@ -81,27 +81,27 @@ function print_audit_trail() $user_id = $usr['user_id']; $params = array( 0 => $comments, 1 => array('text' => _('Period'), 'from' => $from,'to' => $to), - 2 => array('text' => _('Type'), 'from' => ($systype != -1 ? systypes::name($systype) : _('All')), 'to' => ''), + 2 => array('text' => _('Type'), 'from' => ($systype != -1 ? $systypes_array[$systype] : _('All')), 'to' => ''), 3 => array('text' => _('User'), 'from' => ($user != -1 ? $user_id : _('All')), 'to' => '')); $rep = new FrontReport(_('Audit Trail'), "AuditTrail", user_pagesize()); $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); - $rep->Header(); + $rep->NewPage(); $trans = getTransactions($from, $to, $systype, $user); while ($myrow=db_fetch($trans)) { - $rep->TextCol(0, 1, sql2date($myrow['stamp'])); + $rep->TextCol(0, 1, sql2date(date("Y-m-d", $myrow['unix_stamp']))); if (user_date_format() == 0) $rep->TextCol(1, 2, date("h:i:s a", $myrow['unix_stamp'])); else $rep->TextCol(1, 2, date("H:i:s", $myrow['unix_stamp'])); $rep->TextCol(2, 3, $myrow['user_id']); $rep->TextCol(3, 4, sql2date($myrow['gl_date'])); - $rep->TextCol(4, 5, systypes::name($myrow['type'])); + $rep->TextCol(4, 5, $systypes_array[$myrow['type']]); $rep->TextCol(5, 6, $myrow['trans_no']); if ($myrow['gl_seq'] == null) $action = _('Changed');