From: Bernd Bleßmann Date: Fri, 11 Jun 2021 09:23:28 +0000 (+0200) Subject: Auftrag-Controller: Aufträge manuell auf nicht-/geliefert setzen können. X-Git-Tag: kivitendo-mebil_0.1-0~9^2~182 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=043285c8863c8ac1e28f09f413148a71cc4a3444;p=kivitendo-erp.git Auftrag-Controller: Aufträge manuell auf nicht-/geliefert setzen können. --- 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) {