From 3665b63ff9e9c638676ed63796be6221570af5ba Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 9 Jul 2025 11:02:19 +0530 Subject: [PATCH] Commented scheduler run commands --- routes/web.php | 90 +++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/routes/web.php b/routes/web.php index db5a798..748d613 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6,60 +6,60 @@ use App\Models\Plant; use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Route; -Route::get('/', function () { - return redirect('/admin'); -}); + Route::get('/', function () { + return redirect('/admin'); + }); -// Route::get('/test_mail', function () { -// // $tableData = InvoiceValidation::select('id as no', 'plant_id as plant', 'invoice_number as TotalInvoice') -// // ->orderBy('plant', 'asc') -// // ->get() -// // ->unique('invoice') -// // ->values() -// // ->toArray(); + // Route::get('/scheduler', function() { + // Artisan::call('schedule:run'); + // }); -// $plants = InvoiceValidation::select('plant_id')->distinct()->pluck('plant_id'); -// $tableData = []; -// $no = 1; + // Route::get('/test_mail', function () { -// foreach ($plants as $plantId) { -// $plant = Plant::find($plantId); + // $plants = InvoiceValidation::select('plant_id')->distinct()->pluck('plant_id'); -// $plantName = $plant ? $plant->name : $plantId; + // $tableData = []; + // $no = 1; -// $totalInvoice = InvoiceValidation::where('plant_id', $plantId) -// ->distinct('invoice_number') -// ->count('invoice_number'); + // foreach ($plants as $plantId) { -// $startDate = now()->setTime(8, 0, 0); -// $endDate = now()->copy()->addDay()->setTime(8, 0, 0); + // $plant = Plant::find($plantId); -// $scannedInvoice = InvoiceValidation::select('invoice_number') -// ->where('plant_id', $plantId) -// ->whereNull('quantity') -// ->whereBetween('updated_at', [$startDate, $endDate]) -// ->groupBy('invoice_number') -// ->havingRaw("COUNT(*) = SUM(CASE WHEN scanned_status = 'Scanned' THEN 1 ELSE 0 END)") -// ->count(); + // $plantName = $plant ? $plant->name : $plantId; -// $tableData[] = [ -// 'no' => $no++, -// 'plant' => $plantName, -// 'totalInvoice' => $totalInvoice, -// 'scannedInvoice' => $scannedInvoice, -// ]; -// } + // $totalInvoice = InvoiceValidation::where('plant_id', $plantId) + // ->distinct('invoice_number') + // ->count('invoice_number'); -// Mail::to('jothikumar.padmanaban@cripumps.com')->send( -// new test($tableData) -// ); -// // Mail::to([ -// // 'jothikumar.padmanaban@cripumps.com', -// // 'tamilselvan.selvaraj@cripumps.com', -// // 'dineshkumar.kaliyappan@cripumps.com' -// // ])->send(new test($tableData)); + // $startDate = now()->setTime(8, 0, 0); + // $endDate = now()->copy()->addDay()->setTime(8, 0, 0); -// return "Mail sent!"; -// }); + // $scannedInvoice = InvoiceValidation::select('invoice_number') + // ->where('plant_id', $plantId) + // ->whereNull('quantity') + // ->whereBetween('updated_at', [$startDate, $endDate]) + // ->groupBy('invoice_number') + // ->havingRaw("COUNT(*) = SUM(CASE WHEN scanned_status = 'Scanned' THEN 1 ELSE 0 END)") + // ->count(); + + // $tableData[] = [ + // 'no' => $no++, + // 'plant' => $plantName, + // 'totalInvoice' => $totalInvoice, + // 'scannedInvoice' => $scannedInvoice, + // ]; + // } + + // Mail::to('jothikumar.padmanaban@cripumps.com')->send( + // new test($tableData) + // ); + // // Mail::to([ + // // 'jothikumar.padmanaban@cripumps.com', + // // 'tamilselvan.selvaraj@cripumps.com', + // // 'dineshkumar.kaliyappan@cripumps.com' + // // ])->send(new test($tableData)); + + // return "Mail sent!"; + // });