diff --git a/routes/web.php b/routes/web.php index d7382c01..99e07dd3 100644 --- a/routes/web.php +++ b/routes/web.php @@ -100,16 +100,15 @@ 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::whereHas('transactions', function ($query){ + $bookings = \App\Models\Booking::where('status', 3)->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(); + $booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->delete(); $po = $booking->transactions()->where('type', TransactionType::PURCHASE_ORDER)->first(); $supplier_deliver_order_transaction = $booking->transactions()->where('type', TransactionType::SUPPLIER_DELIVER)->first(); - dd($supplier_deliver_order_transaction); $supplier = Company::find($booking->transactions()->where('type', TransactionType::PAYMENT)->where('status', 3)->first()->transactions()->first()); $supplier_order_pdf = LaravelMpdf::loadView('pages.pdfs.supplier_deliver_order', ['supplier_deliver_order_transaction' => $supplier_deliver_order_transaction, 'po_order_transaction' => $po, 'supplier' => $supplier]); $document_object = new DocumentObject(