@extends('layouts.app') @section('title', __('accounting-reports::lang.kpi_dashboard')) @section('content')

@lang('accounting-reports::lang.kpi_dashboard') @lang('accounting-reports::lang.key_performance_indicators')

@component('components.widget', ['class' => 'box-primary'])
{!! Form::label('start_date', __('accounting-reports::lang.start_date') . ':') !!} {!! Form::text('start_date', @format_date($kpis['period']['start'] ?? now()->startOfMonth()), ['class' => 'form-control date-picker', 'readonly', 'id' => 'start_date']) !!}
{!! Form::label('end_date', __('accounting-reports::lang.end_date') . ':') !!} {!! Form::text('end_date', @format_date($kpis['period']['end'] ?? now()->endOfMonth()), ['class' => 'form-control date-picker', 'readonly', 'id' => 'end_date']) !!}
{!! Form::label('location_id', __('purchase.business_location') . ':') !!} {!! Form::select('location_id', $locations ?? [], null, ['class' => 'form-control select2', 'placeholder' => __('messages.all'), 'style' => 'width:100%', 'id' => 'location_filter']) !!}

@endcomponent

Profitability KPIs

Gross Profit Margin {{ number_format($kpis['profitability']['gross_profit_margin'] ?? 0, 2) }}%
Net Profit Margin {{ number_format($kpis['profitability']['net_profit_margin'] ?? 0, 2) }}%
Operating Margin {{ number_format($kpis['profitability']['operating_margin'] ?? 0, 2) }}%
Total Revenue @format_currency($kpis['profitability']['revenue'] ?? 0)

@format_currency($kpis['profitability']['gross_profit'] ?? 0)

Gross Profit

@format_currency($kpis['profitability']['net_profit'] ?? 0)

Net Profit

Liquidity KPIs

Current Ratio {{ number_format($kpis['liquidity']['current_ratio'] ?? 0, 2) }}
Quick Ratio {{ number_format($kpis['liquidity']['quick_ratio'] ?? 0, 2) }}
Cash Ratio {{ number_format($kpis['liquidity']['cash_ratio'] ?? 0, 2) }}
Working Capital @format_currency($kpis['liquidity']['working_capital'] ?? 0)

Efficiency KPIs

Receivables Collection (Days) {{ number_format($kpis['efficiency']['receivables_collection_period_days'] ?? 0, 1) }}
Inventory Turnover {{ number_format($kpis['efficiency']['inventory_turnover_ratio'] ?? 0, 2) }}
Days Inventory Outstanding {{ number_format($kpis['efficiency']['days_inventory_outstanding'] ?? 0, 1) }}
Cash Conversion Cycle (Days) {{ number_format($kpis['efficiency']['cash_conversion_cycle_days'] ?? 0, 1) }}

Sales KPIs

Total Sales @format_currency($kpis['sales']['total_sales'] ?? 0)
Total Transactions {{ number_format($kpis['sales']['total_transactions'] ?? 0) }}
Avg Transaction Value @format_currency($kpis['sales']['average_transaction_value'] ?? 0)
Avg Basket Size {{ number_format($kpis['sales']['average_basket_size'] ?? 0, 2) }}

Inventory KPIs

Total Inventory Value @format_currency($kpis['inventory']['total_inventory_value'] ?? 0)
Stock-Out Rate {{ number_format($kpis['inventory']['stock_out_rate'] ?? 0, 2) }}%
{{ $kpis['inventory']['stock_out_products'] ?? 0 }} of {{ $kpis['inventory']['total_products'] ?? 0 }} products
Slow-Moving Inventory @format_currency($kpis['inventory']['slow_moving_inventory_value'] ?? 0)
{{ number_format($kpis['inventory']['slow_moving_percentage'] ?? 0, 2) }}% of total inventory
@if(isset($kpis['location_performance']) && !empty($kpis['location_performance']))

Location Performance

@foreach($kpis['location_performance'] as $location) @endforeach
Location Revenue Gross Profit Gross Margin
{{ $location['location_name'] ?? 'N/A' }} @format_currency($location['revenue'] ?? 0) @format_currency($location['gross_profit'] ?? 0) {{ number_format($location['gross_margin'] ?? 0, 2) }}%
@endif
@endsection @section('javascript') @endsection