{{ $recetas->total() }}
Total recetas
{{ $recetas->where('status','Active')->count() }}
Activas
{{ $recetas->where('status','Draft')->count() }}
Borrador
@forelse($recetas as $r) @php $pf = $r->productionFormula; $lf = $pf?->labFormula; $color = $lf?->customerColor; $curve = $r->dyeCurve; $hex = $color?->fallback_hex ?? $color?->color_hex ?? '#94A3B8'; $statusBadge = match($r->status) { 'Active' => 'badge-green', 'Archived' => 'badge-gray', default => 'badge-amber', }; @endphp
@if($color)
@endif

{{ $r->nombre }}

{{ $r->status_label }}
@if($color) 🎨 {{ $color->code }} — {{ $color->name }} @endif @if($pf) 📦 Partida: {{ $pf->partida }} · V.{{ $pf->version_number }} @endif @if($curve) 📈 Curva: {{ $curve->nombre }} @endif 🚿 Relación de baño: {{ $r->water_ratio }}:1 @if($r->emitido_por) 👤 {{ $r->emitido_por }} @endif
@if($pf && $pf->formulaItems->isNotEmpty())
Colorantes / Químicos
@foreach($pf->formulaItems as $item) @endforeach
Producto Proveedor Energía % owf
{{ $item->dyestuff?->name ?? '—' }} {{ $item->dyestuff?->supplier ?? '—' }} @if($item->dyestuff?->energy_level) {{ $item->dyestuff->energy_level }} @endif {{ number_format($item->concentration_owf, 4) }}
@elseif($pf)

Sin ítems de fórmula.

@else

Sin fórmula de producción asignada.

@endif @if($calcRecipeId === $r->id && $calcRecipe)
kg de tela
@if($calcBatchKg > 0)
@foreach($calcRecipe->productionFormula?->formulaItems ?? [] as $item) @php $totalKg = ($item->concentration_owf / 100) * $calcBatchKg; @endphp @endforeach
Producto % owf Kg tela Total (kg)
{{ $item->dyestuff?->name ?? '—' }} {{ number_format($item->concentration_owf, 4) }} {{ number_format($calcBatchKg, 1) }} {{ number_format($totalKg, 3) }} kg
@if($calcRecipe->dyeCurve && $calcRecipe->water_ratio > 0)
Agua total: {{ number_format($calcBatchKg * $calcRecipe->water_ratio, 0) }} L ({{ $calcBatchKg }} kg × {{ $calcRecipe->water_ratio }}:1)
@endif @endif
@endif @if($r->notes)
{{ $r->notes }}
@endif
@if($r->productionFormula && $r->dyeCurve) 🖨 Imprimir @endif
@empty
No hay recetas registradas.
@endforelse
{{ $recetas->links() }}
@if($showModal) @endif