{{-- Stock material calculator, scoped to deliverable $di / section $si. Adds a material line with real m²/offcut via WithMaterialCalculator. The ad-hoc (off-catalogue) block is guarded on the trait exposing calcSource, so it stays dormant until Session 3 lands, then lights up automatically. --}} @php $mc = $this->materialCalc; $adHocReady = property_exists($this, 'calcSource'); @endphp
{{ __('Add material, real m², offcut & cost') }}
{{ __('Consumed') }}
{{ $this->trimNum($mc['consumed_qty']) }} {{ $mc['consumed_unit'] }}
{{ __('Offcut') }}
{{ $this->trimNum($mc['offcut_area']) }} m² ({{ number_format($mc['offcut_pct'], 0) }}%)
{{ __('Material cost') }}
{{ $baseCode }} {{ number_format($mc['material_cost'], 2) }}
{{ __('Weight') }}
{{ $mc['weight_kg'] !== null ? $mc['weight_kg'].' kg' : '—' }}
{{ $mc['note'] }}
@endif @if ((float) $mc['offcut_cost'] > 0){{ __('Offcut costs :cur :amt, what do you want to do?', ['cur' => $baseCode, 'amt' => number_format($mc['offcut_cost'], 2)]) }}
@if ($mc['remnant_reusable']){{ __('Reusable remnant, consider absorbing it.') }}
@endif{{ __('Enter a size and quantity to calculate…') }}
@endif @elseif ($adHocReady && $this->calcSource === 'adhoc') {{-- Off-catalogue material, typed name + buy price (Session 3 fields). --}}