alte testpage für parts entfernen
[kivitendo-erp.git] / bin / mozilla / ic.pl
index 04257ce..3434861 100644 (file)
@@ -106,8 +106,6 @@ sub search {
   $form->{title} = $locale->text($form->{title});
   $form->{title} = $locale->text('Assemblies') if ($is_xyz{is_assembly});
 
-  $form->{jsscript} = 1;
-
   $form->{CUSTOM_VARIABLES}                  = CVar->get_configs('module' => 'IC');
   ($form->{CUSTOM_VARIABLES_FILTER_CODE},
    $form->{CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables'      => $form->{CUSTOM_VARIABLES},
@@ -1593,9 +1591,11 @@ sub form_header {
   my $no_default_bin_entry = { 'id' => '0', description => '--', 'BINS' => [ { id => '0', description => ''} ] };
   push @ { $form->{WAREHOUSES} }, $no_default_bin_entry;
   if (my $max = scalar @{ $form->{WAREHOUSES} }) {
-
-    my $default_warehouse_id = $::instance_conf->get_default_warehouse_id;
-    my $default_bin_id       = $::instance_conf->get_default_bin_id;
+    my ($default_warehouse_id, $default_bin_id);
+    if ($form->{action} eq 'add') { # default only for new entries
+      $default_warehouse_id = $::instance_conf->get_warehouse_id;
+      $default_bin_id       = $::instance_conf->get_bin_id;
+    }
     $form->{warehouse_id} ||= $default_warehouse_id || $form->{WAREHOUSES}->[$max -1]->{id};
     $form->{bin_id}       ||= $default_bin_id       ||  $form->{WAREHOUSES}->[$max -1]->{BINS}->[0]->{id};
   }
@@ -1608,16 +1608,11 @@ sub form_header {
     flash('info', $::locale->text('This partnumber is not unique. You should change it.'));
   }
 
-  # use JavaScript Calendar or not (yes!)
-  $form->{jsscript} = 1;
-
   my $units = AM->retrieve_units(\%myconfig, $form);
   $form->{ALL_UNITS} = [ map +{ name => $_ }, sort { $units->{$a}{sortkey} <=> $units->{$b}{sortkey} } keys %$units ];
 
   $form->{defaults} = AM->get_defaults();
 
-  $::request->{layout}->focus("#partnumber");
-
   $form->{CUSTOM_VARIABLES} = CVar->get_custom_variables('module' => 'IC', 'trans_id' => $form->{id});
 
   CVar->render_inputs('variables' => $form->{CUSTOM_VARIABLES}, show_disabled_message => 1)