fix: corregir ventas y mejorar catalogos
This commit is contained in:
@@ -7,7 +7,7 @@ export class VentasService {
|
||||
throw new Error('La venta debe tener cantidades mayores que cero');
|
||||
}
|
||||
// Validar stock mínimo conceptual - se puede expandir
|
||||
return db.transaction('rw', db.ventas, db.ventaLineas, async () => {
|
||||
return db.transaction('rw', db.ventas, db.ventaLineas, db.movimientosInventario, async () => {
|
||||
for (const linea of lineas) {
|
||||
const movimientos = await db.movimientosInventario.where('productoId').equals(linea.productoId).toArray();
|
||||
const stock = movimientos.reduce((total, movimiento) => total + movimiento.cantidad, 0);
|
||||
|
||||
Reference in New Issue
Block a user