mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-20 21:13:59 +00:00
delete 1688 purchase order for special customers
This commit is contained in:
+3
-6
@@ -414,16 +414,13 @@ Route::get('/po/manual/fix', function(){
|
||||
return $query->where('document_type', DocumentType::ECOMMERCE_PURCHASE_ORDER);
|
||||
})->get();
|
||||
|
||||
dd($bookings->pluck('company_id'));
|
||||
foreach ($purchaseOrders as $purchaseOrder){
|
||||
$purchaseOrder->status = ApprovalStatus::PENDING_SUBMISSION;
|
||||
$purchaseOrder->save();
|
||||
|
||||
$booking = $purchaseOrder->owner;
|
||||
foreach ($bookings as $booking){
|
||||
$booking->status = ApprovalStatus::APPROVED;
|
||||
$booking->save();
|
||||
|
||||
$booking->documents()->whereIn('document_type', [DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::INVOICE, DocumentType::SUPPLIER_DELIVER_ORDER])->delete();
|
||||
$booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->update(['status' => ApprovalStatus::PENDING_SUBMISSION]);
|
||||
|
||||
}
|
||||
|
||||
})->name('ecommerce.fix');
|
||||
|
||||
Reference in New Issue
Block a user