version de produccion, solucion de envios y cuentas. Agregado precio de compra en variantes y signos de pesos en registroVenta

This commit is contained in:
Michael Robles
2024-07-02 15:05:34 -07:00
parent de494fc86d
commit 621c80a3b2
10 changed files with 22 additions and 13 deletions
+5 -3
View File
@@ -1056,7 +1056,7 @@ namespace compabetov2.database
try
{
string sqlCuenta = "INSERT INTO cuenta (total, fecha, estado, descripcion,cliente) VALUES(@total, @fecha, 'ACTIVO', @descripcion,@cliente);";
string sqlDetalle = "INSERT INTO detalle_cuenta (fk_cuenta, fk_variante, cantidad) VALUES(@fk_cuenta, @fk_variante, @cantidad);";
string sqlDetalle = "INSERT INTO detalle_cuenta (fk_cuenta, fk_variante, cantidad, precioVenta, precioCompra) VALUES(@fk_cuenta, @fk_variante, @cantidad,@precioVenta,@precioCompra);";
string sqlIdCuenta = "SELECT idCuenta FROM cuenta ORDER BY idCuenta DESC LIMIT 1";
string sqlProductoStock = "SELECT stock FROM Producto WHERE idproducto = @idproducto";
string sqlProductoUpdate = "UPDATE Producto SET stock = @stock WHERE idproducto = @idproducto";
@@ -1084,6 +1084,8 @@ namespace compabetov2.database
commandDetalle.Parameters.AddWithValue("@fk_cuenta", idCuenta);
commandDetalle.Parameters.AddWithValue("@fk_variante", detalleCuenta.producto.idVariante);
commandDetalle.Parameters.AddWithValue("@cantidad", detalleCuenta.cantidad);
commandDetalle.Parameters.AddWithValue("@precioVenta", detalleCuenta.producto.precio);
commandDetalle.Parameters.AddWithValue("@precioCompra", detalleCuenta.producto.precioCompra);
commandDetalle.ExecuteNonQuery();
//modificar stock
@@ -1145,7 +1147,7 @@ namespace compabetov2.database
conexion.Open();
string sql = "Select v.idVariante , v.nombre ,v.cantidad ,v.fk_producto , dc.cantidad from detalle_cuenta dc, variantes v " +
string sql = "Select v.idVariante , v.nombre ,v.cantidad ,v.fk_producto , dc.cantidad, dc.precioCompra , dc.precioVenta from detalle_cuenta dc, variantes v " +
"WHERE dc.fk_variante = v.idVariante and dc.fk_cuenta = @fk_cuenta;";
SQLiteCommand command = new SQLiteCommand(sql, conexion);
command.Parameters.AddWithValue("@fk_cuenta", idCuenta);
@@ -1525,7 +1527,7 @@ namespace compabetov2.database
conexion.Open();
string sql = "Select v.idVariante, v.nombre, v.cantidad, v.fk_producto, de.cantidad from detalle_envios de,variantes v " +
string sql = "Select v.idVariante, v.nombre, v.cantidad, v.fk_producto, de.cantidad,de.precioCompra , de.precioVenta from detalle_envios de,variantes v " +
"WHERE de.fk_variante = v.idVariante and de.fk_envios = @fk_envios;";
SQLiteCommand command = new SQLiteCommand(sql, conexion);
command.Parameters.AddWithValue("@fk_envios", idEnvio);