gelöschte Benutzer in ar/search ausblenden
[kivitendo-erp.git] / bin / mozilla / do.pl
index 45d807e..39cba4a 100644 (file)
@@ -174,7 +174,7 @@ sub order_links {
                'ids' => $form->{id});
 
   $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes currency));
-  $form->{shipto} = 1 if $form->{id};
+  $form->{shipto} = 1 if $form->{id} || $form->{convert_from_oe_ids};
 
   # get customer / vendor
   if ($form->{vc} eq 'vendor') {
@@ -266,8 +266,7 @@ sub form_header {
           if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
 
   my $vc = $form->{vc} eq "customer" ? "customers" : "vendors";
-  $form->get_lists("contacts"       => "ALL_CONTACTS",
-                   "shipto"         => "ALL_SHIPTO",
+  $form->get_lists("shipto"         => "ALL_SHIPTO",
                    "projects"       => {
                      "key"          => "ALL_PROJECTS",
                      "all"          => 0,
@@ -280,6 +279,15 @@ sub form_header {
                    "departments"    => "ALL_DEPARTMENTS",
                    "business_types" => "ALL_BUSINESS_TYPES",
     );
+  $::form->{ALL_CONTACTS}          = SL::DB::Manager::Contact->get_all(query => [
+    or => [
+      cp_cv_id => $::form->{"$::form->{vc}_id"} * 1,
+      and      => [
+        cp_cv_id => undef,
+        cp_id    => $::form->{cp_id} * 1
+      ]
+    ]
+  ]);
 
   map { $_->{value} = "$_->{description}--$_->{id}" } @{ $form->{ALL_DEPARTMENTS} };
   map { $_->{value} = "$_->{name}--$_->{id}"        } @{ $form->{ALL_VC} };
@@ -782,6 +790,7 @@ sub invoice {
   require "bin/mozilla/$form->{script}";
 
   my $currency = $form->{currency};
+  $form->{shipto} = 1 if $form->{convert_from_do_ids};
   invoice_links();
 
   if ($form->{ordnumber}) {
@@ -830,7 +839,7 @@ sub invoice {
 
   #  show pricegroup in newly loaded invoice when creating invoice from delivery order
   for my $i (1 .. $form->{rowcount}) {
-    $form->{"sellprice_pg_$i"} = join /--/, $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"};
+    $form->{"sellprice_pg_$i"} = join '--', $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"};
   }
   IS->get_pricegroups_for_parts(\%myconfig, \%$form);
   set_pricegroup($_) for 1 .. $form->{rowcount};
@@ -936,7 +945,7 @@ sub invoice_multi {
 
   #  show pricegroup in newly loaded invoice when creating invoice from delivery order
   for my $i (1 .. $form->{rowcount}) {
-    $form->{"sellprice_pg_$i"} = join /--/, $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"};
+    $form->{"sellprice_pg_$i"} = join '--', $form->{"sellprice_$i"}, $form->{"pricegroup_id_$i"};
   }
   IS->get_pricegroups_for_parts(\%myconfig, \%$form);
   set_pricegroup($_) for 1 .. $form->{rowcount};