arreglado bug de no agregar precios en saldar cuenta y conlcuir envio

This commit is contained in:
Michael Robles
2024-07-02 14:08:39 -07:00
parent eb59d05294
commit de494fc86d
15 changed files with 45 additions and 15 deletions
+6 -2
View File
@@ -1239,7 +1239,7 @@ namespace compabetov2.database
try
{
string sqlVenta = "INSERT INTO venta (fecha, total) VALUES(@fecha, @total);";
string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_variante, cantidad) VALUES(@idVenta, @fk_variante, @cantidada);";
string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_variante, cantidad, precioCompra, precioVenta) VALUES(@idVenta, @fk_variante, @cantidada,@precioCompra,@precioVenta);";
string sqlCuenta = "UPDATE cuenta SET estado ='SALDADO' WHERE idCuenta = @idCuenta;";
string sqlIdVenta = "SELECT idVenta FROM venta ORDER BY idVenta DESC LIMIT 1";
string sqlImporte = "INSERT INTO detalle_importe (fk_importe,cantidad,precio,fk_venta) VALUES (@fk_importe,@cantidad,@precio,@fk_venta)";
@@ -1269,6 +1269,8 @@ namespace compabetov2.database
commandEmpleado.Parameters.AddWithValue("@idVenta", idVenta);
commandEmpleado.Parameters.AddWithValue("@fk_variante", detalleCuenta.producto.idVariante);
commandEmpleado.Parameters.AddWithValue("@cantidada", detalleCuenta.cantidad);
commandEmpleado.Parameters.AddWithValue("@precioCompra", detalleCuenta.producto.precioCompra);
commandEmpleado.Parameters.AddWithValue("@precioVenta", detalleCuenta.producto.precio);
commandEmpleado.ExecuteNonQuery();
}
@@ -1697,7 +1699,7 @@ namespace compabetov2.database
try
{
string sqlVenta = "INSERT INTO venta (fecha, total,responzable) VALUES(@fecha, @total,@responzable);";
string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_variante, cantidad) VALUES(@idVenta, @fk_variante, @cantidada);";
string sqlDetalle = "INSERT INTO detalle_venta (fk_venta, fk_variante, cantidad, precioCompra, precioVenta) VALUES(@idVenta, @fk_variante, @cantidada,@precioCompra,@precioVenta);";
string sqlEnvio = "UPDATE envios SET estado ='CONCLUIDO' WHERE idEnvios = @idEnvios;";
string sqlIdVenta = "SELECT idVenta FROM venta ORDER BY idVenta DESC LIMIT 1";
string sqlStock = "select stock from Producto p where idproducto = @idProducto";
@@ -1726,6 +1728,8 @@ namespace compabetov2.database
commandEmpleado.Parameters.AddWithValue("@idVenta", idVenta);
commandEmpleado.Parameters.AddWithValue("@fk_variante", detalleEnvio.producto.idVariante);
commandEmpleado.Parameters.AddWithValue("@cantidada", detalleEnvio.cantidad);
commandEmpleado.Parameters.AddWithValue("@precioCompra", detalleEnvio.producto.precioCompra);
commandEmpleado.Parameters.AddWithValue("@precioVenta", detalleEnvio.producto.precio);
commandEmpleado.ExecuteNonQuery();
//actualizar stock