@extends('layout.app') @section('title', 'Stock Items Summary') @push('header_script') @endpush @section('content')
Category Summary: {{ $categoryName }}
As on Date: {{ date('d-M-Y', strtotime($asOfDate)) }}
@php $grandTotalValue = 0; $unitsUsed = []; $totalQty = 0; @endphp @forelse($items as $item) @php $grandTotalValue += $item['value']; $totalQty += $item['qty']; $unitName = strtolower(trim($item['units'])); if (!in_array($unitName, $unitsUsed)) { $unitsUsed[] = $unitName; } @endphp @empty @endforelse
Particulars Quantity Rate Value
{{ $item['product_name'] }} {{ number_format($item['qty'], 2) }} {{ $item['units'] }} {{ number_format($item['rate'], 2) }} {{ number_format($item['value'], 2) }}
No Stock Items Available
Grand Total @if(count($unitsUsed) === 1 && count($items) > 0) {{ number_format($totalQty, 2) }} {{ strtoupper(reset($unitsUsed)) }} @endif {{ number_format($grandTotalValue, 2) }}
@endsection @push('footer_script') @endpush