diff --git a/app/Filament/Exports/ClassCharacteristicExporter.php b/app/Filament/Exports/ClassCharacteristicExporter.php index 95fc2027..f306cbc2 100644 --- a/app/Filament/Exports/ClassCharacteristicExporter.php +++ b/app/Filament/Exports/ClassCharacteristicExporter.php @@ -332,6 +332,8 @@ class ClassCharacteristicExporter extends Exporter ->label('MARKED BY'), ExportColumn::make('man_marked_status') ->label('MANUAL MARKED PHYSICAL COUNT'), + ExportColumn::make('man_marked_expected_time') + ->label('MANUAL MARKED EXPECTED TIME'), ExportColumn::make('man_marked_datetime') ->label('MANUAL MARKED DATETIME'), ExportColumn::make('man_marked_by') diff --git a/app/Filament/Imports/ClassCharacteristicImporter.php b/app/Filament/Imports/ClassCharacteristicImporter.php index 21cf0e35..4eeccc0e 100644 --- a/app/Filament/Imports/ClassCharacteristicImporter.php +++ b/app/Filament/Imports/ClassCharacteristicImporter.php @@ -611,6 +611,10 @@ class ClassCharacteristicImporter extends Importer ->label('MANUAL MARKED PHYSICAL COUNT') ->exampleHeader('MANUAL MARKED STATUS') ->example('0'), + ImportColumn::make('man_marked_expected_time') + ->label('MANUAL MARKED EXPECTED TIME') + ->exampleHeader('MANUAL MARKED EXPECTED TIME') + ->example('0'), ImportColumn::make('man_marked_datetime') ->label('MANUAL MARKED DATETIME') ->exampleHeader('MANUAL MARKED DATETIME') diff --git a/app/Filament/Resources/ClassCharacteristicResource.php b/app/Filament/Resources/ClassCharacteristicResource.php index 177015cc..bc11dc90 100644 --- a/app/Filament/Resources/ClassCharacteristicResource.php +++ b/app/Filament/Resources/ClassCharacteristicResource.php @@ -130,7 +130,7 @@ class ClassCharacteristicResource extends Resource ->reactive() ->minLength(7) ->maxLength(10) - ->readOnly(fn (callable $get) => (! $get('plant_id') || ! $get('machine_id') || ! $get('item_id'))) + ->readOnly(fn (Get $get) => (! $get('plant_id') || ! $get('machine_id') || ! $get('item_id') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -138,25 +138,25 @@ class ClassCharacteristicResource extends Resource Forms\Components\TextInput::make('class') ->label('CLASS') ->reactive() + ->readOnly(fn (Get $get) => (! $get('aufnr') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); - }) - ->readOnly(fn (callable $get) => (! $get('aufnr'))) - ->required(), + }), + // ->required(), Forms\Components\TextInput::make('arbid') ->label('ARBID') ->reactive() - ->readOnly(fn (callable $get) => (! $get('class'))) + ->readOnly(fn (Get $get) => (! $get('class') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); - }) - ->required(), + }), + // ->required(), Forms\Components\TextInput::make('gamng') ->label('GAMNG') ->reactive() ->numeric() ->minValue(1.000) - ->readOnly(fn (callable $get) => (! $get('arbid'))) + ->readOnly(fn (Get $get) => (! $get('arbid') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -167,7 +167,7 @@ class ClassCharacteristicResource extends Resource ->integer() ->minValue(1) ->maxValue(fn (callable $get) => ($get('gamng') ?? 1)) - ->readOnly(fn (callable $get) => (! $get('gamng'))) + ->readOnly(fn (Get $get) => (! $get('gamng') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -176,7 +176,7 @@ class ClassCharacteristicResource extends Resource ->label('GERNR') ->reactive() ->minLength(13) - ->readOnly(fn (callable $get) => (! $get('lmnga'))) + ->readOnly(fn (Get $get) => (! $get('lmnga') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -202,91 +202,105 @@ class ClassCharacteristicResource extends Resource Forms\Components\TextInput::make('zz1_cn_bill_ord') ->label('ZZ1 CN BILL ORD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_amps') ->label('ZMM AMPS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_brand') ->label('ZMM BRAND') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_degreeofprotection') ->label('ZMM DEGREEOFPROTECTION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_delivery') ->label('ZMM DELIVERY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_dir_rot') ->label('ZMM DIR ROT') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_discharge') ->label('ZMM DISCHARGE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_discharge_max') ->label('ZMM DISCHARGE MAX') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_discharge_min') ->label('ZMM DISCHARGE MIN') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_duty') ->label('ZMM DUTY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_eff_motor') ->label('ZMM EFF MOTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_eff_pump') ->label('ZMM EFF PUMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_frequency') ->label('ZMM FREQUENCY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_head') ->label('ZMM HEAD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_heading') ->label('ZMM HEADING') ->reactive() - ->readOnly(fn (callable $get) => (! $get('aufnr') || ! $get('gernr'))) + ->readOnly(fn (Get $get) => ($get('id') || ! $get('aufnr') || ! $get('gernr'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -294,702 +308,819 @@ class ClassCharacteristicResource extends Resource Forms\Components\TextInput::make('zmm_head_max') ->label('ZMM HEAD MAX') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_head_minimum') ->label('ZMM HEAD MINIMUM') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_idx_eff_mtr') ->label('ZMM IDX EFF MTR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_idx_eff_pump') ->label('ZMM IDX EFF PUMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_kvacode') ->label('ZMM KVACODE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_maxambtemp') ->label('ZMM MAXAMBTEMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_mincoolingflow') ->label('ZMM MINCOOLINGFLOW') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motorseries') ->label('ZMM MOTORSERIES') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motor_model') ->label('ZMM MOTOR MODEL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_outlet') ->label('ZMM OUTLET') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_phase') ->label('ZMM PHASE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pressure') ->label('ZMM PRESSURE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pumpflowtype') ->label('ZMM PUMPFLOWTYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pumpseries') ->label('ZMM PUMPSERIES') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pump_model') ->label('ZMM PUMP MODEL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_ratedpower') ->label('ZMM RATEDPOWER') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_region') ->label('ZMM REGION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_servicefactor') ->label('ZMM SERVICEFACTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_servicefactormaximumamps') ->label('ZMM SERVICEFACTORMAXIMUMAMPS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_speed') ->label('ZMM SPEED') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_suction') ->label('ZMM SUCTION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_suctionxdelivery') ->label('ZMM SUCTIONXDELIVERY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_supplysource') ->label('ZMM SUPPLYSOURCE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_temperature') ->label('ZMM TEMPERATURE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_thrustload') ->label('ZMM THRUSTLOAD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_volts') ->label('ZMM VOLTS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_wire') ->label('ZMM WIRE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_package') ->label('ZMM PACKAGE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pvarrayrating') ->label('ZMM PVARRAYRATING') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isi') ->label('ZMM ISI') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isimotor') ->label('ZMM ISIMOTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isipump') ->label('ZMM ISIPUMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isipumpset') ->label('ZMM ISIPUMPSET') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pumpset_model') ->label('ZMM PUMPSET MODEL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_stages') ->label('ZMM STAGES') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_headrange') ->label('ZMM HEADRANGE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_overall_efficiency') ->label('ZMM OVERALL EFFICIENCY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_connection') ->label('ZMM CONNECTION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_min_bore_size') ->label('ZMM MIN BORE SIZE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isireference') ->label('ZMM ISIREFERENCE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_category') ->label('ZMM CATEGORY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_submergence') ->label('ZMM SUBMERGENCE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_capacitorstart') ->label('ZMM CAPACITORSTART') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_capacitorrun') ->label('ZMM CAPACITORRUN') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_inch') ->label('ZMM INCH') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motor_type') ->label('ZMM MOTOR TYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_dismantle_direction') ->label('ZMM DISMANTLE DIRECTION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_eff_ovrall') ->label('ZMM EFF OVRALL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_bodymoc') ->label('ZMM BODYMOC') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_rotormoc') ->label('ZMM ROTORMOC') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_dlwl') ->label('ZMM DLWL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_inputpower') ->label('ZMM INPUTPOWER') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_imp_od') ->label('ZMM IMP OD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_ambtemp') ->label('ZMM AMBTEMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_de') ->label('ZMM DE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_dischargerange') ->label('ZMM DISCHARGERANGE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_efficiency_class') ->label('ZMM EFFICIENCY CLASS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_framesize') ->label('ZMM FRAMESIZE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_impellerdiameter') ->label('ZMM IMPELLERDIAMETER') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_insulationclass') ->label('ZMM INSULATIONCLASS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_maxflow') ->label('ZMM MAXFLOW') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_minhead') ->label('ZMM MINHEAD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_mtrlofconst') ->label('ZMM MTRLOFCONST') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_nde') ->label('ZMM NDE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_powerfactor') ->label('ZMM POWERFACTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_tagno') ->label('ZMM TAGNO') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_year') ->label('ZMM YEAR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_laser_name') ->label('ZMM LASER NAME') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_logo_cp') ->label('ZMM LOGO CP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_logo_ce') ->label('ZMM LOGO CE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_logo_nsf') ->label('ZMM LOGO NSF') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_logo_eac') ->label('ZMM LOGO EAC') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_beenote') ->label('ZMM BEENOTE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_beenumber') ->label('ZMM BEENUMBER') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_beestar') ->label('ZMM BEESTAR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_codeclass') ->label('ZMM CODECLASS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_colour') ->label('ZMM COLOUR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grade') ->label('ZMM GRADE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grwt_pset') ->label('ZMM GRWT PSET') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grwt_cable') ->label('ZMM GRWT CABLE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grwt_motor') ->label('ZMM GRWT MOTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grwt_pf') ->label('ZMM GRWT PF') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grwt_pump') ->label('ZMM GRWT PUMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isivalve') ->label('ZMM ISIVALVE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isi_wc') ->label('ZMM ISI WC') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_labelperiod') ->label('ZMM LABELPERIOD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_length') ->label('ZMM LENGTH') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_license_cml_no') ->label('ZMM LICENSE CML NO') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_mfgmonyr') ->label('ZMM MFGMONYR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_modelyear') ->label('ZMM MODELYEAR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motoridentification') ->label('ZMM MOTORIDENTIFICATION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_newt_pset') ->label('ZMM NEWT PSET') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_newt_cable') ->label('ZMM NEWT CABLE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_newt_motor') ->label('ZMM NEWT MOTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_newt_pf') ->label('ZMM NEWT PF') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_newt_pump') ->label('ZMM NEWT PUMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_packtype') ->label('ZMM PACKTYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_panel') ->label('ZMM PANEL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_performance_factor') ->label('ZMM PERFORMANCE FACTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pumpidentification') ->label('ZMM PUMPIDENTIFICATION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_psettype') ->label('ZMM PSETTYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_size') ->label('ZMM SIZE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_eff_ttl') ->label('ZMM EFF TTL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_type') ->label('ZMM TYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_usp') ->label('ZMM USP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_operating_range') ->label('ZMM OPERATING RANGE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_intake_air') ->label('ZMM INTAKE AIR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_oxygen_transfer_rate') ->label('ZMM OXYGEN TRANSFER RATE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_air_inlet_pipesize') ->label('ZMM AIR INLET PIPESIZE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_sump_depth') ->label('ZMM SUMP DEPTH') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_poles') ->label('ZMM POLES') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motor_heading') ->label('ZMM MOTOR HEADING') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motor_speed') ->label('ZMM MOTOR SPEED') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zqmm_qty') ->label('ZQMM QTY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_operating_temperature') ->label('ZMM OPERATING TEMPERATURE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_axial_force') ->label('ZMM AXIAL FORCE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_mrp') ->label('ZMM MRP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), @@ -1020,14 +1151,23 @@ class ClassCharacteristicResource extends Resource // Forms\Components\TextInput::make('stopped_by') // ->label('STOPPED BY') // ->reactive() - // ->readOnly(fn (callable $get) => ! $get('id')) + // ->readOnly(fn (Get $get) => ! $get('id')) // ->afterStateUpdated(function (callable $set) { // $set('updated_by', Filament::auth()->user()?->name); // }), Forms\Components\TextInput::make('mark_status') ->label('MARKED STATUS') ->reactive() - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked') + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('marked_physical_count') == null || $get('marked_physical_count') == '' || $get('marked_physical_count') == '0') { + $set('mark_status', null); + $set('marked_physical_count', '0'); + $set('marked_expected_time', '0'); + } + $set('marked_datetime', now()->toDateTimeString()); + $set('marked_by', Filament::auth()->user()?->name); + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('marked_physical_count') @@ -1036,7 +1176,16 @@ class ClassCharacteristicResource extends Resource ->minValue(0) ->integer() ->maxValue(3) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked') + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('marked_physical_count') == null || $get('marked_physical_count') == '' || $get('marked_physical_count') == '0') { + $set('mark_status', null); + $set('marked_physical_count', '0'); + $set('marked_expected_time', '0'); + } + $set('marked_datetime', now()->toDateTimeString()); + $set('marked_by', Filament::auth()->user()?->name); + $set('updated_by', Filament::auth()->user()?->name); }) ->default(0) @@ -1044,7 +1193,16 @@ class ClassCharacteristicResource extends Resource Forms\Components\TextInput::make('marked_expected_time') ->label('MARKED EXPECTED TIME') ->reactive() - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked') + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('marked_physical_count') == null || $get('marked_physical_count') == '' || $get('marked_physical_count') == '0') { + $set('mark_status', null); + $set('marked_physical_count', '0'); + $set('marked_expected_time', '0'); + } + $set('marked_datetime', now()->toDateTimeString()); + $set('marked_by', Filament::auth()->user()?->name); + $set('updated_by', Filament::auth()->user()?->name); }) ->default('0') @@ -1053,7 +1211,16 @@ class ClassCharacteristicResource extends Resource ->label('MARKED DATETIME') ->reactive() ->placeholder('Select Marked DateTime') - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked') + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('marked_physical_count') == null || $get('marked_physical_count') == '' || $get('marked_physical_count') == '0') { + $set('mark_status', null); + $set('marked_physical_count', '0'); + $set('marked_expected_time', '0'); + } + $set('marked_datetime', now()->toDateTimeString()); + $set('marked_by', Filament::auth()->user()?->name); + $set('updated_by', Filament::auth()->user()?->name); }) ->default(now()) @@ -1061,17 +1228,54 @@ class ClassCharacteristicResource extends Resource Forms\Components\TextInput::make('marked_by') ->label('MARKED BY') ->reactive() - ->readOnly(fn (callable $get) => ! $get('id')) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked') + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('marked_physical_count') == null || $get('marked_physical_count') == '' || $get('marked_physical_count') == '0') { + $set('mark_status', null); + $set('marked_physical_count', '0'); + $set('marked_expected_time', '0'); + } + $set('marked_datetime', now()->toDateTimeString()); + $set('marked_by', Filament::auth()->user()?->name); + $set('updated_by', Filament::auth()->user()?->name); }) ->default(Filament::auth()->user()?->name) ->required(), - Forms\Components\TextInput::make('man_marked_status') + Forms\Components\TextInput::make('man_marked_status')// man_marked_expected_time ->label('MANUAL MARKED PHYSICAL COUNT') ->reactive() - ->readOnly(fn (callable $get) => ! ($get('mark_status') == 'Marked') && ! ($get('motor_marked_status') == 'Marked') && ! ($get('pump_marked_status') == 'Marked') && ! ($get('name_plate_marked_status') == 'Marked')) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => ($get('mark_status') != 'Marked' && $get('motor_marked_status') != 'Marked' && $get('pump_marked_status') != 'Marked' && $get('name_plate_marked_status') != 'Marked') || $get('id')) + ->afterStateUpdated(function (callable $set, callable $get) { + if (($get('mark_status') != 'Marked' && $get('motor_marked_status') != 'Marked' && $get('pump_marked_status') != 'Marked' && $get('name_plate_marked_status') != 'Marked') || $get('man_marked_status') == null || $get('man_marked_status') == '' || $get('man_marked_status') == '0') { + $set('man_marked_status', '0'); + $set('man_marked_expected_time', '0'); + $set('man_marked_datetime', null); + $set('man_marked_by', null); + } else { + $set('man_marked_datetime', now()->toDateTimeString()); + $set('man_marked_by', Filament::auth()->user()?->name); + } + + $set('updated_by', Filament::auth()->user()?->name); + }) + ->default('0') + ->required(), + Forms\Components\TextInput::make('man_marked_expected_time') + ->label('MANUAL MARKED EXPECTED TIME') + ->reactive() + ->readOnly(fn (Get $get) => ($get('mark_status') != 'Marked' && $get('motor_marked_status') != 'Marked' && $get('pump_marked_status') != 'Marked' && $get('name_plate_marked_status') != 'Marked') || $get('id')) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('man_marked_status') == null || $get('man_marked_status') == '' || $get('man_marked_status') == '0') { + $set('man_marked_status', '0'); + $set('man_marked_expected_time', '0'); + $set('man_marked_datetime', null); + $set('man_marked_by', null); + } else { + $set('man_marked_datetime', now()->toDateTimeString()); + $set('man_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }) ->default('0') @@ -1080,22 +1284,54 @@ class ClassCharacteristicResource extends Resource ->label('MANUAL MARKED DATETIME') ->reactive() ->placeholder('Select Manual Marked DateTime') - ->readOnly(fn (callable $get) => ! ($get('mark_status') == 'Marked') && ! ($get('motor_marked_status') == 'Marked') && ! ($get('pump_marked_status') == 'Marked') && ! ($get('name_plate_marked_status') == 'Marked')) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => ($get('mark_status') != 'Marked' && $get('motor_marked_status') != 'Marked' && $get('pump_marked_status') != 'Marked' && $get('name_plate_marked_status') != 'Marked') || $get('id')) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('man_marked_status') == null || $get('man_marked_status') == '' || $get('man_marked_status') == '0') { + $set('man_marked_status', '0'); + $set('man_marked_expected_time', '0'); + $set('man_marked_datetime', null); + $set('man_marked_by', null); + } else { + $set('man_marked_datetime', now()->toDateTimeString()); + $set('man_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('man_marked_by') ->label('MANUAL MARKED BY') ->reactive() - ->readOnly(fn (callable $get) => ! ($get('mark_status') == 'Marked') && ! ($get('motor_marked_status') == 'Marked') && ! ($get('pump_marked_status') == 'Marked') && ! ($get('name_plate_marked_status') == 'Marked')) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => ($get('mark_status') != 'Marked' && $get('motor_marked_status') != 'Marked' && $get('pump_marked_status') != 'Marked' && $get('name_plate_marked_status') != 'Marked') || $get('id')) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('man_marked_status') == null || $get('man_marked_status') == '' || $get('man_marked_status') == '0') { + $set('man_marked_status', '0'); + $set('man_marked_expected_time', '0'); + $set('man_marked_datetime', null); + $set('man_marked_by', null); + } else { + $set('man_marked_datetime', now()->toDateTimeString()); + $set('man_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('motor_marked_status') ->label('MOTOR MARKED STATUS') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'MOTOR', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('motor_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'MOTOR', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('motor_marked_physical_count') == null || $get('motor_marked_physical_count') == '' || $get('motor_marked_physical_count') == '0') { + $set('motor_marked_status', null); + $set('motor_marked_physical_count', '0'); + $set('motor_expected_time', '0'); + $set('motor_marked_datetime', null); + $set('motor_marked_by', null); + } else { + $set('motor_marked_datetime', now()->toDateTimeString()); + $set('motor_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('motor_marked_physical_count') @@ -1104,8 +1340,20 @@ class ClassCharacteristicResource extends Resource ->minValue(0) ->integer() ->maxValue(3) - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'MOTOR', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('motor_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'MOTOR', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('motor_marked_physical_count') == null || $get('motor_marked_physical_count') == '' || $get('motor_marked_physical_count') == '0') { + $set('motor_marked_status', null); + $set('motor_marked_physical_count', '0'); + $set('motor_expected_time', '0'); + $set('motor_marked_datetime', null); + $set('motor_marked_by', null); + } else { + $set('motor_marked_datetime', now()->toDateTimeString()); + $set('motor_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }) ->default(0) @@ -1113,8 +1361,20 @@ class ClassCharacteristicResource extends Resource Forms\Components\TextInput::make('motor_expected_time') ->label('MOTOR EXPECTED TIME') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'MOTOR', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('motor_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'MOTOR', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('motor_marked_physical_count') == null || $get('motor_marked_physical_count') == '' || $get('motor_marked_physical_count') == '0') { + $set('motor_marked_status', null); + $set('motor_marked_physical_count', '0'); + $set('motor_expected_time', '0'); + $set('motor_marked_datetime', null); + $set('motor_marked_by', null); + } else { + $set('motor_marked_datetime', now()->toDateTimeString()); + $set('motor_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }) ->default('0') @@ -1123,21 +1383,57 @@ class ClassCharacteristicResource extends Resource ->label('MOTOR MARKED DATETIME') ->reactive() ->placeholder('Select Motor Marked DateTime') - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('motor_marked_status') == 'Marked') + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('motor_marked_physical_count') == null || $get('motor_marked_physical_count') == '' || $get('motor_marked_physical_count') == '0') { + $set('motor_marked_status', null); + $set('motor_marked_physical_count', '0'); + $set('motor_expected_time', '0'); + $set('motor_marked_datetime', null); + $set('motor_marked_by', null); + } else { + $set('motor_marked_datetime', now()->toDateTimeString()); + $set('motor_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('motor_marked_by') ->label('MOTOR MARKED BY') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'MOTOR', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('motor_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'MOTOR', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('motor_marked_physical_count') == null || $get('motor_marked_physical_count') == '' || $get('motor_marked_physical_count') == '0') { + $set('motor_marked_status', null); + $set('motor_marked_physical_count', '0'); + $set('motor_expected_time', '0'); + $set('motor_marked_datetime', null); + $set('motor_marked_by', null); + } else { + $set('motor_marked_datetime', now()->toDateTimeString()); + $set('motor_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('pump_marked_status') ->label('PUMP MARKED STATUS') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'PUMP', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('pump_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'PUMP', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('pump_marked_physical_count') == null || $get('pump_marked_physical_count') == '' || $get('pump_marked_physical_count') == '0') { + $set('pump_marked_status', null); + $set('pump_marked_physical_count', '0'); + $set('pump_expected_time', '0'); + $set('pump_marked_datetime', null); + $set('pump_marked_by', null); + } else { + $set('pump_marked_datetime', now()->toDateTimeString()); + $set('pump_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('pump_marked_physical_count') @@ -1146,8 +1442,20 @@ class ClassCharacteristicResource extends Resource ->minValue(0) ->integer() ->maxValue(3) - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'PUMP', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('pump_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'PUMP', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('pump_marked_physical_count') == null || $get('pump_marked_physical_count') == '' || $get('pump_marked_physical_count') == '0') { + $set('pump_marked_status', null); + $set('pump_marked_physical_count', '0'); + $set('pump_expected_time', '0'); + $set('pump_marked_datetime', null); + $set('pump_marked_by', null); + } else { + $set('pump_marked_datetime', now()->toDateTimeString()); + $set('pump_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }) ->default(0) @@ -1155,8 +1463,20 @@ class ClassCharacteristicResource extends Resource Forms\Components\TextInput::make('pump_expected_time') ->label('PUMP EXPECTED TIME') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'PUMP', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('pump_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'PUMP', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('pump_marked_physical_count') == null || $get('pump_marked_physical_count') == '' || $get('pump_marked_physical_count') == '0') { + $set('pump_marked_status', null); + $set('pump_marked_physical_count', '0'); + $set('pump_expected_time', '0'); + $set('pump_marked_datetime', null); + $set('pump_marked_by', null); + } else { + $set('pump_marked_datetime', now()->toDateTimeString()); + $set('pump_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }) ->default('0') @@ -1165,28 +1485,76 @@ class ClassCharacteristicResource extends Resource ->label('PUMP MARKED DATETIME') ->reactive() ->placeholder('Select Pump Marked DateTime') - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('pump_marked_status') == 'Marked') + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('pump_marked_physical_count') == null || $get('pump_marked_physical_count') == '' || $get('pump_marked_physical_count') == '0') { + $set('pump_marked_status', null); + $set('pump_marked_physical_count', '0'); + $set('pump_expected_time', '0'); + $set('pump_marked_datetime', null); + $set('pump_marked_by', null); + } else { + $set('pump_marked_datetime', now()->toDateTimeString()); + $set('pump_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('pump_marked_by') ->label('PUMP MARKED BY') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'PUMP', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('pump_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'PUMP', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('pump_marked_physical_count') == null || $get('pump_marked_physical_count') == '' || $get('pump_marked_physical_count') == '0') { + $set('pump_marked_status', null); + $set('pump_marked_physical_count', '0'); + $set('pump_expected_time', '0'); + $set('pump_marked_datetime', null); + $set('pump_marked_by', null); + } else { + $set('pump_marked_datetime', now()->toDateTimeString()); + $set('pump_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('name_plate_marked_status') ->label('NAME PLATE MARKED STATUS') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('name_plate_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('name_plate_marked_physical_count') == null || $get('name_plate_marked_physical_count') == '' || $get('name_plate_marked_physical_count') == '0') { + $set('name_plate_marked_status', null); + $set('name_plate_marked_physical_count', '0'); + $set('name_plate_expected_time', '0'); + $set('name_plate_marked_datetime', null); + $set('name_plate_marked_by', null); + } else { + $set('name_plate_marked_datetime', now()->toDateTimeString()); + $set('name_plate_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('name_plate_expected_time') ->label('NAME PLATE EXPECTED TIME') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('name_plate_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('name_plate_marked_physical_count') == null || $get('name_plate_marked_physical_count') == '' || $get('name_plate_marked_physical_count') == '0') { + $set('name_plate_marked_status', null); + $set('name_plate_marked_physical_count', '0'); + $set('name_plate_expected_time', '0'); + $set('name_plate_marked_datetime', null); + $set('name_plate_marked_by', null); + } else { + $set('name_plate_marked_datetime', now()->toDateTimeString()); + $set('name_plate_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }) ->default('0') @@ -1195,14 +1563,38 @@ class ClassCharacteristicResource extends Resource ->label('NAME PLATE MARKED DATETIME') ->reactive() ->placeholder('Select Name Plate Marked DateTime') - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('name_plate_marked_status') == 'Marked') + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('name_plate_marked_physical_count') == null || $get('name_plate_marked_physical_count') == '' || $get('name_plate_marked_physical_count') == '0') { + $set('name_plate_marked_status', null); + $set('name_plate_marked_physical_count', '0'); + $set('name_plate_expected_time', '0'); + $set('name_plate_marked_datetime', null); + $set('name_plate_marked_by', null); + } else { + $set('name_plate_marked_datetime', now()->toDateTimeString()); + $set('name_plate_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('name_plate_marked_by') ->label('NAME PLATE MARKED BY') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) - ->afterStateUpdated(function (callable $set) { + ->readOnly(fn (Get $get) => $get('mark_status') == 'Marked' || $get('name_plate_marked_status') == 'Marked') + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->afterStateUpdated(function (callable $set, callable $get) { + if ($get('name_plate_marked_physical_count') == null || $get('name_plate_marked_physical_count') == '' || $get('name_plate_marked_physical_count') == '0') { + $set('name_plate_marked_status', null); + $set('name_plate_marked_physical_count', '0'); + $set('name_plate_expected_time', '0'); + $set('name_plate_marked_datetime', null); + $set('name_plate_marked_by', null); + } else { + $set('name_plate_marked_datetime', now()->toDateTimeString()); + $set('name_plate_marked_by', Filament::auth()->user()?->name); + } + $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\Select::make('motor_pump_pumpset_status') @@ -1210,6 +1602,7 @@ class ClassCharacteristicResource extends Resource // ->label('Search by PUMPSET Type') ->nullable() ->searchable() + ->disabled(fn (Get $get) => ! empty($get('id'))) ->options(function (callable $get) { $plantId = $get('plant_id'); $machineId = $get('machine_id'); @@ -1243,6 +1636,7 @@ class ClassCharacteristicResource extends Resource Forms\Components\TextInput::make('winded_serial_number') ->label('WINDED SERIAL NUMBER') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), @@ -1252,52 +1646,59 @@ class ClassCharacteristicResource extends Resource ->minValue(0) ->integer() ->maxValue(1) + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('motor_machine_name') ->label('MOTOR MACHINE NAME') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'MOTOR', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->readOnly(fn (Get $get) => $get('id')) + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'MOTOR', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('pump_machine_name') ->label('PUMP MACHINE NAME') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'PUMP', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->readOnly(fn (Get $get) => $get('id')) + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'PUMP', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('name_plate_machine_name') ->label('NAME PLATE MACHINE NAME') ->reactive() - ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + ->readOnly(fn (Get $get) => $get('id')) + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), // Forms\Components\TextInput::make('pumpset_machine_name') // ->label('PUMPSET MACHINE NAME') // ->reactive() - // ->readOnly(fn (callable $get) => ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) + // ->readOnly(fn (Get $get) => ! (Str::contains($get('zmm_heading'), 'PUMPSET', ignoreCase: true)) && ! (Str::contains($get('zmm_heading'), 'PRESSURE BOOSTER SYSTEM', ignoreCase: true))) // ->afterStateUpdated(function (callable $set) { // $set('updated_by', Filament::auth()->user()?->name); // }), Forms\Components\TextInput::make('part_validation_1') ->label('PART VALIDATION 1') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('part_validation_2') ->label('PART VALIDATION 2') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('samlight_logged_name') ->label('SAMLIGHT LOGGED NAME') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), @@ -1314,6 +1715,7 @@ class ClassCharacteristicResource extends Resource '1' => 'Alert Approved', ]; }) + ->disabled(fn (Get $get) => ! empty($get('id'))) ->default('5') ->reactive() ->afterStateUpdated(function (callable $set) { @@ -1344,6 +1746,7 @@ class ClassCharacteristicResource extends Resource '1' => 'Alert Approved', ]; }) + ->disabled(fn (Get $get) => ! empty($get('id'))) ->default('5') ->reactive() ->afterStateUpdated(function (callable $set) { @@ -1363,6 +1766,7 @@ class ClassCharacteristicResource extends Resource '1' => 'Alert Approved', ]; }) + ->disabled(fn (Get $get) => ! empty($get('id'))) ->default('5') ->reactive() ->afterStateUpdated(function (callable $set) { @@ -1373,6 +1777,7 @@ class ClassCharacteristicResource extends Resource ->label('PENDING RELEASED STATUS') ->reactive() ->integer() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -1384,6 +1789,7 @@ class ClassCharacteristicResource extends Resource ->minValue(0) ->integer() ->maxValue(3) + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -2043,6 +2449,10 @@ class ClassCharacteristicResource extends Resource ->label('MANUAL MARKED PHYSICAL COUNT') ->alignCenter() ->sortable(), + Tables\Columns\TextColumn::make('man_marked_expected_time') + ->label('MANUAL MARKED EXPECTED TIME') + ->alignCenter() + ->sortable(), Tables\Columns\TextColumn::make('man_marked_datetime') ->label('MANUAL MARKED DATETIME') ->alignCenter() @@ -2717,12 +3127,14 @@ class ClassCharacteristicResource extends Resource $itemCodeExist = Item::where('plant_id', $plantId)->where('code', $itemCode)->first(); if (! $itemCodeExist) { $invalidMatCodesNotFound[] = $itemCode; + continue; } - if($itemCodeExist){ + if ($itemCodeExist) { $itemCharacMaster = ItemCharacteristic::where('plant_id', $plantId)->where('item_id', $itemCodeExist->id)->first(); - if(!$itemCharacMaster){ + if (! $itemCharacMaster) { $invalidMasterFound[] = $itemCode; + continue; } } @@ -2758,8 +3170,9 @@ class ClassCharacteristicResource extends Resource continue; } - if ((int)$releaseQuan > (int)$orderQuan) { + if ((int) $releaseQuan > (int) $orderQuan) { $invalidRelQuan[] = $releaseQuan; + continue; } @@ -2822,7 +3235,6 @@ class ClassCharacteristicResource extends Resource $uniqueInvalidRelQuan = array_unique($invalidRelQuan); - if (! empty($uniqueInvalidPlaCodesMaster)) { Notification::make() ->title('Invalid Plant Codes') @@ -2856,8 +3268,7 @@ class ClassCharacteristicResource extends Resource } return; - } - elseif (! empty($uniqueInvalidItemCharMast)) { + } elseif (! empty($uniqueInvalidItemCharMast)) { Notification::make() ->title('Invalid Item Codes') ->body('The following item codes not found in item characteristic master:
'.implode(', ', $uniqueInvalidItemCharMast)) @@ -3180,13 +3591,14 @@ class ClassCharacteristicResource extends Resource ->title('Import Failed') ->body("{$insertedCount} records failed.") ->success(); + return; - } - else{ + } else { Notification::make() ->title('Import Successful') ->body("{$insertedCount} records inserted successfully.") ->success(); + return; } diff --git a/app/Filament/Resources/TempClassCharacteristicResource.php b/app/Filament/Resources/TempClassCharacteristicResource.php index b876223e..e33af909 100644 --- a/app/Filament/Resources/TempClassCharacteristicResource.php +++ b/app/Filament/Resources/TempClassCharacteristicResource.php @@ -124,7 +124,7 @@ class TempClassCharacteristicResource extends Resource ->reactive() ->minLength(7) ->maxLength(10) - ->readOnly(fn (callable $get) => (! $get('plant_id') || ! $get('machine_id') || ! $get('item_id'))) + ->readOnly(fn (Get $get) => (! $get('plant_id') || ! $get('machine_id') || ! $get('item_id') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -132,6 +132,7 @@ class TempClassCharacteristicResource extends Resource Forms\Components\TextInput::make('model_type') ->label('MODEL TYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -142,12 +143,12 @@ class TempClassCharacteristicResource extends Resource ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) - ->readOnly(fn (callable $get) => (! $get('aufnr'))) + ->readOnly(fn (Get $get) => (! $get('aufnr') || $get('id'))) ->required(), Forms\Components\TextInput::make('arbid') ->label('ARBID') ->reactive() - ->readOnly(fn (callable $get) => (! $get('class'))) + ->readOnly(fn (Get $get) => (! $get('class') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -157,7 +158,7 @@ class TempClassCharacteristicResource extends Resource ->reactive() ->numeric() ->minValue(1.000) - ->readOnly(fn (callable $get) => (! $get('arbid'))) + ->readOnly(fn (Get $get) => (! $get('arbid') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -168,7 +169,7 @@ class TempClassCharacteristicResource extends Resource ->integer() ->minValue(1) ->maxValue(fn (callable $get) => ($get('gamng') ?? 1)) - ->readOnly(fn (callable $get) => (! $get('gamng'))) + ->readOnly(fn (Get $get) => (! $get('gamng') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -177,7 +178,7 @@ class TempClassCharacteristicResource extends Resource ->label('GERNR') ->reactive() ->minLength(13) - ->readOnly(fn (callable $get) => (! $get('lmnga'))) + ->readOnly(fn (Get $get) => (! $get('lmnga') || $get('id'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -203,91 +204,105 @@ class TempClassCharacteristicResource extends Resource Forms\Components\TextInput::make('zz1_cn_bill_ord') ->label('ZZ1 CN BILL ORD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_amps') ->label('ZMM AMPS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_brand') ->label('ZMM BRAND') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_degreeofprotection') ->label('ZMM DEGREEOFPROTECTION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_delivery') ->label('ZMM DELIVERY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_dir_rot') ->label('ZMM DIR ROT') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_discharge') ->label('ZMM DISCHARGE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_discharge_max') ->label('ZMM DISCHARGE MAX') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_discharge_min') ->label('ZMM DISCHARGE MIN') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_duty') ->label('ZMM DUTY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_eff_motor') ->label('ZMM EFF MOTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_eff_pump') ->label('ZMM EFF PUMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_frequency') ->label('ZMM FREQUENCY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_head') ->label('ZMM HEAD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_heading') ->label('ZMM HEADING') ->reactive() - ->readOnly(fn (callable $get) => (! $get('aufnr') || ! $get('gernr'))) + ->readOnly(fn (Get $get) => ($get('id') || ! $get('aufnr') || ! $get('gernr'))) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }) @@ -295,714 +310,833 @@ class TempClassCharacteristicResource extends Resource Forms\Components\TextInput::make('zmm_head_max') ->label('ZMM HEAD MAX') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_head_minimum') ->label('ZMM HEAD MINIMUM') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_idx_eff_mtr') ->label('ZMM IDX EFF MTR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_idx_eff_pump') ->label('ZMM IDX EFF PUMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_kvacode') ->label('ZMM KVACODE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_maxambtemp') ->label('ZMM MAXAMBTEMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_mincoolingflow') ->label('ZMM MINCOOLINGFLOW') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motorseries') ->label('ZMM MOTORSERIES') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motor_model') ->label('ZMM MOTOR MODEL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_outlet') ->label('ZMM OUTLET') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_phase') ->label('ZMM PHASE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pressure') ->label('ZMM PRESSURE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pumpflowtype') ->label('ZMM PUMPFLOWTYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pumpseries') ->label('ZMM PUMPSERIES') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pump_model') ->label('ZMM PUMP MODEL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_ratedpower') ->label('ZMM RATEDPOWER') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_region') ->label('ZMM REGION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_servicefactor') ->label('ZMM SERVICEFACTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_servicefactormaximumamps') ->label('ZMM SERVICEFACTORMAXIMUMAMPS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_speed') ->label('ZMM SPEED') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_suction') ->label('ZMM SUCTION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_suctionxdelivery') ->label('ZMM SUCTIONXDELIVERY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_supplysource') ->label('ZMM SUPPLYSOURCE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_temperature') ->label('ZMM TEMPERATURE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_thrustload') ->label('ZMM THRUSTLOAD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_volts') ->label('ZMM VOLTS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_wire') ->label('ZMM WIRE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_package') ->label('ZMM PACKAGE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pvarrayrating') ->label('ZMM PVARRAYRATING') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isi') ->label('ZMM ISI') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isimotor') ->label('ZMM ISIMOTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isipump') ->label('ZMM ISIPUMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isipumpset') ->label('ZMM ISIPUMPSET') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pumpset_model') ->label('ZMM PUMPSET MODEL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_stages') ->label('ZMM STAGES') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_headrange') ->label('ZMM HEADRANGE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_overall_efficiency') ->label('ZMM OVERALL EFFICIENCY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_connection') ->label('ZMM CONNECTION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_min_bore_size') ->label('ZMM MIN BORE SIZE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isireference') ->label('ZMM ISIREFERENCE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_category') ->label('ZMM CATEGORY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_submergence') ->label('ZMM SUBMERGENCE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_capacitorstart') ->label('ZMM CAPACITORSTART') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_capacitorrun') ->label('ZMM CAPACITORRUN') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_inch') ->label('ZMM INCH') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motor_type') ->label('ZMM MOTOR TYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_dismantle_direction') ->label('ZMM DISMANTLE DIRECTION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_eff_ovrall') ->label('ZMM EFF OVRALL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_bodymoc') ->label('ZMM BODYMOC') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_rotormoc') ->label('ZMM ROTORMOC') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_dlwl') ->label('ZMM DLWL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_inputpower') ->label('ZMM INPUTPOWER') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_imp_od') ->label('ZMM IMP OD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_ambtemp') ->label('ZMM AMBTEMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_de') ->label('ZMM DE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_dischargerange') ->label('ZMM DISCHARGERANGE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_efficiency_class') ->label('ZMM EFFICIENCY CLASS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_framesize') ->label('ZMM FRAMESIZE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_impellerdiameter') ->label('ZMM IMPELLERDIAMETER') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_insulationclass') ->label('ZMM INSULATIONCLASS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_maxflow') ->label('ZMM MAXFLOW') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_minhead') ->label('ZMM MINHEAD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_mtrlofconst') ->label('ZMM MTRLOFCONST') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_nde') ->label('ZMM NDE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_powerfactor') ->label('ZMM POWERFACTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_tagno') ->label('ZMM TAGNO') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_year') ->label('ZMM YEAR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_laser_name') ->label('ZMM LASER NAME') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_logo_cp') ->label('ZMM LOGO CP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_logo_ce') ->label('ZMM LOGO CE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_logo_nsf') ->label('ZMM LOGO NSF') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_logo_eac') ->label('ZMM LOGO EAC') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_beenote') ->label('ZMM BEENOTE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_beenumber') ->label('ZMM BEENUMBER') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_beestar') ->label('ZMM BEESTAR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_codeclass') ->label('ZMM CODECLASS') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_colour') ->label('ZMM COLOUR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grade') ->label('ZMM GRADE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grwt_pset') ->label('ZMM GRWT PSET') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grwt_cable') ->label('ZMM GRWT CABLE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grwt_motor') ->label('ZMM GRWT MOTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grwt_pf') ->label('ZMM GRWT PF') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_grwt_pump') ->label('ZMM GRWT PUMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isivalve') ->label('ZMM ISIVALVE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_isi_wc') ->label('ZMM ISI WC') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_labelperiod') ->label('ZMM LABELPERIOD') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_length') ->label('ZMM LENGTH') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_license_cml_no') ->label('ZMM LICENSE CML NO') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_mfgmonyr') ->label('ZMM MFGMONYR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_modelyear') ->label('ZMM MODELYEAR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motoridentification') ->label('ZMM MOTORIDENTIFICATION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_newt_pset') ->label('ZMM NEWT PSET') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_newt_cable') ->label('ZMM NEWT CABLE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_newt_motor') ->label('ZMM NEWT MOTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_newt_pf') ->label('ZMM NEWT PF') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_newt_pump') ->label('ZMM NEWT PUMP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_packtype') ->label('ZMM PACKTYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_panel') ->label('ZMM PANEL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_performance_factor') ->label('ZMM PERFORMANCE_FACTOR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_pumpidentification') ->label('ZMM PUMPIDENTIFICATION') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_psettype') ->label('ZMM PSETTYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_size') ->label('ZMM SIZE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_eff_ttl') ->label('ZMM EFF TTL') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_type') ->label('ZMM TYPE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_usp') ->label('ZMM USP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_operating_range') ->label('ZMM OPERATING RANGE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_intake_air') ->label('ZMM INTAKE AIR') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_oxygen_transfer_rate') ->label('ZMM OXYGEN TRANSFER RATE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_air_inlet_pipesize') ->label('ZMM AIR INLET PIPESIZE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_sump_depth') ->label('ZMM SUMP DEPTH') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_poles') ->label('ZMM POLES') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motor_heading') ->label('ZMM MOTOR HEADING') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_motor_speed') ->label('ZMM MOTOR SPEED') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zqmm_qty') ->label('ZQMM QTY') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_operating_temperature') ->label('ZMM OPERATING TEMPERATURE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_axial_force') ->label('ZMM AXIAL FORCE') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('zmm_mrp') ->label('ZMM MRP') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('winded_serial_number') ->label('WINDED SERIAL NUMBER') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), Forms\Components\TextInput::make('has_work_flow_id') ->label('HAS WORK FLOW ID') ->reactive() + ->readOnly(fn (Get $get) => $get('id')) ->afterStateUpdated(function (callable $set) { $set('updated_by', Filament::auth()->user()?->name); }), diff --git a/app/Http/Controllers/CharacteristicsController.php b/app/Http/Controllers/CharacteristicsController.php index 13f91c80..7b028b70 100644 --- a/app/Http/Controllers/CharacteristicsController.php +++ b/app/Http/Controllers/CharacteristicsController.php @@ -1736,9 +1736,12 @@ class CharacteristicsController extends Controller $curRewWind = ($char['winded_rework_status'] == '1') ? '1' : $curRewWind; $manStat = (intval($curStat->man_marked_status ?? 0) ?: 0) + 1; + $manExpecTim = (floatval($curStat->man_marked_expected_time ?? 0.0) ?: 0.0) + $expectedTime; + // $manStat = ($curStat->man_marked_status == null || $curStat->man_marked_status == '' || $curStat->man_marked_status == '0') ? 0 : (int) $curStat->man_marked_status; $values = [ 'man_marked_status' => (string) $manStat, + 'man_marked_expected_time' => (string) $manExpecTim, 'man_marked_datetime' => empty($char['man_marked_datetime']) ? now() : $char['man_marked_datetime'], 'man_marked_by' => (($char['man_marked_by'] == 'jothi') ? 'Admin' : $char['man_marked_by']) ?? $curManualMarkBy, 'winded_serial_number' => empty($char['winded_serial_number']) ? $curWindNo : $char['winded_serial_number'], @@ -2445,7 +2448,7 @@ class CharacteristicsController extends Controller } } - $availFields = ['class', 'arbid', 'gamng', 'lmnga', '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_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'zmm_mrp', 'marked_datetime', 'marked_by', 'motor_pump_pumpset_status', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'pending_released_status', 'has_work_flow_id', 'motor_stop_flow_id', 'pump_stop_flow_id', 'name_plate_stop_flow_id']; // 'mark_status','marked_physical_count', 'marked_expected_time', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_datetime', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_datetime', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_datetime', 'name_plate_marked_by', 'winded_serial_number', 'winded_rework_status', 'part_validation_1', 'part_validation_2', 'samlight_logged_name' + $availFields = ['class', 'arbid', 'gamng', 'lmnga', '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_logo_cp', 'zmm_logo_ce', 'zmm_logo_nsf', 'zmm_logo_eac', 'zmm_grwt_motor', 'zmm_grwt_pump', 'zmm_grwt_pset', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_newt_motor', 'zmm_newt_pump', 'zmm_newt_pset', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_operating_range', 'zmm_intake_air', 'zmm_oxygen_transfer_rate', 'zmm_air_inlet_pipesize', 'zmm_sump_depth', 'zmm_poles', 'zmm_motor_heading', 'zmm_motor_speed', 'zmm_beenote', 'zmm_beenumber', 'zmm_beestar', 'zmm_eff_ttl', 'zmm_labelperiod', 'zmm_modelyear', 'zmm_performance_factor', 'zqmm_qty', 'zmm_operating_temperature', 'zmm_axial_force', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'zmm_mrp', 'marked_datetime', 'marked_by', 'motor_pump_pumpset_status', 'motor_machine_name', 'pump_machine_name', 'name_plate_machine_name', 'pending_released_status', 'has_work_flow_id', 'motor_stop_flow_id', 'pump_stop_flow_id', 'name_plate_stop_flow_id']; // 'mark_status','marked_physical_count', 'marked_expected_time', 'man_marked_status', 'man_marked_datetime', 'man_marked_by', 'man_marked_expected_time', 'motor_marked_status', 'motor_marked_physical_count', 'motor_expected_time', 'motor_marked_datetime', 'motor_marked_by', 'pump_marked_status', 'pump_marked_physical_count', 'pump_expected_time', 'pump_marked_datetime', 'pump_marked_by', 'name_plate_marked_status', 'name_plate_expected_time', 'name_plate_marked_datetime', 'name_plate_marked_by', 'winded_serial_number', 'winded_rework_status', 'part_validation_1', 'part_validation_2', 'samlight_logged_name' if ($itemCode != '' && $itemCode != null && $itemCode && Str::length($itemCode) > 0) { $existingJobNo = ClassCharacteristic::where('aufnr', $jobNo)->first(); // ->where('machine_id', $machineId)->where('plant_id', $plantId) @@ -3750,7 +3753,7 @@ class CharacteristicsController extends Controller $characteristicsData = ClassCharacteristic::where('gernr', $serialNumber)->where('item_id', $itemId)->where('machine_id', $machineId)->where('plant_id', $plantId)->get(); - $remFields = ['id', 'plant_id', 'machine_id', 'item_id', 'gernr', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'zmm_mrp', 'created_at', 'updated_at', 'created_by', 'updated_by', 'deleted_at']; // , 'is_stopped', 'stopped_datetime', 'stopped_by' + $remFields = ['id', 'plant_id', 'machine_id', 'item_id', 'gernr', 'zmm_codeclass', 'zmm_colour', 'zmm_grade', 'zmm_grwt_cable', 'zmm_grwt_pf', 'zmm_isivalve', 'zmm_isi_wc', 'zmm_length', 'zmm_license_cml_no', 'zmm_mfgmonyr', 'zmm_motoridentification', 'zmm_newt_cable', 'zmm_newt_pf', 'zmm_packtype', 'zmm_panel', 'zmm_pumpidentification', 'zmm_psettype', 'zmm_size', 'zmm_type', 'zmm_usp', 'zmm_mrp', 'man_marked_expected_time', 'created_at', 'updated_at', 'created_by', 'updated_by', 'deleted_at']; // , 'is_stopped', 'stopped_datetime', 'stopped_by' $filteredData = $characteristicsData->map(function ($char) use ($remFields) { $charArray = $char->toArray(); diff --git a/app/Models/ClassCharacteristic.php b/app/Models/ClassCharacteristic.php index d66555af..9790ea64 100644 --- a/app/Models/ClassCharacteristic.php +++ b/app/Models/ClassCharacteristic.php @@ -161,6 +161,7 @@ class ClassCharacteristic extends Model 'marked_datetime', 'marked_by', 'man_marked_status', + 'man_marked_expected_time', 'man_marked_datetime', 'man_marked_by', 'motor_marked_status', diff --git a/database/migrations/2026_09_30_114854_add_man_marked_expected_time_column_in_class_characteristics_table.php b/database/migrations/2026_09_30_114854_add_man_marked_expected_time_column_in_class_characteristics_table.php new file mode 100644 index 00000000..b7b84b58 --- /dev/null +++ b/database/migrations/2026_09_30_114854_add_man_marked_expected_time_column_in_class_characteristics_table.php @@ -0,0 +1,31 @@ +