public function export(Company $company, EdiConnection $edi)
 {
     $orders = $this->navisionService->getUserUnconfirmedOrders($company->nav_code, $edi->start_date);
     $functionName = "{$edi->edi}XML";
     foreach ($orders as $order) {
         $xml = $this->XMLCreationService->{$functionName}($order);
         $data = $this->saveFile($xml, $order->number, $edi->edi);
         dd($data);
         //TODO::check what "uploaded" is, bool?
         $uploaded = Ftp::connection($edi->edi)->uploadFile($data['filePath'], 'OUT/' . $data['fileName'], FTP_ASCII);
         if ($uploaded) {
             $this->navisionService->userConfirmOrder($order->key);
         }
     }
 }
 /**
  * Confirm an order
  *
  * @param Request $request
  * @return \Illuminate\Http\JsonResponse
  */
 public function confirmOrder(Request $request)
 {
     event(with(new OrderChangedEvent($request->input('number'))));
     DB::table('company_confirm_order')->insert(['order_number' => $request->input('number'), 'company_id' => Auth::user()->get()->company->id, 'created_at' => Carbon::now()->toDateTimeString(), 'updated_at' => Carbon::now()->toDateTimeString()]);
     $order = $this->navisionService->userConfirmOrder($request->input('key'));
     return $this->success($order);
 }