fix rack do's

This commit is contained in:
omair saleh
2022-04-14 11:50:42 +08:00
parent 89865302e3
commit 1c97dcefce
+5 -1
View File
@@ -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();