@component('laravel-crm::components.card') @component('laravel-crm::components.card-header') @slot('title') {{ $order->title }} @endslot @slot('actions') @php (! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\subTotal($order)) ? $subTotalError = true : $subTotalError = false; (! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\tax($order)) ? $taxError = true : $taxError = false; (! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\total($order)) ? $totalError = true : $totalError = false; @endphp @include('laravel-crm::partials.return-button',[ 'model' => $order, 'route' => 'orders' ]) | @can('edit crm orders') @if($subTotalError || $taxError || $totalError) Error with order, check amounts @else @if(! $order->deliveryComplete()) @haspurchaseordersenabled {{ ucwords(__('laravel-crm::lang.purchase_order')) }} @endhaspurchaseordersenabled @endif @if(! $order->invoiceComplete()) @hasinvoicesenabled {{ ucwords(__('laravel-crm::lang.generate_invoice')) }} @endhasinvoicesenabled @endif @if(! $order->deliveryComplete()) @hasdeliveriesenabled {{ ucwords(__('laravel-crm::lang.create_delivery')) }} @endhasdeliveriesenabled @endif @endif @endcan @can('view crm orders') @if(! $subTotalError && ! $taxError && ! $totalError) {{ ucfirst(__('laravel-crm::lang.download')) }} @endif @endcan @include('laravel-crm::partials.navs.activities') | @can('edit crm orders') @endcan @can('delete crm orders')
{{ method_field('DELETE') }} {{ csrf_field() }}
@endcan
@endslot @endcomponent @component('laravel-crm::components.card-body')
{{ ucfirst(__('laravel-crm::lang.details')) }}

{{ ucfirst(__('laravel-crm::lang.number')) }}
{{ $order->order_id }}
Reference
{{ $order->reference }}
@hasquotesenabled @if($order->quote)
{{ ucfirst(__('laravel-crm::lang.quote')) }}
{{ $order->quote->quote_id }}
@endif @endhasquotesenabled
Description
{{ $order->description }}
@foreach($addresses as $address)
{{ ($address->addressType) ? ucfirst($address->addressType->name).' ' : null }}{{ ucfirst(__('laravel-crm::lang.address')) }}
{{ \VentureDrake\LaravelCrm\Http\Helpers\AddressLine\addressSingleLine($address) }} {{ ($address->primary) ? '(Primary)' : null }}
@endforeach
Labels
@include('laravel-crm::partials.labels',[ 'labels' => $order->labels ])
Owner
@if($order->ownerUser){{ $order->ownerUser->name ?? null }} @else {{ ucfirst(__('laravel-crm::lang.unallocated')) }} @endif
{{ ucfirst(__('laravel-crm::lang.client')) }}

@if($order->client){{ $order->client->name }}@endif

{{ ucfirst(__('laravel-crm::lang.organization')) }}

@if($order->organization){{ $order->organization->name }}@endif

{{ ($organization_address) ? \VentureDrake\LaravelCrm\Http\Helpers\AddressLine\addressSingleLine($organization_address) : null }}

{{ ucfirst(__('laravel-crm::lang.contact_person')) }}

@if($order->person){{ $order->person->name }}@endif

@isset($email)

{{ $email->address }} ({{ ucfirst($email->type) }})

@endisset @isset($phone)

{{ $phone->number }} ({{ ucfirst($phone->type) }})

@endisset @can('view crm products')
{{ ucfirst(__('laravel-crm::lang.order_items')) }} ({{ $order->orderProducts->count() }})
@foreach($order->orderProducts()->whereNotNull('product_id')->orderBy('order', 'asc')->orderBy('created_at', 'asc')->get() as $orderProduct) @if($orderProduct->comments) @endif @endforeach
{{ ucfirst(__('laravel-crm::lang.item')) }} {{ ucfirst(__('laravel-crm::lang.price')) }} {{ ucfirst(__('laravel-crm::lang.quantity')) }} {{ $taxName }} {{ ucfirst(__('laravel-crm::lang.amount')) }}
{{ $orderProduct->product->name }} @if($orderProduct->product->code)
{{ $orderProduct->product->code }} @endif
{{ money($orderProduct->price ?? null, $orderProduct->currency) }} {{ $orderProduct->quantity }} {{ money($orderProduct->tax_amount ?? null, $orderProduct->currency) }} @if(! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\lineAmount($orderProduct)) {{ money($orderProduct->amount ?? null, $orderProduct->currency) }} @else {{ money($orderProduct->amount ?? null, $orderProduct->currency) }} @endif
{{ ucfirst(__('laravel-crm::lang.comments')) }}
{{ $orderProduct->comments }}
{{ ucfirst(__('laravel-crm::lang.sub_total')) }} @if(! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\subTotal($order)) {{ money($order->subtotal, $order->currency) }} @else {{ money($order->subtotal, $order->currency) }} @endif
{{ ucfirst(__('laravel-crm::lang.discount')) }} {{ money($order->discount, $order->currency) }}
{{ ucfirst(__('laravel-crm::lang.tax')) }} @if(! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\tax($order)) {{ money($order->tax, $order->currency) }} @else {{ money($order->tax, $order->currency) }} @endif
{{ ucfirst(__('laravel-crm::lang.adjustment')) }} {{ money($order->adjustments, $order->currency) }}
{{ ucfirst(__('laravel-crm::lang.total')) }} @if(! \VentureDrake\LaravelCrm\Http\Helpers\CheckAmount\total($order)) {{ money($order->total, $order->currency) }} @else {{ money($order->total, $order->currency) }} @endif
@endcan
@include('laravel-crm::partials.activities', [ 'model' => $order ])
@endcomponent @endcomponent