Added view rights against plant on import and export
This commit is contained in:
@@ -10,7 +10,9 @@ use Filament\Actions\Exports\Models\Export;
|
||||
class EbReadingExporter extends Exporter
|
||||
{
|
||||
protected static ?string $model = EbReading::class;
|
||||
static $rowNumber = 0;
|
||||
|
||||
public static $rowNumber = 0;
|
||||
|
||||
public static function getColumns(): array
|
||||
{
|
||||
return [
|
||||
@@ -20,8 +22,8 @@ class EbReadingExporter extends Exporter
|
||||
// Increment and return the row number
|
||||
return ++$rowNumber;
|
||||
}),
|
||||
ExportColumn::make('plant.name')
|
||||
->label('PLANT'),
|
||||
ExportColumn::make('plant.code')
|
||||
->label('PLANT CODE'),
|
||||
ExportColumn::make('lcd_segment_check')
|
||||
->label('LCD SEGMENT CHECK'),
|
||||
ExportColumn::make('meter_serial_no')
|
||||
|
||||
@@ -16,10 +16,10 @@ class EbReadingImporter extends Importer
|
||||
return [
|
||||
ImportColumn::make('plant')
|
||||
->requiredMapping()
|
||||
->exampleHeader('Plant Name')
|
||||
->example('Ransar Industries-I')
|
||||
->label('Plant Name')
|
||||
->relationship(resolveUsing:'name')
|
||||
->exampleHeader('Plant Code')
|
||||
->example('1000')
|
||||
->label('Plant Code')
|
||||
->relationship(resolveUsing: 'code')
|
||||
->rules(['required']),
|
||||
ImportColumn::make('lcd_segment_check')
|
||||
->label('LCD Segment Check')
|
||||
@@ -227,7 +227,7 @@ class EbReadingImporter extends Importer
|
||||
// 'email' => $this->data['email'],
|
||||
// ]);
|
||||
|
||||
return new EbReading();
|
||||
return new EbReading;
|
||||
}
|
||||
|
||||
public static function getCompletedNotificationBody(Import $import): string
|
||||
|
||||
Reference in New Issue
Block a user