@extends('layouts.app') @section('content')
{{ $errors->first() }}
@endif{{ $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())| Barcode | Product | Opening Qty | Purchased | Stock Added | Sold | Other (Net) | {{ $period->status==='closed'?'Saved Closing Qty':'Remaining Qty' }} | Unrecorded Change | Expected at Count | Counted Qty | Count Difference |
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $row->barcode ?: '-' }} | {{ $row->product_name }} | @foreach(['opening','purchased','added','sold','other','closing','unrecorded'] as $field){{ number_format($row->$field,2) }} | @endforeach{{ $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 | @foreach(['opening','purchased','added','sold','other','closing','unrecorded'] as $field){{ number_format($rows->sum($field),2) }} | @endforeach{{ 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) }} | |||||||
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