fix 1688 purchase order

This commit is contained in:
omair saleh
2022-10-19 16:21:35 +08:00
parent d38f2d83cc
commit fd1daaa64b
+15 -11
View File
@@ -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);
// }
});