Finanzbuchhaltung: schönere »…verbucht«-Meldungen via Flash
[kivitendo-erp.git] / bin / mozilla / is.pl
index 2f1f9b7..6f71598 100644 (file)
@@ -45,11 +45,12 @@ 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;
 
+require "bin/mozilla/common.pl";
 require "bin/mozilla/io.pl";
-require "bin/mozilla/arap.pl";
 
 use strict;
 
@@ -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} };
@@ -841,9 +841,8 @@ sub post {
   if (!$form->{no_redirect_after_post}) {
     $form->{action} = 'edit';
     $form->{script} = 'is.pl';
-    $form->{saved_message} = $form->{label} . " $form->{invnumber} " . $locale->text('posted!');
     $form->{callback} = build_std_url(qw(action edit id callback saved_message));
-    $form->redirect;
+    $form->redirect($form->{label} . " $form->{invnumber} " . $locale->text('posted!'));
   }
 
   $main::lxdebug->leave_sub();