Revision 262108d0
Von Moritz Bunkus vor mehr als 16 Jahren hinzugefügt
SL/AP.pm | ||
---|---|---|
464 | 464 |
|
465 | 465 |
my @a = (transdate, invnumber, name); |
466 | 466 |
push @a, "employee" if $self->{l_employee}; |
467 |
my $sortorder = join(', ', @a); |
|
467 |
my $sortdir = $form->{sortdir} ? 'ASC' : 'DESC'; |
|
468 |
my $sortorder = join(', ', map { "$_ $sortdir" } @a); |
|
468 | 469 |
|
469 | 470 |
if (grep({ $_ eq $form->{sort} } |
470 | 471 |
qw(transdate id invnumber ordnumber name netamount tax amount |
471 | 472 |
paid datepaid due duedate notes employee))) { |
472 |
$sortorder = $form->{sort}; |
|
473 |
$sortorder = $form->{sort} . " $sortdir";
|
|
473 | 474 |
} |
474 | 475 |
|
475 |
$query .= " ORDER by $sortorder";
|
|
476 |
$query .= " ORDER BY $sortorder";
|
|
476 | 477 |
|
477 | 478 |
my $sth = $dbh->prepare($query); |
478 | 479 |
$sth->execute(@values) || |
bin/mozilla/ap.pl | ||
---|---|---|
1376 | 1376 |
|
1377 | 1377 |
($form->{vendor}, $form->{vendor_id}) = split(/--/, $form->{vendor}); |
1378 | 1378 |
|
1379 |
$form->{sort} ||= 'transdate';
|
|
1379 |
report_generator_set_default_sort('transdate', 1);
|
|
1380 | 1380 |
|
1381 | 1381 |
AP->ap_transactions(\%myconfig, \%$form); |
1382 | 1382 |
|
... | ... | |
1413 | 1413 |
'globalprojectnumber' => { 'text' => $locale->text('Project Number'), }, |
1414 | 1414 |
); |
1415 | 1415 |
|
1416 |
foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid |
|
1417 |
employee shippingpoint shipvia)) {
|
|
1418 |
$column_defs{$name}->{link} = $href . "&sort=$name"; |
|
1416 |
foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia)) {
|
|
1417 |
my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
|
|
1418 |
$column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
|
|
1419 | 1419 |
} |
1420 | 1420 |
|
1421 | 1421 |
my %column_alignment = map { $_ => 'right' } qw(netamount tax amount paid due); |
... | ... | |
1428 | 1428 |
|
1429 | 1429 |
$report->set_export_options('ap_transactions', @hidden_variables); |
1430 | 1430 |
|
1431 |
$report->set_sort_indicator($form->{sort}, 1);
|
|
1431 |
$report->set_sort_indicator($form->{sort}, $form->{sortdir});
|
|
1432 | 1432 |
|
1433 | 1433 |
my @options; |
1434 | 1434 |
if ($form->{vendor}) { |
Auch abrufbar als: Unified diff
Sortierung in Berichten über Eingangsrechnungen/Kreditorenbuchungen auch auf- und absteigbar sortierbar gemacht.