@extends('admin.template.master') @section('stylesheets') {!! Html::style('assets/admin/bower_components/select2/dist/css/select2.min.css') !!} @endsection @section('title')

Order delivery Setup - @if($store_loc) {{$store_loc == "bsl" ? 'Barisal Branch' : ''}} @endif

@endsection @section('main-content')

Order # {{ $order->order_id }}

{{ Form::label('Order Date') }} {{ \Carbon\Carbon::parse($order->created_at)->format('M d, Y h:i a') }}

{{ Form::label('Total Amount') }} {{ number_format($order->grand_total, 2, '.', ',') }}

{{ Form::label('Payment Method') }} {{ $order->transaction ? $order->transaction->paymentMethod->payment_method_name : 'Not Available' }}

{{ $orderDelivery->customer_confirmation }} {{ $orderDelivery->transaction_no ? ' (' . $orderDelivery->transaction_no . ')' : '' }}

@if($fsp_user)

{{ Form::label('FSP') }} {{ $fsp_user->name }}

@endif

Billing Information

@if($order->billing) @if($order->billing->billing_name)

{{ Form::label('Billing Name') }} {{ $order->billing->billing_name }}

@endif @if($order->billing->billing_address)

{{ Form::label('Billing Address') }} {{ $order->billing->billing_address }}

@endif @else

Not available

@endif

Shipping Information

@if($order->shipping) @if($order->shipping->shipping_method_id)

{{ Form::label('Shipping Method') }} {{ $order->shipping->shippingMethod? $order->shipping->shippingMethod->shipping_method_name : 'Not Available' }}

@endif @if($order->shipping->shipping_method_id == 2)

{{ Form::label('City') }} {{ $order->shipping->shippingAreaOne ? $order->shipping->shippingAreaOne->shipping_area_one_name:'' }}

{{ Form::label('Address') }} @if($order->shipping->holdings) {{ $order->shipping->holdings }} @else Not available @endif

{{ Form::label('Delivery Type') }} {!! isset($order->shipping_type_name) ? $order->shipping_type_name : $delivery_type_name !!}

@else

{{ Form::label('Shipping Zone') }} @if($customAddress) Custom Location
{!! $customAddress !!} @else {!! $order->shipping->shippingZone ? $order->shipping->shippingZone->name . '
' . $order->shipping->shippingZone->address : 'Not Available' !!} @endif

{{ Form::label('Delivery Type') }} {!! isset($order->shipping->shipping_type_name) ? $order->shipping->shipping_type_name : $delivery_type_name !!}

@endif @if($order->shipping->contact_no)

{{ Form::label('Contact') }} {{ $order->shipping->contact_no }}

@endif @else

Not available

@endif

Account Information

{{ Form::label('Customer Name') }} {{ $order->customerDetail ? $order->customerDetail->customer_name : 'Not available' }}

{{ Form::label('Email') }} {{ $order->customer ? $order->customer->email : 'Not available' }}

{{ Form::label('Address') }} {{ $order->customerDetail ? $order->customerDetail->customer_address : 'Not available' }}

{{ Form::label('Contact') }} {{ $order->customer ? $order->customer->code.$order->customer->phone : 'Not available' }}

{{ Form::label('Customer Group') }} {{ $order->customer ? $order->customer->group->group_name : 'Not available' }}

Items Ordered

@if(count($ordered_products) >0) @php($subtotal = 0) @foreach($ordered_products as $ordered_product) @php($subtotal+=$ordered_product->total_price) @endforeach @else @endif
Product name Product ID Qty Unit_Price Subtotal
{{ $ordered_product->product_name }} {{ $ordered_product->product_code_inv }} {{$ordered_product->quantity}} {{ number_format($ordered_product->unit_price, 2, '.', ',') }} {{ number_format($ordered_product->total_price, 2, '.', ',') }}
No product
@if(count($ordered_products) >0)

Order Totals

@if($order->special_discount) @endif @if($customerDiscount) @endif
{!! Form::label('Subtotal') !!} {{number_format($subtotal+$order->special_discount, 2, '.', ',')}}
{!! Form::label('Shipping & Handling') !!} {{number_format($order->shipping->shipping_cost, 2, '.', ',')}}
{!! Form::label($specialDiscountLabel) !!} {{number_format($order->special_discount, 2, '.', ',')}}
{!! Form::label('Grand Total') !!} {{number_format($subtotal + $order->shipping->shipping_cost, 2, '.', ',')}}
{!! Form::label('Customer Discount') !!} {{number_format($customerDiscount->discount_price, 2, '.', ',')}}
{!! Form::label('New Grand Total') !!} {{number_format($customerDiscount->new_grand_total, 2, '.', ',')}}
@endif
@csrf
@if(Session::has('Sourcing_error'))
{{Session('Sourcing_error')}}
@endif @if(Session::has('message'))
{{Session('message')}}
@endif @if($orderCanceledByCustomer)
This order has been canceled by customer
@endif @if(!$orderCanceledByCustomer)
@if($store_loc) @php($showAllFields = false) @php($deliveryClosed = $orderDelivery->delivery_closed == 1 ? true : false) @php($dealClose = $orderDelivery->deal_status == 0 ? true : false) @if($orderDelivery->delivery_closed == 1 OR $orderDelivery->deal_status == 0) @php($closed = true) @else @php($closed = false) @endif {!! Form::open(['method' => 'PUT', 'url' => '/admin/order-deliveries/' . $orderDelivery->id]) !!} {!! Form::hidden('order_id', $order->order_id) !!}
{{--1. Customer Area--}} @if($store_loc == "bsl")
@php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->customer_area !== null) || !in_array('customer_area', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif {!! Form::label('1. Customer Area') !!} {!! Form::select('customer_area', $customerArea, isset($orderDelivery->customer_area) ? $orderDelivery->customer_area : 240, ['class' => 'form-control', 'placeholder' => 'Select customer area', 'id' => 'customer_area', $disabled]) !!} @if ($errors->has('customer_area')) {!! $errors->first('customer_area') !!}@endif
{{--2. Customer Zone--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->customer_zone !== null) || !in_array('customer_zone', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('2. Customer Zone') !!} {!! Form::select('customer_zone', $zones, isset($orderDelivery->customer_zone) ? $orderDelivery->customer_zone : 1, ['class' => 'form-control', 'placeholder' => 'Select customer zone', 'id' => 'customer_zone', $disabled]) !!} @if ($errors->has('customer_zone')) {!! $errors->first('customer_zone') !!}@endif
{{--3. Available--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->available !== null) || !in_array('available', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('3. Available') !!} {!! Form::select('available', $availableOptions, isset($orderDelivery->available) ? $orderDelivery->available : "Available", ['class' => 'form-control', 'placeholder' => 'Select available', 'id' => 'available', $disabled]) !!} @if ($errors->has('available')) {!! $errors->first('available') !!}@endif
{{--4. Available Locations--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->available_locations !== null) || !in_array('available_locations', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('4. Available Locations') !!} {!! Form::select('available_locations', $availableLocations, isset($orderDelivery->available_locations) ? $orderDelivery->available_locations : "17,BSL", ['class' => 'form-control', 'placeholder' => 'Select available location', 'id' => 'available_locations', $disabled]) !!} @if ($errors->has('available_locations')) {!! $errors->first('available_locations') !!}@endif
{{--5. Customer Confirmation--}} @php($disabled = '') @if( $closed || ($fsp_user && \Illuminate\Support\Facades\Auth::id() != $fsp_user->id) || (!$allowed_change_given_delivery_data && $orderDelivery->pre_confirmation !== null && (($fsp_user && \Illuminate\Support\Facades\Auth::id() != $fsp_user->id) || (!$fsp_user))) || !in_array('pre_confirmation', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('5. Order Confirmation') !!} {!! Form::select('pre_confirmation', $customerConfirmation, isset($orderDelivery->pre_confirmation) ? $orderDelivery->pre_confirmation : 1, ['class' => 'form-control', 'placeholder' => 'Select Order Confirmation', 'id' => 'pre_confirmation', $disabled]) !!} @if ($errors->has('pre_confirmation')) {!! $errors->first('pre_confirmation') !!}@endif
{{--6. Payment Confirmation--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->customer_confirmation !== null) || !in_array('customer_confirmation', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('6. Payment Confirmation') !!} {!! Form::select('customer_confirmation', $confirmationOptions, isset($orderDelivery->customer_confirmation) ? $orderDelivery->customer_confirmation : "COD", ['class' => 'form-control', 'placeholder' => 'Select Payment Confirmation', 'id' => 'customer_confirmation', $disabled]) !!} @if ($errors->has('customer_confirmation')) {!! $errors->first('customer_confirmation') !!}@endif
{!! Form::label('Transaction No') !!} {!! Form::text('transaction_no', $orderDelivery->transaction_no, ['class' => 'form-control', 'placeholder' => 'Enter transaction no', $disabled]) !!} @if ($errors->has('transaction_no')) {!! $errors->first('transaction_no') !!}@endif
{{--7. Interchange No--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->inter_change_no !== null) || !in_array('inter_change_no', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('7. Interchange No') !!} {!! Form::text('inter_change_no', isset($orderDelivery->inter_change_no) ? $orderDelivery->inter_change_no : "OK", ['class' => 'form-control', 'placeholder' => 'Enter inter change no', $disabled]) !!} @if ($errors->has('inter_change_no')) {!! $errors->first('inter_change_no') !!}@endif
{{--8. Interchange Location--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->inter_change_locations !== null) || !in_array('inter_change_locations', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('8. Interchange Locations') !!} {!! Form::select('inter_change_locations', $availableLocations, isset($orderDelivery->inter_change_locations) ? $orderDelivery->inter_change_locations : "17,BSL", ['class' => 'form-control', 'placeholder' => 'Select interchange location', 'id' => 'inter_change_locations', $disabled]) !!} @if ($errors->has('inter_change_locations')) {!! $errors->first('inter_change_locations') !!}@endif
{{--9. Serial No--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->serial_no !== null) || !in_array('serial_no', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('9. Serial No') !!} {!! Form::text('serial_no', isset($orderDelivery->serial_no) ? $orderDelivery->serial_no : "OK", ['class' => 'form-control', 'placeholder' => 'Enter serial no', $disabled]) !!} @if ($errors->has('serial_no')) {!! $errors->first('serial_no') !!}@endif
{{--10. INV Bill No--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->inv_bill_no !== null) || !in_array('inv_bill_no', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('10. INV Bill No') !!} {!! Form::text('inv_bill_no', $orderDelivery->inv_bill_no, ['class' => 'form-control', 'placeholder' => 'Enter INV bill no', $disabled]) !!} @if ($errors->has('inv_bill_no')) {!! $errors->first('inv_bill_no') !!}@endif
{{--11. Interchange Received--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->inter_received !== null) || !in_array('inter_received', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('11. Interchange Received') !!} {!! Form::select('inter_received', $interchangeReceived, isset($orderDelivery->inter_received) ? $orderDelivery->inter_received : 1, ['class' => 'form-control', 'placeholder' => 'Select interchange received', 'id' => 'inter_received', $disabled]) !!} @if ($errors->has('inter_received')) {!! $errors->first('inter_received') !!}@endif
{{--12. QC Pass--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->qc_passed !== null) || !in_array('qc_passed', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('12. QC Pass') !!} {!! Form::select('qc_passed', $qcPassed, isset($orderDelivery->qc_passed) ? $orderDelivery->qc_passed : "Passed", ['class' => 'form-control', 'placeholder' => 'Select qc pass', 'id' => 'qc_passed', $disabled]) !!} @if ($errors->has('qc_passed')) {!! $errors->first('qc_passed') !!}@endif
{{--13. Packed By--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->packed_by !== null) || !in_array('packed_by', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('13. Packed By') !!} {!! Form::select('packed_by', ['BSL' => 'BSL'], 'BSL', ['class' => 'form-control', 'placeholder' => 'Select packed by', 'id' => 'packed_by', $disabled]) !!} @if ($errors->has('packed_by')) {!! $errors->first('packed_by') !!}@endif
{{--14. Shipping Date--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->delivery_date !== null) || !in_array('delivery_date', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('14. Shipping Date (Scheduled Delivery Date)') !!} {!! Form::date('delivery_date', isset($orderDelivery->delivery_date) ? new DateTime($orderDelivery->delivery_date) : \Carbon\Carbon::now(), ['class' => 'form-control', $disabled]) !!} @if ($errors->has('delivery_date')) {!! $errors->first('delivery_date') !!}@endif
{{--15. Vehicle--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->vehicle !== null) || !in_array('vehicle', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('15. Vehicle') !!} {!! Form::select('vehicle', $vehicles, isset($orderDelivery->vehicle) ? $orderDelivery->vehicle : 12, ['class' => 'form-control', 'placeholder' => 'Select vehicle', 'id' => 'vehicle', $disabled]) !!} @if ($errors->has('vehicle')) {!! $errors->first('vehicle') !!}@endif
{!! Form::label('') !!} Print
{{--16. Delivery Complete--}} @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->delivery_complete !== null) || !in_array('delivery_complete', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('16. Delivery Complete') !!} {!! Form::select('delivery_complete', $interchangeReceived, isset($orderDelivery->delivery_complete) ? $orderDelivery->delivery_complete : 1, ['class' => 'form-control', 'placeholder' => 'Select delivery complate', 'id' => 'delivery_complete', $disabled]) !!} @if ($errors->has('delivery_complete')) {!! $errors->first('delivery_complete') !!}@endif
{{--17. Un Delivery--}} @if($orderDelivery->delivery_complete == '0' && $showAllFields) @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->undelivery !== null) || !in_array('undelivery', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('17. Un Delivery') !!} {!! Form::select('undelivery', $unDeliveryOptions, isset($orderDelivery->undelivery) ? $orderDelivery->undelivery : null, ['class' => 'form-control', 'placeholder' => 'Select un delivery', 'id' => 'undelivery', $disabled]) !!} @if ($errors->has('undelivery')) {!! $errors->first('undelivery') !!}@endif
@endif {{--18. Redelivery Schedule--}} @if($orderDelivery->undelivery == 'No Response' && $showAllFields) @php($disabled = '') @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->re_delivery_schedule !== null) || !in_array('re_delivery_schedule', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('18. Redelivery Schedule') !!} {!! Form::date('re_delivery_schedule', isset($orderDelivery->re_delivery_schedule) ? new DateTime($orderDelivery->re_delivery_schedule) : null, ['class' => 'form-control', $disabled]) !!} @if ($errors->has('re_delivery_schedule')) {!! $errors->first('re_delivery_schedule') !!}@endif
{!! Form::label('') !!} Print
@endif {{--19. Re Delivery Complete--}} @if(isset($orderDelivery->re_delivery_schedule) && $showAllFields) @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->re_delivery_complete !== null) || !in_array('re_delivery_complete', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('19. Re Delivery Complete') !!} {!! Form::select('re_delivery_complete', $interchangeReceived, isset($orderDelivery->re_delivery_complete) ? $orderDelivery->re_delivery_complete : null, ['class' => 'form-control', 'placeholder' => 'Select delivery complate', 'id' => 're_delivery_complete', $disabled]) !!} @if ($errors->has('re_delivery_complete')) {!! $errors->first('re_delivery_complete') !!}@endif
@endif {{--20. Bill Void--}} @if(($orderDelivery->undelivery == 'Cancel' OR $orderDelivery->re_delivery_complete == '0') && $showAllFields) @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->bill_void !== null) || !in_array('bill_void', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('20. Bill Void') !!} {!! Form::select('bill_void', $interchangeReceived, isset($orderDelivery->bill_void) ? $orderDelivery->bill_void : null, ['class' => 'form-control', 'placeholder' => 'Select bill void', 'id' => 'bill_void', $disabled]) !!} @if ($errors->has('bill_void')) {!! $errors->first('bill_void') !!}@endif
@endif @endif
{{--21. Note--}} @if( $closed || (!$allowed_change_given_delivery_data && $orderDelivery->delivery_complete_note !== '' && $orderDelivery->delivery_complete_note !== null) || !in_array('delivery_complete_note', $selectedFields) ) @php($disabled = 'disabled') @else @php($disabled = '') @endif
{!! Form::label('21. Note') !!} {!! Form::text('delivery_complete_note', $orderDelivery->delivery_complete_note, ['class' => 'form-control', 'placeholder' => 'Enter delivery complete note', $disabled]) !!} @if ($errors->has('delivery_complete_note')) {!! $errors->first('delivery_complete_note') !!}@endif
{!! Form::hidden('deal_status', $orderDelivery->deal_status, ['id' => 'deal_status']) !!}
{!! Form::close() !!} @endif
@else
{!! Form::button('Close',['class' => 'btn btn-danger', 'onclick' => 'window.close();']) !!}
@endif

Past Orders

Order # Purchased On FSP Bill to Name Account Name Ship to Contact Grand Total Status Action
@endsection @section('javascripts') {!! Html::script('assets/admin/bower_components/select2/dist/js/select2.full.min.js') !!} @endsection