@php $fmt = fn ($v) => \App\Support\Fmt::plain($v, 2); $money = fn ($v) => \App\Support\Fmt::money($v); $day = fn ($v) => \App\Support\Fmt::day($v instanceof \DateTimeInterface ? $v->format('Y-m-d') : $v); $diffCount = $count->differingLines(); $valueAt = fn ($line) => abs($line->variance() ?? 0) * (float) ($line->item?->weighted_avg_cost ?? 0); @endphp

Greenville Academy

Stores & Catering — Stock Take Sheet
{{ $count->stock_take_no }}
{{ $day($count->counted_on) }}
Status: {{ $count->status }}
Store{{ $count->store?->name ?? '—' }}
Counted by{{ $count->counted_by ?: '—' }}
Lines{{ $count->lines->count() }}
Differing lines{{ $diffCount }}

Count sheet

@foreach ($count->lines as $line) @endforeach
# Item Unit Book qty Counted qty Variance Unit cost Value
{{ $loop->iteration }} {{ $line->item?->name ?? '—' }} {{ $line->item?->unit ?? '—' }} {{ $fmt($line->book_qty) }} {{ $line->counted_qty === null ? '—' : $fmt($line->counted_qty) }} {{ $line->variance() === null ? '—' : \App\Support\Fmt::signed($line->variance()) }} {{ $money($line->item?->weighted_avg_cost ?? 0) }} {{ $money($valueAt($line)) }}
Totals {{ $fmt($count->lines->sum('book_qty')) }} {{ $fmt($count->lines->sum(fn ($l) => (float) ($l->counted_qty ?? 0))) }} {{ \App\Support\Fmt::signed($count->lines->sum(fn ($l) => $l->variance() ?? 0)) }} {{ $money($count->lines->sum($valueAt)) }}
@if ($count->status === 'Draft')

Differences posted on approval become Adjustment movements referencing {{ $count->stock_take_no }}.

@endif
Counted by
Checked by
Store keeper