This commit is contained in:
Michael Robles
2024-02-02 21:30:00 -07:00
parent 76bc57c080
commit c401f0a5d4
8 changed files with 7 additions and 5 deletions
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+3 -3
View File
@@ -942,7 +942,7 @@ namespace compabetov2.database
{
try
{
string sqlCuenta = "INSERT INTO cuenta (total, fecha, estado, descripcion) VALUES(@total, @fecha, 'ACTIVO', @descripcion);";
string sqlCuenta = "INSERT INTO cuenta (total, fecha, estado, descripcion,cliente) VALUES(@total, @fecha, 'ACTIVO', @descripcion,'');";
string sqlDetalle = "INSERT INTO detalle_cuenta (fk_cuenta, fk_producto, cantidad) VALUES(@fk_cuenta, @fk_producto, @cantidad);";
string sqlIdCuenta = "SELECT idCuenta FROM cuenta ORDER BY idCuenta DESC LIMIT 1";
string sqlProductoStock = "SELECT stock FROM Producto WHERE idproducto = @idproducto";
@@ -1439,7 +1439,7 @@ namespace compabetov2.database
SQLiteCommand commandVenta = new SQLiteCommand(sqlVenta, conexion);
commandVenta.Parameters.AddWithValue("@fecha", DateTime.Now.ToString());
commandVenta.Parameters.AddWithValue("@total", envio.total);
commandVenta.Parameters.AddWithValue("@total", envio.total + 10);
commandVenta.Parameters.AddWithValue("@responzable", envio.responsable);
commandVenta.ExecuteNonQuery();
@@ -1555,7 +1555,7 @@ namespace compabetov2.database
"CREATE TABLE detalle_venta (fk_venta INTEGER, fk_producto INTEGER,cantidad INTEGER DEFAULT 0, PRIMARY KEY (fk_venta, fk_producto), " +
"FOREIGN KEY (fk_venta) REFERENCES venta(idVenta),FOREIGN KEY (fk_producto) REFERENCES producto(idproducto));",
"CREATE TABLE cuenta (idCuenta INTEGER PRIMARY KEY AUTOINCREMENT, total DECIMAL(10,2), fecha TEXT, estado TEXT DEFAULT 'ACTIVO', descripcion TEXT)",
"CREATE TABLE cuenta (idCuenta INTEGER PRIMARY KEY AUTOINCREMENT, total DECIMAL(10,2), fecha TEXT, estado TEXT DEFAULT 'ACTIVO', descripcion TEXT, cliente TEXT DEFAULT '')",
"CREATE TABLE detalle_cuenta (fk_cuenta INTEGER, fk_producto INTEGER,cantidad INTEGER, PRIMARY KEY (fk_cuenta, fk_producto), " +
"FOREIGN KEY (fk_cuenta) REFERENCES Cuenta(idCuenta),FOREIGN KEY (fk_producto) REFERENCES producto(idproducto))",
+3 -1
View File
@@ -11,12 +11,14 @@ namespace compabetov2.database.modelos
public int idVenta;
public int cantidad;
public Producto producto;
public decimal total;
public DetalleVentaModel(int cantidad, Producto producto, int id = -1)
public DetalleVentaModel(int cantidad, Producto producto, int id = -1, decimal total = 0)
{
this.cantidad = cantidad;
this.producto = producto;
this.idVenta = id;
this.total = total;
}
}
}
Binary file not shown.
Binary file not shown.