@extends('admin/layouts/admin') @section('title', __($translatePrefix . '.show.title', ['name' => $item->name])) @section('scripts') @endsection @section('styles') @endsection @section('content')
@include('admin/shared/alerts')
@csrf @method('PUT')

{{ __($translatePrefix . '.show.title', ['name' => $item->name]) }}

{{ __($translatePrefix. '.show.subheading', ['date' => $item->created_at->format('d/m/y')]) }}

@include('admin/shared/input', ['name' => 'code', 'label' => __($translatePrefix . '.code'), 'value' => old('code', $item->code)])
@include('admin/shared/select', ['name' => 'type', 'label' => __('global.type'), 'value' => old('type', $item->type), 'options' => $types])
@include('admin/shared/flatpickr', ['name' => 'start_at', 'label' => __($translatePrefix . '.start_at'), 'value' => old('start_at', $item->start_at ? $item->start_at->format('Y-m-d H:i:s') : null)])
@include('admin/shared/flatpickr', ['name' => 'end_at', 'label' => __($translatePrefix . '.end_at'), 'value' => old('end_at', $item->end_at != null ? $item->end_at->format('Y-m-d H:i:s') : null)])
@include('admin/shared/input', ['name' => 'applied_month', 'label' => __($translatePrefix . '.applied_month'), 'value' => old('applied_month', $item->applied_month), 'help' => __($translatePrefix . '.applied_month_help'), 'type' => 'number'])
@include('admin/shared/input', ['name' => 'max_uses', 'label' => __($translatePrefix . '.max_uses'), 'value' => old('max_uses', $item->max_uses), 'type' => 'number', 'help' => __($translatePrefix . '.uses_help')])
@include('admin/shared/input', ['name' => 'max_uses_per_customer', 'label' => __($translatePrefix . '.max_uses_per_customer'), 'value' => old('max_uses_per_customer', $item->max_uses_per_customer), 'type' => 'number', 'help' => __($translatePrefix . '.uses_help')])
@include('admin/shared/input', ['name' => 'usages', 'label' => __($translatePrefix . '.usages'), 'value' => old('usages', $item->usages), 'type' => 'number'])
@include('admin/shared/input', ['name' => 'minimum_order_amount', 'label' => __($translatePrefix . '.minimum_order_amount'), 'value' => old('minimum_order_amount', $item->minimum_order_amount), 'type' => 'number'])
@include('admin/shared/search-select-multiple', ['name' => 'products[]', 'label' => __($translatePrefix . '.products'), 'value' => $selectedProducts, 'options' => $products])
@include('admin/shared/search-select-multiple', ['name' => 'groups[]', 'label' => __($translatePrefix . '.groups'), 'value' => [], 'options' => $groups])
@include('admin/shared/search-select-multiple', ['name' => 'required_products[]', 'label' => __($translatePrefix . '.required_products'), 'value' => $requiredProductSelected, 'options' => $requiredProducts])
@include('admin/shared/search-field', ['name' => 'customer_id', 'label' => __($translatePrefix . '.allowed_customer'), 'apiUrl' => route('admin.customers.search'), 'options' => $item->customer ? [$item->customer_id => $item->customer->excerptFullName()] : [], 'value' => $item->customer_id])
@include('admin/shared/checkbox', ['name' => 'is_global', 'label' => __($translatePrefix . '.is_global'), 'checked' => old('is_global', $item->is_global)]) @include('admin/shared/checkbox', ['name' => 'free_setup', 'label' => __($translatePrefix . '.free_setup'), 'checked' => old('free_setup', $item->free_setup)]) @include('admin/shared/checkbox', ['name' => 'first_order_only', 'label' => __($translatePrefix . '.first_order_only'), 'checked' => old('first_order_only', $item->first_order_only)])
{{ __('admin.products.showmorepricing') }}
@foreach ($recurrings as $recurring) @endforeach @foreach ($recurrings as $k => $recurring) @endforeach @foreach ($recurrings as $k => $recurring) @endforeach
{{ $recurring['translate'] }}
{{ __($translatePrefix . '.pricelabel') }} @include('admin/shared/input', ['name' => 'pricing['. $k .'][price]','type' => 'number', 'step' => '0.01', 'min' => 0, 'value' => old('recurrings_' . $k . '_price', $pricing->{$k}), 'attributes' => ['data-months' => $recurring['months']]])
{{ __('store.fees') }} @include('admin/shared/input', ['name' => 'pricing['. $k .'][setup]', 'type' => 'number','step' => '0.01', 'min' => 0, 'value' => old('recurrings_' . $k . '_setup', $pricing->{'setup_'.$k}), 'attributes' => ['data-months' => $recurring['months']]])
@if ($errors->has('pricing'))

{{ $errors->first('pricing') }}

@endif

{{ __($translatePrefix . '.usage') }}

@if (count($usages) == 0) @endif @foreach($usages as $usage) @endforeach
#
{{ __('global.customer') }}
{{ __($translatePrefix . '.used_at') }}
{{ __('global.amount') }}
{{ __('global.actions') }}

{{ __('global.no_results') }}

{{ $usage->id }} @if ($usage->customer) {{ $usage->customer->excerptFullName() }} @else {{ __('global.deleted') }} @endif {{ $usage->used_at->format('d/m/y H:i') }} {{ formatted_price($usage->amount) }} @method('DELETE') @csrf
{{ $usages->links('admin.shared.layouts.pagination') }}
@include('admin/metadata/overlay', ['item' => $item]) @endsection