{{-- ── Top bar: Back + Print ────────────────────────────── --}}
{{-- ── Document header ─────────────────────────────────── --}}

Receta de Producción

Ref #{{ $formula->id }} · v{{ $formula->version_number }} · Emitida {{ now()->format('d/m/Y') }}
{{-- ── Meta grid ────────────────────────────────────────── --}}
Nombre
{{ $formula->nombre }}
Color
{{ $formula->color?->name ?? '—' }}
Cliente
{{ $formula->color?->client ?? '—' }}
Temporada
{{ $formula->color?->season ?? '—' }}
Partida
{{ $formula->partida ?? '—' }}
Curva
{{ $formula->dyeCurve?->nombre ?? '—' }}
Relación Baño
1:{{ $formula->water_ratio ?? 10 }}
Estado
@if($formula->status === 'Approved') Aprobada @elseif($formula->status === 'Pending') Borrador @else Supersedida @endif
Emitido por
{{ $formula->emitido_por ?? '—' }}
{{-- ── Kg / Litres input (lab fills before print or writes by hand) ── --}}
Litros de baño: —
{{-- Printed version shows kg line if override set --}} @if($formula->batch_kg_override || ($batchKg ?? null)) @endif {{-- ── Notes ───────────────────────────────────────────── --}} @if($formula->notes)
Notas Laboratorio
{{ $formula->notes }}
@endif @if($formula->warehouse_notes)
Notas Almacén / Pesaje
{{ $formula->warehouse_notes }}
@endif {{-- ── Curve summary ────────────────────────────────────── --}} @if($formula->dyeCurve)
🌡 Curva: {{ $formula->dyeCurve->nombre }} {{ $formula->dyeCurve->substrateLabel }} · {{ $formula->dyeCurve->processTypeLabel }} · {{ $formula->dyeCurve->colorRangeLabel }}
@foreach($formula->dyeCurve->steps as $s) @php $abbr = match($s->tipo) { 'CALENTAMIENTO' => 'CAL', 'MANTENIMIENTO' => 'MAN', 'ENFRIAMIENTO' => 'ENF', 'LAVADO' => 'LAV', default => '?', }; @endphp
{{ $abbr }}
{{ $s->temp_inicio_c }}→{{ $s->temp_final_c }}°C @if($s->gradiente_c_min > 0) / {{ $s->gradiente_c_min }}°/min @endif / {{ $s->est_min }} min @if($s->ventana_adicion) ★ @endif
@endforeach
@php $path = $formula->dyeCurve->miniChartPath(520, 60); @endphp @if($path)
@endif
@endif {{-- ── Chemical dosing by step ──────────────────────────── --}} @php $byStep = $formula->items->groupBy('curve_step_id'); $unassigned = $byStep->get(null, collect())->merge($byStep->get('', collect())); @endphp @if($formula->items->isNotEmpty())

Formulación Química

{{-- Steps with dosing windows that have items --}} @if($formula->dyeCurve) @foreach($formula->dyeCurve->steps as $step) @php $stepItems = $byStep->get($step->id, collect()); @endphp @if($stepItems->isNotEmpty())
@php $abbr = match($step->tipo) { 'CALENTAMIENTO' => 'CAL', 'MANTENIMIENTO' => 'MAN', 'ENFRIAMIENTO' => 'ENF', 'LAVADO' => 'LAV', default => '?', }; @endphp {{ $abbr }} Paso {{ $step->orden }}: {{ $step->temp_inicio_c }}→{{ $step->temp_final_c }}°C @if($step->descripcion)· {{ $step->descripcion }}@endif
@foreach($stepItems->sortBy('add_sequence') as $item) @endforeach
Químico / Colorante Código UOM Concentración g/L (ref.) Kg (—) Notas Operador
{{ $item->dyestuff?->name ?? '—' }} {{ $item->dyestuff?->code ?? '' }} @if($item->uom === 'owf') % owf @else g/L @endif @if($item->uom === 'owf') {{ $item->concentration_pct_owf ?? '—' }}% @else {{ $item->concentration_gr_l ?? '—' }} g/L @endif {{-- If owf, g/L depends on batch kg — shown by JS --}} @if($item->uom === 'g_l') {{ $item->concentration_gr_l ?? '—' }} @else — @endif —   {{ $item->preparation_notes ?? '' }}
@endif @endforeach @endif {{-- Unassigned items --}} @if($unassigned->isNotEmpty())
N/A Sin paso asignado
@foreach($unassigned->sortBy('add_sequence') as $item) @endforeach
Químico / Colorante Código UOM Concentración Kg Notas Operador
{{ $item->dyestuff?->name ?? '—' }} {{ $item->dyestuff?->code ?? '' }} @if($item->uom === 'owf') % owf @else g/L @endif @if($item->uom === 'owf') {{ $item->concentration_pct_owf ?? '—' }}% @else {{ $item->concentration_gr_l ?? '—' }} g/L @endif — {{ $item->preparation_notes ?? '' }}
@endif @else
Sin formulación química.
@endif {{-- ── Signature blocks ────────────────────────────────── --}}
Preparado por (Laboratorio)
Revisado por (Supervisor)
Recibido por (Operador)

Generado el {{ now()->format('d/m/Y H:i') }} · INDELRUE MES · Receta #{{ $formula->id }}

{{-- /page --}}