Kundenbericht: richtig nach Kreditlimit, UStID und Amtsgericht sortieren
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 12 Dec 2019 11:57:31 +0000 (12:57 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 12 Dec 2019 11:57:31 +0000 (12:57 +0100)
SL/CT.pm

index 6a52ee7..0c20a6f 100644 (file)
--- a/SL/CT.pm
+++ b/SL/CT.pm
@@ -84,6 +84,9 @@ sub search {
       "salesman"           => "e.name",
       "payment"            => "pt.description",
       "pricegroup"         => "pg.pricegroup",
+      "ustid"              => "ct.ustid",
+      "creditlimit"        => "ct.creditlimit",
+      "commercial_court"   => "ct.commercial_court",
     );
 
   $form->{sort} ||= "name";
@@ -98,7 +101,7 @@ sub search {
   }
   my $sortdir   = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
 
-  if ($sortorder !~ /(business|id|discount|itime)/ && !$join_records) {
+  if ($sortorder !~ /(business|creditlimit|id|discount|itime)/ && !$join_records) {
     $sortorder  = "lower($sortorder) ${sortdir}";
   } else {
     $sortorder .= " ${sortdir}";