HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/blijegasten/blijegasten.be/resources/views/kms/shop/orders/index.blade.php
@extends('kms.layouts.kms')

@php /** @var \App\Komma\Globalization\RegionInfoInterface $shopRegionInfo */@endphp
@section('content')
    <div id="entity" class="full-width">
        <div class="entity-header">
            <div class="entity-header-attributes">
                <h2>{{ ucfirst(__('shop/orders.orders')) }}</h2>
            </div>
        </div>

        @if ($errors->any())
            <div class="alert alert-danger">
                <h2>@lang('shop/orders.search_error'):</h2>
                <ul>
                    @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
        @endif
        <div class="entity-tabs">
            <ul>
                <li class="active">
                    <a href="#search">@lang('shop/orders.overview')</a>
                </li>
            </ul>
        </div>
        <div class="entity-attributes">
            <div id="tab-content-search" class="tab-content active first">
                <form action="{{ route('orders.search') }}" method="GET" id="entity-form" class="order-search-form">
                    <div class="order-search">
                        <div class="c-form-element">
                            <label for="order_nr">{{ ucfirst(__('shop/orders.order_number')) }}:</label>
                            <input dusk="order_number" type="text" id="order_nr" name="order_number"
                                   value="{{ old('order_number') }}">
                        </div>
                        <div class="c-form-element">
                            <label for="company">{{ ucfirst(__('company.company')) }}:</label> <input dusk="company"
                                                                                                      type="text"
                                                                                                      id="company"
                                                                                                      name="company"
                                                                                                      value="{{ old('company') }}">
                        </div>
                        <div class="c-form-element">
                            <label for="first_name">{{ ucfirst(__('kms/global.first_name')) }}:</label>
                            <input
                                    dusk="first_name"
                                    type="text"
                                    id="first_name"
                                    name="first_name"
                                    value="{{ old('first_name') }}">
                        </div>
                        <div class="c-form-element">

                            <label for="last_name">{{ ucfirst(__('kms/global.last_name')) }}:</label> <input
                                    dusk="last_name"
                                    type="text"
                                    id="last_name"
                                    name="last_name"
                                    value="{{ old('last_name') }}">
                        </div>
                        <div class="c-form-element">
                            <label for="email">{{ ucfirst(__('kms/global.email')) }}:</label> <input dusk="email"
                                                                                                     type="text"
                                                                                                     id="email"
                                                                                                     name="email"
                                                                                                     value="{{ old('email') }}">
                        </div>
                        <div class="c-form-element">
                            <label for="street">{{ ucfirst(__('company.street')) }}:</label> <input dusk="street"
                                                                                                    type="text"
                                                                                                    id="street"
                                                                                                    name="street"
                                                                                                    value="{{ old('street') }}">
                        </div>
                        <div class="c-form-element">
                            <label for="house_number">{{ ucfirst(__('company.house_number')) }}:</label> <input
                                    dusk="house_number" type="text" id="house_number" name="house_number"
                                    value="{{ old('house_number') }}">
                        </div>
                        <div class="c-form-element">
                            <label for="postal_code">{{ ucfirst(__('company.postal_code')) }}:</label> <input
                                    dusk="postal_code"
                                    type="text"
                                    id="postal_code"
                                    name="postal_code"
                                    value="{{ old('postal_code') }}">
                        </div>
                        <div class="c-form-element last">
                            <input type="submit" dusk="search_orders_button"
                                   value="{{ ucfirst(__('shop/orders.filter')) }}">
                        </div>
                    </div>
                    <button class="order-search-filter-button"
                            onclick="this.previousSibling.previousSibling.classList.toggle('active'); return false;">
                        Filters
                    </button>
                    <div class="c-form-element selectboxes">
                        <div class="entity-attribute-select" data-key="status">
                            <label for="status">{{ ucfirst(__('shop/orders.status_name')) }}:</label>
                            <div class="select-wrapper">
                                <select class="select-menu" name="status" id="status"
                                        onchange="this.form.submit()">
                                    <option value="each">@lang('shop/orders.all_statuses')</option>
                                    @foreach(__('shop/orders.status') as $orderStatusKey => $translation)
                                        <option @if(old('status') === $orderStatusKey) selected
                                                @endif value="{{ $orderStatusKey }}">{{ $translation }}</option>
                                    @endforeach
                                </select>
                            </div>
                        </div>
                        <div class="entity-attribute-select" data-key="perPage">
                            <label for="perPage">{{ ucfirst(__('shop/orders.results_per_page')) }}:</label>
                            <div class="select-wrapper">
                                <select class="select-menu" name="perPage" id="perPage" onchange="this.form.submit()">
                                    <option {{ (isset($perPage) && $perPage == 5) ? 'selected' : '' }} value="5">5
                                    </option>
                                    <option {{ (isset($perPage) && $perPage == 10) ? 'selected' : '' }} value="10">10
                                    </option>
                                    <option {{ (isset($perPage) && $perPage == 20) ? 'selected' : '' }} value="20">20
                                    </option>
                                    <option {{ (isset($perPage) && $perPage == 50) ? 'selected' : '' }} value="50">50
                                    </option>
                                    <option {{ (isset($perPage) && $perPage == 100) ? 'selected' : '' }} value="100">
                                        100
                                    </option>
                                </select>
                            </div>
                        </div>
                    </div>
                </form>

            @if(isset($orders)) <!--Only is set when a search was done or latest orders where included.-->
                <h2>{{count($orders)}} {{ $resultsTypeTranslation }}</h2>
                @if(count($orders) > 0)
                    <form action="{{ route('orders.batch_edit') }}" method="POST" dusk="order_table"
                          class="order-result-form">
                        {{ method_field('PATCH') }}
                        {{ csrf_field() }}
                        <table class="order-table" dusk="order_shipments_table">
                            <thead>
                            <tr>
                                <th class="batch-checkbox-header"></th>
                                <th colspan="7">@lang('shop/orders.order_data')</th>
                                <th colspan="12">@lang('shop/orders.invoice_data')</th>
                                <th colspan="8">@lang('shop/orders.shipping_data')</th>
                            </tr>
                            <tr>
                                <th class="batch-checkbox-header"></th>
                                <th>{{ ucfirst(__('shop/orders.order')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.order_number')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.created_at')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.status_name')) }}</th>
                                <th>{{ ucfirst(__('shop/products.discount')) }}</th>
                                <th>{{ ucfirst(__('kms/global.total')) }}</th>
                                <th>{{ ucfirst(__('shop/shipments.short_shipments_count')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.invoice')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.invoice_company')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.invoice_first_name')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.invoice_last_name')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.invoice_email')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.invoice_telephone')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.invoice_street')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.invoice_house_number')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.invoice_postal_code')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.invoice_city')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.shipping_telephone')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.shipping_street')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.shipping_house_number')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.shipping_postal_code')) }}</th>
                                <th>{{ ucfirst(__('shop/orders.shipping_city')) }}</th>

                            </tr>
                            </thead>
                            <tbody>
                            @foreach($orders as $count => $order)
                                @php /** @var \App\Komma\Shop\Orders\Models\Order $order */@endphp
                                <tr class="order-row">
                                    <td class="batch-checkboxes">
                                        <input type="checkbox" class="batch-checkbox js-batch-checkbox" name="order_ids[]" value="{{ $order->id }}"
                                               dusk="order_checkbox_{{ $order->id }}"
                                               @if(old('order_ids['.$count.']')) checked @endif>
                                    </td>
                                    <td><a href="{{ route('orders.show', ['order' => $order]) }}"
                                           dusk="order_{{ $order->id }}">{{__('shop/orders.preview')}}</a></td>
                                    <td>{{ $order->order_number }}</td>
                                    <td>{{ $order->created_at }}</td>
                                    <td>{{ __('shop/orders.status.'.$order->status) }}</td>
                                    <td>{{ $order->discount }}</td>
                                    <td>{{ $shopRegionInfo->getCurrencySymbol().$shopRegionInfo->getNumberFormat()->centsToCurrency($order->total) }}</td>
                                    <td>
                                        @if($order->shipments->count() > 0)
                                            @foreach($order->shipments as $shipment)
                                                <a href="{{ route('shipments.show', ['$shipment' => $shipment]) }}">{{$shipment->id}}</a>
                                            @endforeach
                                        @else
                                            @lang('kms/global.none')
                                        @endif
                                    </td>
                                    <td><a target="_blank"
                                           href="/preview/logistics/pdf/invoice/{{ $order->id }}">{{__('shop/orders.preview')}}</a>
                                    </td>
                                    </td>
                                    <td>{{ $order->invoice_company }}</td>
                                    <td>{{ $order->first_name }}</td>
                                    <td>{{ $order->last_name }}</td>
                                    <td>{{ $order->email }}</td>
                                    <td>{{ $order->invoice_telephone }}</td>
                                    <td>{{ $order->invoice_street }}</td>
                                    <td>{{ $order->invoice_house_number }}</td>
                                    <td>{{ $order->invoice_postal_code }}</td>
                                    <td>{{ $order->invoice_city }}</td>
                                    <td>{{ $order->shipping_telephone }}</td>
                                    <td>{{ $order->shipping_street }}</td>
                                    <td>{{ $order->shipping_house_number }}</td>
                                    <td>{{ $order->shipping_postal_code }}</td>
                                    <td>{{ $order->shipping_city }}</td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                        <div class="batch_edit_controls" dusk="batch_edit_controls">
                            <select class="select-menu" name="change_status_to" id="change_status_to"
                                    dusk="change_status_to">
                                @foreach(\App\Komma\Shop\Orders\OrderStatus::getAsArray() as $order_status)
                                    <option value="{{ $order_status }}">@lang('shop/orders.status.'.$order_status)</option>
                                @endforeach
                            </select>
                            <button type="submit" name="change_status" value="change_status"
                                    dusk="change_status">@lang('shop/orders.batch.status')</button>
                            @if(isset($status))
                                @if(($status === \App\Komma\Shop\Orders\OrderStatus::AWAITING_FULFILLMENT || $status === \App\Komma\Shop\Orders\OrderStatus::PARTIALLY_SHIPPED || $status === \App\Komma\Shop\Orders\OrderStatus::AWAITING_SHIPMENT))
                                    <button type="submit" name="create_shipments" value="create_shipments"
                                            dusk="create_shipments">@lang('shop/orders.create_shipments')</button>
                                @endif

                                @if(($status === \App\Komma\Shop\Orders\OrderStatus::AWAITING_SHIPMENT))
                                    <button type="submit" name="group_shipments" value="group_shipments"
                                            dusk="group_shipments">@lang('shop/orders.batch.group')</button>
                                @endif
                            @endif
                        </div>
                    </form>
                    @include('site.components.pagination.list', ['paginator' => $orders])
                @endif
                @else
                    <p>@lang('shop/orders.no_results')</p>
                @endif
            </div>
        </div>
@stop