@php use App\Support\GrnGradeCatalog; use App\Support\PaymentVoucherModes; $voucherModes = $voucherModes ?? PaymentVoucherModes::all(); $mode = $mode ?? 'full'; $voucherMode = $voucherMode ?? PaymentVoucherModes::get($mode); $allowedModes = $allowedModes ?? array_keys($voucherModes); $activeGrades = $activeGrades ?? []; @endphp
@foreach($voucherModes as $key => $meta) @php $isAllowed = in_array($key, $allowedModes, true); $isActive = $mode === $key; $disabledTitle = 'Not available for this GRN'; if (! $isAllowed && ($requiresGradedPurchase ?? false)) { $labels = collect($allowedModes) ->map(fn ($k) => $voucherModes[$k]['label'] ?? $k) ->implode(' or '); $disabledTitle = 'This GRN has graded coffee across multiple screens. Use '.$labels.'.'; } @endphp @if($isAllowed) {{ $meta['label'] }} @else @endif @endforeach