From 602836d36728a0c3874ac90db0aaa8892826908d Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sat, 14 May 2011 09:43:17 +0200 Subject: [PATCH] Fixed wrong date displayed in View/Print transaction for edited journal entries. --- admin/db/transactions_db.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/admin/db/transactions_db.inc b/admin/db/transactions_db.inc index 0233bc50..293e8f4d 100644 --- a/admin/db/transactions_db.inc +++ b/admin/db/transactions_db.inc @@ -50,6 +50,11 @@ function get_sql_for_view_transactions($filtertype, $from, $to, &$trans_ref) elseif ($type_name != null) $sql .= " AND t.`$type_name` = ".db_escape($filtertype); + // the ugly hack below is necessary to exclude old gl_trans records lasting after edition, + // otherwise old data transaction can be retrieved instead of current one. + if ($table_name==TB_PREF.'gl_trans') + $sql .= " AND t.`amount` <> 0"; + $sql .= " GROUP BY ".($type_name ? "t.$type_name," : '')." t.$trans_no_name"; $sql .= " ORDER BY t.$trans_no_name"; return $sql; -- 2.30.2