@if (! $modelo)
No hay un modelo seleccionado para calcular la estructura del costo.
@else @php $inv = (float) $valorTerneroInvernada; $alim = (float) $costoAlimentacionCab; $san = (float) $costoSanidadCab; $gscom = (float) $gastoCompraCab + (float) $gastoVentaCab; $fletes = (float) $fleteCompraCab + (float) $fleteVentaCab; $estruc = (float) $costoAmortizacionCab; $cab = max(1, (float) $capacidadEstructura); $total = $inv + $alim + $san + $gscom + $fletes + $estruc; $pct = static fn (float $v): float => $total > 0 ? ($v * 100) / $total : 0.0; $fmt = static fn (float $v): string => number_format($v, 2, ',', '.'); $subtotalInvAlim = $inv + $alim; $subtotalInvAlimPct = $pct($subtotalInvAlim); $subtotalInvAlimArs = $subtotalInvAlim * $cab; @endphp {{-- Invernada --}} {{-- Alimento + subtotal Invernada+Alimento --}} {{-- Sanidad --}} {{-- Gastos comercialización --}} {{-- Fletes --}} {{-- Estructura --}}
Estructura del costo
Invernada {{ $fmt($pct($inv)) }}%
Alimento {{ $fmt($pct($alim)) }}% {{ $fmt($subtotalInvAlimPct) }}% $ {{ $fmt($subtotalInvAlimArs) }}
Sanidad {{ $fmt($pct($san)) }}%
Gs comercialización {{ $fmt($pct($gscom)) }}%
Fletes {{ $fmt($pct($fletes)) }}%
Estructura {{ $fmt($pct($estruc)) }}%
Total Costo 100,00% $ {{ $fmt($total * $cab) }}
@endif