{{-- ============================================================ --}} {{-- PENDING ACTIONS ALERT BAR --}} {{-- ============================================================ --}} @if (collect($pendingItems)->sum() > 0)

Pending Actions

{{ collect($pendingItems)->sum() }} Total
@if (($pendingItems['draftSettlements'] ?? 0) > 0) {{ $pendingItems['draftSettlements'] }} Draft Settlements @endif @if (($pendingItems['draftGrns'] ?? 0) > 0) {{ $pendingItems['draftGrns'] }} Draft GRNs @endif @if (($pendingItems['draftGoodsIssues'] ?? 0) > 0) {{ $pendingItems['draftGoodsIssues'] }} Draft Goods Issues @endif @if (($pendingItems['draftJournalEntries'] ?? 0) > 0) {{ $pendingItems['draftJournalEntries'] }} Draft Journal Entries @endif @if (($pendingItems['draftPayments'] ?? 0) > 0) {{ $pendingItems['draftPayments'] }} Draft Payments @endif
@endif {{-- ============================================================ --}} {{-- KPI SUMMARY CARDS - Interactive with hover zoom + shadow --}} {{-- ============================================================ --}}
@if (isset($kpiCards['totalSalesThisMonth']))
Sales This Month

{{ number_format($kpiCards['totalSalesThisMonth'], 2) }}

@endif @if (isset($kpiCards['grossProfitThisMonth']))
Gross Profit

{{ number_format($kpiCards['grossProfitThisMonth'], 2) }}

@endif @if (isset($kpiCards['totalPurchasesThisMonth']))
Purchases This Month

{{ number_format($kpiCards['totalPurchasesThisMonth'], 2) }}

@endif @if (isset($kpiCards['outstandingPayables']))
Outstanding Payables

{{ number_format($kpiCards['outstandingPayables'], 2) }}

@endif @if (isset($kpiCards['totalInventoryValue']))
Inventory Value

{{ number_format($kpiCards['totalInventoryValue'], 2) }}

@if (isset($kpiCards['productsInStock']))

{{ $kpiCards['productsInStock'] }} / {{ $kpiCards['totalProducts'] }} products in stock

@endif
@endif @if (isset($kpiCards['cashCollectedThisMonth']))
Cash Collected

{{ number_format($kpiCards['cashCollectedThisMonth'], 2) }}

@endif @if (isset($kpiCards['creditSalesThisMonth']))
Credit Sales

{{ number_format($kpiCards['creditSalesThisMonth'], 2) }}

@endif @if (isset($kpiCards['goodsIssuedThisMonth']))
Goods Issued

{{ number_format($kpiCards['goodsIssuedThisMonth'], 2) }}

@endif @if (isset($kpiCards['draftJournalEntries']))
Draft Journals

{{ $kpiCards['draftJournalEntries'] }}

@endif @if (isset($kpiCards['paymentsThisMonth']))
Payments This Month

{{ number_format($kpiCards['paymentsThisMonth'], 2) }}

@endif
{{-- ============================================================ --}} {{-- ROW 1: Monthly Sales Trend + Sales by Payment Method --}} {{-- ============================================================ --}} @if (!empty($monthlySalesTrend['labels']) || !empty($salesByPaymentMethod['values']))
@if (!empty($monthlySalesTrend['labels']))

Monthly Sales & Profit Trend

Last 12 months performance overview

@endif @if (!empty($salesByPaymentMethod['values']) && array_sum($salesByPaymentMethod['values']) > 0)

Sales by Payment Method

Current month breakdown

@endif
@endif {{-- ============================================================ --}} {{-- ROW 2: Revenue vs COGS + Profit Margin Gauge --}} {{-- ============================================================ --}} @if (!empty($revenueVsCogs['labels']) || !empty($profitMarginGauge))
@if (!empty($revenueVsCogs['labels']))

Revenue vs COGS vs Expenses

6-month cost analysis

@endif @if (!empty($profitMarginGauge) && $profitMarginGauge['revenue'] > 0)

Profit Margin

Current month profitability

Revenue

{{ number_format($profitMarginGauge['revenue'], 0) }}

Profit

{{ number_format($profitMarginGauge['profit'], 0) }}

@endif
@endif {{-- ============================================================ --}} {{-- ROW 3: Daily Sales + Cash vs Credit Trend --}} {{-- ============================================================ --}} @if (!empty($dailySalesTrend['labels']) || !empty($cashVsCreditTrend['labels']))
@if (!empty($dailySalesTrend['labels']))

Daily Sales (Last 30 Days)

Zoom in to explore daily patterns

@endif @if (!empty($cashVsCreditTrend['labels']))

Cash vs Credit vs Cheque Trend

6-month payment method breakdown

@endif
@endif {{-- ============================================================ --}} {{-- ROW 4: Sales by Day of Week + Customer Channel Distribution --}} {{-- ============================================================ --}} @if (!empty($salesByDayOfWeek['labels']) || !empty($customerChannelDistribution['labels']))
@if (!empty($salesByDayOfWeek['labels']) && array_sum($salesByDayOfWeek['values']) > 0)

Sales by Day of Week

90-day sales pattern analysis

@endif @if (!empty($customerChannelDistribution['labels']))

Customer Channel Distribution

Active customers by channel type

@endif
@endif {{-- ============================================================ --}} {{-- ROW 5: Purchases vs Payments + GRN vs Goods Issue --}} {{-- ============================================================ --}} @if (!empty($purchasesVsPayments['labels']) || !empty($grnVsGoodsIssueTrend['labels']))
@if (!empty($purchasesVsPayments['labels']))

Purchases vs Payments

6-month supplier obligations

@endif @if (!empty($grnVsGoodsIssueTrend['labels']))

Goods Receipt vs Goods Issue

6-month inbound vs outbound flow

@endif
@endif {{-- ============================================================ --}} {{-- ROW 6: Top Products (Sales) + Top Salesperson --}} {{-- ============================================================ --}} @if (!empty($topProductsBySales['labels']) || !empty($topSalespersonBySales['labels']))
@if (!empty($topProductsBySales['labels']))

Top Products by Sales

This month's best sellers

@endif @if (!empty($topSalespersonBySales['labels']))

Top Salespeople

This month's top performers

@endif
@endif {{-- ============================================================ --}} {{-- ROW 7: Warehouse Stock + Stock Movement Breakdown --}} {{-- ============================================================ --}} @if (!empty($warehouseStockDistribution['labels']) || !empty($stockMovementBreakdown['labels']))
@if (!empty($warehouseStockDistribution['labels']))

Stock by Warehouse

Value distribution across locations

@endif @if (!empty($stockMovementBreakdown['labels']))

Stock Movement (Last 30 Days)

Inward vs outward flow breakdown

@endif
@endif {{-- ============================================================ --}} {{-- ROW 8: Top Products (Stock Value) + Settlement Status + Journal Status --}} {{-- ============================================================ --}} @if (!empty($topProductsByStockValue['labels']) || !empty($settlementStatusDistribution['labels']) || !empty($journalEntryStatus['labels']))
@if (!empty($topProductsByStockValue['labels']))

Top Products by Stock Value

Highest value inventory items

@endif
@if (!empty($settlementStatusDistribution['labels']) && array_sum($settlementStatusDistribution['values']) > 0)

Settlement Status

All-time distribution

@endif @if (!empty($journalEntryStatus['labels']) && array_sum($journalEntryStatus['values']) > 0)

Journal Entry Status

All-time distribution

@endif
@endif {{-- ============================================================ --}} {{-- QUICK LINKS --}} {{-- ============================================================ --}}

Quick Actions

Jump to frequently used operations

@can('goods-receipt-note-create')
New GRN
@endcan @can('goods-issue-create')
New Issue
@endcan @can('sales-settlement-create')
New Settlement
@endcan @can('journal-entry-create')
New Journal
@endcan @can('supplier-payment-create')
New Payment
@endcan @can('inventory-view')
View Stock
@endcan
@push('scripts') @endpush