fix conflict issue in sticker pdf service
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Gemini PR Review / Gemini PR Review (pull_request) Successful in 20s
Laravel Pint / pint (pull_request) Failing after 2m32s
Laravel Larastan / larastan (pull_request) Failing after 5m36s

This commit is contained in:
dhanabalan
2026-09-20 10:50:49 +05:30
parent 6b3c693b5e
commit dc95259fc5
42 changed files with 3844 additions and 1966 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -19,6 +19,7 @@ use Filament\Forms\Components\ViewField;
use Filament\Notifications\Notification;
use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Components\Hidden;
use Illuminate\Support\Facades\Auth;
class ProductionCalender extends Page
{
@@ -160,4 +161,9 @@ class ProductionCalender extends Page
}
}
public static function canAccess(): bool
{
return Auth::check() && Auth::user()->can('view production calender page');
}
}

View File

@@ -403,6 +403,9 @@ class ProductionQuantityPage extends Page implements HasForms
public function processMachine($value)
{
$plantId = $this->pId;
$plantCode = Plant::find($plantId);
$PlaCo = $plantCode->code;
$this->mNam = $value;
$now = Carbon::now()->format('H:i:s');
@@ -412,6 +415,72 @@ class ProductionQuantityPage extends Page implements HasForms
$machine = Machine::where('plant_id', $plantId)->where('work_center', $this->mNam)->with('line.block')->first();
$machinenotAgaPlant = Machine::where('work_center', $this->mNam)->first();
$machineAgaPlant = Machine::where('plant_id', $plantId)->where('work_center', $this->mNam)->first();
if (!$machinenotAgaPlant) {
Notification::make()
->title('Unknown WorkCenter')
->body("Work Center not found")
->danger()
->send();
$this->form->fill([
'plant_id' => $this->pId,
'machine_id' => $this->mNam,
'block_name' => $this->bNam,
'shift_id' => $this->sNam,
'line_id' => $this->lNam,
'item_id' => null,
'serial_number' => null,
'success_msg' => null,
'production_order' => $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
return;
}
else if (!$machineAgaPlant) {
Notification::make()
->title('Unknown WorkCenter')
->body("Work Center not found against plant code $PlaCo")
->danger()
->send();
$this->form->fill([
'plant_id' => $this->pId,
'machine_id' => $this->mNam,
'block_name' => $this->bNam,
'shift_id' => $this->sNam,
'line_id' => $this->lNam,
'item_id' => null,
'serial_number' => null,
'success_msg' => null,
'production_order' => $this->prodOrder,
'sap_msg_status' => null,
'sap_msg_description' => null,
// 'operator_id'=> $operatorName,
'recent_qr' => $this->recQr,
]);
return;
}
$rec = ProductionQuantity::where('plant_id', $plantId)->where('machine_id', $machineAgaPlant->id)->latest()->first();
if($rec)
{
$item = Item::where('id', $rec->item_id)->where('plant_id', $plantId)->first();
$itemCode = $item?->code ?? '';
$serialNo = $rec->serial_number ?? '';
$this->recQr = $itemCode . ' | ' . $serialNo;
}
if ($machine) {
$this->lNam = Line::where('id', $machine->line_id)->value('name');
$this->bNam = $machine->line->block->name ?? null;
@@ -436,15 +505,6 @@ class ProductionQuantityPage extends Page implements HasForms
'recent_qr' => $this->recQr,
]);
$this->triggerChartUpdate();
} else {
Notification::make()
->title('Unknown WorkCenter')
->body('Work Center not found')
->danger()
->send();
return;
}
}
@@ -1065,46 +1125,6 @@ class ProductionQuantityPage extends Page implements HasForms
$iCode = trim($splits[0]);
$sNumber = isset($splits[1]) ? trim($splits[1]) : null;
// $machine = Machine::where('work_center', $this->mNam)->where('plant_id', $this->pId)->first();
// $this->mId = $machine->id;
// $lineId = $machine->line_id;
// $this->lId = $lineId;
// $line = Line::find($lineId);
// if (! $line) {
// Notification::make()
// ->title('Invalid Line')
// ->body('Line associated with the machine not found.')
// ->danger()
// ->send();
// return;
// }
// $blockId = $line->block_id;
// $this->bId = $blockId;
// $shift = Shift::where('block_id', $blockId)->first();
// if (! $shift) {
// Notification::make()
// ->title('No Shift Found')
// ->body('No shift associated with this block.')
// ->danger()
// ->send();
// return;
// }
// $shiftId = $shift->id;
// $this->sId = $shiftId;
// $line = Line::with('block')->find($lineId);
// $lineName = $line?->name;
// $blockName = $line?->block?->name;
// $shiftName = $shift?->name;
if (! ctype_alnum($iCode)) {
@@ -1121,7 +1141,7 @@ class ProductionQuantityPage extends Page implements HasForms
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id' => $operatorName,
'recent_qr' => $this->recent_qr,
'recent_qr' => $this->recQr,
]);
Notification::make()
@@ -1145,7 +1165,7 @@ class ProductionQuantityPage extends Page implements HasForms
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id' => $operatorName,
'recent_qr' => $this->recent_qr,
'recent_qr' => $this->recQr,
]);
Notification::make()
@@ -1169,7 +1189,7 @@ class ProductionQuantityPage extends Page implements HasForms
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id' => $operatorName,
'recent_qr' => $this->recent_qr,
'recent_qr' => $this->recQr,
]);
Notification::make()
@@ -1194,7 +1214,7 @@ class ProductionQuantityPage extends Page implements HasForms
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id' => $operatorName,
'recent_qr' => $this->recent_qr,
'recent_qr' => $this->recQr,
]);
Notification::make()
@@ -1221,7 +1241,7 @@ class ProductionQuantityPage extends Page implements HasForms
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id' => $operatorName,
'recent_qr' => $this->recent_qr,
'recent_qr' => $this->recQr,
]);
Notification::make()
@@ -1376,13 +1396,10 @@ class ProductionQuantityPage extends Page implements HasForms
->title('Invalid QR Found') // {$operatorName}
->body('Please, scan the valid QR code.')
->danger()
// ->persistent()
->send();
return;
} else {
// // Perform any additional processing or database operations
// $this->saveFormData($formValues);
$parts = explode('|', $this->qrData);
$itemCode = trim($parts[0]);
@@ -1467,7 +1484,7 @@ class ProductionQuantityPage extends Page implements HasForms
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id' => $operatorName,
'recent_qr' => $this->recent_qr,
'recent_qr' => $this->recQr,
]);
return;
@@ -1489,7 +1506,6 @@ class ProductionQuantityPage extends Page implements HasForms
// $this->recent_qr = $itemCode.' | '.$this->sNoId;
// after success insertion
$this->form->fill([
'plant_id' => $this->pId,
'machine_id' => $this->mNam,
'block_name' => $this->bNam,
@@ -1502,7 +1518,7 @@ class ProductionQuantityPage extends Page implements HasForms
'sap_msg_status' => null,
'sap_msg_description' => null,
'operator_id' => $operatorName,
'recent_qr' => $this->recent_qr,
'recent_qr' => $itemCode.' | '.$this->sNoId,
]);
Notification::make()

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,7 @@ use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Notifications\Notification;
use Illuminate\Support\Facades\Auth;
class ProductionTarget extends Page
{
@@ -30,13 +31,16 @@ class ProductionTarget extends Page
->schema([
Select::make('plant_id')
->label('Plant')
->relationship('plant', 'name')
->reactive()
// ->searchable()
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
})
->required()
->afterStateUpdated(function ($state, callable $get, $set) {
// dd($state);
$set('line_id', null);
$set('year', null);
$set('month', null);
@@ -45,6 +49,8 @@ class ProductionTarget extends Page
Select::make('line_id')
->label('Line')
->required()
->relationship('line', 'name')
// ->searchable()
->columnSpan(1)
->options(function (callable $get) {
if (!$get('plant_id')) {
@@ -58,6 +64,8 @@ class ProductionTarget extends Page
->reactive()
->afterStateUpdated(function ($state, callable $get, $set) {
$plantId = $get('plant_id');
$set('year', null);
$set('month', null);
$this->dispatch('loadData',$plantId, $state, '', '');
@@ -65,7 +73,9 @@ class ProductionTarget extends Page
Select::make('year')
->label('Year')
->reactive()
// ->searchable()
->options([
'2025' => '2025',
'2026' => '2026',
'2027' => '2027',
'2028' => '2028',
@@ -93,6 +103,7 @@ class ProductionTarget extends Page
Select::make('month')
->label('Month')
->reactive()
// ->searchable()
->options([
'01' => 'January',
'02' => 'February',
@@ -170,4 +181,9 @@ class ProductionTarget extends Page
$this->dispatch('loadData1' ,$plantId, $lineId, $year, $month);
}
public static function canAccess(): bool
{
return Auth::check() && Auth::user()->can('view production target page');
}
}

View File

@@ -61,14 +61,55 @@ class RfqDashboard extends Page
// session()->forget('rfq_number');
// }),
// Select::make('rfq_number')
// ->label('Select RFQ Number')
// ->reactive()
// ->options(function (callable $get) {
// return RequestQuotation::orderBy('rfq_number')
// ->pluck('rfq_number', 'id')
// ->toArray();
// })
// ->afterStateUpdated(function ($state, callable $set) {
// session(['rfq_id' => $state]);
// $set('transport_name', null);
// session()->forget('transport_name');
// }),
Select::make('rfq_number')
->label('Select RFQ Number')
->reactive()
->options(function (callable $get) {
->options(function () {
return RequestQuotation::orderBy('rfq_number')
->pluck('rfq_number', 'id')
->toArray();
$user = Filament::auth()->user();
if ($user?->hasAnyRole(['Super Admin', 'RFQ Supervisor'])) {
return RequestQuotation::orderBy('rfq_number')
->pluck('rfq_number', 'id')
->toArray();
}
$userName = $user?->name;
$masterIds = \App\Models\SpotRateTransportMaster::whereRaw(
"user_name::jsonb @> ?",
[json_encode([$userName])]
)
->pluck('id')
->unique()
->toArray();
if (empty($masterIds)) {
return [];
}
return RequestQuotation::whereIn(
'spot_rate_transport_master_id',
$masterIds
)
->orderBy('rfq_number')
->pluck('rfq_number', 'id')
->toArray();
})
->afterStateUpdated(function ($state, callable $set) {
session(['rfq_id' => $state]);

View File

@@ -10,6 +10,8 @@ class Welcome extends Page
protected static string $view = 'filament.pages.welcome';
protected static ?string $navigationGroup = 'IIOT';
public function getHeading(): string
{
return '';