From: Jan Büren Date: Thu, 9 Jun 2016 13:05:42 +0000 (+0200) Subject: Weitere Änderungen für den revert von 7735019 X-Git-Tag: release-3.4.1~81 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=583f1f0fb395147c5e6459d9c6569bdf8735ec3f;p=kivitendo-erp.git Weitere Änderungen für den revert von 7735019 Damit ist das Ticket #144 erledigt. --- diff --git a/SL/OE.pm b/SL/OE.pm index 3666f7d90..c4e768be0 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -658,8 +658,12 @@ SQL dbh => $dbh); # link previous items with orderitems - foreach (qw(orderitems invoice)) { - if (!$form->{saveasnew} && !$form->{useasnew} && $form->{"converted_from_${_}_id_$i"}) { + # assume we have a new workflow if we link from invoice or order to quotation + # unluckily orderitems are used for quotation and orders - therefore one more + # check to be sure NOT to link from order to quotation + foreach (qw(orderitems)) { + if (!$form->{saveasnew} && !$form->{useasnew} && $form->{"converted_from_${_}_id_$i"} + && $form->{type} !~ 'quotation') { RecordLinks->create_links('dbh' => $dbh, 'mode' => 'ids', 'from_table' => $_, @@ -762,7 +766,7 @@ SQL $form->{convert_from_oe_ids} =~ s/\s+$//; my @convert_from_oe_ids = split m/\s+/, $form->{convert_from_oe_ids}; delete $form->{convert_from_oe_ids}; - if (scalar @convert_from_oe_ids) { + if (!$form->{useasnew} && scalar @convert_from_oe_ids) { RecordLinks->create_links('dbh' => $dbh, 'mode' => 'ids', 'from_table' => 'oe', @@ -920,7 +924,7 @@ sub retrieve { # if called in multi id mode, and still only got one id, switch back to single id if ($form->{"rowcount"} and $#ids == 0) { - $form->{"id"} = $ids[0]; + $form->{"id"} = $ids[0]; undef @ids; delete $form->{convert_from_oe_ids}; }