From 872b3d6b0a3932187d279f17f3c4980a30332d72 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 11 Nov 2026 14:29:00 +0530 Subject: [PATCH 1/3] Updated warning message when motor testing master not found --- app/Http/Controllers/TestingPanelController.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/TestingPanelController.php b/app/Http/Controllers/TestingPanelController.php index 73f841e7..bfeb8562 100644 --- a/app/Http/Controllers/TestingPanelController.php +++ b/app/Http/Controllers/TestingPanelController.php @@ -231,13 +231,9 @@ class TestingPanelController extends Controller $uniqueInvalidCodes = array_unique($missedItemCodes); if (! empty($uniqueInvalidCodes)) { - - // return response("Item codes : ". implode(', ', $uniqueInvalidCodes)." not found in motor testing master for the specified plant {$plantName}", 400) - // ->header('Content-Type', 'text/plain'); - return response()->json([ 'status_code' => 'ERROR', - 'status_description' => 'Item codes : '.implode(', ', $uniqueInvalidCodes)." not found in master for the specified plant : '{$plantName}'!", + 'status_description' => 'Item codes : '.implode(', ', $uniqueInvalidCodes)." not found in motor testing master for the plant : '{$plantName}'!", ], 404); } @@ -895,13 +891,9 @@ class TestingPanelController extends Controller $uniqueInvalidCodes = array_unique($missedItemCodes); if (! empty($uniqueInvalidCodes)) { - - // return response("Item codes : ". implode(', ', $uniqueInvalidCodes)." not found in motor testing master for the specified plant {$plantName}", 400) - // ->header('Content-Type', 'text/plain'); - return response()->json([ 'status_code' => 'ERROR', - 'status_description' => 'Item codes : '.implode(', ', $uniqueInvalidCodes)." not found in master for the specified plant : '{$plantName}'!", + 'status_description' => 'Item codes : '.implode(', ', $uniqueInvalidCodes)." not found in motor testing master table for the plant : '{$plantName}'!", ], 404); } @@ -1079,7 +1071,7 @@ class TestingPanelController extends Controller if (! $motorTestingMaster) { return response()->json([ 'status_code' => 'ERROR', - 'status_description' => "Item code not found in motor testing master table for the plant : '$plantName'!", + 'status_description' => "Item code not found in motor testing master table for the plant : '{$plantName}'!", ], 404); } -- 2.49.1 From 9583e6061e40942ede6ffd3387acbccffc9096b5 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 11 Nov 2026 14:29:28 +0530 Subject: [PATCH 2/3] Removed unwanted line --- app/Filament/Resources/MotorTestingMasterResource.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Filament/Resources/MotorTestingMasterResource.php b/app/Filament/Resources/MotorTestingMasterResource.php index e1c42c74..62b735ae 100644 --- a/app/Filament/Resources/MotorTestingMasterResource.php +++ b/app/Filament/Resources/MotorTestingMasterResource.php @@ -723,7 +723,6 @@ class MotorTestingMasterResource extends Resource } }) ->afterStateUpdated(function ($state, callable $set, callable $get) { - if ($state == 'Single' && $get('connection_type') == 'Star-Delta') { $set('phase_type', 'Three'); } -- 2.49.1 From 0be618bf64fc5953115e033a61f3259f5ee6ee5c Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 12 Nov 2026 14:30:42 +0530 Subject: [PATCH 3/3] Added logic in sticker pdf service --- app/Services/StickerPdfService.php | 48 +++++++++++++++++------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/app/Services/StickerPdfService.php b/app/Services/StickerPdfService.php index 5c568a26..9649dcf2 100644 --- a/app/Services/StickerPdfService.php +++ b/app/Services/StickerPdfService.php @@ -1614,29 +1614,8 @@ class StickerPdfService $stickerHeight = (float) $template['height']; $stickerId = $template['sticker_id'] ?? null; - // $gap = 5.0; - - // $count = ($toSerial - $fromSerial) + 1; - - // $totalHeight = - // ($stickerHeight * $count) - // + - // ($gap * ($count - 1)); - $orientation = $stickerWidth > $stickerHeight ? 'L' : 'P'; - // $pdf = new TCPDF( - // 'P', - // 'mm', - // [ - // $stickerWidth, - // $stickerHeight - // ], - // true, - // 'UTF-8', - // false - // ); - $pdf = new TCPDF($orientation, 'mm', [$stickerWidth, $stickerHeight], true, 'UTF-8', false); $pdf->setPrintHeader(false); @@ -1714,6 +1693,18 @@ class StickerPdfService $pdf->SetFont($element['font'], '', $element['size']); + $font = $element['font'] ?? 'helvetica'; + $fontSize = (float) ($element['size'] ?? 10); + + // if ( + // ($element['characteristics_type'] ?? '') == 'feed_address' + // && mb_strlen((string) $textValue) > 61 + // ) { + // $fontSize = max(6, $fontSize - 2); + // } + + $pdf->SetFont($font, '', $fontSize); + $x = (float) $element['x']; $y = $element['y'] + $currentY; @@ -1737,7 +1728,22 @@ class StickerPdfService $x = $leftMargin; } } + if($stickerId == 'SelfPriming Monoblock Pump'){ + $leftMargin = 10; + $rightMargin = 10; + $usableWidth = 85 - $leftMargin - $rightMargin; // 65mm + + $textWidth = $pdf->GetStringWidth((string) $textValue); + + // Center the address within the available width + $x = $leftMargin + (($usableWidth - $textWidth) / 2); + + // Prevent the address from starting before the left margin + if ($textWidth > $usableWidth) { + $x = $leftMargin; + } + } } $pdf->Text($x, $y, (string) $textValue); -- 2.49.1