@extends('layouts.app') @section('title', 'Dashboard') @push('styles') @endpush @section('content') {{-- Hero Welcome + Banner Row --}}

{{ __('Good ' . (now()->hour < 12 ? 'Morning' : (now()->hour < 17 ? 'Afternoon' : 'Evening')) . ', ' . Auth::user()->name) }}

Stay Organized, Stay Profitable. Running a business isn’t easy-we make it simpler. From inventory to invoices, everything works.

Create Invoice
@if(optional($globalBanner)->banner)
Banner
@endif
{{-- License Status Banner --}} @if($account) @php $days = $account->daysRemaining(); $warningLevel = $days <= 7 ? 'danger' : ($days <= 15 ? 'warning' : ($days <= 30 ? 'info' : null)); @endphp @if($warningLevel)

License {{ $warningLevel === 'danger' ? 'Expiring Soon' : ($warningLevel === 'warning' ? 'Expiring Soon' : 'Renewal Reminder') }}

Your {{ $account->license_plan }} plan license expires in {{ $days }} days ({{ $account->expiry_date->format('d M Y') }}). @if($warningLevel === 'danger') Please renew immediately to avoid service interruption. @endif

@endif @endif {{-- Top Stats Row --}}

Active Products

{{ $activeProducts }}

Total active

Active Customers

{{ $activeCustomers }}

Total active

Taxable Revenue

₹{{ number_format($taxableRevenue, 0) }}

Collected

Non-Taxable Revenue

₹{{ number_format($nonTaxableRevenue, 0) }}

Collected

Pending Payments

₹{{ number_format($pendingPayments, 0) }}

Unpaid

Low Stock

{{ $lowStockProducts }}

Alert items

{{-- Main Charts Row --}}

Sales Overview

@foreach(['7days' => '7 Days', '30days' => '30 Days', '6months' => '6 Months', '1year' => '1 Year'] as $key => $label) @endforeach

Structure

Invoiced ₹{{ number_format($invoicedTotal, 0) }}
@php $invPct = $invoicedTotal > 0 ? 100 : 0; @endphp
tax invoice Collected ₹{{ number_format($taxableRevenue, 0) }}
@php $taxColPct = $taxableInvoiced > 0 ? round(($taxableRevenue / $taxableInvoiced) * 100) : 0; @endphp
non tax invoice Collected ₹{{ number_format($nonTaxableRevenue, 0) }}
@php $nonTaxColPct = $nonTaxableInvoiced > 0 ? round(($nonTaxableRevenue / $nonTaxableInvoiced) * 100) : 0; @endphp
Outstanding ₹{{ number_format($outstandingTotal, 0) }}
@php $outPct = $invoicedTotal > 0 ? round(($outstandingTotal / $invoicedTotal) * 100) : 0; @endphp
@php $totalColPct = $invoicedTotal > 0 ? round(($collectedTotal / $invoicedTotal) * 100) : 0; @endphp
Collection Rate {{ $totalColPct }}%
{{-- Dashboard Widgets Row --}} {{-- Recently Sold + Top Customers Row --}} {{-- Secondary Charts Row --}} {{-- Low Stock Alerts --}}

Low Stock Alerts

Products that need restocking

@if($lowStockProductsList->count() > 0) {{ $lowStockProductsList->count() }} products @endif
@if($lowStockProductsList->count() > 0)
@foreach($lowStockProductsList as $index => $product)

{{ $product->name }}

SKU: #{{ $product->id }}

{{ $product->stock_quantity }} left
Stock level {{ $product->stock_quantity }} / {{ $product->stock_alert_limit }} (alert limit)
@php $pct = $product->stock_alert_limit > 0 ? ($product->stock_quantity / $product->stock_alert_limit) * 100 : 0; @endphp
@endforeach
@else

All stocked up!

No low stock products to worry about.

@endif
@endsection @push('scripts') @endpush