X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=7cf80080589132fb40f169925b27889b358bf92b;hb=0f521b3d8ea765b3e39f2f817e5f4f97a23d562c;hp=5fe66cf47465c924d6329d7e9fc962a6899724b6;hpb=4dc48e117cfdb6e59c2d8b9d8087ef8a3bc245a4;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index 5fe66cf47..7cf800805 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1441,6 +1441,21 @@ SQL } } + # update shop status + my $invoice = SL::DB::Invoice->new( id => $form->{id} )->load; + my @linked_shop_orders = $invoice->linked_records( + from => 'ShopOrder', + via => ['DeliveryOrder','Order',], + ); + #do update + my $shop_order = $linked_shop_orders[0][0]; + 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"); + } + return 1; }