From 330edeccaaf1119c85885849053a21be4c1b5997 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 6 Jun 2026 11:51:25 +0530 Subject: [PATCH] Changed logic for print panel for production order --- app/Http/Controllers/ProductionOrderController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ProductionOrderController.php b/app/Http/Controllers/ProductionOrderController.php index 8476172..55bd80f 100644 --- a/app/Http/Controllers/ProductionOrderController.php +++ b/app/Http/Controllers/ProductionOrderController.php @@ -102,13 +102,20 @@ class ProductionOrderController extends Controller $itemDes = $order->item->description ?? ''; $now = Carbon::now(); $year = $now->format('y'); - $month = $now->format('m'); + // $month = $now->format('m'); + // $month = $now->format('m'); $stickers = []; for ($i = $fromSerial; $i <= $toSerial; $i++) { + $currentSerial = (string) $i; + + $year = substr($currentSerial, -10, 2); + + $month = substr($currentSerial, -8, 2); + $serial = str_pad($i, 6, '0', STR_PAD_LEFT); $serialCount = substr(str_pad($i, 6, '0', STR_PAD_LEFT), -6); @@ -130,7 +137,7 @@ class ProductionOrderController extends Controller } $pdf = Pdf::loadView('production-orders.printpanel', compact('stickers')) - ->setPaper([0, 0, 113.39, 113.39]); + ->setPaper([0, 0, 113.39, 113.39]); return $pdf->stream('stickers.pdf'); }