@foreach ($courier_orders as $data) @php $setting = \App\Setting::first(); $city = \App\City::where('id', $setting->city)->first(); $sale_id = $data['sale_id']; $sale = \Illuminate\Support\Facades\DB::table('sales') ->where('sales.id', $sale_id) ->join('contacts', 'sales.contact_id', '=', 'contacts.id') ->leftjoin('districts', 'contacts.district_id', '=', 'districts.id') ->leftjoin('cities', 'contacts.city', '=', 'cities.id') ->select('sales.*', 'contacts.*', 'districts.name_en as districtName', 'cities.name_en as cityName') ->first(); $item_names = \Illuminate\Support\Facades\DB::table('sale_items') ->join('products', 'sale_items.product_id', '=', 'products.id') ->where('sale_id', $sale_id) ->where('sale_items.deleted_at', null) ->get(); $courier = \App\Courier::find($sale->courier); $store = \App\Dropshipping::find($sale->store_id); @endphp
Customer Invoice
barcode

{{ $sale->full_waybill_no }}

@if (!empty($store->store_name)) @endif

Supplier:

{!! $setting->name !!}

Order #: {{ $sale->invoice_no }}

{{ $courier->name }}

Customer:

Name: {!! $sale->name !!}

Address: {!! $sale->landmark !!} / {!! $sale->cityName !!}

Phone: {!! $sale->mobile !!} @if (!empty($sale->mobile_2)) / {!! $sale->mobile_2 !!} @endif

Online Store:

Name: {{ $store->store_name }}

Address: {{ $store->store_address }}

Phone: {{ $store->store_contact }}

Order Details:

@foreach ($item_names as $item) @php $stock_product = \Illuminate\Support\Facades\DB::table('stocks') ->where('product_id', $item->product_id) ->first(); @endphp @endforeach
Description Qty
{{ $item->product_name }} {{ $item->qty }}
Sub Total {!! number_format($sale->invoice_nettotal - $sale->fake_delivery, 2) !!} @if (!empty($sale->fake_delivery) && $sale->fake_delivery > 0) + {!! number_format($sale->fake_delivery, 2) !!} @endif
Balance {!! number_format($sale->invoice_nettotal, 2) !!}

COD : {!! number_format($sale->invoice_nettotal, 2) !!}

@if (!$loop->last)
@endif @endforeach