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

Dashboard

@if($pendingApprovals['total'] > 0)
@endif
Total Sales
{{ number_format($metrics['total_sales'], 2) }}
@if($comparisons['sales_change'] != 0)
{{ number_format(abs($comparisons['sales_change']), 1) }}% vs previous period
@endif
Net Profit
{{ number_format($metrics['current_profit'], 2) }}
@if($comparisons['profit_change'] != 0)
{{ number_format(abs($comparisons['profit_change']), 1) }}% vs previous period
@endif
Total Expenses
{{ number_format($metrics['total_expenses'], 2) }}
{{ $metrics['total_sales'] > 0 ? number_format(($metrics['total_expenses'] / $metrics['total_sales']) * 100, 1) : 0 }}% of sales
Pending Approvals
{{ $pendingApprovals['total'] }}
{{ $pendingApprovals['disbursements'] }} Disb. | {{ $pendingApprovals['recoveries'] }} Recov.
Cash Flow Analysis
Inflows

{{ number_format($cashFlow['total_inflows'], 2) }}

Cash: {{ number_format($cashFlow['cash_sales'], 2) }}
Recoveries: {{ number_format($cashFlow['recoveries'], 2) }}
Outflows

{{ number_format($cashFlow['total_outflows'], 2) }}

Expenses: {{ number_format($cashFlow['expenses'], 2) }}
Disbursements: {{ number_format($cashFlow['disbursements'], 2) }}

Net Cash Flow

{{ number_format($cashFlow['net_cash_flow'], 2) }}

Outstanding Balances
Customer Balances

{{ number_format($outstandingBalances['customers']['total'], 2) }}

{{ $outstandingBalances['customers']['count'] }} customers
Avg: {{ number_format($outstandingBalances['customers']['average'], 2) }}
Supplier Balances

{{ number_format($outstandingBalances['suppliers']['total'], 2) }}

{{ $outstandingBalances['suppliers']['count'] }} suppliers
Avg: {{ number_format($outstandingBalances['suppliers']['average'], 2) }}
Sales & Profit Trend (Last 12 Months)
Branch Performance
Top 10 Customers by Balance
@forelse($topCustomers as $index => $customer) @empty @endforelse
# Customer Balance Period Recoveries
{{ $index + 1 }} {{ $customer->name }} {{ number_format($customer->balance, 2) }} {{ number_format($customer->period_recoveries ?? 0, 2) }}
No data available
Top 10 Suppliers by Balance
@forelse($topSuppliers as $index => $supplier) @empty @endforelse
# Supplier Balance Period Disbursements
{{ $index + 1 }} {{ $supplier->name }} {{ number_format($supplier->balance, 2) }} {{ number_format($supplier->period_disbursements ?? 0, 2) }}
No data available
Business Projections & Forecasts
Growth Rates
Month over Month

{{ $growthRates['month_over_month'] >= 0 ? '+' : '' }}{{ number_format($growthRates['month_over_month'], 1) }}%

Year over Year

{{ $growthRates['year_over_year'] >= 0 ? '+' : '' }}{{ number_format($growthRates['year_over_year'], 1) }}%

Projection Confidence
{{ $salesProjections['confidence'] }}
Based on {{ $salesProjections['method'] == 'linear_trend' ? '6+ months' : 'limited' }} historical data
@if(count($salesProjections['projections']) > 0)
Sales Projections (Next 3 Months) {{ $salesProjections['growth_rate'] >= 0 ? '+' : '' }}{{ $salesProjections['growth_rate'] }}% trend
@foreach($salesProjections['projections'] as $projection) @endforeach
Month Conservative Estimate Projected Sales Optimistic Estimate Range
{{ $projection['month'] }} {{ number_format($projection['conservative'], 2) }} {{ number_format($projection['projected_sales'], 2) }} {{ number_format($projection['optimistic'], 2) }}
@endif @if(count($profitProjections['projections']) > 0)
Profit Projections (Next 3 Months) Avg Margin: {{ $profitProjections['average_margin'] }}%
@foreach($profitProjections['projections'] as $projection) @endforeach
Month Projected Profit Target (10% Above) Progress to Target
{{ $projection['month'] }} {{ number_format($projection['projected_profit'], 2) }} {{ number_format($projection['target'], 2) }}
90%
@endif
Cash Flow Projections Daily Avg: In {{ number_format($cashFlowProjections['daily_avg_inflow'], 2) }} | Out {{ number_format($cashFlowProjections['daily_avg_outflow'], 2) }}
@foreach($cashFlowProjections['projections'] as $projection) @endforeach
Period Projected Inflow Projected Outflow Net Cash Flow Status
Next {{ $projection['days'] }} days {{ number_format($projection['projected_inflow'], 2) }} {{ number_format($projection['projected_outflow'], 2) }} {{ number_format($projection['projected_net'], 2) }} @if($projection['projected_net'] >= 0) Positive @else Negative @endif
Note: Projections are based on historical trends and patterns. Actual results may vary due to market conditions, seasonal factors, and business decisions. Use these projections as guidance for planning and decision-making.
@endsection @section('customjs') @endsection