@if(isset($result) && count($result) > 0)
@php
$deliveryFee = $riderTip = $saleDiscount = $customerDiscount = $totalItemPrice = $total = $totalPromoPrice = $orderTotal = 0;
$orderId = $result[0]->order_id;
$i = 0;
$itemTotal = 0;
@endphp
@foreach($result as $k => $detail)
@php
if($orderId != $detail->order_id || $i == 0) {
$deliveryFee += $detail->delivery_fee;
$riderTip += $detail->tip;
$saleDiscount += $detail->sale_discount;
$customerDiscount += $detail->customer_discount_amount;
$totalPromoPrice += $detail->promo_code_value;
$orderTotal += $detail->order_total_price;
}
$totalItemPrice += $detail->total_price;
if($detail->order_id != $orderId) {
$itemTotal = $detail->total_price;
}
else {
$itemTotal += $detail->total_price;
}
$p = $k+1;
@endphp
{{ $p }}
|
{{ dateFormat($detail->created_at, SHOW_DATE2) }} |
{{ $detail->order_id }} |
{{ '#' . orderNumber($detail->order_from, $detail->order_number, $detail->order_prefix) }} |
{{ orderFrom($detail->order_from) }} |
@if($orderId != $detail->order_id || $i == 0)
{{ ($detail->promo_code_value > 0) ? numberFormat($detail->promo_code_value, false, false) : '' }} |
{{ ($detail->delivery_fee > 0) ? numberFormat($detail->delivery_fee, false, false) : '' }} |
{{ ($detail->tip > 0) ? numberFormat($detail->tip, false, false) : '' }} |
{{ ($detail->sale_discount > 0) ? numberFormat($detail->sale_discount, false, false) : '' }} |
{{ ($detail->customer_discount_amount > 0) ? numberFormat($detail->customer_discount_amount, false, false) : '' }} |
@else
|
|
|
|
|
@endif
@php
$variationName = ($detail->variation_name != '') ? ' - ' . $detail->variation_name : '';
@endphp
@if($detail->is_half==1 && $detail->item_json != null)
@php
$itemJson=json_decode($detail->item_json);
$itemName=$itemJson[0]->item_name ."+".$itemJson[1]->item_name;
@endphp
{!! $itemName !!}
@else
{{ $detail->item_name . ' ' . $variationName }}
@endif
|
{{ $detail->category_name }} |
{{ $detail->tax_perc }} |
{{ $detail->quantity }} |
{{ ($detail->total_price > 0) ? numberFormat($detail->total_price, false, false) : '' }} |
@if(isset($result[$p]) && $result[$p]->order_id == $detail->order_id)
|
@else
{{ ($itemTotal > 0) ? numberFormat($itemTotal, false, false) : '' }} |
{{ ($detail->order_total_price > 0) ? numberFormat($detail->order_total_price, false, false) : '' }} |
@endif
@php
$orderId = $detail->order_id;
$i++;
@endphp
@endforeach
{{ __('report.total') }}: |
{{ ($totalPromoPrice > 0) ? numberFormat($totalPromoPrice, false, false) : '' }} |
{{ ($deliveryFee > 0) ? numberFormat($deliveryFee, false, false) : '' }} |
{{ ($riderTip > 0) ? numberFormat($riderTip, false, false) : '' }} |
{{ ($saleDiscount > 0) ? numberFormat($saleDiscount, false, false) : '' }} |
{{ ($customerDiscount > 0) ? numberFormat($customerDiscount, false, false) : '' }} |
{{ ($totalItemPrice > 0) ? numberFormat($totalItemPrice, false, false) : '' }} |
{{ ($totalItemPrice > 0) ? numberFormat($totalItemPrice, false, false) : '' }} |
{{ ($orderTotal > 0) ? numberFormat($orderTotal, false, false) : '' }} |
@else
{{ __('common.no_records') }} |
@endif