From 56b09ede7319e2e1232f63c40fac25580e05258b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Tue, 4 Jun 2013 14:45:28 +0200 Subject: [PATCH] =?utf8?q?Standardlagerplatz=20nur=20f=C3=BCr=20neu=20ange?= =?utf8?q?legte=20Waren=20vorausw=C3=A4hlen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/ic.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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}; } -- 2.20.1