listsOrders = $listsOrders; $this->storageInvoiceTransactionProcessor = $storageInvoiceTransactionProcessor; } /** * Execute the console command. * * @return int */ public function handle() { ini_set('memory_limit', '-1'); $this->info(Carbon::now() . ': Start Check all orders for storage invoice.'); $start = new Carbon(); $orders = $this->listsOrders->execute(['with_parcels' => true, 'type_in' => [OrderType::SHARED_CONTAINER, OrderType::DEDICATED_CONTAINER]]); $count = 0; foreach ($orders as $order){ try{ $storages = $this->storageInvoiceTransactionProcessor->executeOrder($order); $count = $count + 1; $this->info('Order '.$count); } catch(\Exception $ex){ $this->info('Exception '.$ex->getMessage()); break; } } $end = new Carbon(); $elapsedTime = $start->diff($end)->format('%H:%I:%S'); $this->info(Carbon::now() . ': Done Check all orders for storage invoice. ElapsedTime: ' . $elapsedTime . '.'); } }