@php $equipmentLabels = $charts['by_equipment']['labels'] ?? []; $equipmentData = $charts['by_equipment']['data'] ?? []; $equipmentMax = !empty($equipmentData) ? max($equipmentData) : 0; $stackLabels = $charts['by_equipment_status']['labels'] ?? []; $stackPerformed = $charts['by_equipment_status']['performed'] ?? []; $stackPending = $charts['by_equipment_status']['pending'] ?? []; $stackRejected = $charts['by_equipment_status']['rejected'] ?? []; $trendLabels = $charts['trend_monthly']['labels'] ?? []; $trendData = $charts['trend_monthly']['data'] ?? []; $trendMax = !empty($trendData) ? max($trendData) : 0; $chartW = 335; $chartH = 205; $padL = 34; $padR = 10; $padT = 18; $padB = 32; $plotW = $chartW - $padL - $padR; $plotH = $chartH - $padT - $padB; $eqCount = max(1, count($equipmentLabels)); $eqSlot = $plotW / $eqCount; $eqBarW = $eqSlot * 0.58; $eqMax = max(1, $equipmentMax); $stackCount = max(1, count($stackLabels)); $stackSlot = $plotW / $stackCount; $stackBarW = $stackSlot * 0.58; $stackTotals = []; foreach ($stackLabels as $i => $label) { $stackTotals[] = (int) ($stackPerformed[$i] ?? 0) + (int) ($stackPending[$i] ?? 0) + (int) ($stackRejected[$i] ?? 0); } $stackMaxVal = max(1, !empty($stackTotals) ? max($stackTotals) : 0); $lineCount = max(1, count($trendData)); $lineMax = max(1, $trendMax); $linePoints = []; foreach ($trendData as $i => $value) { $x = $padL + ($lineCount > 1 ? ($i * ($plotW / ($lineCount - 1))) : ($plotW / 2)); $y = $padT + $plotH - (((int) $value / $lineMax) * $plotH); $linePoints[] = ['x' => $x, 'y' => $y, 'value' => (int) $value]; } @endphp

Reporte de Producción

Periodo: {{ $period }}
Muestras asignadas{{ $summary['assigned'] ?? 0 }}
Muestras realizadas{{ $summary['performed'] ?? 0 }}
Muestras pendientes{{ $summary['pending'] ?? 0 }}
Muestras rechazadas{{ $summary['rejected'] ?? 0 }}
Muestras sin datos{{ $summary['without_data'] ?? 0 }}
Producción por equipo
@if(!empty($chartImages['by_equipment'])) Producción por equipo @else @for($i = 0; $i <= 5; $i++) @php $y = $padT + ($i * ($plotH / 5)); $tickValue = (int) round($eqMax - (($eqMax / 5) * $i)); @endphp {{ $tickValue }} @endfor @foreach($equipmentLabels as $i => $label) @php $value = (int) ($equipmentData[$i] ?? 0); $barHeight = ($value / $eqMax) * $plotH; $x = $padL + ($eqSlot * $i) + (($eqSlot - $eqBarW) / 2); $y = $padT + $plotH - $barHeight; $shortLabel = \Illuminate\Support\Str::limit($label, 6, ''); @endphp {{ $shortLabel }} @endforeach Producción @endif
Realizadas vs Pendientes vs Rechazadas
@if(!empty($chartImages['by_equipment_status'])) Realizadas vs Pendientes vs Rechazadas @else @for($i = 0; $i <= 5; $i++) @php $y = $padT + ($i * ($plotH / 5)); $tickValue = (int) round($stackMaxVal - (($stackMaxVal / 5) * $i)); @endphp {{ $tickValue }} @endfor @foreach($stackLabels as $i => $label) @php $performed = (int) ($stackPerformed[$i] ?? 0); $pending = (int) ($stackPending[$i] ?? 0); $rejected = (int) ($stackRejected[$i] ?? 0); $hPerformed = ($performed / $stackMaxVal) * $plotH; $hPending = ($pending / $stackMaxVal) * $plotH; $hRejected = ($rejected / $stackMaxVal) * $plotH; $x = $padL + ($stackSlot * $i) + (($stackSlot - $stackBarW) / 2); $yBase = $padT + $plotH; $shortLabel = \Illuminate\Support\Str::limit($label, 6, ''); @endphp @if($hPerformed > 0) @endif @if($hPending > 0) @endif @if($hRejected > 0) @endif {{ $shortLabel }} @endforeach Realizadas Pendientes Rechazadas @endif
Tendencia de producción por mes
@if(!empty($chartImages['trend_monthly'])) Tendencia de producción por mes @else @for($i = 0; $i <= 5; $i++) @php $y = $padT + ($i * ($plotH / 5)); $tickValue = (int) round($lineMax - (($lineMax / 5) * $i)); @endphp {{ $tickValue }} @endfor @if(count($linePoints) > 0) @foreach($linePoints as $point) @endforeach @endif @foreach($trendLabels as $i => $label) @php $x = $padL + (count($trendLabels) > 1 ? ($i * ($plotW / (count($trendLabels) - 1))) : ($plotW / 2)); @endphp {{ $label }} @endforeach Producción @endif

Desglose por equipo

@forelse($byEquipment as $item) @empty @endforelse
Equipo Realizadas Pendientes Rechazadas Total
{{ $item['equipment'] }} {{ $item['performed'] }} {{ $item['pending'] }} {{ $item['rejected'] }} {{ $item['total'] }}
Sin datos para los filtros seleccionados.

Detalle

@forelse($details as $detail) @empty @endforelse
Fecha Empleado Equipo Código muestra Estado
{{ $detail['fecha'] }} {{ $detail['empleado'] }} {{ $detail['equipo'] }} {{ $detail['codigo_muestra'] }} {{ $detail['estado'] }}
Sin registros en el periodo consultado.