From: Bernd Bleßmann Date: Fri, 19 Mar 2021 12:54:43 +0000 (+0100) Subject: Mahnungsbericht: zweite Sortierung (fast) immer nach Mahnungslauf … X-Git-Tag: kivitendo-mebil_0.1-0~9^2~413 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4e36326b1705bf924a5cd909a9658a481249af7e;p=kivitendo-erp.git Mahnungsbericht: zweite Sortierung (fast) immer nach Mahnungslauf … … bzw. dunning_id. Damit bleib das Zusammenfassen mehrer Rechnungen eines Laufes beim Sortieren erhalten, falls möglich. --- 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,