Added pre-pro and printed toggles to order
This commit is contained in:
parent
3c98de929e
commit
d950955371
@ -41,58 +41,73 @@ public static function form(Form $form): Form
|
|||||||
return $form->schema([
|
return $form->schema([
|
||||||
Section::make([
|
Section::make([
|
||||||
|
|
||||||
Section::make([
|
Grid::make(1)
|
||||||
Select::make('order_type')
|
->schema([
|
||||||
->required()
|
Select::make('order_type')
|
||||||
->options(OrderType::class)
|
|
||||||
->searchable(),
|
|
||||||
|
|
||||||
Split::make([
|
|
||||||
Select::make('customer_id')
|
|
||||||
->required()
|
->required()
|
||||||
->label('Customer')
|
->options(OrderType::class)
|
||||||
->options(Customer::all()->pluck('company_name', 'id'))
|
|
||||||
->reactive()
|
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
|
||||||
Select::make('contact_id')
|
Split::make([
|
||||||
->label('Contact')
|
Select::make('customer_id')
|
||||||
->options(fn ($get): array => Contact::where('customer_id', $get('customer_id') ?? null)
|
->required()
|
||||||
->get()
|
->label('Customer')
|
||||||
->pluck('full_name', 'id')
|
->options(Customer::all()->pluck('company_name', 'id'))
|
||||||
->toArray())
|
->reactive()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
]),
|
|
||||||
|
|
||||||
TextInput::make('customer_po')
|
Select::make('contact_id')
|
||||||
->required()
|
->label('Contact')
|
||||||
->label('Customer PO'),
|
->options(fn ($get): array => Contact::where('customer_id', $get('customer_id') ?? null)
|
||||||
|
->get()
|
||||||
|
->pluck('full_name', 'id')
|
||||||
|
->toArray())
|
||||||
|
->searchable(),
|
||||||
|
]),
|
||||||
|
|
||||||
Split::make([
|
TextInput::make('customer_po')
|
||||||
DatePicker::make('order_date')
|
|
||||||
->required()
|
->required()
|
||||||
->default(today()),
|
->label('Customer PO'),
|
||||||
DatePicker::make('due_date')
|
|
||||||
|
Split::make([
|
||||||
|
DatePicker::make('order_date')
|
||||||
|
->required()
|
||||||
|
->default(today()),
|
||||||
|
DatePicker::make('due_date')
|
||||||
|
->required()
|
||||||
|
->default(today()->add('10 days')),
|
||||||
|
]),
|
||||||
|
|
||||||
|
Textarea::make('notes')
|
||||||
|
->rows(3),
|
||||||
|
|
||||||
|
])->columnSpan(1),
|
||||||
|
|
||||||
|
Grid::make(1)
|
||||||
|
->schema([
|
||||||
|
ToggleButtons::make('status')
|
||||||
->required()
|
->required()
|
||||||
->default(today()->add('10 days')),
|
->options(OrderStatus::class)
|
||||||
]),
|
->inline(),
|
||||||
])->columnSpan(1),
|
|
||||||
|
|
||||||
Section::make([
|
ToggleButtons::make('order_attributes')
|
||||||
ToggleButtons::make('status')
|
->options(OrderAttributes::class)
|
||||||
->required()
|
->multiple()
|
||||||
->options(OrderStatus::class)
|
->inline(),
|
||||||
->inline(),
|
|
||||||
|
|
||||||
ToggleButtons::make('order_attributes')
|
ToggleButtons::make('printed')
|
||||||
->options(OrderAttributes::class)
|
->boolean()
|
||||||
->multiple()
|
->inline(),
|
||||||
->inline(),
|
ToggleButtons::make('pre_production')
|
||||||
|
->label('Pre-production')
|
||||||
|
->boolean()
|
||||||
|
->inline()
|
||||||
|
->colors([
|
||||||
|
'true' => 'info',
|
||||||
|
'false' => 'info',
|
||||||
|
]),
|
||||||
|
|
||||||
Textarea::make('notes')
|
])->columnSpan(1),
|
||||||
->rows(3),
|
|
||||||
|
|
||||||
])->columnSpan(1),
|
|
||||||
])->columns(2),
|
])->columns(2),
|
||||||
|
|
||||||
TableRepeater::make('order_products')
|
TableRepeater::make('order_products')
|
||||||
@ -126,7 +141,7 @@ public static function form(Form $form): Form
|
|||||||
->cloneable(),
|
->cloneable(),
|
||||||
|
|
||||||
Repeater::make('services')
|
Repeater::make('services')
|
||||||
->label('Production Details')
|
->label('Product Services')
|
||||||
->schema([
|
->schema([
|
||||||
Grid::make(19)
|
Grid::make(19)
|
||||||
->schema([
|
->schema([
|
||||||
|
@ -38,6 +38,8 @@ class Order extends Model
|
|||||||
'digitizing',
|
'digitizing',
|
||||||
'garments',
|
'garments',
|
||||||
'supplied_file',
|
'supplied_file',
|
||||||
|
'printed',
|
||||||
|
'pre_production',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
|
@ -28,6 +28,9 @@ public function up(): void
|
|||||||
$table->boolean('garments')->default(0);
|
$table->boolean('garments')->default(0);
|
||||||
$table->boolean('supplied_file')->default(0);
|
$table->boolean('supplied_file')->default(0);
|
||||||
|
|
||||||
|
$table->boolean('printed')->default(0);
|
||||||
|
$table->boolean('pre_production')->default(0);
|
||||||
|
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
@ -14,7 +14,7 @@ class ContactSeeder extends Seeder
|
|||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
foreach (Customer::all() as $customer) {
|
foreach (Customer::all() as $customer) {
|
||||||
if ($customer->company_name == 'Genumark') {
|
if ($customer->company_name === 'Genumark') {
|
||||||
$customer->contacts()->createMany([
|
$customer->contacts()->createMany([
|
||||||
[
|
[
|
||||||
'first_name' => 'Tammy',
|
'first_name' => 'Tammy',
|
||||||
@ -50,7 +50,7 @@ public function run(): void
|
|||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
Contact::factory(rand(1, 4))->for($customer);
|
Contact::factory(rand(1, 4))->for($customer)->create();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user