@php ($hasCustomer = \App\Models\Account\Customer::first() != null) @extends('admin/layouts/admin') @section('title', __($translatePrefix . '.create.title')) @section('styles') @endsection @section('scripts') @if ($step == 2) @include('shared/js/options') @else @endsection @section('content')
@include('admin/shared/alerts')
@if ($step == 2) @csrf @endif

{{ __($translatePrefix . '.create.title') }}

{{ __($translatePrefix. '.create.subheading') }}

@if ($step == 1 && $hasCustomer && !empty($products)) @endif
@if ($step == 2 || $hasCustomer && !empty($products))
@if ($step == 1)
@include('admin/shared/select', ['name' => 'product_id', 'label' => __('global.product'), 'options' => $products, 'value' => old('product_id', $product_id)])
@include('admin/shared/search-field', ['name' => 'customer_id', 'label' => __('global.customer'), 'apiUrl' => route('admin.customers.search'), 'options' => $item->customer ? [$item->customer_id => $item->customer->excerptFullName()] : [], 'value' => $item->customer_id ])
@include('admin/shared/select', ['name' => 'type', 'label' => __('provisioning.admin.services.show.type'), 'options' => $types, 'value' => $item->type])
@else
@include('admin/shared/input', ['name' => 'name', 'label' => __('global.name'), 'value' => old('name', $item->name ?? '')])
@include('admin/shared/flatpickr', ['name' => 'expires_at', 'label' => __('global.expiration'), 'value' => $item->expires_at ? $item->expires_at->format('Y-m-d H:i:s') : null])
@include('admin/shared/select', ['name' => 'server_id', 'label' => __('global.server'), 'options' => $servers, 'value' => old('server_id', $item->server_id ?? 'none')])
@include('/admin/shared/textarea', ['name' => 'description', 'label' => __('global.description'), 'value' => old('description', $item->description), 'help' => __('provisioning.admin.services.show.description_help')])
@include('admin/shared/textarea', ['name' => 'notes', 'label' => __('provisioning.admin.services.show.notes'), 'value' => old('notes', $item->notes), 'help' => __('provisioning.admin.services.show.notes_help')])
@include('admin/shared/input', ['name' => 'max_renewals', 'label' => __('provisioning.admin.services.show.max_renewals'), 'value' => $item->max_renewals, 'type' => 'number', 'help' => __('admin.blanktonolimit')])
@error('currency') {{ $message }} @enderror

{{ __('admin.products.tariff') }}

{{ __($pricing->related_type == 'product' ? $translatePrefix . '.pricing_synchronized' : $translatePrefix . '.pricing_custom') }}

@include('admin/shared/pricing/table', ['fees' => false]) @endif
@else

{{ __(empty($customers) ? 'admin.customers.create.create_customer_help' : 'admin.products.create.create_product_help') }}

{{ __(empty($customers) ? 'admin.customers.create.title' : 'admin.products.create.title') }}
@endif @if ($step == 2) @if (!empty($options_html))

{{ __('store.config.options') }}

{!! $options_html !!}
@endif
@if ($dataHTML != null) {!! $dataHTML !!} @endif
@endif
@include('admin/shared/pricing/collapse') @endsection