diff --git a/routes/web.php b/routes/web.php index 8c113f787..db5a798b7 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,36 +1,65 @@ send( -// new test() -// ); +// // $tableData = InvoiceValidation::select('id as no', 'plant_id as plant', 'invoice_number as TotalInvoice') +// // ->orderBy('plant', 'asc') +// // ->get() +// // ->unique('invoice') +// // ->values() +// // ->toArray(); +// $plants = InvoiceValidation::select('plant_id')->distinct()->pluck('plant_id'); + +// $tableData = []; +// $no = 1; + +// foreach ($plants as $plantId) { + +// $plant = Plant::find($plantId); + +// $plantName = $plant ? $plant->name : $plantId; + +// $totalInvoice = InvoiceValidation::where('plant_id', $plantId) +// ->distinct('invoice_number') +// ->count('invoice_number'); + +// $startDate = now()->setTime(8, 0, 0); +// $endDate = now()->copy()->addDay()->setTime(8, 0, 0); + +// $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!"; // }); - -// Route::get('/qr-pdf-test', function () { -// $qrBinary = QrCode::format('png')->size(200)->generate('Test'); -// $qrBase64 = base64_encode($qrBinary); - -// $html = 'QR'; -// $mpdf = new Mpdf(['mode' => 'utf-8']); -// $mpdf->WriteHTML($html); -// return response($mpdf->Output('qr-code.pdf', 'S'), 200, [ -// 'Content-Type' => 'application/pdf', -// 'Content-Disposition' => 'attachment; filename="qr-code.pdf"' -// ]); -// }); - -//Route::get('/download-qr-pdf', [TestingPanelController::class, 'downloadQrPdf'])->name('download-qr-pdf'); - -Route::get('/download-qr-pdf/{palletNo}', [TestingPanelController::class, 'downloadQrPdf'])->name('download-qr-pdf');