From 4e36326b1705bf924a5cd909a9658a481249af7e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 19 Mar 2021 13:54:43 +0100 Subject: [PATCH] =?utf8?q?Mahnungsbericht:=20zweite=20Sortierung=20(fast)?= =?utf8?q?=20immer=20nach=20Mahnungslauf=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … bzw. dunning_id. Damit bleib das Zusammenfassen mehrer Rechnungen eines Laufes beim Sortieren erhalten, falls möglich. --- SL/DN.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SL/DN.pm b/SL/DN.pm index 435f57873..f3969fc11 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -780,19 +780,19 @@ sub get_dunning { } my %sort_columns = ( - 'dunning_description' => [ qw(dn.dunning_description customername invnumber) ], - 'customername' => [ qw(customername invnumber) ], + 'dunning_description' => [ qw(dn.dunning_description da.dunning_id customername invnumber) ], + 'customername' => [ qw(customername da.dunning_id invnumber) ], 'invnumber' => [ qw(a.invnumber) ], 'transdate' => [ qw(a.transdate a.invnumber) ], 'duedate' => [ qw(a.duedate a.invnumber) ], - 'dunning_date' => [ qw(dunning_date a.invnumber) ], - 'dunning_duedate' => [ qw(dunning_duedate a.invnumber) ], + 'dunning_date' => [ qw(dunning_date da.dunning_id a.invnumber) ], + 'dunning_duedate' => [ qw(dunning_duedate da.dunning_id a.invnumber) ], 'salesman' => [ qw(salesman) ], ); my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; my $sortkey = $sort_columns{$form->{sort}} ? $form->{sort} : 'customername'; - my $sortorder = join ', ', map { "$_ $sortdir" } (@{ $sort_columns{$sortkey} }, 'da.dunning_id'); + my $sortorder = join ', ', map { "$_ $sortdir" } @{ $sort_columns{$sortkey} }; my $query = qq|SELECT a.id, a.ordnumber, a.invoice, a.transdate, a.invnumber, a.amount, a.language_id, -- 2.20.1