@if(!$recipe)
{{-- ── No recipe found ─────────────────────────────── --}}
@else
@php
$pf = $recipe->productionFormula;
$lf = $pf?->labFormula;
$color = $lf?->customerColor;
$curve = $recipe->dyeCurve;
$items = $pf?->formulaItems ?? collect();
$batchKg = max($batchKg, 1);
$waterL = $batchKg * $recipe->water_ratio;
$ref = $color?->reference_data ?? [];
$hex = $color?->fallback_hex ?? $color?->color_hex ?? '#6B7280';
@endphp
{{-- ── Header ─────────────────────────────────────── --}}
{{-- ── Color + production info ──────────────────── --}}
Color
Código:{{ $color?->code ?? '—' }}
Nombre:{{ $color?->name ?? '—' }}
Cliente:{{ $color?->client ?? '—' }}
Temporada:{{ $color?->season ?? '—' }}
Artículo:{{ $color?->articulo_id ?? '—' }}
@if(!empty($ref['tcx_code']))
Pantone TCX:{{ $ref['tcx_code'] }}
@endif
@if(!empty($ref['l_star']))
LAB (estándar):
L*{{ number_format($ref['l_star'],1) }} a*{{ number_format($ref['a_star']??0,1) }} b*{{ number_format($ref['b_star']??0,1) }}
@endif
Parámetros de Proceso
Fórmula Lab:{{ $lf?->version_name ?? '—' }}
Partida:{{ $pf?->partida ?? '—' }}
Versión Prod:V.{{ $pf?->version_number ?? '—' }}
Curva:{{ $curve?->nombre ?? '—' }}
Kg tela:
{{ number_format($batchKg, 2) }} kg
Relación baño:
{{ $recipe->water_ratio }}:1 → {{ number_format($waterL, 0) }} L
{{-- ── Chemical quantities ──────────────────────── --}}
Preparación de Químicos y Colorantes
@if($items->isEmpty())
Sin ítems de fórmula registrados.
@else
| # |
Colorante / Químico |
Proveedor |
Energía / Tipo |
% owf |
Total (kg) |
Despacho |
@foreach($items as $i => $item)
@php
$dye = $item->dyestuff;
$pct = $item->concentration_owf;
$totalK = ($pct / 100) * $batchKg;
$dispStr = $totalK >= 1 ? number_format($totalK, 3).' kg' : number_format($totalK * 1000, 1).' g';
@endphp
| {{ $i + 1 }} |
{{ $dye?->name ?? '—' }} |
{{ $dye?->supplier ?? '—' }} |
@if($dye?->energy_level)
{{ $dye->energy_level }}
@endif
@if($dye?->fixation_chemistry_type)
{{ $dye->fixation_chemistry_type }}
@endif
|
{{ number_format($pct, 4) }} |
{{ number_format($totalK, 4) }} |
{{ $dispStr }} |
@endforeach
{{-- Water row --}}
| — |
Agua total |
{{ $recipe->water_ratio }}:1 × {{ number_format($batchKg,2) }} kg |
{{ number_format($waterL, 0) }} L |
@endif
{{-- ── Dye curve steps ──────────────────────────── --}}
@if($curve && $curve->steps->isNotEmpty())
Perfil de Temperatura · {{ $curve->nombre }} ({{ $curve->tipo_fibra }})
| # |
Tipo |
T° Inicio |
T° Final |
Grad. °/min / Tiempo |
Adición |
Instrucciones / Notas |
@foreach($curve->steps->sortBy('orden') as $step)
@php
$prefix = substr($step->tipo, 0, 3);
$isHeat = in_array($step->tipo, ['CALENTAMIENTO','ENFRIAMIENTO']);
if ($isHeat && $step->gradiente_c_min > 0) {
$delta = abs($step->temp_final_c - $step->temp_inicio_c);
$estMin = round($delta / $step->gradiente_c_min);
} else {
$estMin = $step->tiempo_min;
}
@endphp
| {{ $step->orden }} |
{{ $step->tipo }} |
{{ $step->temp_inicio_c }}°C |
{{ $step->temp_final_c }}°C |
@if($isHeat && $step->gradiente_c_min)
{{ $step->gradiente_c_min }}°/min ≈ {{ $estMin }} min
@else
{{ $step->tiempo_min }} min
@endif
|
@if($step->ventana_adicion)
●
@else
—
@endif
|
{{ $step->descripcion ?: '' }} |
@endforeach
● = Ventana de adición de químicos
@endif
{{-- ── Notes ─────────────────────────────────────── --}}
@if($recipe->notes)
Notas de receta: {{ $recipe->notes }}
@endif
{{-- ── Signature fields ─────────────────────────── --}}
Preparado por (Laboratorio)
Verificado por (Supervisor)
{{-- ── Footer ────────────────────────────────────── --}}
MES-DYH-001 · Receta #{{ $recipe->id }} · {{ $recipe->nombre }}
Generado: {{ now()->format('d/m/Y H:i') }}
@endif {{-- end $recipe --}}