From 1c9c1ad92b3558fbd11e2ebb0031da402d279537 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 4 Feb 2014 16:14:08 +0100 Subject: [PATCH] SL::DB::Order: bei Wandlung in Lieferschein delivered auf 1 setzen --- SL/DB/Order.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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. -- 2.20.1