@extends('layouts.app') @section('title', 'Loss Prevention') @php $sevClass = ['low' => 'secondary', 'medium' => 'info', 'high' => 'warning', 'critical' => 'danger']; @endphp @section('content')

Loss Prevention

Actions that commonly hide theft: deleted or edited sales, price overrides, voids, cash shortages and stock write-offs. One event is not proof of theft; look for patterns and repeat offenders.

@csrf
On: cashiers must count the drawer (without seeing the expected amount) and shortages are flagged. Off: the register closes without a cash count.
@foreach([ ['Needs review', number_format($kpis['needs_review']), 'High / critical events not yet reviewed', 'bi-flag-fill', $kpis['needs_review'] ? 'danger' : 'success'], ['Deleted sales', formatCurrency($kpis['deleted_value']), $kpis['deleted_count'] . ' sale(s) deleted', 'bi-trash3-fill', $kpis['deleted_count'] ? 'danger' : 'secondary'], ['Cash shortages', formatCurrency($kpis['shortage_value']), 'Counted less than expected at close', 'bi-cash-stack', $kpis['shortage_value'] > 0 ? 'warning' : 'secondary'], ['Edits & overrides', formatCurrency($kpis['edit_value']), 'Lost to edited sales and low prices', 'bi-pencil-square', $kpis['edit_value'] > 0 ? 'warning' : 'secondary'], ['Voids', number_format($kpis['void_count']), 'Items removed / carts cleared', 'bi-x-octagon', 'secondary'], ['Discounts', formatCurrency($kpis['discount_value']), $kpis['discount_count'] . ' discounted sale(s)', 'bi-tag-fill', $kpis['discount_count'] ? 'info' : 'secondary'], ] as [$label, $value, $hint, $icon, $color])
{{ $label }}
{{ $value }}
{{ $hint }}
@endforeach
Staff Risk Ranking
Score: critical 10, high 5, medium 2, low 0.5 per event. "Per 100 sales" compares staff fairly. Team average: {{ number_format($avgRate, 1) }} per 100 sales.
@forelse($cashiers as $c) @empty @endforelse
Staff Sales Deleted Edited Price overrides Voids Discounts Cash short Stock removed Other Score Per 100 sales
{{ $c->user->name }} @if($c->flag) Investigate @endif {{ number_format($c->sales_count) }}
{{ formatCurrency($c->sales_total) }}
{{ (int) $c->deleted }}@if($c->deleted)
{{ formatCurrency($c->deleted_value) }}@endif
{{ (int) $c->edited }}@if($c->edited_value > 0)
−{{ formatCurrency($c->edited_value) }}@endif
{{ (int) $c->price_overrides }} {{ (int) $c->voids }} {{ (int) $c->discounts }}@if($c->discounts)
{{ formatCurrency($c->discount_value) }}@endif
{{ $c->cash_short > 0 ? formatCurrency($c->cash_short) : '—' }} {{ (int) $c->stock_removed }} {{ (int) $c->other }} {{ $c->score }} {{ $c->score_per_100 ?? '—' }}
No sales or events in this period.
Events
@if(request()->hasAny(['user', 'type', 'severity', 'status'])) Clear @endif
@forelse($events as $event) @empty @endforelse
When Severity Event Details At risk Staff
{{ $event->created_at->format('M d, H:i') }} {{ $event->severity }} {{ $event->label }} {{ $event->description }} {{ $event->amount > 0 ? formatCurrency($event->amount) : '—' }} {{ $event->user->name ?? '—' }} @if($event->reviewed) @else @endif
No events found for this period.
{{ $events->fragment('events')->links() }}
@endsection