Skip to content

Commit 2e8e324

Browse files
committed
Fix: correción de error en toma de productos
1 parent 67c58ac commit 2e8e324

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

Frontend/resources/views/inventarioviews/recetas/index.blade.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,16 @@
223223
<label class="form-label fw-bold text-muted small text-uppercase">Producto a Producir</label>
224224
<select name="idProducto" class="form-select shadow-sm p-3" style="border-radius: 12px;" required>
225225
<option value="">Seleccione el producto...</option>
226-
{{-- ✅ La API devuelve JSON array, acceder con ['clave'] no ->propiedad --}}
227226
@foreach($productos as $prod)
228-
<option value="{{ $prod['idProducto'] ?? $prod['ID_PRODUCTO'] ?? '' }}">
229-
{{ $prod['nombreProducto'] ?? $prod['NOMBRE_PRODUCTO'] ?? 'Producto sin nombre' }}
230-
</option>
227+
@php
228+
// Mapeo manual para adaptarnos a lo que envía el módulo de Productos
229+
$id = $prod['idProducto'] ?? $prod['ID_PRODUCTO'] ?? $prod['Id Producto:'] ?? null;
230+
$nombre = $prod['nombreProducto'] ?? $prod['NOMBRE_PRODUCTO'] ?? $prod['Nombre Producto:'] ?? 'Producto sin nombre';
231+
@endphp
232+
233+
@if($id)
234+
<option value="{{ $id }}">{{ $nombre }}</option>
235+
@endif
231236
@endforeach
232237
</select>
233238
</div>

0 commit comments

Comments
 (0)