<div class="row-margin">
	<?php if( !$concesionarios->isEmpty() ): ?>
	<h3>Concesionarios que tienen esta referencia</h3>
	
	<table class="table table-striped">
		
		<tr>
			<th>Concesionario</th>
			<th>Bodega</th>
			<th>Inventario</th>
			<th>Cantidad</th>
		</tr>
		
		<?php
			foreach($concesionarios as $concesionario) {
				foreach($concesionario->bodegas as $bodega) {
					foreach($bodega->inventarios as $inventario) {
						$productos = \App\Models\InventarioDealer::consultar($producto->referencia, $producto->serial, [$inventario->id]);
						if( !$productos ) { continue; }
						foreach($productos as $producto) {
		?>
		<tr>
			<td><?php echo e($concesionario->nombre); ?></td>
			<td><?php echo e($bodega->nombre); ?></td>
			<td><?php echo e($inventario->nombre); ?></td>
			<td class="text-right"><?php echo e($producto->cantidad); ?></td>
		</tr>
		<?php
						}
					}
				}
			}
		?>
		
	</table>
	<?php else: ?>
	<div class="alert alert-warning">
		Esta referencia no fue encontrada en ning&uacute;n concesionario.
	</div>
	<?php endif; ?>
</div>