fetchesGroup = $fetchesGroup; $this->releaseGoodsToCustomerProcessor = $releaseGoodsToCustomerProcessor; $this->fetchesOrder = $fetchesOrder; $this->createStorageInvoiceDocTransactionProcessor = $createStorageInvoiceDocTransactionProcessor; } /** * Execute the console command. * * @return int */ public function handle() { ini_set('memory_limit', '-1'); $this->info(Carbon::now() . ': Start data patch.'); $start = new Carbon(); /* $group = $this->fetchesGroup->execute(['id' => 325]); $this->info('FixGroupPaymentProblem group: '.json_encode($group)); if ($group) { foreach ($group->groupTransactions as $groupTransaction) { $invoice = $groupTransaction->transaction; $this->info('FixGroupPaymentProblem group: '.json_encode($invoice)); $pL = $invoice->owner; $this->releaseGoodsToCustomerProcessor->execute($pL, $invoice); } } */ $order = $this->fetchesOrder->execute(['reference' => '729251424']); $packingLists = $order->destinationWarehousePackages; foreach ($packingLists as $packingList){ $this->createStorageInvoiceDocTransactionProcessor->execute($packingList, true); dd(json_encode($packingList)); } $end = new Carbon(); $elapsedTime = $start->diff($end)->format('%H:%I:%S'); $this->info(Carbon::now() . ': Done data patch. ElapsedTime: ' . $elapsedTime . '.'); } }