X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FDeliveryOrder.pm;h=66c8982add20b5d7b8ddbd11ce2a428a8c0446cd;hb=6c59b08afa062f17a487910125809095fa3fb684;hp=bc518018e202d73f9a1f6e8189e03613f0388065;hpb=3f0ed511a589aca9642391108a960ef4e8a6286d;p=kivitendo-erp.git diff --git a/SL/DB/DeliveryOrder.pm b/SL/DB/DeliveryOrder.pm index bc518018e..66c8982ad 100644 --- a/SL/DB/DeliveryOrder.pm +++ b/SL/DB/DeliveryOrder.pm @@ -101,7 +101,7 @@ sub date { sub _clone_orderitem_cvar { my ($cvar) = @_; - my $cloned = Rose::DB::Object::Helpers::clone_and_reset($_); + my $cloned = $_->clone_and_reset; $cloned->sub_module('delivery_order_items'); return $cloned; @@ -130,13 +130,10 @@ sub new_from { # Custom shipto addresses (the ones specific to the sales/purchase # record and not to the customer/vendor) are only linked from - # shipto -> delivery_orders. Meaning delivery_orders.shipto_id - # will not be filled in that case. Therefore we have to return the - # new shipto object as a separate object so that the caller can - # save it, too. - my $custom_shipto; + # shipto → delivery_orders. Meaning delivery_orders.shipto_id + # will not be filled in that case. if (!$source->shipto_id && $source->id) { - $custom_shipto = $source->custom_shipto->clone($class) if $source->can('custom_shipto') && $source->custom_shipto; + $args{custom_shipto} = $source->custom_shipto->clone($class) if $source->can('custom_shipto') && $source->custom_shipto; } else { $args{shipto_id} = $source->shipto_id; @@ -172,7 +169,7 @@ sub new_from { $delivery_order->items(\@items); - return ($delivery_order, $custom_shipto); + return $delivery_order; } sub customervendor { @@ -258,18 +255,8 @@ quotations and purchase orders) are supported as sources. The conversion copies order items into delivery order items. Dates are copied as appropriate, e.g. the C field will be set to the current date. -Returns one or two objects depending on the context. In list context -the new delivery order instance and a shipto instance will be -returned. In scalar instance only the delivery order instance is -returned. - -Custom shipto addresses (the ones specific to the sales/purchase -record and not to the customer/vendor) are only linked from C -to C. Meaning C will not -be filled in that case. That's why a separate shipto object is created -and returned. - -The objects returned are not saved. +Returns the new delivery order instance. The object returned is not +saved. C<%params> can include the following options: