my @a = (transdate, invnumber, name);
push @a, "employee" if $self->{l_employee};
- my $sortdir = $form->{sortdir} ? 'ASC' : 'DESC';
+ my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
my $sortorder = join(', ', map { "$_ $sortdir" } @a);
if (grep({ $_ eq $form->{sort} }
my @a = (transdate, invnumber, name);
push @a, "employee" if $form->{l_employee};
- my $sortdir = $form->{sortdir} ? 'ASC' : 'DESC';
+ my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
my $sortorder = join(', ', map { "$_ $sortdir" } @a);
if (grep({ $_ eq $form->{sort} }
"transaction_description" => "dord.transaction_description"
);
- my $sortdir = $form->{sortdir} ? 'ASC' : 'DESC';
+ my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
my $sortorder = "dord.id";
if ($form->{sort} && grep($form->{sort}, keys(%allowed_sort_columns))) {
$sortorder = $allowed_sort_columns{$form->{sort}};
push(@values, '%' . $form->{transaction_description} . '%');
}
- my $sortdir = $form->{sortdir} ? 'ASC' : 'DESC';
+ my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
my $sortorder = join(', ', map { "${_} ${sortdir} " } ("o.id", $form->sort_columns("transdate", $ordnumber, "name")));
my %allowed_sort_columns = (
"transdate" => "o.transdate",