X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdo.pl;h=6adf190ead6d9836d575d2d144694d01825753eb;hb=5c8a0b36440e012cd0a54e6b68eb3d1411243b1a;hp=0905b48768caf878ac94e0a2b589786f17a6e5bb;hpb=ac24d564d4fa4620782f0d5742853c52746f3b95;p=kivitendo-erp.git diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 0905b4876..6adf190ea 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -943,7 +943,20 @@ sub save { } $form->{id} = 0 if $form->{saveasnew}; - + # we rely on converted_from_orderitems, if the workflow is used + # be sure that at least one position is linked to the original orderitem + if ($form->{convert_from_oe_ids}) { + my $has_linked_pos; + for my $i (1 .. $form->{rowcount}) { + if ($form->{"converted_from_orderitems_id_$i"}) { + $has_linked_pos = 1; + last; + } + } + if (!$has_linked_pos) { + $form->error($locale->text('Need at least one original position for the workflow Order to Delivery Order!')); + } + } DO->save(); # saving the history if(!exists $form->{addition}) {