@extends('pdf.layout') @section('content') @php $rows = $products->getCollection(); $n = fn ($v) => rtrim(rtrim(number_format((float) $v, 2), '0'), '.') ?: '0'; @endphp
Opening / closing: stock when the register was opened and closed on {{ $day->format('d M Y') }} (without a register that day: at the start and end of the day). "est." = worked out from the stock history.
@if($rows->count())| Product | Category | Selling price | Opening | Closing | Current stock | Total sold | Total purchased | Last sold |
|---|---|---|---|---|---|---|---|---|
| {{ $p->name }} {{ $p->sku }} |
{{ $p->category->name ?? '-' }} | {{ number_format((float) $p->selling_price, 2) }} | @foreach(['opening', 'closing'] as $when)@if($ds && $ds[$when] !== null){{ $n($ds[$when]) }}@if($ds[$when . '_estimated']) est.@endif @else - @endif | @endforeach{{ $n($p->current_stock) }} {{ $p->unit->short_name ?? '' }} | {{ $n($p->total_sold ?? 0) }} | {{ $n(($p->total_purchased ?? 0) + ($p->total_stock_in ?? 0)) }} | {{ $p->last_sold_at ? \Carbon\Carbon::parse($p->last_sold_at)->format('d M Y') : '-' }} |