@extends('admin.layouts.master') @section('buttons') @can('create', \App\Models\Order::class) {{ trans('app.search_again') }} @endcan @can('index', \App\Models\Order::class) {{ trans('app.cancel') }} @endcan @endsection @section('content') @php $shipping_address = $customer->shippingAddress ? $customer->shippingAddress : $customer->primaryAddress; $billing_address = $customer->billingAddress ? $customer->billingAddress : $shipping_address; $shipping_zone = $shipping_address ? get_shipping_zone_of(Auth::user()->merchantId(), $shipping_address->country_id, $shipping_address->state_id) : null; $shipping_options = isset($shipping_zone->id) ? getShippingRates($shipping_zone->id) : 'NaN'; if (is_incevio_package_loaded('packaging')) { $packaging_options = getPackagings(); $default_packaging = isset($cart->packaging_id) ? $cart->shippingPackage : getDefaultPackaging(); } @endphp
@if (count($cart_lists)) @can('index', \App\Models\Cart::class)
@include('admin.partials._cart_list')
@endcan @endif {!! Form::open(['route' => 'admin.order.order.store', 'files' => true, 'id' => 'form', 'data-toggle' => 'validator']) !!}

{{ trans('app.cart') }}

{{ Form::hidden('customer_id', $customer->id) }} {{ Form::hidden('discount', isset($cart->discount) ? $cart->discount : null, ['id' => 'cart-discount']) }} {{ Form::hidden('taxrate', null, ['id' => 'cart-taxrate']) }} {{ Form::hidden('taxes', null, ['id' => 'cart-taxes']) }} @if (is_incevio_package_loaded('packaging')) {{ Form::hidden('packaging_id', $default_packaging ? $default_packaging->id : null, ['id' => 'packaging_id']) }} {{ Form::hidden('packaging', $default_packaging ? $default_packaging->cost : null, ['id' => 'cart-packaging']) }} @endif {{ Form::hidden('shipping', null, ['id' => 'cart-shipping']) }} {{ Form::hidden('shipping_zone_id', isset($shipping_zone->id) ? $shipping_zone->id : null, ['id' => 'shipping_zone_id']) }} {{ Form::hidden('shipping_rate_id', null, ['id' => 'shipping_rate_id']) }} {{ Form::hidden('shipping_address', $shipping_address ? $shipping_address->id : null) }} {{ Form::hidden('billing_address', $billing_address ? $billing_address->id : null) }} @include('admin.order._add_to_cart') @include('admin.order._cart')
{!! Form::label('admin_note', trans('app.form.admin_note'), ['class' => 'with-help']) !!} {!! Form::textarea('admin_note', isset($cart->admin_note) ? $cart->admin_note : null, ['class' => 'form-control summernote-without-toolbar', 'rows' => '2', 'placeholder' => trans('app.placeholder.admin_note')]) !!}
@if (is_incevio_package_loaded('packaging')) @endif @if ((bool) get_formated_decimal(config('shop_settings.order_handling_cost'))) @endif
{{ trans('app.total') }} {{ get_formated_currency_symbol() }} {{ get_formated_decimal(0, true, 2) }}
{{ trans('app.discount') }} − {{ get_formated_currency_symbol() }} {{ isset($cart->discount) ? get_formated_decimal($cart->discount, true, 2) : get_formated_decimal(0, true, 2) }}
{{ trans('app.shipping') }}
{{ get_formated_currency_symbol() }} {{ get_formated_decimal(0, true, 2) }}
{{ trans('app.packaging') }}
{{ $default_packaging ? $default_packaging->name : '' }}
{{ get_formated_currency_symbol() }} {{ get_formated_decimal($default_packaging ? $default_packaging->cost : 0, true, 2) }}
{{ trans('app.handling') }} {{ get_formated_currency_symbol() }} {{ get_formated_decimal(config('shop_settings.order_handling_cost'), true, 2) }}
{{ trans('app.taxes') }}
{{ isset($shipping_zone->name) ? $shipping_zone->name . ' ' : '' }} %
{{ get_formated_currency_symbol() }} {{ get_formated_decimal(0, true, 2) }}
{{ trans('app.grand_total') }} {{ get_formated_currency_symbol() }} {{ get_formated_decimal(0, true, 2) }}

* {{ trans('app.form.required_fields') }}

@if (isset($cart)) {{ Form::hidden('cart_id', $cart->id, ['id' => 'cart_id']) }} @unless (isset($order_cart)) {!! Form::checkbox('delete_the_cart', 1, null, ['class' => 'icheck', 'checked']) !!} {!! Form::label('delete_the_cart', strtoupper(trans('app.delete_the_cart')), ['class' => 'indent5']) !!} @endunless @endif
@if (Gate::allows('create', \App\Models\Cart::class) || Gate::allows('create', \App\Models\Order::class) || Gate::allows('update', \App\Models\Cart::class)) @endif @if ($shipping_options != 'NaN' && !isset($order_cart) && Gate::allows('create', \App\Models\Order::class)) @endif

{{ trans('app.customer') }}

@if ($customer->image) {{ trans('app.avatar') }} @else {{ trans('app.avatar') }} @endif {{ $customer->getName() }}

{{ trans('app.email') . ': ' . $customer->email }} @can('view', $customer) {{ trans('app.view_detail') }} @endcan

{{ trans('app.addresses') }}

{{ strtoupper(trans('app.shipping_address')) }}
@if (isset($cart->shipping_address)) {{ trans('app.edit') }} {!! $cart->shippingAddress->toHtml('
', false) !!} @else @if ($shipping_address) {{ trans('app.edit') }} {!! $shipping_address->toHtml('
', false) !!} @else {{ trans('app.add_address') }} @endif @endif
{{ strtoupper(trans('app.billing_address')) }}
{!! Form::checkbox('same_as_shipping_address', 1, null, ['id' => 'same_as_shipping_address', 'class' => 'icheck']) !!} {!! Form::label('same_as_shipping_address', strtoupper(trans('app.same_as_shipping_address')), ['class' => 'indent5']) !!}
@if (isset($cart->billing_address)) {{ trans('app.edit') }} {!! $cart->billingAddress->toHtml('
', false) !!} @else @if ($billing_address) {{ trans('app.edit') }} {!! $billing_address->toHtml('
', false) !!} @endif @endif

{{ trans('app.payment') }}

{!! Form::label('payment_method_id', trans('app.form.payment_method') . '*') !!} {!! Form::select('payment_method_id', $payment_methods, isset($cart->payment_method_id) ? $cart->payment_method_id : config('shop_settings.default_payment_method_id'), ['class' => 'form-control select2-normal', 'placeholder' => trans('app.placeholder.payment'), 'required']) !!}
{!! Form::label('payment_status', trans('app.form.payment_status') . '*') !!} {!! Form::select('payment_status', $payment_statuses, isset($cart->payment_status) ? $cart->payment_status : 1, ['class' => 'form-control select2-normal', 'required']) !!}

{{ trans('app.invoice') }}

{!! Form::label('message_to_customer', trans('app.form.message_to_customer'), ['class' => 'with-help']) !!} {!! Form::textarea('message_to_customer', isset($cart->message_to_customer) ? $cart->message_to_customer : null, ['class' => 'form-control summernote-without-toolbar', 'rows' => '2', 'placeholder' => trans('app.placeholder.message_to_customer')]) !!}
{!! Form::checkbox('send_invoice_to_customer', 1, null, ['class' => 'icheck', 'checked']) !!} {!! Form::label('send_invoice_to_customer', strtoupper(trans('app.send_invoice_to_customer')), ['class' => 'indent5']) !!}
{!! Form::close() !!}
@endsection @section('page-script') @endsection