FUNCIONA VENTAS (quedo horrible la vista, despues la cambio, pero anda!)

This commit is contained in:
BryamE
2026-01-08 04:23:06 -03:00
parent 37e8f498be
commit 8f10e3595d
9 changed files with 263 additions and 236 deletions
+2 -2
View File
@@ -46,10 +46,10 @@ class SaleController extends Controller
foreach ($request->items as $item) {
$product = Product::find($item['product_id']);
$totalSale += $product->precio * $item['quantity'];
$totalSale += $product->price * $item['quantity'];
if ($product->stock_quantity < $item['quantity']) {
throw new \Exception("No hay suficiente stock de " . $product->nombre);
throw new \Exception("No hay suficiente stock de " . $product->name);
}
}