Finanzbuchhaltung: schönere »…verbucht«-Meldungen via Flash
[kivitendo-erp.git] / bin / mozilla / ap.pl
index 5f46115..a297bc6 100644 (file)
@@ -48,7 +48,6 @@ use SL::DB::PurchaseInvoice;
 use SL::Webdav;
 use SL::Locale::String qw(t8);
 
-require "bin/mozilla/arap.pl";
 require "bin/mozilla/common.pl";
 require "bin/mozilla/reportgenerator.pl";
 
@@ -693,7 +692,7 @@ sub post {
     }
     # /saving the history
     # Dieser Text wird niemals ausgegeben: Probleme beim redirect?
-    $form->redirect($locale->text('Transaction posted!')) unless $inline;
+    $form->redirect($locale->text('AP transaction posted.')) unless $inline;
   } else {
     $form->error($locale->text('Cannot post transaction!'));
   }
@@ -816,18 +815,16 @@ sub search {
   my %myconfig = %main::myconfig;
   my $locale   = $main::locale;
 
-  # setup customer selection
-  $form->all_vc(\%myconfig, "vendor", "AP");
-
   $form->{title}    = $locale->text('AP Transactions');
 
-  $form->get_lists("projects"     => { "key" => "ALL_PROJECTS", "all" => 1 },
-                   "vendors"      => "ALL_VC");
+  $form->get_lists(projects => { "key" => "ALL_PROJECTS", "all" => 1 });
 
-  $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
+  $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted;
   # constants and subs for template
   $form->{vc_keys}   = sub { "$_[0]->{name}--$_[0]->{id}" };
 
+  $::request->layout->add_javascripts("autocomplete_project.js");
+
   $form->header;
   print $form->parse_html_template('ap/search', { %myconfig });
 
@@ -864,8 +861,6 @@ sub ap_transactions {
 
   $main::auth->assert('vendor_invoice_edit');
 
-  ($form->{vendor}, $form->{vendor_id}) = split(/--/, $form->{vendor});
-
   report_generator_set_default_sort('transdate', 1);
 
   AP->ap_transactions(\%myconfig, \%$form);