From fd1daaa64b6ce4375c3d18bb335afa3ff23f781a Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 19 Oct 2022 16:21:35 +0800 Subject: [PATCH] fix 1688 purchase order --- routes/web.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) 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); +// } });