@php $meta = [ 'Shop' => $stockTaking->shop?->name, 'Taken By' => $stockTaking->takenBy?->name, 'Taken At' => $stockTaking->taken_at?->format('d M Y H:i'), 'Previous Stock Take' => $stockTaking->referenceStockTaking?->stock_take_number ?? 'Opening count', ]; $summary = [ ['label' => 'Lines Counted', 'value' => number_format((float) $stockTaking->items_count, 0)], ['label' => 'Discrepancies', 'value' => number_format((float) $stockTaking->discrepancy_count, 0)], ['label' => 'Exceptions', 'value' => number_format((float) $stockTaking->exception_count, 0)], ['label' => 'Exception Qty', 'value' => number_format((float) $stockTaking->exception_quantity_total, 2)], ['label' => 'Total Adjustment Qty', 'value' => number_format((float) $stockTaking->adjustment_quantity_total, 2)], ['label' => 'Expected Total Qty', 'value' => number_format((float) $report['summary']['total_expected_quantity'], 2)], ]; $notes = $stockTaking->notes; @endphp @extends('reports.layout') @section('content')
Variance Analysis
@if (collect($report['items'])->isNotEmpty()) @foreach ($report['items'] as $item) $item['has_discrepancy']])> @endforeach
Product Last Stock Take Net Movement Expected Qty Counted Qty Variance Status
{{ $item['product_name'] }} {{ $item['previous_quantity'] === null ? '-' : number_format((float) $item['previous_quantity'], 2) }} {{ $item['movement_quantity'] === null ? '-' : sprintf('%+.2f', (float) $item['movement_quantity']) }} {{ number_format((float) $item['expected_quantity'], 2) }} {{ number_format((float) $item['counted_quantity'], 2) }} {{ sprintf('%+.2f', (float) $item['variance_quantity']) }} $item['has_discrepancy'], 'pill-ok' => ! $item['has_discrepancy'], ])> {{ $item['has_discrepancy'] ? 'Discrepancy' : 'Matched' }}
@else
No counted stock lines were saved for this stock taking.
@endif
Unregistered Item Exceptions
@if (collect($report['exceptions'])->isNotEmpty()) @foreach ($report['exceptions'] as $exception) @endforeach
Entered Name Barcode Counted Qty Unit Status Resolved Product Resolved By Notes
{{ $exception['entered_name'] }} {{ $exception['entered_barcode'] ?: '-' }} {{ number_format((float) $exception['counted_quantity'], 2) }} {{ $exception['unit'] }} {{ ucfirst($exception['status']) }} {{ $exception['resolved_product_name'] ?: '-' }} {{ $exception['resolved_by_name'] ?: '-' }} @if ($exception['resolved_at'])
{{ \Illuminate\Support\Carbon::parse($exception['resolved_at'])->format('d M Y H:i') }} @endif
{{ $exception['notes'] ?: '-' }}
@else
No unregistered item exceptions were captured during this stock taking.
@endif @endsection