From 84db7f413b4e61dd6bbce432f9b4a05cfa8a90ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 8 Oct 2021 18:02:49 +0200 Subject: [PATCH] =?utf8?q?DeliveryOrder:=20new=5Ffrom=20-=20fix=20f=C3=BCr?= =?utf8?q?=20Quellobjekte=20die=20keine=20Kunden/Lieferanten=20haben?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/DeliveryOrder.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SL/DB/DeliveryOrder.pm b/SL/DB/DeliveryOrder.pm index a7c20cb9b..068d6c419 100644 --- a/SL/DB/DeliveryOrder.pm +++ b/SL/DB/DeliveryOrder.pm @@ -155,7 +155,8 @@ sub new_from { # infer type from legacy fields if not given $params{order_type} //= $source->customer_id ? 'sales_delivery_order' : $source->vendor_id ? 'purchase_delivery_order' - : undef; + : $source->is_sales ? 'sales_delivery_order' + : croak "need some way to set delivery order type from source"; # overwrite legacy is_sales from type_data $args{is_sales} = SL::Controller::DeliveryOrder::TypeData::get3($params{order_type}, "properties", "is_customer"); -- 2.20.1