Added plant code instead of plant name on import and export
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 10s

This commit is contained in:
dhanabalan
2026-01-13 16:42:30 +05:30
parent b7b7f88235
commit 9bed5f6937
2 changed files with 20 additions and 14 deletions

View File

@@ -24,18 +24,18 @@ class TestingPanelReadingExporter 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('line.name')
->label('LINE'),
->label('LINE NAME'),
ExportColumn::make('machine.name')
->label('MACHINE'),
->label('MACHINE NAME'),
ExportColumn::make('motorTestingMaster.item.code')
->label('ITEM CODE'),
ExportColumn::make('motorTestingMaster.item.description')
->label('MODEL'),
->label('MODEL DESCRIPTION'),
ExportColumn::make('output')
->label('OUTPUT'),
->label('OUTPUT NAME'),
ExportColumn::make('serial_number')
->label('SERIAL NUMBER'),
ExportColumn::make('winded_serial_number')
@@ -125,7 +125,7 @@ class TestingPanelReadingExporter extends Exporter
ExportColumn::make('rework_count')
->label('REWORK COUNT'),
ExportColumn::make('update_count')
->label('UPDATE COUNT'),
->label('UPDATED COUNT'),
ExportColumn::make('output_flag')
->label('OUTPUT FLAG'),
ExportColumn::make('tested_by')
@@ -146,10 +146,10 @@ class TestingPanelReadingExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string
{
$body = 'Your testing panel reading export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
$body = 'Your testing panel reading export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
}
return $body;

View File

@@ -80,11 +80,17 @@ class TestingPanelReadingImporter extends Importer
->rules(['required']),
ImportColumn::make('line')
->requiredMapping()
->relationship()
->relationship(resolveUsing: 'name')
->exampleHeader('Line Name')
->example(['4 inch pump line'])
->label('Line Name')
->rules(['required']),
ImportColumn::make('plant')
->requiredMapping()
->relationship()
->relationship(resolveUsing: 'code')
->exampleHeader('Plant Code')
->example(['1000'])
->label('Plant Code')
->rules(['required']),
ImportColumn::make('tested_by'),
ImportColumn::make('updated_by'),
@@ -101,15 +107,15 @@ class TestingPanelReadingImporter extends Importer
// 'email' => $this->data['email'],
// ]);
return new TestingPanelReading();
return new TestingPanelReading;
}
public static function getCompletedNotificationBody(Import $import): string
{
$body = 'Your testing panel reading import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.';
$body = 'Your testing panel reading import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) {
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to import.';
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.';
}
return $body;