added labels in characteristic value exporter #108
@@ -13,30 +13,49 @@ class CharacteristicValueExporter extends Exporter
|
||||
|
||||
public static function getColumns(): array
|
||||
{
|
||||
static $rowNumber = 0;
|
||||
return [
|
||||
ExportColumn::make('id')
|
||||
->label('ID'),
|
||||
ExportColumn::make('plant.name'),
|
||||
ExportColumn::make('line.name'),
|
||||
ExportColumn::make('item.id'),
|
||||
ExportColumn::make('machine.name'),
|
||||
ExportColumn::make('process_order'),
|
||||
ExportColumn::make('coil_number'),
|
||||
ExportColumn::make('status'),
|
||||
ExportColumn::make('created_at'),
|
||||
ExportColumn::make('updated_at'),
|
||||
ExportColumn::make('created_by'),
|
||||
ExportColumn::make('updated_by'),
|
||||
ExportColumn::make('deleted_at'),
|
||||
ExportColumn::make('no')
|
||||
->label('NO')
|
||||
->state(function ($record) use (&$rowNumber) {
|
||||
// Increment and return the row number
|
||||
return ++$rowNumber;
|
||||
}),
|
||||
ExportColumn::make('plant.code')
|
||||
->label('PLANT CODE'),
|
||||
ExportColumn::make('line.name')
|
||||
->label('LINE NAME'),
|
||||
ExportColumn::make('item.code')
|
||||
->label('ITEM CODE'),
|
||||
ExportColumn::make('machine.name')
|
||||
->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
|
||||
{
|
||||
$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()) {
|
||||
$body .= ' ' . number_format($failedRowsCount) . ' ' . str('row')->plural($failedRowsCount) . ' failed to export.';
|
||||
$body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.';
|
||||
}
|
||||
|
||||
return $body;
|
||||
|
||||
Reference in New Issue
Block a user