Compare commits
2 Commits
8c062505c9
...
0b221c5eae
| Author | SHA1 | Date | |
|---|---|---|---|
| 0b221c5eae | |||
|
|
9d8388c221 |
@@ -13,30 +13,49 @@ class CharacteristicValueExporter extends Exporter
|
|||||||
|
|
||||||
public static function getColumns(): array
|
public static function getColumns(): array
|
||||||
{
|
{
|
||||||
|
static $rowNumber = 0;
|
||||||
return [
|
return [
|
||||||
ExportColumn::make('id')
|
ExportColumn::make('no')
|
||||||
->label('ID'),
|
->label('NO')
|
||||||
ExportColumn::make('plant.name'),
|
->state(function ($record) use (&$rowNumber) {
|
||||||
ExportColumn::make('line.name'),
|
// Increment and return the row number
|
||||||
ExportColumn::make('item.id'),
|
return ++$rowNumber;
|
||||||
ExportColumn::make('machine.name'),
|
}),
|
||||||
ExportColumn::make('process_order'),
|
ExportColumn::make('plant.code')
|
||||||
ExportColumn::make('coil_number'),
|
->label('PLANT CODE'),
|
||||||
ExportColumn::make('status'),
|
ExportColumn::make('line.name')
|
||||||
ExportColumn::make('created_at'),
|
->label('LINE NAME'),
|
||||||
ExportColumn::make('updated_at'),
|
ExportColumn::make('item.code')
|
||||||
ExportColumn::make('created_by'),
|
->label('ITEM CODE'),
|
||||||
ExportColumn::make('updated_by'),
|
ExportColumn::make('machine.name')
|
||||||
ExportColumn::make('deleted_at'),
|
->label('WORK CENTER'),
|
||||||
|
ExportColumn::make('process_order')
|
||||||
|
->label('PROCESS ORDER'),
|
||||||
|
ExportColumn::make('coil_number')
|
||||||
|
->label('COIL NUMBER'),
|
||||||
|
ExportColumn::make('status')
|
||||||
|
->label('STATUS'),
|
||||||
|
ExportColumn::make('created_at')
|
||||||
|
->label('CREATED AT'),
|
||||||
|
ExportColumn::make('updated_at')
|
||||||
|
->label('UPDATED AT'),
|
||||||
|
ExportColumn::make('created_by')
|
||||||
|
->label('CREATED BY'),
|
||||||
|
ExportColumn::make('updated_by')
|
||||||
|
->label('UPDATED BY'),
|
||||||
|
ExportColumn::make('deleted_at')
|
||||||
|
->enabledByDefault(false)
|
||||||
|
->label('DELETED AT'),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getCompletedNotificationBody(Export $export): string
|
public static function getCompletedNotificationBody(Export $export): string
|
||||||
{
|
{
|
||||||
$body = 'Your characteristic value export has completed and ' . number_format($export->successful_rows) . ' ' . str('row')->plural($export->successful_rows) . ' exported.';
|
$body = 'Your characteristic value 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;
|
||||||
|
|||||||
Reference in New Issue
Block a user