diff --git a/routes/web.php b/routes/web.php index f0d13b86..e304edb2 100644 --- a/routes/web.php +++ b/routes/web.php @@ -100,7 +100,11 @@ Route::get('/products', function (\App\Classes\Modules\Exports\Services\ExportsP Route::get('/fix_bills', function () { ini_set('max_execution_time', '1000000'); Auth()->login(User::find(1)); - $bookings = \App\Models\Booking::whereIn('id', [11257, 11268, 11281, 11287, 11288, 11290, 11292, 11293, 11296, 11298, 11299, 11302, 11303, 11307, 11314, 11324, 11345, 11346])->get(); + $bookings = \App\Models\Booking::whereHas('transactions', function ($query){ + return $query->where('type', 1)->whereHas('transactions', function($query){ + return $query->where('type', 3)->where('issuer', 2210); + }); + })->get(); foreach ($bookings as $booking){ $booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->delete(); $po = $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->first();