diff --git a/routes/web.php b/routes/web.php index 72860b3f..51ce8e15 100644 --- a/routes/web.php +++ b/routes/web.php @@ -469,7 +469,7 @@ Route::get('/invoice/fix', function(){ $bookings = Booking::where('status', ApprovalStatus::COMPLETED)->whereDate('updated_at', '>=', Carbon::parse('01-01-2023'))->get(); foreach($bookings as $booking){ - $booking->transactions()->whereIn('type', [TransactionType::INVOICE, TransactionType::SUPPLIER_DELIVER])->delete(); + $booking->transactions()->whereIn('transactions.type', [TransactionType::INVOICE, TransactionType::SUPPLIER_DELIVER])->delete(); $booking->documents()->whereIn('type', [DocumentType::INVOICE, DocumentType::PURCHASE_ORDER, DocumentType::DELIVER_ORDER, DocumentType::SUPPLIER_DELIVER_ORDER])->delete(); $booking->status = ApprovalStatus::APPROVED; $booking->save();