@extends('seller.layouts.app') @section('panel_content')
@php $count = DB::table('orders')->where('seller_id', Auth::user()->id) ->count(); $grand_total = DB::table('orders')->where('seller_id', Auth::user()->id) ->sum('orders.grand_total'); $product_storehouse_total = DB::table('orders')->where('seller_id', Auth::user()->id) ->sum('orders.product_storehouse_total'); $total_turnover = "$".sprintf('%.2f',$grand_total); $total_profit = "$".sprintf('%.2f',($grand_total - $product_storehouse_total)); @endphp
{{ $count }}
{{ translate('Total Orders') }}
{{ $total_turnover }}
{{ translate('Total Turnover') }}
{{ $total_profit }}
{{ translate('Total Profit') }}
{{ translate('Orders') }}
@if (count($orders) > 0)
@foreach ($orders as $key => $order_id) @php $order = \App\Models\Order::find($order_id->id); @endphp @if($order != null) @endif @endforeach
# {{ translate('Order Code')}} {{ translate('Num. of Products')}} {{ translate('Amount')}} {{ translate('Profit')}} {{ translate('Pick Up Status') }} {{ translate('Delivery Status')}} {{ translate('Payment Status')}} {{ translate('Options')}}
{{ $key+1 }} {{ $order->code }} {{ count($order->orderDetails->where('seller_id', Auth::user()->id)) }} {{ single_price($order->grand_total) }} @if ($order->product_storehouse_total > 0) {{ single_price($order->grand_total - $order->product_storehouse_total) }} @else {{ translate('None') }} @endif @if ($order->product_storehouse_status) {{translate('Picked Up')}} @else @if ($order->product_storehouse_total) {{translate('Unpicked Up')}} @endif @endif @php $status = $order->delivery_status; @endphp {{ translate(ucfirst(str_replace('_', ' ', $status))) }} @if ($order->payment_status == 'paid') {{ translate('Paid')}} @else {{ translate('Unpaid')}} @endif
{{ $orders->links() }}
@endif
@endsection @section('script') @endsection