DeliveryOrder::new_from: order_type statt new_from
authorSven Schöling <s.schoeling@googlemail.com>
Fri, 10 Dec 2021 12:54:13 +0000 (13:54 +0100)
committerJan Büren <jan@kivitendo.de>
Mon, 14 Feb 2022 14:02:19 +0000 (15:02 +0100)
SL/DB/DeliveryOrder.pm

index 03b35b3..3c293e0 100644 (file)
@@ -140,8 +140,8 @@ sub new_from {
                                                 ordnumber payment_id reqdate salesman_id shippingpoint shipvia taxincluded taxzone_id transaction_description vendor_id billing_address_id
                                              )),
                closed    => 0,
-               is_sales  => !!$source->customer_id,
                delivered => 0,
+               order_type => $params{type},
                transdate => DateTime->today_local,
             );
 
@@ -162,9 +162,6 @@ sub new_from {
                       : $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($args{order_type}, "properties", "is_customer");
-
   my $delivery_order = $class->new(%args);
   $delivery_order->assign_attributes(%{ $params{attributes} }) if $params{attributes};
   my $items          = delete($params{items}) || $source->items_sorted;