Added process order importer and exporter
This commit is contained in:
@@ -19,6 +19,11 @@ use Filament\Notifications\Notification;
|
||||
use Filament\Forms\Components\Actions\Action;
|
||||
use Filament\Facades\Filament;
|
||||
use Smalot\PdfParser\Parser;
|
||||
use Filament\Tables\Actions\ExportAction;
|
||||
use Filament\Tables\Actions\ImportAction;
|
||||
use App\Filament\Exports\ProcessOrderExporter;
|
||||
use App\Filament\Imports\ProcessOrderImporter;
|
||||
|
||||
|
||||
class ProcessOrderResource extends Resource
|
||||
{
|
||||
@@ -88,12 +93,14 @@ class ProcessOrderResource extends Resource
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('coil_number')
|
||||
->label('Coil Number')
|
||||
->default('0')
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('order_quantity')
|
||||
->label('Order Quantity')
|
||||
->required(),
|
||||
Forms\Components\TextInput::make('received_quantity')
|
||||
->label('Received Quantity')
|
||||
->default('0')
|
||||
->required(),
|
||||
Forms\Components\FileUpload::make('attachment')
|
||||
->label('PDF Upload')
|
||||
@@ -360,6 +367,22 @@ class ProcessOrderResource extends Resource
|
||||
Tables\Actions\ForceDeleteBulkAction::make(),
|
||||
Tables\Actions\RestoreBulkAction::make(),
|
||||
]),
|
||||
])
|
||||
->headerActions([
|
||||
ImportAction::make()
|
||||
->label('Import Process Order')
|
||||
->color('warning')
|
||||
->importer(ProcessOrderImporter::class)
|
||||
->visible(function() {
|
||||
return Filament::auth()->user()->can('view import process order');
|
||||
}),
|
||||
ExportAction::make()
|
||||
->label('Export Process Order')
|
||||
->color('warning')
|
||||
->exporter(ProcessOrderExporter::class)
|
||||
->visible(function() {
|
||||
return Filament::auth()->user()->can('view export process order');
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user