Revision 44bd0e51
Von Stephan Köhler vor etwa 19 Jahren hinzugefügt
SL/GL.pm | ||
---|---|---|
342 | 342 |
|
343 | 343 |
my $false = ($myconfig->{dbdriver} eq 'Pg') ? FALSE: q|'0'|; |
344 | 344 |
|
345 |
my $sortorder = join ', ', $form->sort_columns(qw(transdate reference source description accno)); |
|
346 |
my %ordinal = ( transdate => 6, |
|
347 |
reference => 4, |
|
348 |
source => 7, |
|
349 |
description => 5 ); |
|
350 |
map { $sortorder =~ s/$_/$ordinal{$_}/ } keys %ordinal; |
|
351 |
|
|
352 |
if ($form->{sort}) { |
|
353 |
$sortorder = $form->{sort} . ',' . $sortorder; |
|
354 |
} |
|
355 |
|
|
345 | 356 |
my $query = |
346 | 357 |
qq|SELECT g.id, 'gl' AS type, $false AS invoice, g.reference, ac.taxkey, t.taxkey AS sorttax, |
347 | 358 |
g.description, ac.transdate, ac.source, ac.trans_id, |
... | ... | |
371 | 382 |
AND ac.chart_id = c.id |
372 | 383 |
AND a.vendor_id = ct.id |
373 | 384 |
AND a.id = ac.trans_id |
374 |
ORDER BY transdate, trans_id, taxkey DESC, sorttax DESC, oid|;
|
|
385 |
ORDER BY $sortorder, oid|;
|
|
375 | 386 |
my $sth = $dbh->prepare($query); |
376 | 387 |
$sth->execute || $form->dberror($query); |
377 | 388 |
my $trans_id = ""; |
Auch abrufbar als: Unified diff
Merge von 737 aus unstable: Bugfix 125
BUG 125 solved. (Dank an Hartmut Goebel)