@foreach ($courier_orders as $data) @php $setting = App\Setting::first(); $couriors = App\Courier::where('active_status', 'active')->get(); $sale_id = $data['sale_id']; $sale = \Illuminate\Support\Facades\DB::table('sales') ->where('sales.id', $sale_id) ->leftjoin('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(); @endphp
@if ($sale->payment_status == 'due')
BAMBARAWATHTHA
HERBALS (PVT) LTD
NO 206/A/1/1 LAKE ROAD,
BORALESGAMUWA
{{ $setting->mobile }}
CASH ON DELIVERY
barcode
{{ $sale->waybill_prefix . $sale->waybill_no . $sale->waybill_postfix }}
COD AMOUNT: {!! number_format($sale->invoice_nettotal, 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 FREE @endif
INVOICE NUMBER
@if (!empty($sale->invoice_no)) {!! $sale->invoice_no !!} @elseif(!empty($sale->ref_no)) {!! $sale->ref_no !!} @else N/A @endif
ORDER DETAILS QTY
@foreach ($item_names as $item) {{ $item->product_name }}
@endforeach
@foreach ($item_names as $item) {{ $item->qty }}
@endforeach
ISSUED DATE
{{ Carbon\Carbon::parse($sale->sale_date)->format('Y-m-d') }}
COURIER SERVICE
@foreach ($couriors as $courior) @if ($sale->courier == $courior->id) {{ $courior->name }} @endif @endforeach
{{--
Dear Courier Partner, Please Contact Us On
{{ $setting->mobile }}
For Any Issues.
--}}
Customer Details
{{--
Sale Note @if (!empty($sale->sale_note)) {!! $sale->sale_note !!} @endif
--}}
NAME
{!! $sale->name !!}

ADDRESS
{!! $sale->landmark !!}

CITY
{!! $sale->cityName !!}

TP 01
{!! $sale->mobile !!}

TP 02
@if (!empty($sale->mobile_2)) {!! $sale->mobile_2 !!} @endif

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