Historien Suchmaschine: Stacküberlauf vermeiden
[kivitendo-erp.git] / bin / mozilla / am.pl
index fbe5bb8..af30987 100644 (file)
@@ -24,7 +24,8 @@
 # GNU General Public License for more details.
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
 #======================================================================
 #
 # administration
@@ -46,6 +47,7 @@ use SL::DB::Printer;
 use SL::DB::Tax;
 use SL::DB::Language;
 use SL::DB::Default;
+use SL::DBUtils qw(selectall_array_query conv_dateq);
 use CGI;
 
 require "bin/mozilla/common.pl";
@@ -1255,8 +1257,9 @@ sub show_am_history {
 
   my @ids    = grep { $_ * 1 } selectall_array_query($form, $dbh, $query);
   my $daten .= shift @ids;
-  $daten    .= join '', map { " OR trans_id = $_" } @ids;
-
+  if (scalar(@ids) > 0 ) {
+    $daten  .= ' OR trans_id IN (' . join(',', @ids) . ')';
+  }
   my ($sort, $sortby) = split(/\-\-/, $form->{order});
   $sort =~ s/.*\.(.*)$/$1/;