diff --git a/routes/web.php b/routes/web.php index 7e9f16bb..5c4f6563 100644 --- a/routes/web.php +++ b/routes/web.php @@ -386,18 +386,22 @@ Route::get('/payments/manual', function(){ -Route::get('/1688/fix', function(){ - set_time_limit(1800); - $purchaseOrderDocuments = \App\Models\Document::where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->get(); +Route::get('/1688/fix/{reference}', function($reference){ - foreach($purchaseOrderDocuments as $document){ - $booking = $document->owner; - $booking->status = ApprovalStatus::APPROVED; - $booking->save(); + $booking = Booking::where('marking', $reference)->first(); - $booking->documents()->whereIn('document_type', [DocumentType::INVOICE, DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::SUPPLIER_DELIVER_ORDER])->delete(); - - (App()->make(createPurchaseOrderFor1688OrderProcessor::class))->execute($document->owner); - } + $this->createPurchaseOrderFor1688OrderProcessor->execute($booking); +// set_time_limit(1800); +// $purchaseOrderDocuments = \App\Models\Document::where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER)->get(); +// +// foreach($purchaseOrderDocuments as $document){ +// $booking = $document->owner; +// $booking->status = ApprovalStatus::APPROVED; +// $booking->save(); +// +// $booking->documents()->whereIn('document_type', [DocumentType::INVOICE, DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::SUPPLIER_DELIVER_ORDER])->delete(); +// +// (App()->make(createPurchaseOrderFor1688OrderProcessor::class))->execute($document->owner); +// } });