From 043285c8863c8ac1e28f09f413148a71cc4a3444 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 11 Jun 2021 11:23:28 +0200 Subject: [PATCH] =?utf8?q?Auftrag-Controller:=20Auftr=C3=A4ge=20manuell=20?= =?utf8?q?auf=20nicht-/geliefert=20setzen=20k=C3=B6nnen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/Order.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 88069f3c4..fe27d55c3 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -1798,8 +1798,10 @@ sub pre_render { } if (any { $self->type eq $_ } (sales_order_type(), purchase_order_type())) { - # calculate shipped qtys here to prevent calling calculate for every item via the items method - SL::Helper::ShippedQty->new->calculate($self->order)->write_to_objects; + # Calculate shipped qtys here to prevent calling calculate for every item via the items method. + # Do not use write_to_objects to prevent order->delivered to be set, because this should be + # the value from db, which can be set manually or is set when linked delivery orders are saved. + SL::Helper::ShippedQty->new->calculate($self->order)->write_to(\@{$self->order->items}); } if ($self->order->number && $::instance_conf->get_webdav) { -- 2.20.1