@extends('layouts.main') @push('styles') @endpush @section('content')

Bricks Production Summary

Open vs Closed Output
@foreach ($summary as $index => $item) @php $totalOutput = (int) $item->open_output + (int) $item->closed_output; $sold = (int) ($item->sold_qty ?? 0); $current = (int) ($item->current_stock ?? ($totalOutput - $sold)); @endphp @endforeach
# Brick Type Open Stock Output Closed Stock Output Total Output Sold Current Stock
{{ $index + 1 }} {{ $item->brickType->name ?? 'Unknown' }} {{ number_format($item->open_output) }} {{ number_format($item->closed_output) }} {{ number_format($totalOutput) }} {{ number_format($sold) }} {{ number_format($current) }}

Expected vs Actual Output

@foreach ($totals as $index => $item) @php $diff = (int)$item->actual_output - (int)$item->expected_output; $class = $diff >= 0 ? 'text-success' : 'text-danger'; $prefix = $diff >= 0 ? '+' : '-'; $sold = (int) ($item->sold_qty ?? 0); $current = (int) ($item->current_stock ?? ((int)$item->actual_output - $sold)); @endphp @endforeach
# Brick Type Expected Output Actual Output Extra/Short Output Sold Current Stock
{{ $index + 1 }} {{ $item->brickType->name ?? 'Unknown' }} {{ number_format($item->expected_output) }} {{ number_format($item->actual_output) }} {{ $prefix }}{{ number_format(abs($diff)) }} {{ number_format($sold) }} {{ number_format($current) }}
@endsection