Revision 19688fca
Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt
SL/WH.pm | ||
---|---|---|
301 | 301 |
$filter{na} = '-' unless $filter{na}; |
302 | 302 |
|
303 | 303 |
# make order, search in $filter and $form |
304 |
$form->{sort} = $filter{sort} unless $form->{sort}; |
|
305 |
$form->{order} = ($form->{sort} = 'itime') unless $form->{sort}; |
|
306 |
$form->{sort} = 'itime' if $form->{sort} eq "date"; |
|
307 |
$form->{order} = $filter{order} unless $form->{order}; |
|
308 |
$form->{sort} .= (($form->{order}) ? " DESC" : " ASC"); |
|
304 |
my $sort_col = $form->{sort}; |
|
305 |
my $sort_order = $form->{order}; |
|
306 |
|
|
307 |
$sort_col = $filter{sort} unless $sort_col; |
|
308 |
$sort_order = ($sort_col = 'itime') unless $sort_col; |
|
309 |
$sort_col = 'itime' if $sort_col eq 'date'; |
|
310 |
$sort_order = $filter{order} unless $sort_order; |
|
311 |
my $sort_spec = "${sort_col} " . ($sort_order ? " DESC" : " ASC"); |
|
309 | 312 |
|
310 | 313 |
my $where_clause = join(" AND ", @filter_ary) . " AND " if (@filter_ary); |
311 | 314 |
|
... | ... | |
400 | 403 |
WHERE $where_clause i1.qty > 0 AND |
401 | 404 |
i1.trans_id IN ( SELECT i.trans_id FROM inventory i GROUP BY i.trans_id HAVING COUNT(i.trans_id) = 1 ) |
402 | 405 |
GROUP BY $group_clause |
403 |
ORDER BY r_$form->{sort}|;
|
|
406 |
ORDER BY r_${sort_spec}|;
|
|
404 | 407 |
|
405 | 408 |
my $sth = prepare_execute_query($form, $dbh, $query, @filter_vars, @filter_vars, @filter_vars); |
406 | 409 |
|
... | ... | |
521 | 524 |
map { $form->{"l_${_}id"} = "Y" if ($form->{"l_${_}description"} || $form->{"l_${_}number"}); } qw(warehouse bin); |
522 | 525 |
|
523 | 526 |
# make order, search in $filter and $form |
524 |
$form->{sort} = $filter{sort} unless $form->{sort}; |
|
525 |
$form->{sort} = "parts_id" unless $form->{sort}; |
|
526 |
$form->{order} = $filter{order} unless $form->{order}; |
|
527 |
$form->{sort} =~ s/ASC|DESC//; # kill stuff left in from previous queries |
|
528 |
my $orderby = $form->{sort}; |
|
529 |
$form->{sort} .= (($form->{order}) ? " DESC" : " ASC"); |
|
527 |
my $sort_col = $form->{sort}; |
|
528 |
my $sort_order = $form->{order}; |
|
529 |
|
|
530 |
$sort_col = $filter{sort} unless $sort_col; |
|
531 |
$sort_col = "parts_id" unless $sort_col; |
|
532 |
$sort_order = $filter{order} unless $sort_order; |
|
533 |
$sort_col =~ s/ASC|DESC//; # kill stuff left in from previous queries |
|
534 |
my $orderby = $sort_col; |
|
535 |
my $sort_spec = "${sort_col} " . ($sort_order ? " DESC" : " ASC"); |
|
530 | 536 |
|
531 | 537 |
my $where_clause = join " AND ", ("1=1", @filter_ary); |
532 | 538 |
|
... | ... | |
571 | 577 |
$joins |
572 | 578 |
WHERE $where_clause |
573 | 579 |
GROUP BY $group_clause $group_by |
574 |
ORDER BY $form->{sort}|;
|
|
580 |
ORDER BY $sort_spec|;
|
|
575 | 581 |
|
576 | 582 |
my $sth = prepare_execute_query($form, $dbh, $query, @filter_vars); |
577 | 583 |
|
Auch abrufbar als: Unified diff
Beim PDF- und CSV-Export der verschiedenen Berichte die vorherige Sortierreihenfolge beibehalten.
Fix für Bug 845.