72 lines
2.5 KiB
PHP
72 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\OrdenProduccionResource\RelationManagers;
|
|
|
|
use App\Models\TrasladoPrenda;
|
|
use Filament\Resources\RelationManagers\RelationManager;
|
|
use Filament\Tables;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Forms\Form;
|
|
use Filament\Forms;
|
|
|
|
class TrasladosRelationManager extends RelationManager
|
|
{
|
|
protected static string $relationship = 'traslados';
|
|
|
|
protected static ?string $recordTitleAttribute = 'id';
|
|
|
|
public function form(Form $form): Form
|
|
{
|
|
return $form->schema([
|
|
Forms\Components\TextInput::make('cantidad_enviada')->numeric(),
|
|
Forms\Components\TextInput::make('cantidad_recibida')->numeric(),
|
|
Forms\Components\TextInput::make('residual')->numeric()->disabled(),
|
|
Forms\Components\Select::make('origen')->options([
|
|
'confeccion' => 'Confección',
|
|
'tintoreria' => 'Tintorería',
|
|
'acabados' => 'Acabados',
|
|
'bodega' => 'Bodega',
|
|
]),
|
|
Forms\Components\Select::make('destino')->options([
|
|
'confeccion' => 'Confección',
|
|
'tintoreria' => 'Tintorería',
|
|
'acabados' => 'Acabados',
|
|
'bodega' => 'Bodega',
|
|
]),
|
|
Forms\Components\Textarea::make('notas')->columnSpanFull(),
|
|
]);
|
|
}
|
|
|
|
public function table(Tables\Table $table): Tables\Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('id')->label('ID'),
|
|
TextColumn::make('origen'),
|
|
TextColumn::make('destino'),
|
|
TextColumn::make('cantidad_enviada'),
|
|
TextColumn::make('cantidad_recibida'),
|
|
TextColumn::make('prendas_defectuosas'),
|
|
TextColumn::make('reparaciones'),
|
|
TextColumn::make('saldos'),
|
|
TextColumn::make('residual'),
|
|
TextColumn::make('estado'),
|
|
TextColumn::make('fecha_envio')->dateTime(),
|
|
TextColumn::make('fecha_recepcion')->dateTime(),
|
|
])
|
|
->filters([
|
|
//
|
|
])
|
|
->headerActions([
|
|
Tables\Actions\CreateAction::make(),
|
|
])
|
|
->actions([
|
|
Tables\Actions\EditAction::make(),
|
|
Tables\Actions\DeleteAction::make(),
|
|
])
|
|
->bulkActions([
|
|
Tables\Actions\DeleteBulkAction::make(),
|
|
]);
|
|
}
|
|
}
|