X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FWH.pm;h=04b1914e003a29456e96e0f67483552a3d98dfd7;hb=217d32f3531a3565d647a1cfd0f3deb9b9ec1365;hp=a2df9f3b44ce2e59af0723caeea7029a5ec38632;hpb=72f25b5383e66ac43ffb0eeabdcc989f9ac4cb10;p=kivitendo-erp.git diff --git a/SL/WH.pm b/SL/WH.pm index a2df9f3b4..04b1914e0 100644 --- a/SL/WH.pm +++ b/SL/WH.pm @@ -398,7 +398,6 @@ sub get_warehouse_journal { ( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_partunit l_itime) ); $where_clause = defined($where_clause) ? $where_clause : ''; - $main::lxdebug->message(0, "where_clause = ".$where_clause); my $query = qq|SELECT DISTINCT $select{trans} FROM inventory i1 @@ -625,7 +624,12 @@ sub get_warehouse_report { my $sort_order = $form->{order}; $sort_col = $filter{sort} unless $sort_col; - $sort_col = "parts_id" unless $sort_col; + # falls $sort_col gar nicht in dem Bericht aufgenommen werden soll, + # führt ein entsprechenes order by $sort_col zu einem SQL-Fehler + # entsprechend parts_id als default lassen, wenn $sort_col UND l_$sort_col + # vorhanden sind (bpsw. l_partnumber = 'Y', für in Bericht aufnehmen). + # S.a. Bug 1597 jb 12.5.2011 + $sort_col = "parts_id" unless ($sort_col && $form->{"l_$sort_col"}); $sort_order = $filter{order} unless $sort_order; $sort_col =~ s/ASC|DESC//; # kill stuff left in from previous queries my $orderby = $sort_col;