X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/f71e1c67e070d737390634bce3b6b67a2a2a1a1c..d7f3d531eb80c72495f2491764fab2b74db4eb35:/SL/IS.pm diff --git a/SL/IS.pm b/SL/IS.pm index bda82bc76..7cf800805 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1445,12 +1445,12 @@ SQL my $invoice = SL::DB::Invoice->new( id => $form->{id} )->load; my @linked_shop_orders = $invoice->linked_records( from => 'ShopOrder', - via => ['Order', 'DeliveryOrder'], + via => ['DeliveryOrder','Order',], ); - if (scalar @linked_shop_orders == 1){ #do update my $shop_order = $linked_shop_orders[0][0]; - require SL::Shop; + if ( $shop_order ) { + require SL::Shop; my $shop_config = SL::DB::Manager::Shop->get_first( query => [ id => $shop_order->shop_id ] ); my $shop = SL::Shop->new( config => $shop_config ); $shop->connector->set_orderstatus($shop_order->shop_trans_id, "completed");