@extends('layouts.app') @section('content')

{{ auth()->user()->hasRole('admin') ? 'Admin' : 'Wholeselar' }} Panel

@if (auth()->user()->hasRole('wholeseller')) @endif
@if (auth()->user()->hasRole('admin'))

Retailers

{{ count($retailer) > 0 ? count($retailer) : 0 }}

Wholesalers

{{ count($wholeseller) > 0 ? count($wholeseller) : 0 }}

Orders

{{ count($order) > 0 ? count($order) : 0 }}
@else

Mapped Retailers

{{ count($retailer) > 0 ? count($retailer) : 0 }}

Orders

{{ count($order) > 0 ? count($order) : 0 }}
@endif
{{-- Product Details and Listing --}}

Product Delivery {{ count($orderDetails) > 0 ? count($orderDetails) . ' Products ' : '0 Product ' }}Ordered so far

@if (!empty($orderDetails) && count($orderDetails) > 0) @foreach ($orderDetails as $details)
@if (!empty($details->product?->image)) @else @endif {{ $details->product?->name ?? 'NA' }}
{{-- @dd($details)
To : {{ $details->order?->retailer?->first_name . ' ' . $details->order?->retailer?->last_name }} {{ $details->order?->status == '1' ? 'Ongoing' : ($details->order?->status == '2' ? 'Invoiced' : 'Cancelled') }}
--}}
@endforeach @else

No Product Found

@endif

Product Orders

Status
{{-- --}}
@if (!empty($order) && count($order) > 0)
{{-- --}} {{-- --}} @foreach ($order as $order_item) {{-- --}} {{-- --}} {{-- --}} @endforeach
Order ID Created Retailer Total PaymentStatus
Cost
Qty
GST
Total
{{ $order_item->order_no }} {{ \Carbon\Carbon::parse($order_item->created_at)->diffForHumans() }} {{ $order_item->retailer?->first_name . ' ' . $order_item->retailer?->last_name }} ₹ {{ $order_item->total_price ?? 0 }} {{ $order_item->payment_type ?? 'NA' }} {{ $details->order?->status == '1' ? 'Ongoing' : ($details->order?->status == '2' ? 'Invoiced' : 'Cancelled') }}
@else

No Order Found

@endif


{{-- Chart --}}
@if(auth()->user()->hasRole('wholeseller')) @endif @if(auth()->user()->hasRole('admin')) @endif
@endsection @push('script') {{-- --}} @endpush