@extends('layouts.app') @section('title', 'AI Reports & Analytics') @section('content')

AI Reports & Analytics Permission-scoped business, pricing and accounting intelligence

Export overview
@foreach(['sales'=>'Sales','purchases'=>'Purchases','expenses'=>'Expenses','receivables'=>'Receivables','payables'=>'Payables'] as $key=>$label) @php($metric = data_get($snapshot, 'metrics.'.$key))
{{ $label }}@if(is_array($metric)){{ number_format((float)$metric['total'],2) }}{{ number_format((int)$metric['count']) }} records@elseRestrictedRole permission required@endif
@endforeach
@if(auth()->user()->can('superadmin') || auth()->user()->can('ai.use_pricing_copilot'))@endif @if(auth()->user()->can('superadmin') || auth()->user()->can('ai.view_accounting'))@endif

Business movement

SalesPurchasesExpenses

Period summary

{{ $snapshot['period']['days'] }} days analyzed

From {{ $snapshot['period']['from'] }} to {{ $snapshot['period']['to'] }}


All figures are permission- and location-scoped. Current dues are calculated from invoices less recorded payments.

Top-selling products

@forelse($snapshot['top_products'] as $row)@empty@endforelse
ProductVariationSKUUnitsRevenue
{{ $row['product'] }}{{ $row['variation'] }}{{ $row['sku'] }}{{ number_format($row['units'],2) }}{{ number_format($row['revenue'],2) }}
No accessible product sales in this period.
@if(auth()->user()->can('superadmin') || auth()->user()->can('ai.use_pricing_copilot'))

Evidence-backed price recommendations

Export CSV

Uses cost, current gross margin, sales velocity, available stock, and alert quantity. Suggestions are advisory and are never applied automatically.

@forelse($snapshot['pricing'] as $row)@empty@endforelse
ProductCostCurrentMarginSuggestedChangeStock / SoldConfidenceReason
{{ $row['product'] }}
{{ $row['sku'] }}
{{ number_format($row['cost'],2) }}{{ number_format($row['current_price'],2) }}{{ number_format($row['current_margin_percent'],1) }}%{{ number_format($row['suggested_price'],2) }}{{ $row['change_percent'] > 0 ? '+' : '' }}{{ number_format($row['change_percent'],1) }}%{{ number_format($row['stock'],2) }} / {{ number_format($row['units_sold'],2) }}{{ ucfirst($row['confidence']) }}{{ $row['reason'] }}
No accessible products.
@endif @if(auth()->user()->can('superadmin') || auth()->user()->can('ai.view_accounting'))
@if(!empty($snapshot['accounting'])) @php($accounting = $snapshot['accounting'])
Cash credits{{ number_format(data_get($accounting,'cash_flow.credits',0),2) }}
Cash debits{{ number_format(data_get($accounting,'cash_flow.debits',0),2) }}
Net cash flow{{ number_format(data_get($accounting,'cash_flow.net',0),2) }}
@if($accounting['profit_loss'])
Est. gross profit{{ number_format($accounting['profit_loss']['estimated_gross_profit'],2) }}
Est. net profit{{ number_format($accounting['profit_loss']['estimated_net_profit'],2) }}
@endif
@if($accounting['profit_loss'])

Profit analysis

RevenueEstimated COGSEstimated gross profitExpensesEstimated net profitQuickSell mapped net profit
{{ number_format($accounting['profit_loss']['revenue'],2) }}{{ number_format($accounting['profit_loss']['estimated_cogs'],2) }}{{ number_format($accounting['profit_loss']['estimated_gross_profit'],2) }}{{ number_format($accounting['profit_loss']['expenses'],2) }}{{ number_format($accounting['profit_loss']['estimated_net_profit'],2) }}{{ number_format($accounting['profit_loss']['net_profit'],2) }}
{{ $accounting['profit_loss']['estimate_basis'] }} QuickSell mapped profit uses the software's purchase-to-sale mappings.
@endif

Account balances and period movement

Export CSV
@forelse($accounting['accounts'] as $row)@empty@endforelse
AccountNumberBalanceCreditsDebitsNet flow
{{ $row['name'] }}{{ $row['account_number'] }}{{ number_format($row['balance'],2) }}{{ number_format($row['credits'],2) }}{{ number_format($row['debits'],2) }}{{ number_format($row['net_cash_flow'],2) }}
No account-ledger entries are available.

Recent ledger entries

@forelse($accounting['recent_ledger_entries'] as $row)@empty@endforelse
DateAccountReferenceTypeAmountNote
{{ $row['date'] }}{{ $row['account'] }}{{ $row['reference'] }}{{ ucfirst($row['type']) }} {{ $row['transaction_type'] ? '· '.str_replace('_',' ',$row['transaction_type']) : '' }}{{ number_format($row['amount'],2) }}{{ $row['note'] }}
No ledger entries in this period.
@else
Your underlying QuickSell role does not permit accounting reports.
@endif
@endif

AI management report

Generate an executive summary using only the figures currently shown on this permission-scoped dashboard.

@endsection @section('javascript') @endsection