From: Sven Schöling Date: Fri, 10 Dec 2021 15:47:12 +0000 (+0100) Subject: DeliveryOrder: record links beim Speichern setzen X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~216^2~31 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=cce35acc654914bcd9bd06d2b361d8c3a0106c05;p=kivitendo-erp.git DeliveryOrder: record links beim Speichern setzen --- diff --git a/SL/Controller/DeliveryOrder.pm b/SL/Controller/DeliveryOrder.pm index a0d9c19d6..1c1f4d006 100644 --- a/SL/Controller/DeliveryOrder.pm +++ b/SL/Controller/DeliveryOrder.pm @@ -36,7 +36,7 @@ use SL::Helper::UserPreferences::PositionsScrollbar; use SL::Helper::UserPreferences::UpdatePositions; use SL::Controller::Helper::GetModels; -use SL::Controller::DeliveryOrder::TypeData; +use SL::Controller::DeliveryOrder::TypeData qw(:types); use List::Util qw(first sum0); use List::UtilsBy qw(sort_by uniq_by); @@ -1576,8 +1576,8 @@ sub save { if ($::form->{converted_from_oe_id}) { my @converted_from_oe_ids = split ' ', $::form->{converted_from_oe_id}; foreach my $converted_from_oe_id (@converted_from_oe_ids) { - my $src = SL::DB::DeliveryOrder->new(id => $converted_from_oe_id)->load; - $src->update_attributes(closed => 1) if $src->type =~ /_quotation$/; + my $src = SL::DB::Order->new(id => $converted_from_oe_id)->load; + $src->update_attributes(closed => 1) if $src->type =~ /_quotation$/ && $self->order->is_type(PURCHASE_DELIVERY_ORDER_TYPE); $src->link_to_record($self->order); } if (scalar @{ $::form->{converted_from_orderitems_ids} || [] }) {