FUNCIONA VENTAS (quedo horrible la vista, despues la cambio, pero anda!)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user