1
0
forked from poc/pds

Updated alignments on import and export

This commit is contained in:
dhanabalan
2026-01-13 16:15:06 +05:30
parent 6b40204e35
commit 5cba017b72
2 changed files with 10 additions and 10 deletions

View File

@@ -17,11 +17,11 @@ class ConfigurationExporter extends Exporter
return [ return [
ExportColumn::make('no') ExportColumn::make('no')
->label('NO') ->label('NO')
->state(function ($record) use (&$rowNumber) { ->state(function ($record) use (&$rowNumber) {
// Increment and return the row number // Increment and return the row number
return ++$rowNumber; return ++$rowNumber;
}), }),
ExportColumn::make('plant.code') ExportColumn::make('plant.code')
->label('PLANT'), ->label('PLANT'),
ExportColumn::make('line.name') ExportColumn::make('line.name')
@@ -46,10 +46,10 @@ class ConfigurationExporter extends Exporter
public static function getCompletedNotificationBody(Export $export): string public static function getCompletedNotificationBody(Export $export): string
{ {
$body = 'Your configuration export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.'; $body = 'Your configuration export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.';
if ($failedRowsCount = $export->getFailedRowsCount()) { 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; return $body;

View File

@@ -62,15 +62,15 @@ class ConfigurationImporter extends Importer
// 'email' => $this->data['email'], // 'email' => $this->data['email'],
// ]); // ]);
return new Configuration(); return new Configuration;
} }
public static function getCompletedNotificationBody(Import $import): string public static function getCompletedNotificationBody(Import $import): string
{ {
$body = 'Your configuration import has completed and ' . number_format($import->successful_rows) . ' ' . str('row')->plural($import->successful_rows) . ' imported.'; $body = 'Your configuration import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.';
if ($failedRowsCount = $import->getFailedRowsCount()) { 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; return $body;