X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FOE.pm;h=f776d515a99738550616f70ca7d869635d9bf866;hb=51264c4371793e3ac8990a54640f9e9b43e3f306;hp=74733c8672b8f9a40d8d10f3df605cbadb965599;hpb=c1ec3f4f93af94698c2d017329ed8286a7c3cc0b;p=kivitendo-erp.git diff --git a/SL/OE.pm b/SL/OE.pm index 74733c867..f776d515a 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -864,7 +864,16 @@ sub retrieve { # and remember for the rest of the function my $is_collective_order = scalar @ids; - $form->{useasnew} = !!$is_collective_order; + + # If collective order was created from exactly 1 order, we assume the same + # behaviour as a "save as new" from within an order is actually desired, i.e. + # the original order isn't part of a workflow where we want to remember + # record_links, but simply a quick way of generating a new order from an old + # one without having to enter everything again. + # Setting useasnew will prevent the creation of record_links for the items + # when saving the new order. + # This form variable is probably not necessary, could just set saveasnew instead + $form->{useasnew} = 1 if $is_collective_order == 1; if (!$form->{id}) { my $extra_days = $form->{type} eq 'sales_quotation' ? $::instance_conf->get_reqdate_interval : 1; @@ -1069,6 +1078,8 @@ sub retrieve { } # delete orderitems_id in collective orders, so that they get cloned no matter what + # is this correct? or is the following meant? + # remember orderitems_ids in converted_from_orderitems_ids, so that they may be linked $ref->{converted_from_orderitems_id} = delete $ref->{orderitems_id} if $is_collective_order; # get tax rates and description