@extends('layouts.master') @section('content') @if (isset($order[0]['order_number']))
@if($order_shiptment1->isEmpty() && $order_shiptment_details->isEmpty())

No Data Found of order.

@else
@foreach($order as $ordershiptment) @endforeach
SKU Name Shipping Name Shipping Date Delivery ID Order Line Item ID Parent Line ID Group ID Unit (ex VAT) Unit (inc VAT) VAT Rate Quantity Discount Total Sub Total
{{ $ordershiptment['sku'] ?? 'N/A' }} {{ $ordershiptment['Name'] ?? 'N/A' }} {{ $ordershiptment['shipping-name'] ?? 'N/A' }} @php $date = 'N/A'; if (!empty($ordershiptment['shipping-date']) && strtotime($ordershiptment['shipping-date'])) { $date = \Carbon\Carbon::parse($ordershiptment['shipping-date'])->format('d-m-Y'); } @endphp {{ $date }} {{ $ordershiptment['Laravel_Delivery_ID'] ?? 'N/A' }} {{ $ordershiptment['Laravel_order_line_item_ID'] ?? 'N/A' }} {{ $ordershiptment['Laravel_Parent_Order_Line_ID'] ?? 'N/A' }} {{ $ordershiptment['parentline'] ?? 'N/A' }} £{{ number_format($ordershiptment['Unit_ex_VAT'] ?? 0, 2) }} £{{ number_format($ordershiptment['Unit_inc_VAT'] ?? 0, 2) }} {{ $ordershiptment['VATRate'] ?? 'N/A' }} {{ $ordershiptment['Quantity'] ?? 'N/A' }} £{{ number_format($ordershiptment['DiscountTotal'] ?? 0, 2) }} £{{ number_format($ordershiptment['Subtotal'] ?? 0, 2) }}
Summary
@php $shippingCosts = collect($order)->pluck('Delivery_Total')->unique()->toArray(); $sum = array_sum($shippingCosts) ?? 0; @endphp
Item Sub Total:
£{{ number_format($order[0]['Item_Sub_Total'] ?? 0, 2) }}
Item Discount Total:
£{{ number_format($order[0]['Item_Discount_Total'] ?? 0, 2) }}
Item Total:
£{{ number_format($order[0]['ItemTotal'] ?? 0, 2) }}
Item VAT Total:
£{{ number_format($order[0]['Item_VAT_Total'] ?? 0, 2) }}
Delivery Total (inc VAT):
£{{ number_format($sum, 2) }}
@foreach($order_shiptment_details as $key => $deliveries)
🚚 Delivery #{{$key +1}}

Netsuite ID: {{$deliveries['netsuite_id'] ?? 'N/A'}}

@if (!empty($deliveries['netsuite_id'])) 🔗 View Order @endif
{{$deliveries['entry_count']}} item(s) despatched to:

{{ $deliveries['address']->addressee }}
📞 {{$deliveries['address']->addrPhone}}
📍 {{ $deliveries['address']->addr1 }} @if(!empty($deliveries['address']->addr2)), {{ $deliveries['address']->addr2 }} @endif
{{ $deliveries['address']->city }}, {{ $deliveries['address']->zip }}, {{ $deliveries['address']->country->refName }}


@php $giftMessage = $order_shiptment_gift ->where('shipment_id', $deliveries['shipment_id']) ->where('internalid', 3657) ->pluck('gift_message', 'item_id') ->toArray(); @endphp @if($giftMessage)
Gift Message:
@foreach (array_unique($giftMessage) as $itemId => $message) {{-- Looping over key-value pair --}}

{!! nl2br(e($message)) !!}

{{-- Display the message and the key (item_id) --}} @endforeach
@endif
@php $product_codes = []; @endphp @if(isset($deliveries['products']) && !empty($deliveries['products'])) @foreach($deliveries['products'] as $product_detaills) @if(!in_array($product_detaills['product_code'], $product_codes))
{{ $product_detaills['product_name'] }}
Product Code: {{ $product_detaills['product_code'] }}
Quantity: {{ $product_detaills['qty'] }}

@php $product_codes[] = $product_detaills['product_code']; @endphp @endif @endforeach @endif
@endforeach
@if($order_details_magento->last_response !=null && empty($order_details_magento->netsuite_internalId))
Time stamp Log Entry
{{$order_details_magento->created_at->format('d/m/Y')}} {{$order_details_magento->last_response}}
@else

No Error Log Found.

@endif
@endif @else

No Data Found of order

@endif @endsection