@extends('layouts.app') @section('title', 'POSM Audit Detail - ' . $posmAudit->outlet->name) @section('content')
POSM Audit Detail: {{ $posmAudit->outlet->name }}
{{-- Extra Actions on Left --}} @if($posmAudit->status == 'completed') Completed on {{ $posmAudit->completed_date->format('Y-m-d') }} @elseif($posmAudit->status == 'flagged') Flagged @else Status: {{ ucfirst(str_replace('_', ' ', $posmAudit->status)) }} @endif {{-- Standardized 6 Icons (Icons only if routes not defined) --}}
Audit Summary
{{ $posmAudit->outlet->name }}
{{ $posmAudit->outlet->outlet_type }}
{{ $posmAudit->outlet->address }}
{{ $posmAudit->scheduled_date->format('Y-m-d') }}
{{ $posmAudit->due_date->format('Y-m-d') }} @if($posmAudit->is_overdue) @endif
{{ $posmAudit->tm->name ?? 'Unassigned' }}
{{ $posmAudit->creator->name ?? 'System' }} on {{ $posmAudit->created_at->format('Y-m-d H:i') }}
Audit Items & Results
@forelse($posmAudit->items as $item) @empty @endforelse
MATERIAL NAME NORM QTY ACTUAL QTY VARIANCE STATUS REMARKS
{{ $item->material_name }} {{ $item->norm_quantity }} {{ $item->actual_quantity }} @if($item->variance == 0) - @else {{ $item->variance > 0 ? '+' : '' }}{{ $item->variance }} @endif @if($item->needs_restocking) Needs Restock @else OK @endif {{ $item->remarks ?? '-' }}
@if($posmAudit->status == 'scheduled')

Audit is scheduled. Results will appear once completed.

@else

No audit items found.

@endif
@if($posmAudit->status == 'completed' && $posmAudit->items->where('needs_restocking', true)->count() > 0)
Stock Issues Detected

This audit has identified materials that need restocking. A service request has been automatically suggested for follow-up.

@endif
@endsection @push('js') @endpush