diff --git a/app/Http/Controllers/SaleController.php b/app/Http/Controllers/SaleController.php index d0d63b2..27fa950 100644 --- a/app/Http/Controllers/SaleController.php +++ b/app/Http/Controllers/SaleController.php @@ -34,7 +34,7 @@ class SaleController extends Controller $producto = Product::find($item['product_id']); $totalVenta += $producto->price * $item['quantity']; - if ($producto->stock < $item['quantity']) { + if ($producto->stock_quantity < $item['quantity']) { throw new \Exception("No hay suficiente stock de " . $producto->name); } }