Removed generate pallet pdf from testing panel controlled and added into api
This commit is contained in:
@@ -1,36 +1,65 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\TestingPanelController;
|
||||
use App\Mail\test;
|
||||
use App\Models\InvoiceValidation;
|
||||
use App\Models\Plant;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use SimpleSoftwareIO\QrCode\Facades\QrCode;
|
||||
use Mpdf\Mpdf;
|
||||
|
||||
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();
|
||||
|
||||
// $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()
|
||||
// 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 = '<img src="data:image/png;base64,' . $qrBase64 . '" alt="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');
|
||||
|
||||
Reference in New Issue
Block a user