From ae71699d053c724351aea9bb5ad2039079da6624 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 30 Nov 2015 14:15:04 +0100 Subject: [PATCH] =?utf8?q?Setzt=20dois=5Fid=20f=C3=BCr=20inventory=20beim?= =?utf8?q?=20Standard-Auslagern?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit behebt Fehler #109 --- bin/mozilla/do.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index ac71eca9a..55c37adef 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -1720,6 +1720,9 @@ sub transfer_in_out_default { # dieser array_ref ist für DO->save da: # einmal die all_requests in YAML verwandeln, damit delivery_order_items_stock # gefüllt werden kann. + # could be dumped to the form in the first loop, + # but maybe bin_id and warehouse_id has changed to the "korrekturlager" with + # allowed negative qty ($::instance_conf->get_warehouse_id_ignore_onhand) ... my $i = 0; foreach (@all_requests){ $i++; @@ -1729,6 +1732,15 @@ sub transfer_in_out_default { save(no_redirect => 1); # Wir können auslagern, deshalb beleg speichern # und in delivery_order_items_stock speichern + + # ... and fill back the persistent dois_id for inventory fk + undef (@all_requests); + foreach my $i (1 .. $form->{rowcount}) { + next unless ($form->{"id_$i"} && $form->{"stock_${prefix}_$i"}); + foreach my $request (@{ DO->unpack_stock_information('packed' => $form->{"stock_${prefix}_$i"}) }) { + push @all_requests, $request; + } + } DO->transfer_in_out('direction' => $prefix, 'requests' => \@all_requests); -- 2.20.1