Compare commits
31 Commits
2c66f2e6bd
...
renovate/b
| Author | SHA1 | Date | |
|---|---|---|---|
| 52f61551a3 | |||
| f3389399eb | |||
|
|
775396ace6 | ||
| c18a07853e | |||
|
|
a21ff06dcc | ||
| 555f810c0f | |||
|
|
b036cc57e6 | ||
| 2e5d185be1 | |||
|
|
68446902db | ||
| 0ece1d0dd6 | |||
|
|
aa7d1802c8 | ||
| e145560920 | |||
|
|
4365f30075 | ||
| e02052e536 | |||
|
|
578e147740 | ||
| 39e40e011f | |||
|
|
6601ee48d9 | ||
| 7184eda58c | |||
|
|
002b6550de | ||
| 3c4b419078 | |||
|
|
247c671fc3 | ||
| 7ba5375386 | |||
|
|
bfdc5c85ab | ||
| c3324caa08 | |||
|
|
bd2269d2b0 | ||
| ace14124f3 | |||
|
|
e8a1e97bd6 | ||
| c68a45ef8d | |||
|
|
d4319f6399 | ||
| 3edd8fafc6 | |||
|
|
da26035e84 |
201
app/Filament/Resources/CharacteristicApproverMasterResource.php
Normal file
201
app/Filament/Resources/CharacteristicApproverMasterResource.php
Normal file
@@ -0,0 +1,201 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\CharacteristicApproverMasterResource\Pages;
|
||||
use App\Models\CharacteristicApproverMaster;
|
||||
use App\Models\Machine;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
|
||||
class CharacteristicApproverMasterResource extends Resource
|
||||
{
|
||||
protected static ?string $model = CharacteristicApproverMaster::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Laser Marking';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\Select::make('plant_id')
|
||||
->label('Plant')
|
||||
->reactive()
|
||||
->relationship('plant', 'name')
|
||||
->required(),
|
||||
Forms\Components\Select::make('machine_id')
|
||||
->label('Work Center')
|
||||
// ->relationship('machine', 'name')
|
||||
->reactive()
|
||||
->searchable()
|
||||
->options(function (callable $get) {
|
||||
$plantId = $get('plant_id');
|
||||
if (empty($plantId)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Machine::where('plant_id', $plantId)->pluck('work_center', 'id');
|
||||
})
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('characteristic_field')
|
||||
->label('Characteristic Field'),
|
||||
Forms\Components\TextInput::make('machine_name')
|
||||
->label('Machine Name'),
|
||||
Forms\Components\TextInput::make('name1')
|
||||
->label('Name-1'),
|
||||
Forms\Components\TextInput::make('mail1')
|
||||
->label('Mail-1'),
|
||||
Forms\Components\TextInput::make('duration1')
|
||||
->label('Duration-1 (Hour.Minute)'),
|
||||
Forms\Components\TextInput::make('name2')
|
||||
->label('Name-2'),
|
||||
Forms\Components\TextInput::make('mail2')
|
||||
->label('Mail-2'),
|
||||
Forms\Components\TextInput::make('duration2')
|
||||
->label('Duration-2 (Hour.Minute)'),
|
||||
Forms\Components\TextInput::make('name3')
|
||||
->label('Name-3'),
|
||||
Forms\Components\TextInput::make('mail3')
|
||||
->label('Mail-3'),
|
||||
Forms\Components\TextInput::make('duration3')
|
||||
->label('Duration-3 (Hour.Minute)'),
|
||||
Forms\Components\Hidden::make('created_by')
|
||||
->label('Created By')
|
||||
->default(Filament::auth()->user()?->name),
|
||||
Forms\Components\Hidden::make('updated_by')
|
||||
->label('Updated By')
|
||||
->default(Filament::auth()->user()?->name),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('No.')
|
||||
->label('No.')
|
||||
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
|
||||
$paginator = $livewire->getTableRecords();
|
||||
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
||||
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
||||
|
||||
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||
}),
|
||||
Tables\Columns\TextColumn::make('plant.name')
|
||||
->label('Plant')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('machine.work_center')
|
||||
->label('Work Center')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('characteristic_field')
|
||||
->label('Characteristic Field')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('machine_name')
|
||||
->label('Machine Name')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('name1')
|
||||
->label('Approver Name 1')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('mail1')
|
||||
->label('Mail 1')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('duration1')
|
||||
->label('Duration 1 (Hour.Minute)')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('name2')
|
||||
->label('Approver Name 2')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('mail2')
|
||||
->label('Mail 2')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('duration2')
|
||||
->label('Duration 2 (Hour.Minute)')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('name3')
|
||||
->label('Approver Name 3')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('mail3')
|
||||
->label('Mail 3')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('duration3')
|
||||
->label('Duration 3 (Hour.Minute)')
|
||||
->alignCenter()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('created_at')
|
||||
->label('Created At')
|
||||
->alignCenter()
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('updated_at')
|
||||
->label('Updated At')
|
||||
->alignCenter()
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('deleted_at')
|
||||
->dateTime()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->filters([
|
||||
Tables\Filters\TrashedFilter::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\ViewAction::make(),
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\ForceDeleteBulkAction::make(),
|
||||
Tables\Actions\RestoreBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => Pages\ListCharacteristicApproverMasters::route('/'),
|
||||
'create' => Pages\CreateCharacteristicApproverMaster::route('/create'),
|
||||
'view' => Pages\ViewCharacteristicApproverMaster::route('/{record}'),
|
||||
'edit' => Pages\EditCharacteristicApproverMaster::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getEloquentQuery(): Builder
|
||||
{
|
||||
return parent::getEloquentQuery()
|
||||
->withoutGlobalScopes([
|
||||
SoftDeletingScope::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CharacteristicApproverMasterResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CharacteristicApproverMasterResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateCharacteristicApproverMaster extends CreateRecord
|
||||
{
|
||||
protected static string $resource = CharacteristicApproverMasterResource::class;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CharacteristicApproverMasterResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CharacteristicApproverMasterResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditCharacteristicApproverMaster extends EditRecord
|
||||
{
|
||||
protected static string $resource = CharacteristicApproverMasterResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\ViewAction::make(),
|
||||
Actions\DeleteAction::make(),
|
||||
Actions\ForceDeleteAction::make(),
|
||||
Actions\RestoreAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CharacteristicApproverMasterResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CharacteristicApproverMasterResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListCharacteristicApproverMasters extends ListRecords
|
||||
{
|
||||
protected static string $resource = CharacteristicApproverMasterResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CharacteristicApproverMasterResource\Pages;
|
||||
|
||||
use App\Filament\Resources\CharacteristicApproverMasterResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewCharacteristicApproverMaster extends ViewRecord
|
||||
{
|
||||
protected static string $resource = CharacteristicApproverMasterResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
1054
app/Filament/Resources/ClassCharacteristicResource.php
Normal file
1054
app/Filament/Resources/ClassCharacteristicResource.php
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ClassCharacteristicResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ClassCharacteristicResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateClassCharacteristic extends CreateRecord
|
||||
{
|
||||
protected static string $resource = ClassCharacteristicResource::class;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ClassCharacteristicResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ClassCharacteristicResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditClassCharacteristic extends EditRecord
|
||||
{
|
||||
protected static string $resource = ClassCharacteristicResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\ViewAction::make(),
|
||||
Actions\DeleteAction::make(),
|
||||
Actions\ForceDeleteAction::make(),
|
||||
Actions\RestoreAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ClassCharacteristicResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ClassCharacteristicResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListClassCharacteristics extends ListRecords
|
||||
{
|
||||
protected static string $resource = ClassCharacteristicResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\ClassCharacteristicResource\Pages;
|
||||
|
||||
use App\Filament\Resources\ClassCharacteristicResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewClassCharacteristic extends ViewRecord
|
||||
{
|
||||
protected static string $resource = ClassCharacteristicResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
573
app/Filament/Resources/RequestCharacteristicResource.php
Normal file
573
app/Filament/Resources/RequestCharacteristicResource.php
Normal file
@@ -0,0 +1,573 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources;
|
||||
|
||||
use App\Filament\Resources\RequestCharacteristicResource\Pages;
|
||||
use App\Models\CharacteristicApproverMaster;
|
||||
use App\Models\Item;
|
||||
use App\Models\Machine;
|
||||
use App\Models\RequestCharacteristic;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class RequestCharacteristicResource extends Resource
|
||||
{
|
||||
protected static ?string $model = RequestCharacteristic::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
|
||||
protected static ?string $navigationGroup = 'Laser Marking';
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
|
||||
// $disableField = function ($get) {
|
||||
// $currentUser = Filament::auth()->user();
|
||||
// $approverId = $get('characteristic_approver_master_id');
|
||||
|
||||
// if (!$approverId) return true; // disable if no approver selected
|
||||
|
||||
// $approver = CharacteristicApproverMaster::find($approverId);
|
||||
// if (!$approver) return true;
|
||||
|
||||
// // Enable if Super Admin
|
||||
// if ($currentUser && $currentUser->hasRole('Super Admin')) {
|
||||
// return false; // not disabled
|
||||
// }
|
||||
|
||||
// // Enable only if current user is one of the approvers
|
||||
// $userName = $currentUser?->name;
|
||||
|
||||
// return !in_array($userName, [
|
||||
// $approver->name1,
|
||||
// $approver->name2,
|
||||
// $approver->name3,
|
||||
// ]);
|
||||
// };
|
||||
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\Select::make('plant_id')
|
||||
->label('Plant')
|
||||
->relationship('plant', 'name')
|
||||
->required()
|
||||
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
||||
Forms\Components\Select::make('machine_id')
|
||||
->label('Work Center')
|
||||
// ->relationship('machine', 'name')
|
||||
->reactive()
|
||||
->searchable()
|
||||
->options(function (callable $get) {
|
||||
$plantId = $get('plant_id');
|
||||
if (empty($plantId)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Machine::where('plant_id', $plantId)->pluck('work_center', 'id');
|
||||
})
|
||||
->required()
|
||||
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
||||
Forms\Components\TextInput::make('work_flow_id')
|
||||
->label('Work Flow ID')
|
||||
->readOnly()
|
||||
->reactive(),
|
||||
// ->rule(function (callable $get) {
|
||||
// return Rule::unique('request_characteristics', 'work_flow_id')
|
||||
// ->where('plant_id', $get('plant_id'))
|
||||
// ->ignore($get('id'));
|
||||
// }),
|
||||
Forms\Components\Select::make('item_id')
|
||||
->label('Item')
|
||||
// ->relationship('item', 'id')
|
||||
->reactive()
|
||||
->searchable()
|
||||
->options(function (callable $get) {
|
||||
$plantId = $get('plant_id');
|
||||
if (empty($plantId)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Item::where('plant_id', $plantId)->pluck('code', 'id');
|
||||
})
|
||||
->required()
|
||||
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
||||
Forms\Components\Select::make('characteristic_approver_master_id')
|
||||
->label('Characteristic Approver')
|
||||
// ->relationship('characteristicApproverMaster', 'id')
|
||||
->reactive()
|
||||
->searchable()
|
||||
->options(function (callable $get) {
|
||||
$plantId = $get('plant_id');
|
||||
|
||||
$machineId = $get('machine_id');
|
||||
|
||||
if (! $plantId) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$approvers = CharacteristicApproverMaster::where('plant_id', $plantId)
|
||||
->where('machine_id', $machineId)
|
||||
->get();
|
||||
|
||||
$options = [];
|
||||
|
||||
foreach ($approvers as $approver) {
|
||||
if ($approver->name1) {
|
||||
$options[$approver->id.'_name1'] = $approver->name1;
|
||||
}
|
||||
if ($approver->name2) {
|
||||
$options[$approver->id.'_name2'] = $approver->name2;
|
||||
}
|
||||
if ($approver->name3) {
|
||||
$options[$approver->id.'_name3'] = $approver->name3;
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
})
|
||||
->dehydrateStateUsing(function ($state, callable $set) {
|
||||
|
||||
if (empty($state) || ! str_contains($state, '_')) {
|
||||
return $state;
|
||||
}
|
||||
|
||||
$parts = explode('_', $state);
|
||||
|
||||
if (count($parts) != 2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
[$id, $level] = $parts;
|
||||
|
||||
$set('approver_level', $level);
|
||||
|
||||
return (int) $id;
|
||||
})
|
||||
->required()
|
||||
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
||||
Forms\Components\TextInput::make('aufnr')
|
||||
->label('Aufnr')
|
||||
->reactive()
|
||||
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
||||
Forms\Components\TextInput::make('characteristic_name')
|
||||
->label('Characteristic Name')
|
||||
->reactive()
|
||||
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
||||
Forms\Components\TextInput::make('current_value')
|
||||
->label('Current Value')
|
||||
->reactive()
|
||||
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
||||
Forms\Components\TextInput::make('update_value')
|
||||
->label('Update Value')
|
||||
->reactive()
|
||||
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
||||
Forms\Components\Select::make('approver_status1')
|
||||
->label('Approver Status 1')
|
||||
->reactive()
|
||||
->options([
|
||||
'Approved' => 'Approved',
|
||||
'Hold' => 'Hold',
|
||||
'Rejected' => 'Rejected',
|
||||
])
|
||||
->disabled(function ($get) {
|
||||
$currentUser = Filament::auth()->user();
|
||||
$approverId = $get('characteristic_approver_master_id');
|
||||
|
||||
if (! $approverId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (str_contains($approverId, '_')) {
|
||||
[$approverId, $level] = explode('_', $approverId);
|
||||
}
|
||||
|
||||
$approver = CharacteristicApproverMaster::find($approverId);
|
||||
if (! $approver) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Super Admin can edit any
|
||||
if ($currentUser && $currentUser->hasRole('Super Admin')) {
|
||||
return false; // field enabled
|
||||
}
|
||||
|
||||
// Otherwise, enable only if the user's name matches
|
||||
return $approver->name1 != $currentUser?->name;
|
||||
}),
|
||||
Forms\Components\TextInput::make('approver_remark1')
|
||||
->label('Approver Remark 1')
|
||||
->reactive(),
|
||||
Forms\Components\DateTimePicker::make('approved1_at')
|
||||
->label('Approved At 1')
|
||||
->reactive()
|
||||
->disabled(function ($get) {
|
||||
$currentUser = Filament::auth()->user(); // logged-in user
|
||||
$approverId = $get('characteristic_approver_master_id');
|
||||
|
||||
if (! $approverId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (str_contains($approverId, '_')) {
|
||||
[$approverId, $level] = explode('_', $approverId);
|
||||
}
|
||||
|
||||
$approver = CharacteristicApproverMaster::find($approverId);
|
||||
if (! $approver) {
|
||||
return true;
|
||||
}
|
||||
if ($currentUser && $currentUser->hasRole('Super Admin')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $approver->name1 != $currentUser?->name;
|
||||
}),
|
||||
Forms\Components\Select::make('approver_status2')
|
||||
->label('Approver Status 2')
|
||||
->reactive()
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||
if ($state && empty($get('approved2_at'))) {
|
||||
$set('approved2_at', now());
|
||||
}
|
||||
})
|
||||
->options([
|
||||
'Approved' => 'Approved',
|
||||
'Hold' => 'Hold',
|
||||
'Rejected' => 'Rejected',
|
||||
])
|
||||
->disabled(function ($get) {
|
||||
$currentUser = Filament::auth()->user(); // get the User object
|
||||
$approverId = $get('characteristic_approver_master_id');
|
||||
|
||||
if (! $approverId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (str_contains($approverId, '_')) {
|
||||
[$approverId, $level] = explode('_', $approverId);
|
||||
}
|
||||
|
||||
$approver = CharacteristicApproverMaster::find($approverId);
|
||||
if (! $approver) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Super Admin can always edit
|
||||
if ($currentUser && $currentUser->hasRole('Super Admin')) {
|
||||
return false; // ENABLE field
|
||||
}
|
||||
|
||||
// Otherwise, enable only if the user's name matches
|
||||
return $approver->name2 != $currentUser?->name;
|
||||
}),
|
||||
Forms\Components\TextInput::make('approver_remark2')
|
||||
->label('Approver Remark 2')
|
||||
->reactive(),
|
||||
Forms\Components\DateTimePicker::make('approved2_at')
|
||||
->label('Approverd At 2')
|
||||
->reactive()
|
||||
->disabled(function ($get) {
|
||||
$currentUser = Filament::auth()->user(); // logged-in user
|
||||
$approverId = $get('characteristic_approver_master_id');
|
||||
|
||||
if (! $approverId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (str_contains($approverId, '_')) {
|
||||
[$approverId, $level] = explode('_', $approverId);
|
||||
}
|
||||
|
||||
$approver = CharacteristicApproverMaster::find($approverId);
|
||||
if (! $approver) {
|
||||
return true;
|
||||
}
|
||||
if ($currentUser && $currentUser->hasRole('Super Admin')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $approver->name2 != $currentUser?->name;
|
||||
})
|
||||
->dehydrated(true),
|
||||
Forms\Components\Select::make('approver_status3')
|
||||
->label('Approver Status 3')
|
||||
->reactive()
|
||||
->options([
|
||||
'Approved' => 'Approved',
|
||||
'Hold' => 'Hold',
|
||||
'Rejected' => 'Rejected',
|
||||
])
|
||||
->disabled(function ($get) {
|
||||
$currentUser = Filament::auth()->user();
|
||||
$approverId = $get('characteristic_approver_master_id');
|
||||
|
||||
if (! $approverId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (str_contains($approverId, '_')) {
|
||||
[$approverId, $level] = explode('_', $approverId);
|
||||
}
|
||||
|
||||
$approver = CharacteristicApproverMaster::find($approverId);
|
||||
if (! $approver) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($currentUser->hasRole('Super Admin')) {
|
||||
return false;
|
||||
} else {
|
||||
return $approver->name3 != $currentUser?->name;
|
||||
}
|
||||
|
||||
}),
|
||||
Forms\Components\TextInput::make('approver_remark3')
|
||||
->label('Approver Remark 3')
|
||||
->reactive(),
|
||||
Forms\Components\DateTimePicker::make('approved3_at')
|
||||
->label('Approverd At 3')
|
||||
->reactive()
|
||||
->disabled(function ($get) {
|
||||
$currentUser = Filament::auth()->user(); // logged-in user
|
||||
$approverId = $get('characteristic_approver_master_id');
|
||||
|
||||
if (! $approverId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (str_contains($approverId, '_')) {
|
||||
[$approverId, $level] = explode('_', $approverId);
|
||||
}
|
||||
|
||||
$approver = CharacteristicApproverMaster::find($approverId);
|
||||
if (! $approver) {
|
||||
return true;
|
||||
}
|
||||
if ($currentUser && $currentUser->hasRole('Super Admin')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $approver->name3 != $currentUser?->name;
|
||||
}),
|
||||
Forms\Components\Hidden::make('created_by')
|
||||
->label('Created By')
|
||||
->default(Filament::auth()->user()?->name),
|
||||
Forms\Components\Hidden::make('updated_by')
|
||||
->label('Updated By')
|
||||
->default(Filament::auth()->user()?->name),
|
||||
Forms\Components\TextInput::make('id')
|
||||
->hidden()
|
||||
->readOnly(),
|
||||
]);
|
||||
}
|
||||
|
||||
protected static function isFieldDisabled($get): bool
|
||||
{
|
||||
$currentUser = Filament::auth()->user();
|
||||
$approverId = $get('characteristic_approver_master_id');
|
||||
|
||||
if (! $approverId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (str_contains($approverId, '_')) {
|
||||
[$approverId, $level] = explode('_', $approverId);
|
||||
}
|
||||
|
||||
$approver = CharacteristicApproverMaster::find($approverId);
|
||||
if (! $approver) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($currentUser && $currentUser->hasRole('Super Admin')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$userName = $currentUser?->name;
|
||||
|
||||
return in_array($userName, [
|
||||
$approver->name1,
|
||||
$approver->name2,
|
||||
$approver->name3,
|
||||
]);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('No.')
|
||||
->label('No.')
|
||||
->getStateUsing(function ($record, $livewire, $column, $rowLoop) {
|
||||
$paginator = $livewire->getTableRecords();
|
||||
$perPage = method_exists($paginator, 'perPage') ? $paginator->perPage() : 10;
|
||||
$currentPage = method_exists($paginator, 'currentPage') ? $paginator->currentPage() : 1;
|
||||
|
||||
return ($currentPage - 1) * $perPage + $rowLoop->iteration;
|
||||
}),
|
||||
Tables\Columns\TextColumn::make('work_flow_id')
|
||||
->label('Work Flow ID')
|
||||
->alignCenter()
|
||||
->searchable(), // isIndividual: true
|
||||
Tables\Columns\TextColumn::make('plant.name')
|
||||
->label('Plant')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('machine.work_center')
|
||||
->label('Work Center')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('item.code')
|
||||
->label('Item Code')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('aufnr')
|
||||
->label('Aufnr')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('characteristic_name')
|
||||
->label('Characteristic Name')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('current_value')
|
||||
->label('Current Value')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('update_value')
|
||||
->label('Update Value')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('characteristicApproverMaster.name1')
|
||||
->label('Approver Name 1')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('approver_status1')
|
||||
->label('Approver Status 1')
|
||||
// ->color('success')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('approved1_at')
|
||||
->label('Approver At 1')
|
||||
->alignCenter()
|
||||
->dateTime()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('characteristicApproverMaster.name2')
|
||||
->label('Approver Name 2')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('approver_status2')
|
||||
->label('Approver Status 2')
|
||||
// ->color('danger')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('approved2_at')
|
||||
->label('Approver At 2')
|
||||
->alignCenter()
|
||||
->dateTime()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('characteristicApproverMaster.name3')
|
||||
->label('Approver Name 3')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('approver_status3')
|
||||
->label('Approver Status 3')
|
||||
// ->color('primary')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('approved3_at')
|
||||
->label('Approver At 3')
|
||||
->alignCenter()
|
||||
->dateTime()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('created_at')
|
||||
->dateTime()
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('created_by')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable(),
|
||||
Tables\Columns\TextColumn::make('updated_at')
|
||||
->dateTime()
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('updated_by')
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
Tables\Columns\TextColumn::make('deleted_at')
|
||||
->dateTime()
|
||||
->alignCenter()
|
||||
->searchable()
|
||||
->sortable()
|
||||
->toggleable(isToggledHiddenByDefault: true),
|
||||
])
|
||||
->searchPlaceholder('Search Work Flow ID')
|
||||
->filters([
|
||||
Tables\Filters\TrashedFilter::make(),
|
||||
])
|
||||
->actions([
|
||||
Tables\Actions\ViewAction::make(),
|
||||
Tables\Actions\EditAction::make(),
|
||||
])
|
||||
->bulkActions([
|
||||
Tables\Actions\BulkActionGroup::make([
|
||||
Tables\Actions\DeleteBulkAction::make(),
|
||||
Tables\Actions\ForceDeleteBulkAction::make(),
|
||||
Tables\Actions\RestoreBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => Pages\ListRequestCharacteristics::route('/'),
|
||||
'create' => Pages\CreateRequestCharacteristic::route('/create'),
|
||||
'view' => Pages\ViewRequestCharacteristic::route('/{record}'),
|
||||
'edit' => Pages\EditRequestCharacteristic::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getEloquentQuery(): Builder
|
||||
{
|
||||
return parent::getEloquentQuery()
|
||||
->withoutGlobalScopes([
|
||||
SoftDeletingScope::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\RequestCharacteristicResource\Pages;
|
||||
|
||||
use App\Filament\Resources\RequestCharacteristicResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateRequestCharacteristic extends CreateRecord
|
||||
{
|
||||
protected static string $resource = RequestCharacteristicResource::class;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\RequestCharacteristicResource\Pages;
|
||||
|
||||
use App\Filament\Resources\RequestCharacteristicResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditRequestCharacteristic extends EditRecord
|
||||
{
|
||||
protected static string $resource = RequestCharacteristicResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\ViewAction::make(),
|
||||
Actions\DeleteAction::make(),
|
||||
Actions\ForceDeleteAction::make(),
|
||||
Actions\RestoreAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\RequestCharacteristicResource\Pages;
|
||||
|
||||
use App\Filament\Resources\RequestCharacteristicResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListRequestCharacteristics extends ListRecords
|
||||
{
|
||||
protected static string $resource = RequestCharacteristicResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\RequestCharacteristicResource\Pages;
|
||||
|
||||
use App\Filament\Resources\RequestCharacteristicResource;
|
||||
use Filament\Actions;
|
||||
use Filament\Resources\Pages\ViewRecord;
|
||||
|
||||
class ViewRequestCharacteristic extends ViewRecord
|
||||
{
|
||||
protected static string $resource = RequestCharacteristicResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Actions\EditAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
43
app/Models/CharacteristicApproverMaster.php
Normal file
43
app/Models/CharacteristicApproverMaster.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class CharacteristicApproverMaster extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'plant_id',
|
||||
'machine_id',
|
||||
'machine_name',
|
||||
'name1',
|
||||
'mail1',
|
||||
'name2',
|
||||
'mail2',
|
||||
'name3',
|
||||
'mail3',
|
||||
'duration1',
|
||||
'duration2',
|
||||
'duration3',
|
||||
'characteristic_field',
|
||||
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
public function plant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Plant::class);
|
||||
}
|
||||
|
||||
public function machine(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Machine::class);
|
||||
}
|
||||
}
|
||||
182
app/Models/ClassCharacteristic.php
Normal file
182
app/Models/ClassCharacteristic.php
Normal file
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class ClassCharacteristic extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'plant_id',
|
||||
'item_id',
|
||||
'machine_id',
|
||||
'aufnr',
|
||||
'class',
|
||||
'arbid',
|
||||
'gamng',
|
||||
'lmnga',
|
||||
'gernr',
|
||||
'zz1_cn_bill_ord',
|
||||
'zmm_amps',
|
||||
'zmm_brand',
|
||||
'zmm_degreeofprotection',
|
||||
'zmm_delivery',
|
||||
'zmm_dir_rot',
|
||||
'zmm_discharge',
|
||||
'zmm_discharge_max',
|
||||
'zmm_discharge_min',
|
||||
'zmm_duty',
|
||||
'zmm_eff_motor',
|
||||
'zmm_eff_pump',
|
||||
'zmm_frequency',
|
||||
'zmm_head',
|
||||
'zmm_heading',
|
||||
'zmm_head_max',
|
||||
'zmm_head_minimum',
|
||||
'zmm_idx_eff_mtr',
|
||||
'zmm_idx_eff_pump',
|
||||
'zmm_kvacode',
|
||||
'zmm_maxambtemp',
|
||||
'zmm_mincoolingflow',
|
||||
'zmm_motorseries',
|
||||
'zmm_motor_model',
|
||||
'zmm_outlet',
|
||||
'zmm_phase',
|
||||
'zmm_pressure',
|
||||
'zmm_pumpflowtype',
|
||||
'zmm_pumpseries',
|
||||
'zmm_pump_model',
|
||||
'zmm_ratedpower',
|
||||
'zmm_region',
|
||||
'zmm_servicefactor',
|
||||
'zmm_servicefactormaximumamps',
|
||||
'zmm_speed',
|
||||
'zmm_suction',
|
||||
'zmm_suctionxdelivery',
|
||||
'zmm_supplysource',
|
||||
'zmm_temperature',
|
||||
'zmm_thrustload',
|
||||
'zmm_volts',
|
||||
'zmm_wire',
|
||||
'zmm_package',
|
||||
'zmm_pvarrayrating',
|
||||
'zmm_isi',
|
||||
'zmm_isimotor',
|
||||
'zmm_isipump',
|
||||
'zmm_isipumpset',
|
||||
'zmm_pumpset_model',
|
||||
'zmm_stages',
|
||||
'zmm_headrange',
|
||||
'zmm_overall_efficiency',
|
||||
'zmm_connection',
|
||||
'zmm_min_bore_size',
|
||||
'zmm_isireference',
|
||||
'zmm_category',
|
||||
'zmm_submergence',
|
||||
'zmm_capacitorstart',
|
||||
'zmm_capacitorrun',
|
||||
'zmm_inch',
|
||||
'zmm_motor_type',
|
||||
'zmm_dismantle_direction',
|
||||
'zmm_eff_ovrall',
|
||||
'zmm_bodymoc',
|
||||
'zmm_rotormoc',
|
||||
'zmm_dlwl',
|
||||
'zmm_inputpower',
|
||||
'zmm_imp_od',
|
||||
'zmm_ambtemp',
|
||||
'zmm_de',
|
||||
'zmm_dischargerange',
|
||||
'zmm_efficiency_class',
|
||||
'zmm_framesize',
|
||||
'zmm_impellerdiameter',
|
||||
'zmm_insulationclass',
|
||||
'zmm_maxflow',
|
||||
'zmm_minhead',
|
||||
'zmm_mtrlofconst',
|
||||
'zmm_nde',
|
||||
'zmm_powerfactor',
|
||||
'zmm_tagno',
|
||||
'zmm_year',
|
||||
'zmm_laser_name',
|
||||
'zmm_beenote',
|
||||
'zmm_beenumber',
|
||||
'zmm_beestar',
|
||||
'zmm_codeclass',
|
||||
'zmm_colour',
|
||||
'zmm_logo_cp',
|
||||
'zmm_logo_ce',
|
||||
'zmm_logo_nsf',
|
||||
'zmm_grade',
|
||||
'zmm_grwt_pset',
|
||||
'zmm_grwt_cable',
|
||||
'zmm_grwt_motor',
|
||||
'zmm_grwt_pf',
|
||||
'zmm_grwt_pump',
|
||||
'zmm_isivalve',
|
||||
'zmm_isi_wc',
|
||||
'zmm_labelperiod',
|
||||
'zmm_length',
|
||||
'zmm_license_cml_no',
|
||||
'zmm_mfgmonyr',
|
||||
'zmm_modelyear',
|
||||
'zmm_motoridentification',
|
||||
'zmm_newt_pset',
|
||||
'zmm_newt_cable',
|
||||
'zmm_newt_motor',
|
||||
'zmm_newt_pf',
|
||||
'zmm_newt_pump',
|
||||
'zmm_packtype',
|
||||
'zmm_panel',
|
||||
'zmm_performance_factor',
|
||||
'zmm_pumpidentification',
|
||||
'zmm_psettype',
|
||||
'zmm_size',
|
||||
'zmm_eff_ttl',
|
||||
'zmm_type',
|
||||
'zmm_usp',
|
||||
'mark_status',
|
||||
'marked_datetime',
|
||||
'marked_by',
|
||||
'man_marked_status',
|
||||
'man_marked_datetime',
|
||||
'man_marked_by',
|
||||
'motor_marked_status',
|
||||
'motor_marked_by',
|
||||
'pump_marked_status',
|
||||
'pump_marked_by',
|
||||
'motor_pump_pumpset_status',
|
||||
'motor_machine_name',
|
||||
'pump_machine_name',
|
||||
'pumpset_machine_name',
|
||||
'part_validation_1',
|
||||
'part_validation_2',
|
||||
'samlight_logged_name',
|
||||
'pending_released_status',
|
||||
'motor_expected_time',
|
||||
'pump_expected_time',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
public function plant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Plant::class);
|
||||
}
|
||||
|
||||
public function item(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Item::class);
|
||||
}
|
||||
|
||||
public function machine(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Machine::class);
|
||||
}
|
||||
}
|
||||
99
app/Models/RequestCharacteristic.php
Normal file
99
app/Models/RequestCharacteristic.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class RequestCharacteristic extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'plant_id',
|
||||
'machine_id',
|
||||
'item_id',
|
||||
'characteristic_approver_master_id',
|
||||
'aufnr',
|
||||
'characteristic_name',
|
||||
'current_value',
|
||||
'update_value',
|
||||
'approver_status1',
|
||||
'approver_status2',
|
||||
'approver_status3',
|
||||
'approver_remark1',
|
||||
'approver_remark2',
|
||||
'approver_remark3',
|
||||
'approved1_at',
|
||||
'approved2_at',
|
||||
'approved3_at',
|
||||
'mail_status',
|
||||
'trigger_at',
|
||||
'work_flow_id',
|
||||
|
||||
'created_at',
|
||||
'updated_at',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
public function plant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Plant::class);
|
||||
}
|
||||
|
||||
public function item(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Item::class);
|
||||
}
|
||||
|
||||
|
||||
public function machine(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Machine::class);
|
||||
}
|
||||
|
||||
public function characteristicApproverMaster(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(CharacteristicApproverMaster::class);
|
||||
}
|
||||
|
||||
// public function approverName1()
|
||||
// {
|
||||
// return $this->belongsTo(
|
||||
// CharacteristicApproverMaster::class,
|
||||
// 'characteristic_approver_master_id'
|
||||
// );
|
||||
// }
|
||||
|
||||
// public function approverName2()
|
||||
// {
|
||||
// return $this->belongsTo(
|
||||
// CharacteristicApproverMaster::class,
|
||||
// 'characteristic_approver_master_id'
|
||||
// );
|
||||
// }
|
||||
|
||||
// public function approverName3()
|
||||
// {
|
||||
// return $this->belongsTo(
|
||||
// CharacteristicApproverMaster::class,
|
||||
// 'characteristic_approver_master_id'
|
||||
// );
|
||||
// }
|
||||
|
||||
public function approver()
|
||||
{
|
||||
return $this->belongsTo(
|
||||
CharacteristicApproverMaster::class,
|
||||
'characteristic_approver_master_id'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
106
app/Policies/CharacteristicApproverMasterPolicy.php
Normal file
106
app/Policies/CharacteristicApproverMasterPolicy.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Auth\Access\Response;
|
||||
use App\Models\CharacteristicApproverMaster;
|
||||
use App\Models\User;
|
||||
|
||||
class CharacteristicApproverMasterPolicy
|
||||
{
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('view-any CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view(User $user, CharacteristicApproverMaster $characteristicapprovermaster): bool
|
||||
{
|
||||
return $user->checkPermissionTo('view CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('create CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update(User $user, CharacteristicApproverMaster $characteristicapprovermaster): bool
|
||||
{
|
||||
return $user->checkPermissionTo('update CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete(User $user, CharacteristicApproverMaster $characteristicapprovermaster): bool
|
||||
{
|
||||
return $user->checkPermissionTo('delete CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete any models.
|
||||
*/
|
||||
public function deleteAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('delete-any CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can restore the model.
|
||||
*/
|
||||
public function restore(User $user, CharacteristicApproverMaster $characteristicapprovermaster): bool
|
||||
{
|
||||
return $user->checkPermissionTo('restore CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can restore any models.
|
||||
*/
|
||||
public function restoreAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('restore-any CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can replicate the model.
|
||||
*/
|
||||
public function replicate(User $user, CharacteristicApproverMaster $characteristicapprovermaster): bool
|
||||
{
|
||||
return $user->checkPermissionTo('replicate CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can reorder the models.
|
||||
*/
|
||||
public function reorder(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('reorder CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can permanently delete the model.
|
||||
*/
|
||||
public function forceDelete(User $user, CharacteristicApproverMaster $characteristicapprovermaster): bool
|
||||
{
|
||||
return $user->checkPermissionTo('force-delete CharacteristicApproverMaster');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can permanently delete any models.
|
||||
*/
|
||||
public function forceDeleteAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('force-delete-any CharacteristicApproverMaster');
|
||||
}
|
||||
}
|
||||
106
app/Policies/ClassCharacteristicPolicy.php
Normal file
106
app/Policies/ClassCharacteristicPolicy.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Auth\Access\Response;
|
||||
use App\Models\ClassCharacteristic;
|
||||
use App\Models\User;
|
||||
|
||||
class ClassCharacteristicPolicy
|
||||
{
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('view-any ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view(User $user, ClassCharacteristic $classcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('view ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('create ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update(User $user, ClassCharacteristic $classcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('update ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete(User $user, ClassCharacteristic $classcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('delete ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete any models.
|
||||
*/
|
||||
public function deleteAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('delete-any ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can restore the model.
|
||||
*/
|
||||
public function restore(User $user, ClassCharacteristic $classcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('restore ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can restore any models.
|
||||
*/
|
||||
public function restoreAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('restore-any ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can replicate the model.
|
||||
*/
|
||||
public function replicate(User $user, ClassCharacteristic $classcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('replicate ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can reorder the models.
|
||||
*/
|
||||
public function reorder(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('reorder ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can permanently delete the model.
|
||||
*/
|
||||
public function forceDelete(User $user, ClassCharacteristic $classcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('force-delete ClassCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can permanently delete any models.
|
||||
*/
|
||||
public function forceDeleteAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('force-delete-any ClassCharacteristic');
|
||||
}
|
||||
}
|
||||
106
app/Policies/RequestCharacteristicPolicy.php
Normal file
106
app/Policies/RequestCharacteristicPolicy.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use Illuminate\Auth\Access\Response;
|
||||
use App\Models\RequestCharacteristic;
|
||||
use App\Models\User;
|
||||
|
||||
class RequestCharacteristicPolicy
|
||||
{
|
||||
/**
|
||||
* Determine whether the user can view any models.
|
||||
*/
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('view-any RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can view the model.
|
||||
*/
|
||||
public function view(User $user, RequestCharacteristic $requestcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('view RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can create models.
|
||||
*/
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('create RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can update the model.
|
||||
*/
|
||||
public function update(User $user, RequestCharacteristic $requestcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('update RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete the model.
|
||||
*/
|
||||
public function delete(User $user, RequestCharacteristic $requestcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('delete RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can delete any models.
|
||||
*/
|
||||
public function deleteAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('delete-any RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can restore the model.
|
||||
*/
|
||||
public function restore(User $user, RequestCharacteristic $requestcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('restore RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can restore any models.
|
||||
*/
|
||||
public function restoreAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('restore-any RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can replicate the model.
|
||||
*/
|
||||
public function replicate(User $user, RequestCharacteristic $requestcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('replicate RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can reorder the models.
|
||||
*/
|
||||
public function reorder(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('reorder RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can permanently delete the model.
|
||||
*/
|
||||
public function forceDelete(User $user, RequestCharacteristic $requestcharacteristic): bool
|
||||
{
|
||||
return $user->checkPermissionTo('force-delete RequestCharacteristic');
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the user can permanently delete any models.
|
||||
*/
|
||||
public function forceDeleteAny(User $user): bool
|
||||
{
|
||||
return $user->checkPermissionTo('force-delete-any RequestCharacteristic');
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@
|
||||
"tpetry/laravel-postgresql-enhanced": "^2.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.15",
|
||||
"barryvdh/laravel-debugbar": "^4.0",
|
||||
"barryvdh/laravel-ide-helper": "^3.5",
|
||||
"beyondcode/laravel-dump-server": "^2.1",
|
||||
"fakerphp/faker": "^1.23",
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$sql = <<<'SQL'
|
||||
CREATE TABLE class_characteristics (
|
||||
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
||||
plant_id BIGINT NOT NULL,
|
||||
machine_id BIGINT NOT NULL,
|
||||
item_id BIGINT NOT NULL,
|
||||
aufnr TEXT DEFAULT NULL,
|
||||
class TEXT DEFAULT NULL,
|
||||
arbid TEXT DEFAULT NULL,
|
||||
gamng TEXT DEFAULT NULL,
|
||||
lmnga TEXT DEFAULT NULL,
|
||||
gernr TEXT DEFAULT NULL,
|
||||
zz1_cn_bill_ord TEXT DEFAULT NULL,
|
||||
zmm_amps TEXT DEFAULT NULL,
|
||||
zmm_brand TEXT DEFAULT NULL,
|
||||
zmm_degreeofprotection TEXT DEFAULT NULL,
|
||||
zmm_delivery TEXT DEFAULT NULL,
|
||||
zmm_dir_rot TEXT DEFAULT NULL,
|
||||
zmm_discharge TEXT DEFAULT NULL,
|
||||
zmm_discharge_max TEXT DEFAULT NULL,
|
||||
zmm_discharge_min TEXT DEFAULT NULL,
|
||||
zmm_duty TEXT DEFAULT NULL,
|
||||
zmm_eff_motor TEXT DEFAULT NULL,
|
||||
zmm_eff_pump TEXT DEFAULT NULL,
|
||||
zmm_frequency TEXT DEFAULT NULL,
|
||||
zmm_head TEXT DEFAULT NULL,
|
||||
zmm_heading TEXT DEFAULT NULL,
|
||||
zmm_head_max TEXT DEFAULT NULL,
|
||||
zmm_head_minimum TEXT DEFAULT NULL,
|
||||
zmm_idx_eff_mtr TEXT DEFAULT NULL,
|
||||
zmm_idx_eff_pump TEXT DEFAULT NULL,
|
||||
zmm_kvacode TEXT DEFAULT NULL,
|
||||
zmm_maxambtemp TEXT DEFAULT NULL,
|
||||
zmm_mincoolingflow TEXT DEFAULT NULL,
|
||||
zmm_motorseries TEXT DEFAULT NULL,
|
||||
zmm_motor_model TEXT DEFAULT NULL,
|
||||
zmm_outlet TEXT DEFAULT NULL,
|
||||
zmm_phase TEXT DEFAULT NULL,
|
||||
zmm_pressure TEXT DEFAULT NULL,
|
||||
zmm_pumpflowtype TEXT DEFAULT NULL,
|
||||
zmm_pumpseries TEXT DEFAULT NULL,
|
||||
zmm_pump_model TEXT DEFAULT NULL,
|
||||
zmm_ratedpower TEXT DEFAULT NULL,
|
||||
zmm_region TEXT DEFAULT NULL,
|
||||
zmm_servicefactor TEXT DEFAULT NULL,
|
||||
zmm_servicefactormaximumamps TEXT DEFAULT NULL,
|
||||
zmm_speed TEXT DEFAULT NULL,
|
||||
zmm_suction TEXT DEFAULT NULL,
|
||||
zmm_suctionxdelivery TEXT DEFAULT NULL,
|
||||
zmm_supplysource TEXT DEFAULT NULL,
|
||||
zmm_temperature TEXT DEFAULT NULL,
|
||||
zmm_thrustload TEXT DEFAULT NULL,
|
||||
zmm_volts TEXT DEFAULT NULL,
|
||||
zmm_wire TEXT DEFAULT NULL,
|
||||
zmm_package TEXT DEFAULT NULL,
|
||||
zmm_pvarrayrating TEXT DEFAULT NULL,
|
||||
zmm_isi TEXT DEFAULT NULL,
|
||||
zmm_isimotor TEXT DEFAULT NULL,
|
||||
zmm_isipump TEXT DEFAULT NULL,
|
||||
zmm_isipumpset TEXT DEFAULT NULL,
|
||||
zmm_pumpset_model TEXT DEFAULT NULL,
|
||||
zmm_stages TEXT DEFAULT NULL,
|
||||
zmm_headrange TEXT DEFAULT NULL,
|
||||
zmm_overall_efficiency TEXT DEFAULT NULL,
|
||||
zmm_connection TEXT DEFAULT NULL,
|
||||
zmm_min_bore_size TEXT DEFAULT NULL,
|
||||
zmm_isireference TEXT DEFAULT NULL,
|
||||
zmm_category TEXT DEFAULT NULL,
|
||||
zmm_submergence TEXT DEFAULT NULL,
|
||||
zmm_capacitorstart TEXT DEFAULT NULL,
|
||||
zmm_capacitorrun TEXT DEFAULT NULL,
|
||||
zmm_inch TEXT DEFAULT NULL,
|
||||
zmm_motor_type TEXT DEFAULT NULL,
|
||||
zmm_dismantle_direction TEXT DEFAULT NULL,
|
||||
zmm_eff_ovrall TEXT DEFAULT NULL,
|
||||
zmm_bodymoc TEXT DEFAULT NULL,
|
||||
zmm_rotormoc TEXT DEFAULT NULL,
|
||||
zmm_dlwl TEXT DEFAULT NULL,
|
||||
zmm_inputpower TEXT DEFAULT NULL,
|
||||
zmm_imp_od TEXT DEFAULT NULL,
|
||||
zmm_ambtemp TEXT DEFAULT NULL,
|
||||
zmm_de TEXT DEFAULT NULL,
|
||||
zmm_dischargerange TEXT DEFAULT NULL,
|
||||
zmm_efficiency_class TEXT DEFAULT NULL,
|
||||
zmm_framesize TEXT DEFAULT NULL,
|
||||
zmm_impellerdiameter TEXT DEFAULT NULL,
|
||||
zmm_insulationclass TEXT DEFAULT NULL,
|
||||
zmm_maxflow TEXT DEFAULT NULL,
|
||||
zmm_minhead TEXT DEFAULT NULL,
|
||||
zmm_mtrlofconst TEXT DEFAULT NULL,
|
||||
zmm_nde TEXT DEFAULT NULL,
|
||||
zmm_powerfactor TEXT DEFAULT NULL,
|
||||
zmm_tagno TEXT DEFAULT NULL,
|
||||
zmm_year TEXT DEFAULT NULL,
|
||||
zmm_laser_name TEXT DEFAULT NULL,
|
||||
zmm_beenote TEXT DEFAULT NULL,
|
||||
zmm_beenumber TEXT DEFAULT NULL,
|
||||
zmm_beestar TEXT DEFAULT NULL,
|
||||
zmm_codeclass TEXT DEFAULT NULL,
|
||||
zmm_colour TEXT DEFAULT NULL,
|
||||
zmm_grade TEXT DEFAULT NULL,
|
||||
zmm_grwt_pset TEXT DEFAULT NULL,
|
||||
zmm_grwt_cable TEXT DEFAULT NULL,
|
||||
zmm_grwt_motor TEXT DEFAULT NULL,
|
||||
zmm_grwt_pf TEXT DEFAULT NULL,
|
||||
zmm_grwt_pump TEXT DEFAULT NULL,
|
||||
zmm_isivalve TEXT DEFAULT NULL,
|
||||
zmm_isi_wc TEXT DEFAULT NULL,
|
||||
zmm_labelperiod TEXT DEFAULT NULL,
|
||||
zmm_length TEXT DEFAULT NULL,
|
||||
zmm_license_cml_no TEXT DEFAULT NULL,
|
||||
zmm_mfgmonyr TEXT DEFAULT NULL,
|
||||
zmm_modelyear TEXT DEFAULT NULL,
|
||||
zmm_motoridentification TEXT DEFAULT NULL,
|
||||
zmm_newt_pset TEXT DEFAULT NULL,
|
||||
zmm_newt_cable TEXT DEFAULT NULL,
|
||||
zmm_newt_motor TEXT DEFAULT NULL,
|
||||
zmm_newt_pf TEXT DEFAULT NULL,
|
||||
zmm_newt_pump TEXT DEFAULT NULL,
|
||||
zmm_logo_cp TEXT DEFAULT NULL,
|
||||
zmm_logo_ce TEXT DEFAULT NULL,
|
||||
zmm_logo_nsf TEXT DEFAULT NULL,
|
||||
zmm_packtype TEXT DEFAULT NULL,
|
||||
zmm_panel TEXT DEFAULT NULL,
|
||||
zmm_performance_factor TEXT DEFAULT NULL,
|
||||
zmm_pumpidentification TEXT DEFAULT NULL,
|
||||
zmm_psettype TEXT DEFAULT NULL,
|
||||
zmm_size TEXT DEFAULT NULL,
|
||||
zmm_eff_ttl TEXT DEFAULT NULL,
|
||||
zmm_type TEXT DEFAULT NULL,
|
||||
zmm_usp TEXT DEFAULT NULL,
|
||||
mark_status TEXT DEFAULT NULL,
|
||||
marked_datetime TIMESTAMP DEFAULT NULL,
|
||||
marked_by TEXT DEFAULT NULL,
|
||||
man_marked_status TEXT DEFAULT '0',
|
||||
man_marked_datetime TIMESTAMP DEFAULT NULL,
|
||||
man_marked_by TEXT DEFAULT NULL,
|
||||
motor_marked_status TEXT DEFAULT NULL,
|
||||
motor_marked_by TEXT DEFAULT NULL,
|
||||
pump_marked_status TEXT DEFAULT NULL,
|
||||
pump_marked_by TEXT DEFAULT NULL,
|
||||
motor_pump_pumpset_status TEXT DEFAULT NULL,
|
||||
motor_machine_name TEXT DEFAULT NULL,
|
||||
pump_machine_name TEXT DEFAULT NULL,
|
||||
pumpset_machine_name TEXT DEFAULT NULL,
|
||||
part_validation_1 TEXT DEFAULT NULL,
|
||||
part_validation_2 TEXT DEFAULT NULL,
|
||||
samlight_logged_name TEXT DEFAULT NULL,
|
||||
pending_released_status INTEGER DEFAULT 0,
|
||||
motor_expected_time TEXT DEFAULT '0',
|
||||
pump_expected_time TEXT DEFAULT '0',
|
||||
|
||||
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
created_by TEXT DEFAULT NULL,
|
||||
updated_by TEXT DEFAULT NULL,
|
||||
deleted_at TIMESTAMP,
|
||||
|
||||
FOREIGN KEY (plant_id) REFERENCES plants (id),
|
||||
FOREIGN KEY (machine_id) REFERENCES machines (id),
|
||||
FOREIGN KEY (item_id) REFERENCES items (id)
|
||||
);
|
||||
SQL;
|
||||
DB::statement($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('class_characteristics');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$sql = <<<'SQL'
|
||||
CREATE TABLE request_characteristics (
|
||||
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
||||
|
||||
plant_id BIGINT NOT NULL,
|
||||
machine_id BIGINT NOT NULL,
|
||||
item_id BIGINT NOT NULL,
|
||||
characteristic_approver_master_id BIGINT NOT NULL,
|
||||
aufnr TEXT DEFAULT NULL,
|
||||
characteristic_name TEXT DEFAULT NULL,
|
||||
current_value TEXT DEFAULT NULL,
|
||||
update_value TEXT DEFAULT NULL,
|
||||
|
||||
approver_status1 TEXT DEFAULT NULL,
|
||||
approver_status2 TEXT DEFAULT NULL,
|
||||
approver_status3 TEXT DEFAULT NULL,
|
||||
|
||||
approver_remark1 TEXT DEFAULT NULL,
|
||||
approver_remark2 TEXT DEFAULT NULL,
|
||||
approver_remark3 TEXT DEFAULT NULL,
|
||||
|
||||
work_flow_id TEXT DEFAULT NULL,
|
||||
mail_status TEXT DEFAULT NULL,
|
||||
trigger_at TIMESTAMP,
|
||||
|
||||
approved1_at TIMESTAMP,
|
||||
approved2_at TIMESTAMP,
|
||||
approved3_at TIMESTAMP,
|
||||
|
||||
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
created_by TEXT DEFAULT NULL,
|
||||
updated_by TEXT DEFAULT NULL,
|
||||
deleted_at TIMESTAMP,
|
||||
|
||||
FOREIGN KEY (plant_id) REFERENCES plants(id),
|
||||
FOREIGN KEY (machine_id) REFERENCES machines(id),
|
||||
FOREIGN KEY (item_id) REFERENCES items(id),
|
||||
FOREIGN KEY (characteristic_approver_master_id) REFERENCES characteristic_approver_masters(id)
|
||||
);
|
||||
SQL;
|
||||
DB::statement($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('request_characteristics');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$sql = <<<'SQL'
|
||||
CREATE TABLE characteristic_approver_masters (
|
||||
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
||||
|
||||
plant_id BIGINT NOT NULL,
|
||||
machine_id BIGINT NOT NULL,
|
||||
machine_name TEXT DEFAULT NULL,
|
||||
characteristic_field TEXT DEFAULT NULL,
|
||||
name1 TEXT DEFAULT NULL,
|
||||
mail1 TEXT DEFAULT NULL,
|
||||
name2 TEXT DEFAULT NULL,
|
||||
mail2 TEXT DEFAULT NULL,
|
||||
name3 TEXT DEFAULT NULL,
|
||||
mail3 TEXT DEFAULT NULL,
|
||||
|
||||
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||
created_by TEXT DEFAULT NULL,
|
||||
updated_by TEXT DEFAULT NULL,
|
||||
deleted_at TIMESTAMP,
|
||||
|
||||
FOREIGN KEY (plant_id) REFERENCES plants(id),
|
||||
FOREIGN KEY (machine_id) REFERENCES machines(id)
|
||||
);
|
||||
SQL;
|
||||
DB::statement($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('characteristic_approver_masters');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
$sql1 = <<<'SQL'
|
||||
ALTER TABLE characteristic_approver_masters
|
||||
ADD COLUMN duration1 NUMERIC(4, 2) DEFAULT 0
|
||||
SQL;
|
||||
|
||||
DB::statement($sql1);
|
||||
|
||||
$sql2 = <<<'SQL'
|
||||
ALTER TABLE characteristic_approver_masters
|
||||
ADD COLUMN duration2 NUMERIC(4, 2) DEFAULT 0
|
||||
SQL;
|
||||
|
||||
DB::statement($sql2);
|
||||
|
||||
$sql3 = <<<'SQL'
|
||||
ALTER TABLE characteristic_approver_masters
|
||||
ADD COLUMN duration3 NUMERIC(4, 2) DEFAULT 0
|
||||
SQL;
|
||||
|
||||
DB::statement($sql3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Schema::table('characteristic_approver_masters', function (Blueprint $table) {
|
||||
// //
|
||||
// });
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\CharacteristicApprovalController;
|
||||
use App\Http\Controllers\CharacteristicsController;
|
||||
use App\Http\Controllers\EquipmentMasterController;
|
||||
use App\Http\Controllers\InvoiceValidationController;
|
||||
@@ -45,7 +46,6 @@ use Illuminate\Support\Facades\Route;
|
||||
|
||||
// Route::post('/user/update', function (Request $request) {
|
||||
// // Return the request data as JSON
|
||||
|
||||
// // dd($request);
|
||||
// return response()->json([
|
||||
// 'message' => 'User updated successfully',
|
||||
@@ -77,7 +77,7 @@ Route::get('/download-reprint-qr-pdf/{palletNo}', [PalletController::class, 'dow
|
||||
|
||||
// Route::get('/download-reprint-process-pdf/{plant}/{item}/{process_order}/{coil_number}/{name}', [PalletController::class, 'downloadReprintProcess'])->name('download-reprint-process-pdf');
|
||||
|
||||
//Route::get('/download-qr1-pdf/{palletNo}', [ProductionStickerReprintController::class, 'downloadQrPdf'])->where('palletNo', '.*')->name('download-qr1-pdf');
|
||||
// Route::get('/download-qr1-pdf/{palletNo}', [ProductionStickerReprintController::class, 'downloadQrPdf'])->where('palletNo', '.*')->name('download-qr1-pdf');
|
||||
Route::get('/download-qr1-pdf', [ProductionStickerReprintController::class, 'downloadQrPdf'])
|
||||
->name('download-qr1-pdf');
|
||||
|
||||
@@ -155,29 +155,37 @@ Route::post('process-order', [PdfController::class, 'storeProcessOrderData']);
|
||||
|
||||
Route::get('sap/files', [SapFileController::class, 'readFiles']);
|
||||
|
||||
// ..Laser Marking - Characteristics
|
||||
|
||||
Route::get('laser/item/get-master-data', [StickerMasterController::class, 'get_master']);
|
||||
|
||||
Route::post('laser/route/data', [CharacteristicsController::class, 'test']); // ->withoutMiddleware(VerifyCsrfToken::class)
|
||||
Route::get('get-characteristics/master-data', [CharacteristicsController::class, 'getCharacteristicsMaster']);
|
||||
|
||||
// ..Part Validation - Characteristics
|
||||
|
||||
// Route::get('get-characteristics/master-data', [CharacteristicsController::class, 'getCharacteristicsMaster']);
|
||||
Route::get('laser/item/get-master-data', [StickerMasterController::class, 'get_master']);
|
||||
|
||||
// ..Serial or job
|
||||
// ..Laser Route to SAP
|
||||
|
||||
// Route::get('laser/characteristics/get', [CharacteristicsController::class, 'getClassChar']);
|
||||
Route::post('laser/route/data', [CharacteristicsController::class, 'test']); // ->withoutMiddleware(VerifyCsrfToken::class)
|
||||
|
||||
// Route::get('laser/characteristics/check', [CharacteristicsController::class, 'checkClassChar']);
|
||||
// ..Job or Serial - Characteristics
|
||||
|
||||
Route::get('laser/characteristics/get', [CharacteristicsController::class, 'getClassChar']);
|
||||
|
||||
Route::get('laser/characteristics/check', [CharacteristicsController::class, 'checkClassChar']);
|
||||
|
||||
// ..Job or Master - Characteristics
|
||||
|
||||
// Route::post('laser/characteristics/data', [CharacteristicsController::class, 'storeClassChar']);
|
||||
Route::post('laser/characteristics/data', [CharacteristicsController::class, 'storeClassChar']);
|
||||
|
||||
// ..serial auto or manual
|
||||
// ..serial (auto or manual)
|
||||
|
||||
// Route::post('laser/characteristics/status', [CharacteristicsController::class, 'storeLaserStatus']);
|
||||
Route::post('laser/characteristics/status', [CharacteristicsController::class, 'storeLaserStatus']);
|
||||
|
||||
// ..Request Characteristics
|
||||
|
||||
Route::post('laser/characteristics/change', [CharacteristicsController::class, 'storeLaserRequestChar']);
|
||||
|
||||
Route::get('laser/characteristics/request', [CharacteristicsController::class, 'getLaserRequestChar']);
|
||||
|
||||
Route::post('laser-doc-pdf', [PdfController::class, 'storeLaserPdf']);
|
||||
|
||||
// ..Product Characteristics
|
||||
|
||||
@@ -195,6 +203,13 @@ Route::post('grmaster-sno-update', [PdfController::class, 'updateGR']);
|
||||
|
||||
Route::post('file/store', [SapFileController::class, 'store'])->name('file.store');
|
||||
|
||||
// routes/api.php
|
||||
// Route::post('/characteristic/hold-save', [CharacteristicApprovalController::class, 'holdSave']);
|
||||
|
||||
// Route::post('send-telegram', [TelegramController::class, 'sendMessage']);
|
||||
|
||||
// Route::post('invoice-exit', [InvoiceValidationController::class, 'handle']);
|
||||
|
||||
|
||||
// Route::post('/characteristic/hold-save', [CharacteristicApprovalController::class, 'holdSave'])
|
||||
// ->name('characteristic.hold.save');
|
||||
|
||||
Reference in New Issue
Block a user