Added export serial method in production order controller
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Larastan / larastan (pull_request) Failing after 3m39s
Laravel Pint / pint (pull_request) Failing after 13m10s

This commit is contained in:
dhanabalan
2026-07-18 15:39:37 +05:30
parent d275fb9407
commit dd56cd7aae

View File

@@ -11,6 +11,8 @@ use Illuminate\Support\Facades\Log;
use Mpdf\QrCode\QrCode;
use Mpdf\QrCode\Output;
use Barryvdh\DomPDF\Facade\Pdf;
use App\Exports\SerialExport;
use Maatwebsite\Excel\Facades\Excel;
class ProductionOrderController extends Controller
{
@@ -62,6 +64,7 @@ class ProductionOrderController extends Controller
];
}
$pdf = Pdf::loadView('production-orders.print', compact('stickers'))
->setPaper([0, 0, 170, 40]);
@@ -214,6 +217,24 @@ class ProductionOrderController extends Controller
}
}
public function exportSerial($production_order, $plantCode, $fromSerialNo, $toSerialNo){
$order = ProductionOrder::where('production_order', $production_order)->first();
if (!$order) {
abort(404, 'Production Order not found');
}
else{
return Excel::download(
new SerialExport(
$order->item->code,
$fromSerialNo,
$toSerialNo
),
'serial_numbers.xlsx'
);
}
}
/**
* Store a newly created resource in storage.
*/