Revision 679db39f
Von Moritz Bunkus vor mehr als 16 Jahren hinzugefügt
SL/AR.pm | ||
---|---|---|
468 | 468 |
|
469 | 469 |
my @a = (transdate, invnumber, name); |
470 | 470 |
push @a, "employee" if $form->{l_employee}; |
471 |
my $sortorder = join(', ', @a); |
|
471 |
my $sortdir = $form->{sortdir} ? 'ASC' : 'DESC'; |
|
472 |
my $sortorder = join(', ', map { "$_ $sortdir" } @a); |
|
472 | 473 |
|
473 | 474 |
if (grep({ $_ eq $form->{sort} } |
474 | 475 |
qw(id transdate duedate invnumber ordnumber name |
475 | 476 |
datepaid employee shippingpoint shipvia))) { |
476 |
$sortorder = $form->{sort}; |
|
477 |
$sortorder = $form->{sort} . " $sortdir";
|
|
477 | 478 |
} |
478 | 479 |
|
479 |
$query .= " WHERE $where ORDER by $sortorder";
|
|
480 |
$query .= " WHERE $where ORDER BY $sortorder";
|
|
480 | 481 |
|
481 | 482 |
my $sth = $dbh->prepare($query); |
482 | 483 |
$sth->execute(@values) || |
bin/mozilla/ar.pl | ||
---|---|---|
1457 | 1457 |
$form->{customer} = $form->unescape($form->{customer}); |
1458 | 1458 |
($form->{customer}, $form->{customer_id}) = split(/--/, $form->{customer}); |
1459 | 1459 |
|
1460 |
$form->{sort} ||= 'transdate';
|
|
1460 |
report_generator_set_default_sort('transdate', 1);
|
|
1461 | 1461 |
|
1462 | 1462 |
AR->ar_transactions(\%myconfig, \%$form); |
1463 | 1463 |
|
... | ... | |
1500 | 1500 |
'marge_percent' => { 'text' => $locale->text('Ertrag prozentual'), }, |
1501 | 1501 |
); |
1502 | 1502 |
|
1503 |
foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid |
|
1504 |
employee shippingpoint shipvia)) {
|
|
1505 |
$column_defs{$name}->{link} = $href . "&sort=$name"; |
|
1503 |
foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia)) {
|
|
1504 |
my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
|
|
1505 |
$column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
|
|
1506 | 1506 |
} |
1507 | 1507 |
|
1508 | 1508 |
my %column_alignment = map { $_ => 'right' } qw(netamount tax amount paid due); |
... | ... | |
1515 | 1515 |
|
1516 | 1516 |
$report->set_export_options('ar_transactions', @hidden_variables); |
1517 | 1517 |
|
1518 |
$report->set_sort_indicator($form->{sort}, 1);
|
|
1518 |
$report->set_sort_indicator($form->{sort}, $form->{sortdir});
|
|
1519 | 1519 |
|
1520 | 1520 |
my @options; |
1521 | 1521 |
if ($form->{customer}) { |
Auch abrufbar als: Unified diff
Sortierung in Berichten über Ausgangsrechnungen/Debitorenbuchungen auch auf- und absteigbar sortierbar gemacht.