Added zmm_mrp column migration, model, resource, importer, exporter, and Updated 5 permissions
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
This commit is contained in:
@@ -311,6 +311,8 @@ class ClassCharacteristicExporter extends Exporter
|
|||||||
->label('ZMM OPERATING TEMPERATURE'),
|
->label('ZMM OPERATING TEMPERATURE'),
|
||||||
ExportColumn::make('zmm_axial_force')
|
ExportColumn::make('zmm_axial_force')
|
||||||
->label('ZMM AXIAL FORCE'),
|
->label('ZMM AXIAL FORCE'),
|
||||||
|
ExportColumn::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP'),
|
||||||
// ExportColumn::make('is_stopped')
|
// ExportColumn::make('is_stopped')
|
||||||
// ->label('IS STOPPED')
|
// ->label('IS STOPPED')
|
||||||
// ->formatStateUsing(fn ($state) => ($state == '0') ? 'No' : ($state == '1' ? 'Yes' : 'Yes (Alert Pending)')),
|
// ->formatStateUsing(fn ($state) => ($state == '0') ? 'No' : ($state == '1' ? 'Yes' : 'Yes (Alert Pending)')),
|
||||||
|
|||||||
@@ -302,6 +302,8 @@ class ProductionTempExporter extends Exporter
|
|||||||
->label('ZMM OPERATING TEMPERATURE'),
|
->label('ZMM OPERATING TEMPERATURE'),
|
||||||
ExportColumn::make('zmm_axial_force')
|
ExportColumn::make('zmm_axial_force')
|
||||||
->label('ZMM AXIAL FORCE'),
|
->label('ZMM AXIAL FORCE'),
|
||||||
|
ExportColumn::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP'),
|
||||||
ExportColumn::make('pending_released_status')
|
ExportColumn::make('pending_released_status')
|
||||||
->label('PENDING RELEASED STATUS'),
|
->label('PENDING RELEASED STATUS'),
|
||||||
ExportColumn::make('created_at')
|
ExportColumn::make('created_at')
|
||||||
|
|||||||
@@ -302,6 +302,8 @@ class TempClassCharacteristicExporter extends Exporter
|
|||||||
->label('ZMM OPERATING TEMPERATURE'),
|
->label('ZMM OPERATING TEMPERATURE'),
|
||||||
ExportColumn::make('zmm_axial_force')
|
ExportColumn::make('zmm_axial_force')
|
||||||
->label('ZMM AXIAL FORCE'),
|
->label('ZMM AXIAL FORCE'),
|
||||||
|
ExportColumn::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP'),
|
||||||
ExportColumn::make('winded_serial_number')
|
ExportColumn::make('winded_serial_number')
|
||||||
->label('WINDED SERIAL NUMBER'),
|
->label('WINDED SERIAL NUMBER'),
|
||||||
ExportColumn::make('model_type')
|
ExportColumn::make('model_type')
|
||||||
|
|||||||
@@ -583,6 +583,10 @@ class ClassCharacteristicImporter extends Importer
|
|||||||
->label('ZMM AXIAL FORCE')
|
->label('ZMM AXIAL FORCE')
|
||||||
->exampleHeader('ZMM AXIAL FORCE')
|
->exampleHeader('ZMM AXIAL FORCE')
|
||||||
->example(''),
|
->example(''),
|
||||||
|
ImportColumn::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP')
|
||||||
|
->exampleHeader('ZMM MRP')
|
||||||
|
->example(''),
|
||||||
ImportColumn::make('mark_status')
|
ImportColumn::make('mark_status')
|
||||||
->label('MARKED STATUS')
|
->label('MARKED STATUS')
|
||||||
->exampleHeader('MARKED STATUS')
|
->exampleHeader('MARKED STATUS')
|
||||||
|
|||||||
@@ -583,9 +583,13 @@ class ProductionTempImporter extends Importer
|
|||||||
->label('ZMM AXIAL FORCE')
|
->label('ZMM AXIAL FORCE')
|
||||||
->exampleHeader('ZMM AXIAL FORCE')
|
->exampleHeader('ZMM AXIAL FORCE')
|
||||||
->example(''),
|
->example(''),
|
||||||
|
ImportColumn::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP')
|
||||||
|
->exampleHeader('ZMM MRP')
|
||||||
|
->example(''),
|
||||||
ImportColumn::make('pending_released_status')
|
ImportColumn::make('pending_released_status')
|
||||||
->label('PENDING RELEASED STATUS')
|
->label('PENDING RELEASED STATUS')
|
||||||
->exampleHeader('ZMM AXIAL FORCE')
|
->exampleHeader('PENDING RELEASED STATUS')
|
||||||
->example(''),
|
->example(''),
|
||||||
ImportColumn::make('created_by')
|
ImportColumn::make('created_by')
|
||||||
->label('CREATED BY')
|
->label('CREATED BY')
|
||||||
|
|||||||
@@ -583,6 +583,10 @@ class TempClassCharacteristicImporter extends Importer
|
|||||||
->label('ZMM AXIAL FORCE')
|
->label('ZMM AXIAL FORCE')
|
||||||
->exampleHeader('ZMM AXIAL FORCE')
|
->exampleHeader('ZMM AXIAL FORCE')
|
||||||
->example(''),
|
->example(''),
|
||||||
|
ImportColumn::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP')
|
||||||
|
->exampleHeader('ZMM MRP')
|
||||||
|
->example(''),
|
||||||
ImportColumn::make('winded_serial_number')
|
ImportColumn::make('winded_serial_number')
|
||||||
->label('WINDed SERIAL NUMBER')
|
->label('WINDed SERIAL NUMBER')
|
||||||
->exampleHeader('WINDED SERIAL NUMBER')
|
->exampleHeader('WINDED SERIAL NUMBER')
|
||||||
|
|||||||
@@ -7,16 +7,19 @@ use App\Filament\Imports\ClassCharacteristicImporter;
|
|||||||
use App\Filament\Resources\ClassCharacteristicResource\Pages;
|
use App\Filament\Resources\ClassCharacteristicResource\Pages;
|
||||||
use App\Models\ClassCharacteristic;
|
use App\Models\ClassCharacteristic;
|
||||||
use App\Models\Item;
|
use App\Models\Item;
|
||||||
|
use App\Models\ItemCharacteristic;
|
||||||
use App\Models\Machine;
|
use App\Models\Machine;
|
||||||
use App\Models\Plant;
|
use App\Models\Plant;
|
||||||
use Filament\Facades\Filament;
|
use Filament\Facades\Filament;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Components\DateTimePicker;
|
use Filament\Forms\Components\DateTimePicker;
|
||||||
|
use Filament\Forms\Components\FileUpload;
|
||||||
use Filament\Forms\Components\Section;
|
use Filament\Forms\Components\Section;
|
||||||
use Filament\Forms\Components\Select;
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
use Filament\Forms\Get;
|
use Filament\Forms\Get;
|
||||||
|
use Filament\Notifications\Notification;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
use Filament\Tables\Actions\ExportAction;
|
use Filament\Tables\Actions\ExportAction;
|
||||||
@@ -25,7 +28,9 @@ use Filament\Tables\Filters\Filter;
|
|||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
use Str;
|
use Str;
|
||||||
|
|
||||||
class ClassCharacteristicResource extends Resource
|
class ClassCharacteristicResource extends Resource
|
||||||
@@ -982,6 +987,12 @@ class ClassCharacteristicResource extends Resource
|
|||||||
->afterStateUpdated(function (callable $set) {
|
->afterStateUpdated(function (callable $set) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
}),
|
}),
|
||||||
|
Forms\Components\TextInput::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP')
|
||||||
|
->reactive()
|
||||||
|
->afterStateUpdated(function (callable $set) {
|
||||||
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
|
}),
|
||||||
// Forms\Components\Select::make('is_stopped')
|
// Forms\Components\Select::make('is_stopped')
|
||||||
// ->label('IS STOPPED')
|
// ->label('IS STOPPED')
|
||||||
// // ->nullable()
|
// // ->nullable()
|
||||||
@@ -1991,6 +2002,10 @@ class ClassCharacteristicResource extends Resource
|
|||||||
->label('ZMM AXIAL FORCE')
|
->label('ZMM AXIAL FORCE')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP')
|
||||||
|
->alignCenter()
|
||||||
|
->sortable(),
|
||||||
// Tables\Columns\TextColumn::make('is_stopped')
|
// Tables\Columns\TextColumn::make('is_stopped')
|
||||||
// ->label('IS STOPPED')
|
// ->label('IS STOPPED')
|
||||||
// ->alignCenter()
|
// ->alignCenter()
|
||||||
@@ -2533,6 +2548,611 @@ class ClassCharacteristicResource extends Resource
|
|||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
->headerActions([
|
->headerActions([
|
||||||
|
Tables\Actions\Action::make('Import Class Characteristic Serial')
|
||||||
|
->label('Import Class Characteristic Serial')
|
||||||
|
->form([
|
||||||
|
Select::make('plant_id')
|
||||||
|
// ->options(Plant::pluck('name', 'id')->toArray()) // Fetch plant names and IDs
|
||||||
|
->options(function (callable $get) {
|
||||||
|
$userHas = Filament::auth()->user()->plant_id;
|
||||||
|
|
||||||
|
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
|
||||||
|
})
|
||||||
|
->searchable()
|
||||||
|
->label('Search by Plant Name')
|
||||||
|
->required()
|
||||||
|
->default(function () {
|
||||||
|
return optional(ClassCharacteristic::latest()->first())->plant_id;
|
||||||
|
})
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
|
// $set('class_characteristics_serial', null);
|
||||||
|
$plantId = $get('plant_id');
|
||||||
|
if (! $plantId) {
|
||||||
|
$set('invoice_serial_number', null);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$plantCode = Plant::find($plantId)?->code ?? null;
|
||||||
|
|
||||||
|
$directory = "uploads/classcharacteristic/{$plantCode}";
|
||||||
|
if ($plantId && ! Storage::disk('local')->exists($directory)) {
|
||||||
|
Storage::disk('local')->makeDirectory($directory);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->reactive(),
|
||||||
|
|
||||||
|
FileUpload::make('class_characteristics_serial')
|
||||||
|
->label('Choose Class Characteristic Serial Upload')
|
||||||
|
->required()
|
||||||
|
->acceptedFileTypes([
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
// 'application/vnd.ms-excel', // Legacy .xls fallback if needed
|
||||||
|
])
|
||||||
|
->rules(['mimes:xlsx', 'max:5120']) // Laravel validation: extension check
|
||||||
|
->maxSize(5120)
|
||||||
|
->preserveFilenames() // <- this keeps the original filename
|
||||||
|
->reactive()
|
||||||
|
->storeFiles(false) // prevent auto-storing, we will store manually
|
||||||
|
->disk('local') // 'local' refers to the local storage disk defined in config/filesystems.php, typically pointing to storage/app.
|
||||||
|
->visible(fn (Get $get) => ! empty($get('plant_id')))
|
||||||
|
->directory(function (callable $get) {
|
||||||
|
$plant = Plant::find($get('plant_id'));
|
||||||
|
$plantCode = $plant?->code ?? null;
|
||||||
|
|
||||||
|
return "uploads/classcharacteristic/{$plantCode}";
|
||||||
|
})
|
||||||
|
->uploadingMessage('Uploading...')
|
||||||
|
->helperText('Only .xlsx files are allowed (Excel files).'),
|
||||||
|
])
|
||||||
|
->action(function (array $data) {
|
||||||
|
$uploadedFile = $data['class_characteristics_serial'];
|
||||||
|
|
||||||
|
$disk = Storage::disk('local');
|
||||||
|
|
||||||
|
$plantId = $data['plant_id'];
|
||||||
|
|
||||||
|
$plant = Plant::find($plantId);
|
||||||
|
$plantCode = $plant?->code ?? null;
|
||||||
|
|
||||||
|
$userName = Filament::auth()->user()->name;
|
||||||
|
|
||||||
|
// Get original filename
|
||||||
|
$originalName = $uploadedFile->getClientOriginalName(); // e.g. 3RA0018732.xlsx
|
||||||
|
|
||||||
|
$extension = strtolower(pathinfo($originalName, PATHINFO_EXTENSION));
|
||||||
|
if ($extension != 'xlsx') {
|
||||||
|
throw new \Exception('Only .xlsx files allowed.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$originalNameOnly = strtoupper(pathinfo($originalName, PATHINFO_FILENAME));
|
||||||
|
|
||||||
|
$originalName = "{$originalNameOnly}.xlsx";
|
||||||
|
|
||||||
|
// Store manually using storeAs to keep original name
|
||||||
|
$path = $uploadedFile->storeAs("uploads/classcharacteristic/{$plantCode}", $originalName, 'local'); // returns relative path
|
||||||
|
|
||||||
|
$fullPath = Storage::disk('local')->path($path);
|
||||||
|
// /home/iot-dev/projects/pds/storage/app/private/uploads/temp/{$plantCode}/3RA0018735.xlsx
|
||||||
|
|
||||||
|
if ($fullPath && file_exists($fullPath)) {
|
||||||
|
$rows = Excel::toArray(null, $fullPath)[0];
|
||||||
|
|
||||||
|
if ((count($rows) - 1) <= 0) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Records Not Found')
|
||||||
|
->body("Import the valid 'Serial Invoice' file to proceed..!")
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$invalidMplaCodes = [];
|
||||||
|
$invalidItemCodes = [];
|
||||||
|
$invalidWorkCenters = [];
|
||||||
|
$invalidPOrders = [];
|
||||||
|
$invalidOrderQuantities = [];
|
||||||
|
$invalidReleaseQuantities = [];
|
||||||
|
$invalidSerialCodes = [];
|
||||||
|
$invalidMatCodesNotFound = [];
|
||||||
|
$invalidPlaCodesNotFound = [];
|
||||||
|
$invalidWorkCodesNotFound = [];
|
||||||
|
$materialCodes = [];
|
||||||
|
$missingSerials = [];
|
||||||
|
$duplicateSerials = [];
|
||||||
|
$seenSerialNumbers = [];
|
||||||
|
$validRowsFound = false;
|
||||||
|
$duplicateSerialNoInDb = [];
|
||||||
|
|
||||||
|
foreach ($rows as $index => $row) {
|
||||||
|
if ($index == 0) {
|
||||||
|
continue;
|
||||||
|
} // Skip header
|
||||||
|
|
||||||
|
$plantCode = trim($row[0]);
|
||||||
|
$itemCode = trim($row[1]);
|
||||||
|
$workCenter = trim($row[2]);
|
||||||
|
$pOrder = trim($row[3]);
|
||||||
|
$orderQuan = trim($row[4]);
|
||||||
|
$releaseQuan = trim($row[5]);
|
||||||
|
$serialNumber = trim($row[6]);
|
||||||
|
|
||||||
|
if (empty($plantCode) && empty($itemCode) && empty($workCenter) && empty($pOrder) && empty($orderQuan) && empty($releaseQuan) && empty($serialNumber)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($plantCode)) {
|
||||||
|
$invalidMplaCodes[] = 'Row '.($index + 1).': Plant Code is empty';
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Str::length($plantCode) < 4 || ! is_numeric($plantCode)) {
|
||||||
|
$invalidMplaCodes[] = $plantCode;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Str::length($plantCode) > 3) {
|
||||||
|
|
||||||
|
$plant = Plant::where('code', $plantCode)->first();
|
||||||
|
if (! $plant) {
|
||||||
|
$invalidPlaCodesNotFound[] = $plantCode;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Str::length($itemCode) < 6 || ! ctype_alnum($itemCode)) {
|
||||||
|
$invalidItemCodes[] = $itemCode;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($itemCode) {
|
||||||
|
$itemCodeExist = Item::where('plant_id', $plantId)->where('code', $itemCode)->first();
|
||||||
|
if (! $itemCodeExist) {
|
||||||
|
$invalidMatCodesNotFound = $itemCode;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($workCenter)) {
|
||||||
|
$invalidWorkCenters[] = $workCenter;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Str::length($workCenter) < 7) {
|
||||||
|
$invalidWorkCenters[] = $workCenter;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (Str::length($workCenter) > 6) {
|
||||||
|
$WorkCenter = Machine::where('plant_id', $plantId)->where('work_center', $workCenter)->first();
|
||||||
|
|
||||||
|
if (! $WorkCenter) {
|
||||||
|
$invalidWorkCodesNotFound[] = $workCenter;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Str::length($pOrder) < 7 || ! is_numeric($pOrder)) {
|
||||||
|
$invalidPOrders[] = $pOrder;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($orderQuan == '' || ! is_numeric($orderQuan)) {
|
||||||
|
$invalidOrderQuantities[] = $orderQuan;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($releaseQuan == '' || ! is_numeric($releaseQuan)) {
|
||||||
|
$invalidReleaseQuantities[] = $releaseQuan;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! empty($serialNumber)) {
|
||||||
|
if (Str::length($serialNumber) < 9 || ! ctype_alnum($serialNumber)) {
|
||||||
|
$invalidSerialCodes[] = $serialNumber;
|
||||||
|
}
|
||||||
|
if ($serialNumber) {
|
||||||
|
if (in_array($serialNumber, $seenSerialNumbers)) {
|
||||||
|
$duplicateSerials[] = $serialNumber;
|
||||||
|
} else {
|
||||||
|
$seenSerialNumbers[] = $serialNumber;
|
||||||
|
$materialCodes[] = $itemCode;
|
||||||
|
$validRowsFound = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Str::length($serialNumber) > 8) {
|
||||||
|
$SerialNoExist = ClassCharacteristic::where('plant_id', $plantId)->where('gernr', $serialNumber)->first();
|
||||||
|
|
||||||
|
if ($SerialNoExist) {
|
||||||
|
$duplicateSerialNoInDb[] = $serialNumber;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$uniqueInvalidCodes = array_unique($invalidItemCodes);
|
||||||
|
|
||||||
|
$uniqueInvalidMatCodesMaster = array_unique($invalidMatCodesNotFound);
|
||||||
|
|
||||||
|
$uniqueInvalidPlaCodesMaster = array_unique($invalidPlaCodesNotFound);
|
||||||
|
|
||||||
|
$uniqueInvalidWorkCenter = array_unique($invalidWorkCenters);
|
||||||
|
|
||||||
|
$uniqueInvalidWorkCenterMaster = array_unique($invalidWorkCodesNotFound);
|
||||||
|
|
||||||
|
$uniqueInvalidPOrder = array_unique($invalidPOrders);
|
||||||
|
|
||||||
|
$uniqueInvalidOrdQuan = array_unique($invalidOrderQuantities);
|
||||||
|
|
||||||
|
$uniqueInvalidReleaseQuan = array_unique($invalidReleaseQuantities);
|
||||||
|
|
||||||
|
$uniqueMissingSerials = array_unique($missingSerials);
|
||||||
|
|
||||||
|
$uniqueSerialCodes = array_unique($invalidSerialCodes);
|
||||||
|
|
||||||
|
$duplicateSerialCodes = array_unique($duplicateSerials);
|
||||||
|
|
||||||
|
$duplicateSerialCodesInDb = array_unique($duplicateSerialNoInDb);
|
||||||
|
|
||||||
|
if (! empty($uniqueInvalidCodes)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid Item Codes')
|
||||||
|
->body('The following item codes should contain minimum 6 digit alpha numeric values:<br>'.implode(', ', $uniqueInvalidCodes))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($uniqueInvalidMatCodesMaster)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid Item Codes')
|
||||||
|
->body('The following item codes not found in item master:<br>'.implode(', ', $uniqueInvalidMatCodesMaster))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($uniqueInvalidPlaCodesMaster)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid Plant Codes')
|
||||||
|
->body('The following plant codes not found in plant master:<br>'.implode(', ', $uniqueInvalidPlaCodesMaster))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($uniqueInvalidWorkCenter)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid Work Center')
|
||||||
|
->body('The following work center should contain miminum 7 digits:<br>'.implode(', ', $uniqueInvalidWorkCenter))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($uniqueInvalidWorkCenterMaster)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid Work Center')
|
||||||
|
->body('The following work center not found in machine master:<br>'.implode(', ', $uniqueInvalidWorkCenterMaster))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($duplicateSerialCodesInDb)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Duplicate Serial Number In DB')
|
||||||
|
->body('The following Serial Number already exist in class characteristic table:<br>'.implode(', ', $duplicateSerialCodesInDb))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($uniqueInvalidPOrder)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid Production Order')
|
||||||
|
->body('The following production order should contain minimum 7 digit values:<br>'.implode(', ', $uniqueInvalidPOrder))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($uniqueInvalidOrdQuan)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid Order Quantity')
|
||||||
|
->body('The following Order Quantity should contain numeric values:<br>'.implode(', ', $uniqueInvalidOrdQuan))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($uniqueInvalidReleaseQuan)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid Released Quantity')
|
||||||
|
->body('The following Released Quantity should contain numeric values:<br>'.implode(', ', $uniqueInvalidReleaseQuan))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($uniqueMissingSerials)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Missing Serial Numbers')
|
||||||
|
->body("The following item codes doesn't have valid serial number:<br>".implode(', ', $uniqueMissingSerials))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($uniqueSerialCodes)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid Serial Number')
|
||||||
|
->body('The following serial numbers should contain minimum 9 digit alpha numeric values:<br>'.implode(', ', $uniqueSerialCodes))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! empty($duplicateSerialCodes)) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Duplicate Serial Numbers')
|
||||||
|
->body('The following serial numbers are already exist in imported excel:<br>'.implode(', ', $duplicateSerialCodes))
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} elseif (! $validRowsFound) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Invalid Serial Invoice')
|
||||||
|
->danger() // This makes the notification red to indicate an error
|
||||||
|
->body('Uploaded Excel sheet is empty or<br>contains no valid data.')
|
||||||
|
->send();
|
||||||
|
if ($disk->exists($path)) {
|
||||||
|
$disk->delete($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ..Insert Logic
|
||||||
|
|
||||||
|
$insertedCount = 0;
|
||||||
|
foreach ($rows as $index => $row) {
|
||||||
|
if ($index == 0) {
|
||||||
|
continue;
|
||||||
|
} // Skip header
|
||||||
|
|
||||||
|
$plantCode = trim($row[0]);
|
||||||
|
$itemCode = trim($row[1]);
|
||||||
|
$workCenter = trim($row[2]);
|
||||||
|
$pOrder = trim($row[3]);
|
||||||
|
$orderQuan = trim($row[4]);
|
||||||
|
$releaseQuan = trim($row[5]);
|
||||||
|
$serialNumber = trim($row[6]);
|
||||||
|
|
||||||
|
if (empty($plantCode) && empty($itemCode) && empty($workCenter) && empty($pOrder) && empty($orderQuan) && empty($releaseQuan) && empty($serialNumber)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$item = Item::where('plant_id', $plantId)->where('code', $itemCode)->first();
|
||||||
|
|
||||||
|
$machine = Machine::where('plant_id', $plantId)->where('work_center', $workCenter)->first();
|
||||||
|
|
||||||
|
$record = ClassCharacteristic::create([
|
||||||
|
'plant_id' => $plantId,
|
||||||
|
'item_id' => $item->id,
|
||||||
|
'machine_id' => $machine->id,
|
||||||
|
'aufnr' => $pOrder,
|
||||||
|
'gamng' => $orderQuan,
|
||||||
|
'lmnga' => $releaseQuan,
|
||||||
|
'gernr' => $serialNumber,
|
||||||
|
'created_by' => $userName,
|
||||||
|
'updated_by' => $userName,
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($record) {
|
||||||
|
$insertedCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$itemCharacteristic = ItemCharacteristic::where('plant_id', $plantId)->where('item_id', $item->id)->first();
|
||||||
|
|
||||||
|
if ($itemCharacteristic) {
|
||||||
|
|
||||||
|
$classCharacteristics = ClassCharacteristic::where('plant_id', $itemCharacteristic->plant_id)
|
||||||
|
->where('item_id', $itemCharacteristic->item_id)
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$updatedCount = 0;
|
||||||
|
|
||||||
|
foreach ($classCharacteristics as $classCharacteristic) {
|
||||||
|
|
||||||
|
$classCharacteristic->update([
|
||||||
|
'zz1_cn_bill_ord' => $itemCharacteristic->zz1_cn_bill_ord,
|
||||||
|
'zmm_amps' => $itemCharacteristic->zmm_amps,
|
||||||
|
'zmm_brand' => $itemCharacteristic->zmm_brand,
|
||||||
|
'zmm_degreeofprotection' => $itemCharacteristic->zmm_degreeofprotection,
|
||||||
|
'zmm_delivery' => $itemCharacteristic->zmm_delivery,
|
||||||
|
'zmm_dir_rot' => $itemCharacteristic->zmm_dir_rot,
|
||||||
|
'zmm_discharge' => $itemCharacteristic->zmm_discharge,
|
||||||
|
'zmm_discharge_max' => $itemCharacteristic->zmm_discharge_max,
|
||||||
|
'zmm_discharge_min' => $itemCharacteristic->zmm_discharge_min,
|
||||||
|
'zmm_duty' => $itemCharacteristic->zmm_duty,
|
||||||
|
'zmm_eff_motor' => $itemCharacteristic->zmm_eff_motor,
|
||||||
|
'zmm_eff_pump' => $itemCharacteristic->zmm_eff_pump,
|
||||||
|
'zmm_frequency' => $itemCharacteristic->zmm_frequency,
|
||||||
|
'zmm_head' => $itemCharacteristic->zmm_head,
|
||||||
|
'zmm_heading' => $itemCharacteristic->zmm_heading,
|
||||||
|
'zmm_head_max' => $itemCharacteristic->zmm_head_max,
|
||||||
|
'zmm_head_minimum' => $itemCharacteristic->zmm_head_minimum,
|
||||||
|
'zmm_idx_eff_mtr' => $itemCharacteristic->zmm_idx_eff_mtr,
|
||||||
|
'zmm_idx_eff_pump' => $itemCharacteristic->zmm_idx_eff_pump,
|
||||||
|
'zmm_kvacode' => $itemCharacteristic->zmm_kvacode,
|
||||||
|
'zmm_maxambtemp' => $itemCharacteristic->zmm_maxambtemp,
|
||||||
|
'zmm_mincoolingflow' => $itemCharacteristic->zmm_mincoolingflow,
|
||||||
|
'zmm_motorseries' => $itemCharacteristic->zmm_motorseries,
|
||||||
|
'zmm_motor_model' => $itemCharacteristic->zmm_motor_model,
|
||||||
|
'zmm_outlet' => $itemCharacteristic->zmm_outlet,
|
||||||
|
'zmm_phase' => $itemCharacteristic->zmm_phase,
|
||||||
|
'zmm_pressure' => $itemCharacteristic->zmm_pressure,
|
||||||
|
'zmm_pumpflowtype' => $itemCharacteristic->zmm_pumpflowtype,
|
||||||
|
'zmm_pumpseries' => $itemCharacteristic->zmm_pumpseries,
|
||||||
|
'zmm_pump_model' => $itemCharacteristic->zmm_pump_model,
|
||||||
|
'zmm_ratedpower' => $itemCharacteristic->zmm_ratedpower,
|
||||||
|
'zmm_region' => $itemCharacteristic->zmm_region,
|
||||||
|
'zmm_servicefactor' => $itemCharacteristic->zmm_servicefactor,
|
||||||
|
'zmm_servicefactormaximumamps' => $itemCharacteristic->zmm_servicefactormaximumamps,
|
||||||
|
'zmm_speed' => $itemCharacteristic->zmm_speed,
|
||||||
|
'zmm_suction' => $itemCharacteristic->zmm_suction,
|
||||||
|
'zmm_suctionxdelivery' => $itemCharacteristic->zmm_suctionxdelivery,
|
||||||
|
'zmm_supplysource' => $itemCharacteristic->zmm_supplysource,
|
||||||
|
'zmm_temperature' => $itemCharacteristic->zmm_temperature,
|
||||||
|
'zmm_thrustload' => $itemCharacteristic->zmm_thrustload,
|
||||||
|
'zmm_volts' => $itemCharacteristic->zmm_volts,
|
||||||
|
'zmm_wire' => $itemCharacteristic->zmm_wire,
|
||||||
|
'zmm_package' => $itemCharacteristic->zmm_package,
|
||||||
|
'zmm_pvarrayrating' => $itemCharacteristic->zmm_pvarrayrating,
|
||||||
|
'zmm_isi' => $itemCharacteristic->zmm_isi,
|
||||||
|
'zmm_isimotor' => $itemCharacteristic->zmm_isimotor,
|
||||||
|
'zmm_isipump' => $itemCharacteristic->zmm_isipump,
|
||||||
|
'zmm_isipumpset' => $itemCharacteristic->zmm_isipumpset,
|
||||||
|
'zmm_pumpset_model' => $itemCharacteristic->zmm_pumpset_model,
|
||||||
|
'zmm_stages' => $itemCharacteristic->zmm_stages,
|
||||||
|
'zmm_headrange' => $itemCharacteristic->zmm_headrange,
|
||||||
|
'zmm_overall_efficiency' => $itemCharacteristic->zmm_overall_efficiency,
|
||||||
|
'zmm_connection' => $itemCharacteristic->zmm_connection,
|
||||||
|
'zmm_min_bore_size' => $itemCharacteristic->zmm_min_bore_size,
|
||||||
|
'zmm_isireference' => $itemCharacteristic->zmm_isireference,
|
||||||
|
'zmm_category' => $itemCharacteristic->zmm_category,
|
||||||
|
'zmm_submergence' => $itemCharacteristic->zmm_submergence,
|
||||||
|
'zmm_capacitorstart' => $itemCharacteristic->zmm_capacitorstart,
|
||||||
|
'zmm_capacitorrun' => $itemCharacteristic->zmm_capacitorrun,
|
||||||
|
'zmm_inch' => $itemCharacteristic->zmm_inch,
|
||||||
|
'zmm_motor_type' => $itemCharacteristic->zmm_motor_type,
|
||||||
|
'zmm_dismantle_direction' => $itemCharacteristic->zmm_dismantle_direction,
|
||||||
|
'zmm_eff_ovrall' => $itemCharacteristic->zmm_eff_ovrall,
|
||||||
|
'zmm_bodymoc' => $itemCharacteristic->zmm_bodymoc,
|
||||||
|
'zmm_rotormoc' => $itemCharacteristic->zmm_rotormoc,
|
||||||
|
'zmm_dlwl' => $itemCharacteristic->zmm_dlwl,
|
||||||
|
'zmm_inputpower' => $itemCharacteristic->zmm_inputpower,
|
||||||
|
'zmm_imp_od' => $itemCharacteristic->zmm_imp_od,
|
||||||
|
'zmm_ambtemp' => $itemCharacteristic->zmm_ambtemp,
|
||||||
|
'zmm_de' => $itemCharacteristic->zmm_de,
|
||||||
|
'zmm_dischargerange' => $itemCharacteristic->zmm_dischargerange,
|
||||||
|
'zmm_efficiency_class' => $itemCharacteristic->zmm_efficiency_class,
|
||||||
|
'zmm_framesize' => $itemCharacteristic->zmm_framesize,
|
||||||
|
'zmm_impellerdiameter' => $itemCharacteristic->zmm_impellerdiameter,
|
||||||
|
'zmm_insulationclass' => $itemCharacteristic->zmm_insulationclass,
|
||||||
|
'zmm_maxflow' => $itemCharacteristic->zmm_maxflow,
|
||||||
|
'zmm_minhead' => $itemCharacteristic->zmm_minhead,
|
||||||
|
'zmm_mtrlofconst' => $itemCharacteristic->zmm_mtrlofconst,
|
||||||
|
'zmm_nde' => $itemCharacteristic->zmm_nde,
|
||||||
|
'zmm_powerfactor' => $itemCharacteristic->zmm_powerfactor,
|
||||||
|
'zmm_tagno' => $itemCharacteristic->zmm_tagno,
|
||||||
|
'zmm_year' => $itemCharacteristic->zmm_year,
|
||||||
|
'zmm_laser_name' => $itemCharacteristic->zmm_laser_name,
|
||||||
|
'zmm_logo_cp' => $itemCharacteristic->zmm_logo_cp,
|
||||||
|
'zmm_logo_ce' => $itemCharacteristic->zmm_logo_ce,
|
||||||
|
'zmm_logo_nsf' => $itemCharacteristic->zmm_logo_nsf,
|
||||||
|
'zmm_logo_eac' => $itemCharacteristic->zmm_logo_eac,
|
||||||
|
'zmm_beenote' => $itemCharacteristic->zmm_beenote,
|
||||||
|
'zmm_beenumber' => $itemCharacteristic->zmm_beenumber,
|
||||||
|
'zmm_beestar' => $itemCharacteristic->zmm_beestar,
|
||||||
|
'zmm_codeclass' => $itemCharacteristic->zmm_codeclass,
|
||||||
|
'zmm_colour' => $itemCharacteristic->zmm_colour,
|
||||||
|
'zmm_grade' => $itemCharacteristic->zmm_grade,
|
||||||
|
'zmm_grwt_pset' => $itemCharacteristic->zmm_grwt_pset,
|
||||||
|
'zmm_grwt_cable' => $itemCharacteristic->zmm_grwt_cable,
|
||||||
|
'zmm_grwt_motor' => $itemCharacteristic->zmm_grwt_motor,
|
||||||
|
'zmm_grwt_pf' => $itemCharacteristic->zmm_grwt_pf,
|
||||||
|
'zmm_grwt_pump' => $itemCharacteristic->zmm_grwt_pump,
|
||||||
|
'zmm_isivalve' => $itemCharacteristic->zmm_isivalve,
|
||||||
|
'zmm_isi_wc' => $itemCharacteristic->zmm_isi_wc,
|
||||||
|
'zmm_labelperiod' => $itemCharacteristic->zmm_labelperiod,
|
||||||
|
'zmm_length' => $itemCharacteristic->zmm_length,
|
||||||
|
'zmm_license_cml_no' => $itemCharacteristic->zmm_license_cml_no,
|
||||||
|
'zmm_mfgmonyr' => $itemCharacteristic->zmm_mfgmonyr,
|
||||||
|
'zmm_modelyear' => $itemCharacteristic->zmm_modelyear,
|
||||||
|
'zmm_motoridentification' => $itemCharacteristic->zmm_motoridentification,
|
||||||
|
'zmm_newt_pset' => $itemCharacteristic->zmm_newt_pset,
|
||||||
|
'zmm_newt_cable' => $itemCharacteristic->zmm_newt_cable,
|
||||||
|
'zmm_newt_motor' => $itemCharacteristic->zmm_newt_motor,
|
||||||
|
'zmm_newt_pf' => $itemCharacteristic->zmm_newt_pf,
|
||||||
|
'zmm_newt_pump' => $itemCharacteristic->zmm_newt_pump,
|
||||||
|
'zmm_packtype' => $itemCharacteristic->zmm_packtype,
|
||||||
|
'zmm_panel' => $itemCharacteristic->zmm_panel,
|
||||||
|
'zmm_performance_factor' => $itemCharacteristic->zmm_performance_factor,
|
||||||
|
'zmm_pumpidentification' => $itemCharacteristic->zmm_pumpidentification,
|
||||||
|
'zmm_psettype' => $itemCharacteristic->zmm_psettype,
|
||||||
|
'zmm_size' => $itemCharacteristic->zmm_size,
|
||||||
|
'zmm_eff_ttl' => $itemCharacteristic->zmm_eff_ttl,
|
||||||
|
'zmm_type' => $itemCharacteristic->zmm_type,
|
||||||
|
'zmm_usp' => $itemCharacteristic->zmm_usp,
|
||||||
|
'zmm_operating_range' => $itemCharacteristic->zmm_operating_range,
|
||||||
|
'zmm_intake_air' => $itemCharacteristic->zmm_intake_air,
|
||||||
|
'zmm_oxygen_transfer_rate' => $itemCharacteristic->zmm_oxygen_transfer_rate,
|
||||||
|
'zmm_air_inlet_pipesize' => $itemCharacteristic->zmm_air_inlet_pipesize,
|
||||||
|
'zmm_sump_depth' => $itemCharacteristic->zmm_sump_depth,
|
||||||
|
'zmm_poles' => $itemCharacteristic->zmm_poles,
|
||||||
|
'zmm_motor_heading' => $itemCharacteristic->zmm_motor_heading,
|
||||||
|
'zmm_motor_speed' => $itemCharacteristic->zmm_motor_speed,
|
||||||
|
'zqmm_qty' => $itemCharacteristic->zqmm_qty,
|
||||||
|
'zmm_operating_temperature' => $itemCharacteristic->zmm_operating_temperature,
|
||||||
|
'zmm_axial_force' => $itemCharacteristic->zmm_axial_force,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$updatedCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($record) {
|
||||||
|
Notification::make()
|
||||||
|
->title('Import Successful')
|
||||||
|
->body("{$insertedCount} records inserted successfully and updated zmm values success for '{$updatedCount}' records.")
|
||||||
|
->success();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
->visible(function () {
|
||||||
|
return Filament::auth()->user()->can('view import class characteristic serial');
|
||||||
|
}),
|
||||||
ImportAction::make()
|
ImportAction::make()
|
||||||
->label('Import Class Characteristics')
|
->label('Import Class Characteristics')
|
||||||
->color('warning')
|
->color('warning')
|
||||||
|
|||||||
@@ -11,21 +11,20 @@ use App\Models\Plant;
|
|||||||
use App\Models\ProductionTemp;
|
use App\Models\ProductionTemp;
|
||||||
use Filament\Facades\Filament;
|
use Filament\Facades\Filament;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Components\DateTimePicker;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
use Filament\Forms\Get;
|
use Filament\Forms\Get;
|
||||||
use Filament\Resources\Resource;
|
use Filament\Resources\Resource;
|
||||||
use Filament\Tables;
|
use Filament\Tables;
|
||||||
use Filament\Tables\Actions\ExportAction;
|
use Filament\Tables\Actions\ExportAction;
|
||||||
use Filament\Tables\Actions\ImportAction;
|
use Filament\Tables\Actions\ImportAction;
|
||||||
|
use Filament\Tables\Filters\Filter;
|
||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
use Filament\Tables\Filters\Filter;
|
|
||||||
use Filament\Forms\Components\DateTimePicker;
|
|
||||||
use Filament\Forms\Components\Section;
|
|
||||||
use Filament\Forms\Components\Select;
|
|
||||||
use Filament\Forms\Components\TextInput;
|
|
||||||
|
|
||||||
class ProductionTempResource extends Resource
|
class ProductionTempResource extends Resource
|
||||||
{
|
{
|
||||||
@@ -949,6 +948,12 @@ class ProductionTempResource extends Resource
|
|||||||
->afterStateUpdated(function (callable $set) {
|
->afterStateUpdated(function (callable $set) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
}),
|
}),
|
||||||
|
Forms\Components\TextInput::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP')
|
||||||
|
->reactive()
|
||||||
|
->afterStateUpdated(function (callable $set) {
|
||||||
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
|
}),
|
||||||
Forms\Components\TextInput::make('pending_released_status')
|
Forms\Components\TextInput::make('pending_released_status')
|
||||||
->label('PENDING RELEASED STATUS')
|
->label('PENDING RELEASED STATUS')
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -1535,6 +1540,10 @@ class ProductionTempResource extends Resource
|
|||||||
->label('ZMM AXIAL FORCE')
|
->label('ZMM AXIAL FORCE')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP')
|
||||||
|
->alignCenter()
|
||||||
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('pending_released_status')
|
Tables\Columns\TextColumn::make('pending_released_status')
|
||||||
->label('PENDING RELEASED STATUS')
|
->label('PENDING RELEASED STATUS')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
|
|||||||
@@ -988,6 +988,12 @@ class TempClassCharacteristicResource extends Resource
|
|||||||
->afterStateUpdated(function (callable $set) {
|
->afterStateUpdated(function (callable $set) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
}),
|
}),
|
||||||
|
Forms\Components\TextInput::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP')
|
||||||
|
->reactive()
|
||||||
|
->afterStateUpdated(function (callable $set) {
|
||||||
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
|
}),
|
||||||
Forms\Components\TextInput::make('winded_serial_number')
|
Forms\Components\TextInput::make('winded_serial_number')
|
||||||
->label('WINDED SERIAL NUMBER')
|
->label('WINDED SERIAL NUMBER')
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -1597,6 +1603,10 @@ class TempClassCharacteristicResource extends Resource
|
|||||||
->label('ZMM AXIAL FORCE')
|
->label('ZMM AXIAL FORCE')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
Tables\Columns\TextColumn::make('zmm_mrp')
|
||||||
|
->label('ZMM MRP')
|
||||||
|
->alignCenter()
|
||||||
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('winded_serial_number')
|
Tables\Columns\TextColumn::make('winded_serial_number')
|
||||||
->label('WINDED SERIAL NUMBER')
|
->label('WINDED SERIAL NUMBER')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ class ClassCharacteristic extends Model
|
|||||||
'zqmm_qty',
|
'zqmm_qty',
|
||||||
'zmm_operating_temperature',
|
'zmm_operating_temperature',
|
||||||
'zmm_axial_force',
|
'zmm_axial_force',
|
||||||
|
'zmm_mrp',
|
||||||
'mark_status',
|
'mark_status',
|
||||||
'marked_physical_count',
|
'marked_physical_count',
|
||||||
'marked_expected_time',
|
'marked_expected_time',
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ class ProductionTemp extends Model
|
|||||||
'zqmm_qty',
|
'zqmm_qty',
|
||||||
'zmm_operating_temperature',
|
'zmm_operating_temperature',
|
||||||
'zmm_axial_force',
|
'zmm_axial_force',
|
||||||
|
'zmm_mrp',
|
||||||
'pending_released_status',
|
'pending_released_status',
|
||||||
'created_at',
|
'created_at',
|
||||||
'updated_at',
|
'updated_at',
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ class TempClassCharacteristic extends Model
|
|||||||
'zqmm_qty',
|
'zqmm_qty',
|
||||||
'zmm_operating_temperature',
|
'zmm_operating_temperature',
|
||||||
'zmm_axial_force',
|
'zmm_axial_force',
|
||||||
|
'zmm_mrp',
|
||||||
'winded_serial_number',
|
'winded_serial_number',
|
||||||
'model_type',
|
'model_type',
|
||||||
'has_work_flow_id',
|
'has_work_flow_id',
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?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 class_characteristics
|
||||||
|
ADD COLUMN zmm_mrp TEXT DEFAULT NULL
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
// Schema::table('class_characteristics', function (Blueprint $table) {
|
||||||
|
// //
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?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 temp_class_characteristics
|
||||||
|
ADD COLUMN zmm_mrp TEXT DEFAULT NULL
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
// Schema::table('temp_class_characteristics', function (Blueprint $table) {
|
||||||
|
// //
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<?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 production_temps
|
||||||
|
ADD COLUMN zmm_mrp TEXT DEFAULT NULL
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
// Schema::table('production_temps', function (Blueprint $table) {
|
||||||
|
// //
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -209,9 +209,16 @@ class PermissionSeeder extends Seeder
|
|||||||
Permission::updateOrCreate(['name' => 'view import production characteristics']);
|
Permission::updateOrCreate(['name' => 'view import production characteristics']);
|
||||||
Permission::updateOrCreate(['name' => 'view export production characteristics']);
|
Permission::updateOrCreate(['name' => 'view export production characteristics']);
|
||||||
|
|
||||||
|
Permission::updateOrCreate(['name' => 'view import class characteristic']);
|
||||||
|
Permission::updateOrCreate(['name' => 'view export class characteristic']);
|
||||||
|
Permission::updateOrCreate(['name' => 'view import class characteristic serial']);
|
||||||
|
|
||||||
Permission::updateOrCreate(['name' => 'view import temp class characteristic']);
|
Permission::updateOrCreate(['name' => 'view import temp class characteristic']);
|
||||||
Permission::updateOrCreate(['name' => 'view export temp class characteristic']);
|
Permission::updateOrCreate(['name' => 'view export temp class characteristic']);
|
||||||
|
|
||||||
|
Permission::updateOrCreate(['name' => 'view import item characteristics']);
|
||||||
|
Permission::updateOrCreate(['name' => 'view export item characteristics']);
|
||||||
|
|
||||||
Permission::updateOrCreate(['name' => 'view import temp stop characteristics']);
|
Permission::updateOrCreate(['name' => 'view import temp stop characteristics']);
|
||||||
Permission::updateOrCreate(['name' => 'view export temp stop characteristics']);
|
Permission::updateOrCreate(['name' => 'view export temp stop characteristics']);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user