Verkaufsrechnungen: Abteilungen sortiert anzeigen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 20 Jan 2017 16:31:05 +0000 (17:31 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 23 Jan 2017 10:54:22 +0000 (11:54 +0100)
bin/mozilla/is.pl

index 2f1f9b7..e73dc4f 100644 (file)
@@ -45,6 +45,7 @@ use English qw(-no_match_vars);
 
 use SL::DB::Default;
 use SL::DB::Customer;
+use SL::DB::Department;
 use SL::DB::Invoice;
 use SL::DB::PaymentTerm;
 
@@ -274,7 +275,7 @@ sub form_header {
                    "currencies"    => "ALL_CURRENCIES",
                    "price_factors" => "ALL_PRICE_FACTORS");
 
-  $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
+  $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted;
 
   # Projects
   my @old_project_ids = uniq grep { $_ } map { $_ * 1 } ($form->{"globalproject_id"}, map { $form->{"project_id_$_"} } 1..$form->{"rowcount"});
@@ -309,7 +310,6 @@ sub form_header {
       ]
     ]
   ]);
-  $TMPL_VAR{department_labels}     = sub { "$_[0]->{description}--$_[0]->{id}" };
 
   # currencies and exchangerate
   my @values = map { $_       } @{ $form->{ALL_CURRENCIES} };