@extends('index') @section('content')

Product Stock Requirements Report

@if(count($reportData) > 0)
@foreach($reportData as $item) @php $statusClass = ''; $statusText = ''; if ($item['total_needed'] > 0) { $statusClass = 'badge-danger'; $statusText = 'Shortage'; } elseif ($item['total_needed'] < 0) { $statusClass = 'badge-success'; $statusText = 'Surplus'; } else { $statusClass = 'badge-secondary'; $statusText = 'Balanced'; } @endphp @endforeach
Product Current Stock Unclosed PTC Confirmed Orders Total Needed Materials
{{ $item['article_no'] }}
{{ $item['product_name'] }}
{{ $item['size_name'] }} @if($item['color_name']), {{ $item['color_name'] }}@endif
{{ $item['current_stock'] }} {{ $item['unclosed_ptc'] }} {{ $item['confirmed_orders'] }} {{ $item['total_needed'] > 0 ? '+' : '' }}{{ $item['total_needed'] }}
{{ $statusText }}
@if(count($item['materials']) > 0)
    @foreach($item['materials'] as $material)
  • {{ $material->name }}: {{ $material->quantity }} {{ $material->unit_name }} @if($item['total_needed'] > 0)
    Need: {{ $material->quantity * $item['total_needed'] }} {{ $material->unit_name }} @endif
  • @endforeach
@else No materials @endif
@else
No products found matching the selected filter.
@endif
@endsection