|
|
|
@ -41,58 +41,73 @@ class OrderResource extends Resource
|
|
|
|
|
return $form->schema([
|
|
|
|
|
Section::make([
|
|
|
|
|
|
|
|
|
|
Section::make([
|
|
|
|
|
Select::make('order_type')
|
|
|
|
|
->required()
|
|
|
|
|
->options(OrderType::class)
|
|
|
|
|
->searchable(),
|
|
|
|
|
|
|
|
|
|
Split::make([
|
|
|
|
|
Select::make('customer_id')
|
|
|
|
|
Grid::make(1)
|
|
|
|
|
->schema([
|
|
|
|
|
Select::make('order_type')
|
|
|
|
|
->required()
|
|
|
|
|
->label('Customer')
|
|
|
|
|
->options(Customer::all()->pluck('company_name', 'id'))
|
|
|
|
|
->reactive()
|
|
|
|
|
->options(OrderType::class)
|
|
|
|
|
->searchable(),
|
|
|
|
|
|
|
|
|
|
Select::make('contact_id')
|
|
|
|
|
->label('Contact')
|
|
|
|
|
->options(fn ($get): array => Contact::where('customer_id', $get('customer_id') ?? null)
|
|
|
|
|
->get()
|
|
|
|
|
->pluck('full_name', 'id')
|
|
|
|
|
->toArray())
|
|
|
|
|
->searchable(),
|
|
|
|
|
]),
|
|
|
|
|
Split::make([
|
|
|
|
|
Select::make('customer_id')
|
|
|
|
|
->required()
|
|
|
|
|
->label('Customer')
|
|
|
|
|
->options(Customer::all()->pluck('company_name', 'id'))
|
|
|
|
|
->reactive()
|
|
|
|
|
->searchable(),
|
|
|
|
|
|
|
|
|
|
TextInput::make('customer_po')
|
|
|
|
|
->required()
|
|
|
|
|
->label('Customer PO'),
|
|
|
|
|
Select::make('contact_id')
|
|
|
|
|
->label('Contact')
|
|
|
|
|
->options(fn ($get): array => Contact::where('customer_id', $get('customer_id') ?? null)
|
|
|
|
|
->get()
|
|
|
|
|
->pluck('full_name', 'id')
|
|
|
|
|
->toArray())
|
|
|
|
|
->searchable(),
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
|
|
Split::make([
|
|
|
|
|
DatePicker::make('order_date')
|
|
|
|
|
->required()
|
|
|
|
|
->default(today()),
|
|
|
|
|
DatePicker::make('due_date')
|
|
|
|
|
TextInput::make('customer_po')
|
|
|
|
|
->required()
|
|
|
|
|
->default(today()->add('10 days')),
|
|
|
|
|
]),
|
|
|
|
|
])->columnSpan(1),
|
|
|
|
|
->label('Customer PO'),
|
|
|
|
|
|
|
|
|
|
Split::make([
|
|
|
|
|
DatePicker::make('order_date')
|
|
|
|
|
->required()
|
|
|
|
|
->default(today()),
|
|
|
|
|
DatePicker::make('due_date')
|
|
|
|
|
->required()
|
|
|
|
|
->default(today()->add('10 days')),
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
|
|
Section::make([
|
|
|
|
|
ToggleButtons::make('status')
|
|
|
|
|
->required()
|
|
|
|
|
->options(OrderStatus::class)
|
|
|
|
|
->inline(),
|
|
|
|
|
Textarea::make('notes')
|
|
|
|
|
->rows(3),
|
|
|
|
|
|
|
|
|
|
])->columnSpan(1),
|
|
|
|
|
|
|
|
|
|
Grid::make(1)
|
|
|
|
|
->schema([
|
|
|
|
|
ToggleButtons::make('status')
|
|
|
|
|
->required()
|
|
|
|
|
->options(OrderStatus::class)
|
|
|
|
|
->inline(),
|
|
|
|
|
|
|
|
|
|
ToggleButtons::make('order_attributes')
|
|
|
|
|
->options(OrderAttributes::class)
|
|
|
|
|
->multiple()
|
|
|
|
|
->inline(),
|
|
|
|
|
ToggleButtons::make('order_attributes')
|
|
|
|
|
->options(OrderAttributes::class)
|
|
|
|
|
->multiple()
|
|
|
|
|
->inline(),
|
|
|
|
|
|
|
|
|
|
Textarea::make('notes')
|
|
|
|
|
->rows(3),
|
|
|
|
|
ToggleButtons::make('printed')
|
|
|
|
|
->boolean()
|
|
|
|
|
->inline(),
|
|
|
|
|
ToggleButtons::make('pre_production')
|
|
|
|
|
->label('Pre-production')
|
|
|
|
|
->boolean()
|
|
|
|
|
->inline()
|
|
|
|
|
->colors([
|
|
|
|
|
'true' => 'info',
|
|
|
|
|
'false' => 'info',
|
|
|
|
|
]),
|
|
|
|
|
|
|
|
|
|
])->columnSpan(1),
|
|
|
|
|
])->columnSpan(1),
|
|
|
|
|
])->columns(2),
|
|
|
|
|
|
|
|
|
|
TableRepeater::make('order_products')
|
|
|
|
@ -126,7 +141,7 @@ class OrderResource extends Resource
|
|
|
|
|
->cloneable(),
|
|
|
|
|
|
|
|
|
|
Repeater::make('services')
|
|
|
|
|
->label('Production Details')
|
|
|
|
|
->label('Product Services')
|
|
|
|
|
->schema([
|
|
|
|
|
Grid::make(19)
|
|
|
|
|
->schema([
|
|
|
|
|