@extends('layouts.app') @section('content')

{{ $period->name }}

Back to Stock Periods @if($period->status==='open')@permission('inventory.stock_period_close')
@csrf
@endpermission @else @permission('inventory.stock_taking_start')
@csrf
@endpermission @endif
@if($errors->any())@endif

Stock Period Report

{{ $period->name }} · {{ $period->branch?->name }} · {{ ucfirst($period->status) }}

Opened: {{ $period->opened_at->format('d/m/Y h:i a') }} — {{ $period->closed_at ? 'Closed: '.$period->closed_at->format('d/m/Y h:i a') : 'Current position: '.now()->format('d/m/Y h:i a') }}

Other movements include transfers, returns, damages, internal issues, pack opening and stock corrections. Closing a period saves the quantities; it does not stop sales or close shifts.

@if($rows->contains(fn($r)=>abs($r->unrecorded)>0.0001))

Some stock changes have no recorded movement. Check the Unrecorded Change column before relying on reconciliation.

@endif @php($counts=$period->stockTaking?->items?->keyBy('product_id') ?? collect())
@forelse($rows as $row)@php($count=$counts->get($row->product_id))@foreach(['opening','purchased','added','sold','other','closing','unrecorded'] as $field)@endforeach@empty@endforelse @foreach(['opening','purchased','added','sold','other','closing','unrecorded'] as $field)@endforeach
BarcodeProductOpening QtyPurchasedStock AddedSoldOther (Net){{ $period->status==='closed'?'Saved Closing Qty':'Remaining Qty' }}Unrecorded ChangeExpected at CountCounted QtyCount Difference
{{ $row->barcode ?: '-' }}{{ $row->product_name }}{{ number_format($row->$field,2) }}{{ $count?->actual_quantity !== null ? number_format($count->available_quantity,2) : '-' }}{{ $count?->actual_quantity !== null ? number_format($count->actual_quantity,2) : '-' }}{{ $count?->actual_quantity !== null ? number_format($count->difference_quantity,2) : '-' }}
No stock in this period.
Totals{{ number_format($rows->sum($field),2) }}{{ number_format($counts->whereNotNull('actual_quantity')->sum('available_quantity'),2) }}{{ number_format($counts->whereNotNull('actual_quantity')->sum('actual_quantity'),2) }}{{ number_format($counts->whereNotNull('actual_quantity')->sum('difference_quantity'),2) }}
@if($period->stock_taking_id)

Stock taking compares the physical count against the system quantity when that count is recorded. Later sales and receipts remain intact when the difference is adjusted.

@endif
@endsection