my @a = (transdate, invnumber, name);
push @a, "employee" if $self->{l_employee};
my $sortorder = join ', ', $form->sort_columns(@a);
- $sortorder = $form->{sort} unless $sortorder;
-
+ $sortorder = $form->{sort} if $form->{sort};
+
$query .= "WHERE $where
ORDER by $sortorder";
my @a = (transdate, invnumber, name);
push @a, "employee" if $form->{l_employee};
my $sortorder = join ', ', $form->sort_columns(@a);
- $sortorder = $form->{sort} unless $sortorder;
+ $sortorder = $form->{sort} if $form->{sort};
$query .= "WHERE $where
ORDER by $sortorder";
my @a = (transdate, $invnumber, name);
my $sortorder = join ', ', $form->sort_columns(@a);
- $sortorder = $form->{sort} unless $sortorder;
+ $sortorder = $form->{sort} if $form->{sort};
$query .= " ORDER by $sortorder";
my $sortorder = $form->{sort};
$sortorder .= $form->{desc};
- $sortorder = $form->{sort} unless $sortorder;
+ $sortorder = $form->{sort} if $form->{sort};
my $query = "";
my $sortorder = join ', ',
("o.id", $form->sort_columns(transdate, $ordnumber, name));
- $sortorder = $form->{sort} unless $sortorder;
+ $sortorder = $form->{sort} if $form->{sort};
$query .= " AND lower($ordnumber) LIKE '$number'" if $form->{$ordnumber};
$query .= " AND o.transdate >= '$form->{transdatefrom}'"
my $ml = ($form->{db} eq 'ar') ? 1 : -1;
my $sortorder = join ', ', $form->sort_columns(qw(transdate invnumber name));
- $sortorder = $form->{sort} unless $sortorder;
+ $sortorder = $form->{sort} if $form->{sort};
$query = qq|SELECT a.id, '0' AS invoice, $transdate AS transdate,
a.invnumber, n.name, a.netamount,