Revision 4e36326b
Von Bernd Bleßmann vor fast 4 Jahren hinzugefügt
SL/DN.pm | ||
---|---|---|
780 | 780 |
} |
781 | 781 |
|
782 | 782 |
my %sort_columns = ( |
783 |
'dunning_description' => [ qw(dn.dunning_description customername invnumber) ], |
|
784 |
'customername' => [ qw(customername invnumber) ], |
|
783 |
'dunning_description' => [ qw(dn.dunning_description da.dunning_id customername invnumber) ],
|
|
784 |
'customername' => [ qw(customername da.dunning_id invnumber) ],
|
|
785 | 785 |
'invnumber' => [ qw(a.invnumber) ], |
786 | 786 |
'transdate' => [ qw(a.transdate a.invnumber) ], |
787 | 787 |
'duedate' => [ qw(a.duedate a.invnumber) ], |
788 |
'dunning_date' => [ qw(dunning_date a.invnumber) ], |
|
789 |
'dunning_duedate' => [ qw(dunning_duedate a.invnumber) ], |
|
788 |
'dunning_date' => [ qw(dunning_date da.dunning_id a.invnumber) ],
|
|
789 |
'dunning_duedate' => [ qw(dunning_duedate da.dunning_id a.invnumber) ],
|
|
790 | 790 |
'salesman' => [ qw(salesman) ], |
791 | 791 |
); |
792 | 792 |
|
793 | 793 |
my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; |
794 | 794 |
my $sortkey = $sort_columns{$form->{sort}} ? $form->{sort} : 'customername'; |
795 |
my $sortorder = join ', ', map { "$_ $sortdir" } (@{ $sort_columns{$sortkey} }, 'da.dunning_id');
|
|
795 |
my $sortorder = join ', ', map { "$_ $sortdir" } @{ $sort_columns{$sortkey} };
|
|
796 | 796 |
|
797 | 797 |
my $query = |
798 | 798 |
qq|SELECT a.id, a.ordnumber, a.invoice, a.transdate, a.invnumber, a.amount, a.language_id, |
Auch abrufbar als: Unified diff
Mahnungsbericht: zweite Sortierung (fast) immer nach Mahnungslauf …
… bzw. dunning_id. Damit bleib das Zusammenfassen mehrer Rechnungen eines
Laufes beim Sortieren erhalten, falls möglich.