Compare commits

..

1 Commits

Author SHA1 Message Date
d2d52b8f1b Merge pull request '20250413' (#151) from development into main
Reviewed-on: #151
2025-04-13 17:01:55 +02:00
2 changed files with 35 additions and 38 deletions

View File

@ -219,11 +219,11 @@ public static function form(Form $form): Form
->label('Product Services') ->label('Product Services')
->addActionLabel('Add new product service') ->addActionLabel('Add new product service')
->schema([ ->schema([
Grid::make(9) Grid::make(19)
->schema([ ->schema([
Select::make('serviceType') Select::make('serviceType')
->columnSpan(2)
->options(ServiceType::all()->pluck('value', 'id')) ->options(ServiceType::all()->pluck('value', 'id'))
->columnSpan(4)
->placeholder('Select...') ->placeholder('Select...')
->searchable() ->searchable()
->createOptionForm([ ->createOptionForm([
@ -239,15 +239,17 @@ public static function form(Form $form): Form
->createOptionUsing(function (array $data): int { ->createOptionUsing(function (array $data): int {
return ServiceType::create($data)->getKey(); return ServiceType::create($data)->getKey();
}), }),
TextInput::make('serviceFileName') TextInput::make('serviceFileName')
->columnSpan(2)
->datalist(ServiceFile::all()->unique('name')->pluck('name')->toArray()) ->datalist(ServiceFile::all()->unique('name')->pluck('name')->toArray())
->columnSpan(3)
->label('Logo Name'), ->label('Logo Name'),
TextInput::make('placement') TextInput::make('placement')
->columnSpan(2) ->datalist(ProductService::all()->unique('placement')->pluck('placement')->toArray())
->datalist(ProductService::all()->unique('placement')->pluck('placement')->toArray()), ->columnSpan(3),
TextInput::make('serviceFileSetupNumber')
->label('Setup')
->columnSpan(1)
->rules('numeric'),
Cluster::make([ Cluster::make([
TextInput::make('serviceFileWidth') TextInput::make('serviceFileWidth')
@ -258,47 +260,43 @@ public static function form(Form $form): Form
->rules('numeric'), ->rules('numeric'),
]) ])
->label('Dimensions') ->label('Dimensions')
->columnSpan(2), ->columnSpan(4),
TextInput::make('amount')
->label('Quantity')
->prefix('#')
->columnSpan(2)
->rules('numeric'),
TextInput::make('amount_price')
->label('Unit price')
->prefix('$')
->columnSpan(2)
->rules('numeric'),
]),
Grid::make(19)
->schema([
TextInput::make('serviceFileCode')
->label('Code')
->datalist(ServiceFile::all()->unique('code')->pluck('code')->toArray())
->columnSpan(2)
->placeholder('A1234'),
Select::make('serviceFileSizeUnit') Select::make('serviceFileSizeUnit')
->columnSpan(1) ->columnSpan(2)
->selectablePlaceholder(false) ->selectablePlaceholder(false)
->label('Unit') ->label('Unit')
->options([ ->options([
'in' => 'Inches', 'in' => 'Inches',
'cm' => 'cm', 'cm' => 'cm',
]), ]),
]),
Grid::make(9)
->schema([
TextInput::make('serviceFileCode')
->columnSpan(1)
->label('Code')
->datalist(ServiceFile::all()->unique('code')->pluck('code')->toArray()),
TextInput::make('serviceFileSetupNumber')
->columnSpan(1)
->label('Setup Number')
->rules('numeric'),
TextInput::make('amount')
->columnSpan(1)
->label('Quantity')
->prefix('#')
->rules('numeric'),
TextInput::make('amount_price')
->columnSpan(1)
->label('Unit price')
->prefix('$')
->rules('numeric'),
Textarea::make('notes') Textarea::make('notes')
->columnSpan(5) ->placeholder('Thread colors... (press enter for new line)')
->placeholder('Thread colors (press enter for new line)')
->autosize() ->autosize()
->rows(1), ->rows(1)
->columnSpan(15),
]), ]),
]) ])
->reorderable() ->reorderable()

View File

@ -200,7 +200,6 @@ protected function getHeaderActions(): array
foreach ($this->record->productServices as $service) { foreach ($this->record->productServices as $service) {
/** @var ServiceFile $newServiceFile */ /** @var ServiceFile $newServiceFile */
$newServiceFile = $service->serviceFile->replicate(); $newServiceFile = $service->serviceFile->replicate();
$newServiceFile->save();
$newService = $service->replicate(); $newService = $service->replicate();
$newService->order_id = $replica->id; $newService->order_id = $replica->id;