From 4c996a3d4df205f272f6c6cb86c1cdfec1ade49d Mon Sep 17 00:00:00 2001 From: Udo Spallek Date: Fri, 6 Jan 2006 02:02:38 +0000 Subject: [PATCH] Solved 179, Dank an Anneli Huth Spalten Sortierung funktioniert nicht in Tabellen --- SL/AP.pm | 4 ++-- SL/AR.pm | 2 +- SL/BP.pm | 2 +- SL/IC.pm | 2 +- SL/OE.pm | 2 +- SL/RP.pm | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SL/AP.pm b/SL/AP.pm index 6475bf2ec..8be0c8f81 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -448,8 +448,8 @@ sub ap_transactions { 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"; diff --git a/SL/AR.pm b/SL/AR.pm index a6b0f42d3..c2c81e630 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -443,7 +443,7 @@ sub ar_transactions { 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"; diff --git a/SL/BP.pm b/SL/BP.pm index 2122a51d7..e77695426 100644 --- a/SL/BP.pm +++ b/SL/BP.pm @@ -185,7 +185,7 @@ sub get_spoolfiles { 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"; diff --git a/SL/IC.pm b/SL/IC.pm index b8815cc59..eb230ef9f 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -934,7 +934,7 @@ sub all_parts { my $sortorder = $form->{sort}; $sortorder .= $form->{desc}; - $sortorder = $form->{sort} unless $sortorder; + $sortorder = $form->{sort} if $form->{sort}; my $query = ""; diff --git a/SL/OE.pm b/SL/OE.pm index 4f54150f7..dc29ffaa1 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -125,7 +125,7 @@ sub transactions { 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}'" diff --git a/SL/RP.pm b/SL/RP.pm index 6c328326c..8879bced1 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -2088,7 +2088,7 @@ sub tax_report { 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, -- 2.20.1