5 Commits

Author SHA1 Message Date
dhanabalan
d7d27a9dc0 added unwanted enters in between code for testing
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Pint / pint (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Gemini PR Review / review (pull_request) Has been cancelled
2025-12-02 12:16:34 +05:30
dhanabalan
e525e3c526 decreased font size of the sticker printing table
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 38s
Laravel Larastan / larastan (pull_request) Failing after 2m18s
Laravel Pint / pint (pull_request) Has been cancelled
2025-12-02 08:35:17 +05:30
dhanabalan
caf2f3c1e7 corrected logic in sticker printing page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Gemini PR Review / review (pull_request) Failing after 38s
Laravel Larastan / larastan (pull_request) Failing after 2m24s
Laravel Pint / pint (pull_request) Failing after 2m7s
2025-12-02 08:24:22 +05:30
dhanabalan
2ceb76f008 Added ref no above the qr code in sticker printing
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 27s
Laravel Larastan / larastan (pull_request) Failing after 2m15s
Laravel Pint / pint (pull_request) Failing after 7m11s
2025-12-01 17:50:30 +05:30
dhanabalan
988d109acc Added serial qr code validation in create page of sticker printing
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Gemini PR Review / review (pull_request) Failing after 22s
Laravel Larastan / larastan (pull_request) Failing after 2m15s
Laravel Pint / pint (pull_request) Failing after 2m13s
2025-12-01 17:41:00 +05:30
4 changed files with 117 additions and 9 deletions

View File

@@ -109,6 +109,7 @@ class ProcessOrderResource extends Resource
->afterStateHydrated(function ($component, $state, Get $get, Set $set) { ->afterStateHydrated(function ($component, $state, Get $get, Set $set) {
$itemId = $get('item_id'); $itemId = $get('item_id');
if ($get('id')) { if ($get('id')) {
$item = \App\Models\Item::where('id', $itemId)->first()?->description; $item = \App\Models\Item::where('id', $itemId)->first()?->description;
if ($item) { if ($item) {
$set('item_description', $item); $set('item_description', $item);
@@ -122,6 +123,7 @@ class ProcessOrderResource extends Resource
->hidden() ->hidden()
->readOnly(), ->readOnly(),
// ->readOnly(true), // ->readOnly(true),
Forms\Components\TextInput::make('process_order') Forms\Components\TextInput::make('process_order')
->label('Process Order') ->label('Process Order')
->reactive() ->reactive()

View File

@@ -9,6 +9,7 @@ use SimpleSoftwareIO\QrCode\Facades\QrCode;
use Filament\Facades\Filament; use Filament\Facades\Filament;
use App\Models\StickerPrinting; use App\Models\StickerPrinting;
use Filament\Notifications\Notification; use Filament\Notifications\Notification;
use Str;
class CreateStickerPrinting extends CreateRecord class CreateStickerPrinting extends CreateRecord
@@ -77,7 +78,65 @@ class CreateStickerPrinting extends CreateRecord
$sNumber = $this->form->getState()['serial_number'] ?? null; $sNumber = $this->form->getState()['serial_number'] ?? null;
if(empty($this->plantId) || empty($ref) || empty($this->serial_number)) { $pattern1 = '/^(?<item_code>[^|]+)\|(?<serial_number>[^|]+)\|?$/i';
$pattern2 = '/^(?<item_code>[^|]+)\|(?<serial_number>[^|]+)\|(?<batch_number>.+)$/i';
$pattern3 = '/^(?<serial_number>[^|]+)$/i';
if (preg_match($pattern1, $sNumber, $matches) || preg_match($pattern2, $sNumber, $matches) || preg_match($pattern3, $sNumber, $matches)) {
$serial = $matches['serial_number'];
if (Str::length($serial) < 9) {
Notification::make()
->title('Invalid Serial Number')
->body("Serial number should conatin minimum 9 digits '$serial'.")
->warning()
->send();
$this->form->fill([
'plant_id' => $plant,
'reference_number' => $ref,
'serial_number' => '',
]);
return;
}
else if(!ctype_alnum($serial)) {
Notification::make()
->title('Invalid Serial Number')
->body("Serial number should be alphanumeric '$serial'.")
->warning()
->send();
$this->form->fill([
'plant_id' => $plant,
'reference_number' => $ref,
'serial_number' => '',
]);
return;
}
$extractedSerialNumber = $matches['serial_number'];
$sNumber = $extractedSerialNumber;
}
else
{
Notification::make()
->title('Invalid Format')
->body("Serial number must be in the format 'itemcode|serialnumber' or 'itemcode|serialnumber|batchnumber'. or just 'serialnumber'.")
->warning()
->send();
// Reset only serial number field
$this->form->fill([
'plant_id' => $plant,
'reference_number' => $ref,
'serial_number' => '',
]);
return;
}
if ($plant == null || trim($plant) == '' || $ref == null || trim($ref) == '' || $sNumber == null || trim($sNumber) == '')
{
Notification::make() Notification::make()
->title('Unknown: Incomplete Data!') ->title('Unknown: Incomplete Data!')
->body("Please ensure Plant, Reference Number, and Serial Number are provided.") ->body("Please ensure Plant, Reference Number, and Serial Number are provided.")
@@ -110,16 +169,16 @@ class CreateStickerPrinting extends CreateRecord
} }
StickerPrinting::create([ StickerPrinting::create([
'plant_id' => $this->plantId, 'plant_id' => $plant,
'reference_number' => $ref, 'reference_number' => $ref,
'serial_number' => $this->serial_number, 'serial_number' => $sNumber,
'created_by' => Filament::auth()->user()->name, 'created_by' => Filament::auth()->user()->name,
]); ]);
$this->dispatch('addStickerToList', $this->plantId, $ref, $this->serial_number); $this->dispatch('addStickerToList', $plant, $ref, $sNumber);
$this->form->fill([ $this->form->fill([
'plant_id' => $this->plantId, 'plant_id' => $plant,
'reference_number' => $ref, 'reference_number' => $ref,
'serial_number' => '', 'serial_number' => '',
]); ]);
@@ -175,6 +234,7 @@ class CreateStickerPrinting extends CreateRecord
// Send data to Pdf view // Send data to Pdf view
$pdf = PDF::loadView('pdf.qrcode', [ $pdf = PDF::loadView('pdf.qrcode', [
'qrCode' => $qrCode, 'qrCode' => $qrCode,
'referenceNumber' => $refNumber,
]); ]);
return response()->streamDownload(function () use ($pdf) { return response()->streamDownload(function () use ($pdf) {

View File

@@ -36,7 +36,8 @@
style="height: 385px;" style="height: 385px;"
> >
<table class="table-auto w-full border-collapse border"> <table class="table-auto w-full border-collapse border">
<thead class="bg-gray-100"> {{-- <thead class="bg-gray-100"> --}}
<thead class="bg-gray-100 text-xs">
<tr> <tr>
<th class="border p-2">No</th> <th class="border p-2">No</th>
<th class="border p-2">Reference No</th> <th class="border p-2">Reference No</th>
@@ -44,7 +45,8 @@
<th class="border p-2">Created By</th> <th class="border p-2">Created By</th>
</tr> </tr>
</thead> </thead>
<tbody> {{-- <tbody> --}}
<tbody class="text-xs">
@forelse($records as $index => $record) @forelse($records as $index => $record)
<tr> <tr>
<td class="border p-2 text-center">{{ $index + 1 }}</td> <td class="border p-2 text-center">{{ $index + 1 }}</td>

View File

@@ -16,7 +16,7 @@
</html> --}} </html> --}}
<!DOCTYPE html> {{-- <!DOCTYPE html>
<html> <html>
<head> <head>
<style> <style>
@@ -40,9 +40,53 @@
</style> </style>
</head> </head>
<body> <body>
<img src="data:image/png;base64,{{ $qrCode }}" /> <img src="data:image/png;base64,{{ $qrCode }}" />
</body>
</html> --}}
<!DOCTYPE html>
<html>
<head>
<style>
@page {
margin: 0;
size: 100mm 100mm;
}
body {
margin: 0;
padding: 0;
width: 100mm;
height: 100mm;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
font-size: 12px;
font-family: Arial, sans-serif;
}
img {
width: 90mm; /* QR CODE REDUCED TO FIT TEXT */
height: 90mm;
}
.ref-text {
margin-top: 3mm;
font-size: 16px; /* Increased Font Size */
font-weight: bold;
}
</style>
</head>
<body>
<div class="ref-text">
{{ $referenceNumber }}
</div>
<img src="data:image/png;base64,{{ $qrCode }}" />
</body> </body>
</html> </html>