@foreach ($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();
@endphp
 |
Order No :{{ $sale->invoice_no }} |
To
| Name : |
{!! $sale->name !!} |
| Address : |
{!! $sale->landmark !!},
@if ($sale->cityName != 'Other')
{!! $sale->cityName !!},
@endif
|
order_sale_note != '1') style="display: none" @endif>
| Sale Note : |
{!! $sale->sale_note !!}
|
| Contact No : |
{!! $sale->mobile !!}
@if (!empty($sale->mobile_2))
{!! $sale->mobile_2 !!}
@endif
|
@if ($setting->is_enable_sale_items_for_waybill)
@if($setting->parcel_des == '0')
| Parcel Desc : |
@foreach ($item_names as $item)
@php
$second_value = \Illuminate\Support\Facades\DB::table('stocks')
->join(
'attribute_values',
'stocks.second_attribute_value_id',
'=',
'attribute_values.id',
)
->where('product_id', $item->product_id)
->first();
@endphp
{{ $item->product_name }}
{{ !empty($item->attribute_value) ? '- ' . $item->attribute_value : ' ' }}
{{ !empty($second_value->value) ? '- ' . $second_value->value : ' ' }}
x {{ $item->qty }}
/
@endforeach
|
@endif
@endif
@if ($setting->name == 'Quickly.lk')
Product Details
|
@foreach ($item_names as $item)
@php
$second_value = \Illuminate\Support\Facades\DB::table('stocks')
->join(
'attribute_values',
'stocks.second_attribute_value_id',
'=',
'attribute_values.id',
)
->where('product_id', $item->product_id)
->first();
@endphp
{{ $item->product_name }} -
{{ $item->sku }}
{{ !empty($item->attribute_value) ? '- ' . $item->attribute_value : ' ' }}
{{ !empty($second_value->value) ? '- ' . $second_value->value : ' ' }}
x {{ $item->qty }}
/
@endforeach
|
@else
@php
$location = $business_locations->first();
@endphp
From
| Name : |
{{ $location->name }} |
| Address : |
{{ $location->landmark }} , {{ $location->city }} ,
@if ($city)
{{ $city->name_en }}
@endif
|
| Contact No : |
{{ $location->mobile }} |
@if ($setting->is_enable_sale_items_for_waybill)
@if($setting->parcel_des == '1')
| Parcel Desc : |
@foreach ($item_names as $item)
@php
$second_value = \Illuminate\Support\Facades\DB::table('stocks')
->join(
'attribute_values',
'stocks.second_attribute_value_id',
'=',
'attribute_values.id',
)
->where('product_id', $item->product_id)
->first();
@endphp
{{ $item->product_name }}
{{ !empty($item->attribute_value) ? '- ' . $item->attribute_value : ' ' }}
{{ !empty($second_value->value) ? '- ' . $second_value->value : ' ' }}
x {{ $item->qty }}
/
@endforeach
|
@endif
@endif
@endif
@if ($sale->payment_status == 'due')
COD : {!! 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
@if ($setting->name == 'Quickly.lk')
@else
FREE
@endif
@endif
{{ $sale->full_waybill_no }}
|
@endforeach
@endforeach