From: Moritz Bunkus Date: Tue, 4 Feb 2014 15:14:08 +0000 (+0100) Subject: SL::DB::Order: bei Wandlung in Lieferschein delivered auf 1 setzen X-Git-Tag: release-3.2.0beta~491^2~24 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1c9c1ad92b3558fbd11e2ebb0031da402d279537;p=kivitendo-erp.git SL::DB::Order: bei Wandlung in Lieferschein delivered auf 1 setzen --- diff --git a/SL/DB/Order.pm b/SL/DB/Order.pm index 8909b7e26..e2516ea73 100644 --- a/SL/DB/Order.pm +++ b/SL/DB/Order.pm @@ -149,10 +149,11 @@ sub convert_to_delivery_order { my ($delivery_order, $custom_shipto); if (!$self->db->with_transaction(sub { require SL::DB::DeliveryOrder; - ($delivery_order, $custom_shipto) = SL::DB::DeliveryOrder->new_from($self); + ($delivery_order, $custom_shipto) = SL::DB::DeliveryOrder->new_from($self, %params); $delivery_order->save; $custom_shipto->save if $custom_shipto; $self->link_to_record($delivery_order); + $self->update_attributes(delivered => 1); 1; })) { return wantarray ? () : undef; @@ -212,7 +213,9 @@ Returns true if the order is of the given type. Creates a new delivery order with C<$self> as the basis by calling L. That delivery order is saved, and -C<$self> is linked to the new invoice via L. +C<$self> is linked to the new invoice via +L. C<$self>'s C attribute is set to +C, and C<$self> is saved. The arguments in C<%params> are passed to L.