1
0
forked from poc/pds

Commented scheduler run commands

This commit is contained in:
dhanabalan
2025-07-09 11:02:19 +05:30
parent aeb3b694e4
commit 3665b63ff9

View File

@@ -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!";
// });