Merge pull request 'added logic for created at and updated at in item characteristic' (#1480) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Reviewed-on: #1480
This commit was merged in pull request #1480.
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Models\Plant;
|
||||
use Filament\Actions\Imports\ImportColumn;
|
||||
use Filament\Actions\Imports\Importer;
|
||||
use Filament\Actions\Imports\Models\Import;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Notifications\Notification;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@@ -568,22 +569,22 @@ class ItemCharacteristicImporter extends Importer
|
||||
->label('ZMM MRP')
|
||||
->exampleHeader('ZMM MRP')
|
||||
->example(''),
|
||||
ImportColumn::make('created_at')
|
||||
->label('CREATED AT')
|
||||
->exampleHeader('CREATED AT')
|
||||
->example('01-01-2026 00:08:00'),
|
||||
ImportColumn::make('created_by')
|
||||
->label('CREATED BY')
|
||||
->exampleHeader('CREATED BY')
|
||||
->example('TEST001'),
|
||||
ImportColumn::make('updated_at')
|
||||
->label('UPDATED AT')
|
||||
->exampleHeader('UPDATED AT')
|
||||
->example('01-01-2026 00:08:00'),
|
||||
ImportColumn::make('updated_by')
|
||||
->label('UPDATED BY')
|
||||
->exampleHeader('UPDATED BY')
|
||||
->example('TEST001'),
|
||||
// ImportColumn::make('created_at')
|
||||
// ->label('CREATED AT')
|
||||
// ->exampleHeader('CREATED AT')
|
||||
// ->example('01-01-2026 00:08:00'),
|
||||
// ImportColumn::make('created_by')
|
||||
// ->label('CREATED BY')
|
||||
// ->exampleHeader('CREATED BY')
|
||||
// ->example('TEST001'),
|
||||
// ImportColumn::make('updated_at')
|
||||
// ->label('UPDATED AT')
|
||||
// ->exampleHeader('UPDATED AT')
|
||||
// ->example('01-01-2026 00:08:00'),
|
||||
// ImportColumn::make('updated_by')
|
||||
// ->label('UPDATED BY')
|
||||
// ->exampleHeader('UPDATED BY')
|
||||
// ->example('TEST001'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -728,6 +729,7 @@ class ItemCharacteristicImporter extends Importer
|
||||
$zmmOperTemp = $this->data['zmm_operating_temperature'];
|
||||
$zmmAxialForce = $this->data['zmm_axial_force'];
|
||||
$zmmMrp = $this->data['zmm_mrp'];
|
||||
$userName = Filament::auth()->user()->name;
|
||||
|
||||
if (Str::length($plantCod) < 4 || ! is_numeric($plantCod) || ! preg_match('/^[1-9]\d{3,}$/', $plantCod)) {
|
||||
$warnMsg[] = 'Invalid plant code found';
|
||||
@@ -889,16 +891,19 @@ class ItemCharacteristicImporter extends Importer
|
||||
'zmm_operating_temperature' => $this->data['zmm_operating_temperature'],
|
||||
'zmm_axial_force' => $this->data['zmm_axial_force'],
|
||||
'zmm_mrp' => $this->data['zmm_mrp'],
|
||||
'created_by' => $userName,
|
||||
'updated_at' => now(),
|
||||
'updated_by' => $userName,
|
||||
]
|
||||
);
|
||||
|
||||
if($itemCharacteristic){
|
||||
Notification::make()
|
||||
->title('Success')
|
||||
->body('Item characteristic saved successfully.')
|
||||
->success()
|
||||
->send();
|
||||
}
|
||||
// if($itemCharacteristic){
|
||||
// Notification::make()
|
||||
// ->title('Success')
|
||||
// ->body('Item characteristic saved successfully.')
|
||||
// ->success()
|
||||
// ->send();
|
||||
// }
|
||||
|
||||
return $itemCharacteristic;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user