@foreach ($orders as $order)
PACKING SLIP
Date: Order#:
{{ date('n/d/Y', strtotime($order->orderdate)) }} {{ $order->orderid }}
@if(!empty($order->order_comments))
Order Comments:
{{ $order->order_comments }}

@endif
Bill To: (Customer ID#{{ $order->customerid }}) Ship To:
{{ $order->billingfirstname }} {{ $order->billinglastname }}
{{ $order->billingaddress1 }}
@if (!empty($order->billingaddress2)) {{ $order->billingaddress2 }} @endif
{{ $order->billingcity }}, {{ $order->billingstate }} {{ $order->billingpostalcode }}
{{ $order->billingcountry }}
{{ $order->billingphonenumber }}
mailto:{{ !empty($order->coustomer->emailaddress) ? $order->coustomer->emailaddress : '' }}
{{ $order->shipfirstname }} {{ $order->shiplastname }}
{{ $order->shipaddress1 }}
@if (!empty($order->shipaddress2)) {{ $order->shipaddress2 }} @endif
{{ $order->shipcity }}, {{ $order->shipstate }} {{ $order->shippostalcode }}
{{ $order->shipcountry }}

Payment Method: Shipping Method:
@if (!empty($order->paymentlog->pay_details)) @if ($order->paymentlog->pay_paymentmethodid == '13') {{ 'Purchase order # ' . $order->paymentlog->pay_details }} @else {{ !empty($order->paymentlog->pay_details) ? $order->paymentlog->pay_details : 'Credit Card' }} @endif @else Paypal @endif {{ $order->shippingmethodname }}

@php $orderdetailcount = $order->orderdetail->count(); $di = 1; @endphp @foreach ($order->orderdetail as $orderdetail) @if ($orderdetail->qtyonpackingslip > 0) @if($orderdetailcount > $di) @endif @endif @if (is_null($orderdetail->qtyonpackingslip)) @if($orderdetailcount > $di) @endif @endif @php $di++; @endphp @endforeach
Code Description Qty Price Total
{{ $orderdetail->productcode }} {{ !empty($orderdetail->pin->Name) ? $orderdetail->pin->Name : $orderdetail->productcode . ' Part' }}  

{{ $orderdetail->qtyonpackingslip }} N/A N/A
{{ $orderdetail->productcode }} {{ !empty($orderdetail->pin->Name) ? $orderdetail->pin->Name : $orderdetail->productcode . ' Part' }}  

{{ $orderdetail->quantity }} N/A N/A

@endforeach