{{-- --}} @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(); $location = $business_locations->first(); @endphp
{{ $location->name }}
{{ $location->mobile }} @if ($location->alternate_number) / {{ $location->alternate_number }} @endif

Issued Date - {{ \Carbon\Carbon::parse($sale->sale_date)->format('Y-m-d') }}
To - {!! $sale->name !!}
Address - {!! $sale->landmark !!},
{!! $sale->cityName != 'Other' ? $sale->cityName : '' !!}
{!! $sale->districtName !!}
City - {!! $sale->cityName !!} Phone No
{!! $sale->mobile !!}
{!! $sale->mobile_2 !!}
District - {!! $sale->districtName !!}
Order No - {!! $sale->invoice_no !!}
@if ($setting->name == 'Online Thoga Kade') COD : {!! number_format($sale->invoice_balance, 2) !!} @if (!empty($sale->currency_type)) {{ $sale->currency_type == 'usd' ? '$' : ' LKR' }} @else LKR @endif @else @if ($sale->payment_status == 'due') COD : {!! number_format($sale->invoice_balance, 2) !!} @if (!empty($sale->currency_type)) {{ $sale->currency_type == 'usd' ? '$' : ' LKR' }} @else LKR @endif @elseif ($sale->payment_status == 'partial') Balance : {!! number_format($sale->invoice_balance, 2) !!} @if (!empty($sale->currency_type)) {{ $sale->currency_type == 'usd' ? '$' : ' LKR' }} @else LKR @endif @else @if ($setting->name == 'Quickly.lk') @else FREE @endif @endif @endif

barcode
{{ $sale->full_waybill_no }}
{{ $location->website }}
{{ $location->landmark }},
{{ $location->city }} - {{ $location->zip_code }}
@endforeach