From: Jan Büren Date: Tue, 4 Jun 2013 12:45:28 +0000 (+0200) Subject: Standardlagerplatz nur für neu angelegte Waren vorauswählen X-Git-Tag: release-3.1.0beta1~383 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=56b09ede7319e2e1232f63c40fac25580e05258b;p=kivitendo-erp.git Standardlagerplatz nur für neu angelegte Waren vorauswählen --- diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 04257ce97..837b842b4 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1593,9 +1593,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_default_warehouse_id; + $default_bin_id = $::instance_conf->get_default_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}; }