@extends('layouts.app') @section('title', 'Dashboard') @section('breadcrumb') @endsection @section('content') {{-- ── Row 1: Key Stats ────────────────────────────────────────────────── --}}
{{-- Today's Sales --}}
৳{{ number_format($todaySales, 0) }}
Today's Sales
{{ $todaySalesCount }} transaction{{ $todaySalesCount == 1 ? '' : 's' }}
{{-- Today's Purchase --}}
৳{{ number_format($todayPurchases, 0) }}
Today's Purchase
{{ $todayPurchasesCount }} order{{ $todayPurchasesCount == 1 ? '' : 's' }}
{{-- Monthly Sales --}}
৳{{ number_format($monthlySales, 0) }}
Monthly Sales
{{ $monthlySalesCount }} sales this month
{{-- Monthly Profit --}}
৳{{ number_format($monthlyProfit, 0) }}
Monthly Profit
Net profit this month
{{-- ── Row 2: Due & Inventory ───────────────────────────────────────────── --}}
{{-- Customer Due --}}
৳{{ number_format($totalCustomerDue, 0) }}
Customer Due
Total receivable
{{-- Supplier Due --}}
৳{{ number_format($totalSupplierDue, 0) }}
Supplier Due
Total payable
{{-- Inventory Value --}}
৳{{ number_format($inventoryValue, 0) }}
Inventory Value
At cost price
{{-- Low Stock --}}
{{ $lowStockCount }}
Low Stock Items
{{ $outOfStockCount }} out of stock
{{-- ── Row 3: Tables & Alerts ──────────────────────────────────────────── --}}
{{-- Recent Sales --}}
Recent Sales View All
@forelse($recentSales as $sale) @empty @endforelse
Invoice Customer Amount Due Status Date
{{ $sale->invoice_no }} {{ $sale->customer?->name ?? 'Walk-in Customer' }} ৳{{ number_format($sale->total_amount, 2) }} @if($sale->due_amount > 0) ৳{{ number_format($sale->due_amount, 2) }} @else Paid @endif @php $sColors = ['completed'=>'success','hold'=>'warning','returned'=>'danger','cancelled'=>'secondary','draft'=>'info']; @endphp {{ ucfirst($sale->status) }} {{ $sale->sale_date->format('d M Y') }}
No sales yet today
{{-- Right column: Low Stock + Warranty Alerts --}}
{{-- Low Stock Alert --}}
Low Stock Alert View All
@forelse($lowStockProducts->take(6) as $variant)
{{ $variant->product->name }}
{{ $variant->variant_name }}
{{ $variant->current_stock }} left
@empty
All stock levels are healthy
@endforelse
{{-- Warranty Expiry Alert --}}
Warranty Expiring View All
@forelse($warrantyExpiring->take(5) as $warranty)
{{ $warranty->customer->name }}
{{ $warranty->serialNumber?->productVariant?->product?->name ?? 'Product' }}
@php $days = $warranty->days_remaining; @endphp {{ $days }}d left
{{ $warranty->end_date->format('d M Y') }}
@empty
No warranties expiring soon
@endforelse
{{-- ── Row 4: Recent Purchases ─────────────────────────────────────────── --}} @can_permission('purchases.view')
Recent Purchases View All
@forelse($recentPurchases as $purchase) @empty @endforelse
Invoice Supplier Total Paid Due Status Date
{{ $purchase->invoice_no }} {{ $purchase->supplier->name }} ৳{{ number_format($purchase->total_amount, 2) }} ৳{{ number_format($purchase->paid_amount, 2) }} @if($purchase->due_amount > 0) ৳{{ number_format($purchase->due_amount, 2) }} @else Paid @endif @php $pColors = ['received'=>'success','partial'=>'warning','paid'=>'success','ordered'=>'info','draft'=>'secondary','returned'=>'danger']; @endphp {{ ucfirst($purchase->status) }} {{ $purchase->purchase_date->format('d M Y') }}
No purchases yet
@endcan_permission @endsection