From 2edde6a9ae21a8cd71fa6006579b42bed0a3c13f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 2 Sep 2015 14:46:36 +0200 Subject: [PATCH] =?utf8?q?Auftrags-Controller:=20item->id=20per=20Hand=20s?= =?utf8?q?etzten=20(assign=5Fattributes=20l=C3=A4sst=20Prim=C3=A4rschl?= =?utf8?q?=C3=BCssel=20aus).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/Order.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index c532740b9..b6cdef475 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -143,14 +143,15 @@ sub action_add_item { my $cv_discount = $self->order->customer? $self->order->customer->discount : 0.0; my %new_attr; - $new_attr{id} = join('_', 'new', Time::HiRes::gettimeofday(), int rand 1000000000000); $new_attr{part} = $part; $new_attr{description} = $part->description if ! $item->{description}; $new_attr{qty} = 1.0 if ! $item->{qty}; $new_attr{unit} = $part->unit; $new_attr{sellprice} = $part->sellprice if ! $item->{sellprice}; $new_attr{discount} = $cv_discount if ! $item->{discount}; + $item->assign_attributes(%new_attr); + $item->id(join('_', 'new', Time::HiRes::gettimeofday(), int rand 1000000000000)) if !$item->id; $self->order->add_items($item); -- 2.20.1