@php $admin = auth()->guard('admin')->user(); @endphp @lang('admin::app.dashboard.index.title') {{-- User Detailes Section --}}

@lang('admin::app.dashboard.index.user-name', ['user_name' => $admin->name])

@lang('admin::app.dashboard.index.user-info')

{{-- Body Component --}}
{{-- Left Section --}}
{{-- Overall Detailes --}}

@lang('admin::app.dashboard.index.overall-details')

{{-- Total Sales --}}
{{-- Sales Stats --}}

{{ core()->formatBasePrice($statistics['over_all']['total_sales']['current']) }}

@lang('admin::app.dashboard.index.total-sales')

{{-- Sales Percentage --}}
@if ($statistics['over_all']['total_sales']['progress'] < 0)

@lang('admin::app.dashboard.index.decreased', [ 'progress' => -number_format($statistics['over_all']['total_sales']['progress'], 1), ])

@else

@lang('admin::app.dashboard.index.increased', [ 'progress' => number_format($statistics['over_all']['total_sales']['progress'], 1), ])

@endif
{{-- Total Orders --}}
{{-- Orders Stats --}}

{{ $statistics['over_all']['total_orders']['current'] }}

@lang('admin::app.dashboard.index.total-orders')

{{-- Order Percentage --}}
@if ($statistics['over_all']['total_orders']['progress'] < 0)

@lang('admin::app.dashboard.index.decreased', [ 'progress' => -number_format($statistics['over_all']['total_orders']['progress'], 1), ])

@else

@lang('admin::app.dashboard.index.increased', [ 'progress' => number_format($statistics['over_all']['total_orders']['progress'], 1), ])

@endif
{{-- Total Customers --}}
{{-- Customers Stats --}}

{{ $statistics['over_all']['total_customers']['current'] }}

@lang('admin::app.dashboard.index.total-customers')

{{-- Customers Percentage --}}
@if ($statistics['over_all']['total_customers']['progress'] < 0)

@lang('admin::app.dashboard.index.decreased', [ 'progress' => -number_format($statistics['over_all']['total_customers']['progress'], 1) ])

@else

@lang('admin::app.dashboard.index.increased', [ 'progress' => number_format($statistics['over_all']['total_customers']['progress'], 1) ])

@endif
{{-- Average sales --}}
{{-- Sales Stats --}}

{{ core()->formatBasePrice($statistics['over_all']['avg_sales']['current']) }}

@lang('admin::app.dashboard.index.average-sale')

{{-- Sales Percentage --}}
@if ($statistics['over_all']['avg_sales']['progress'] < 0)

@lang('admin::app.dashboard.index.decreased', [ 'progress' => -number_format($statistics['over_all']['avg_sales']['progress'], 1), ])

@else

@lang('admin::app.dashboard.index.increased', [ 'progress' => number_format($statistics['over_all']['avg_sales']['progress'], 1), ])

@endif
{{-- Unpaid Invoices --}}

{{ core()->formatBasePrice($statistics['over_all']['total_unpaid_invoices']) }}

@lang('admin::app.dashboard.index.total-unpaid-invoices')

{{-- Todays Details --}}

@lang('admin::app.dashboard.index.today-details')

{{-- Today's Sales --}}
{{-- Sales Stats --}}

{{ core()->formatBasePrice($statistics['today']['total_sales']['current']) }}

@lang('admin::app.dashboard.index.today-sales')

{{-- Percentage Of Sales --}}
@if ($statistics['today']['total_sales']['progress'] < 0)

@lang('admin::app.dashboard.index.decreased', [ 'progress' => -number_format($statistics['today']['total_sales']['progress'], 1), ])

@else

@lang('admin::app.dashboard.index.increased', [ 'progress' => number_format($statistics['today']['total_sales']['progress'], 1), ])

@endif
{{-- Today's Orders --}}
{{-- Orders Stats --}}

{{ $statistics['today']['total_orders']['current'] }}

@lang('admin::app.dashboard.index.today-orders')

{{-- Orders Percentage --}}
@if ($statistics['today']['total_orders']['progress'] < 0)

@lang('admin::app.dashboard.index.decreased', [ 'progress' => -number_format($statistics['today']['total_orders']['progress'], 1), ])

@else

@lang('admin::app.dashboard.index.increased', [ 'progress' => number_format($statistics['today']['total_orders']['progress'], 1), ])

@endif
{{-- Today's Customers --}}
{{-- Customers Stats --}}

{{ $statistics['today']['total_customers']['current'] }}

@lang('admin::app.dashboard.index.today-customers')

{{-- Customers Percentage --}}
@if ($statistics['today']['total_customers']['progress'] < 0)

@lang('admin::app.dashboard.index.decreased', [ 'progress' => -number_format($statistics['today']['total_customers']['progress'], 1), ])

@else

@lang('admin::app.dashboard.index.increased', [ 'progress' => number_format($statistics['today']['total_customers']['progress'], 1), ])

@endif
@foreach ($statistics['today']['orders'] as $item)
{{-- Order ID, Status, Created --}}
{{-- Order Id --}}

@lang('admin::app.dashboard.index.order-id', ['id' => $item->id])

{{ $item->created_at}}

{{-- Order Status --}} @switch($item->status) @case('processing')

{{ $item->status_label }}

@break @case('completed')

{{ $item->status_label }}

@break @case('pending')

{{ $item->status_label }}

@break @case('canceled')

{{ $item->status_label }}

@break @case('closed')

{{ $item->status_label }}

@break @endswitch
{{-- Payment And Channel Detailes --}}
{{-- Grand Total --}}

{{ core()->formatBasePrice($item->grand_total)}}

{{-- Payment Mode --}}

@lang('admin::app.dashboard.index.pay-by', ['method' => core()->getConfigData('sales.payment_methods.' . $item->payment->method . '.title')])

{{-- Channel Name --}}

{{ $item->channel_name }}

{{-- Customer Detailes --}}

{{ $item->customer_first_name }} {{ $item->customer_last_name }}

{{ $item->customer_email }}

{{-- Order Address --}} @foreach ($item->addresses as $address) @if ($address->address_type == 'order_billing')

{{ $address->city . ($address->country ? ', ' . core()->country_name($address->country) : '') }}

@endif @endforeach
{{-- Ordered Product Images --}}
{{-- Using Variable for image Numbering --}} @foreach ($item->items as $index => $orderItem) @if ($index >= 3 && $item->items->count() >= 5) @break; @endif
@if ($orderItem->product?->base_image_url) @else

@lang('admin::app.dashboard.index.product-image')

@endif {{ $orderItem->product?->images->count() }}
@endforeach {{-- Count of Rest Images --}} @if ( $item->items->count() - 3 && $item->items->count() > 4 )

@lang('admin::app.dashboard.index.more-products', ['product_count' => $item->items->count() - 3 ])

@endif
{{-- View More Icon --}}
@endforeach
{{-- Stock Thereshold --}}

@lang('admin::app.dashboard.index.stock-threshold')

{{-- Products List --}} @if(! $statistics['stock_threshold']->isEmpty())
@foreach ($statistics['stock_threshold'] as $item)
@if ($item->product?->base_image_url)
@else

@lang('admin::app.dashboard.index.product-image')

@endif
{{-- Product Name --}}

@if (isset($item->product->name)) {{ $item->product->name }} @endif

{{-- Product SKU --}}

@lang('admin::app.dashboard.index.sku', ['sku' => $item->product->sku])

{{-- Product Number --}}

@if ( isset($item->product->product_number) && ! empty($item->product->product_number) ) @lang('admin::app.dashboard.index.product-number', ['product_number' => $item->product->product_number]) @endif

{{-- Product Price --}}

@if (isset($item->product->price)) {{ core()->formatBasePrice($item->product->price) }} @endif

{{-- Total Product Stock --}}

@lang('admin::app.dashboard.index.total-stock', ['total_stock' => $item->total_qty])

{{-- View More Icon --}}
@endforeach
@else

@lang('admin::app.dashboard.index.empty-threshold')

@lang('admin::app.dashboard.index.empty-threshold-description')

@endif
{{-- Right Section --}}
{{-- First Component --}}

@lang('admin::app.dashboard.index.store-stats')

{{-- Store Stats --}}
@push('scripts') @endpush