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
+1 -5
View File
@@ -1,10 +1,6 @@
{ {
"ExpandedNodes": [ "ExpandedNodes": [
"", ""
"\\admin",
"\\Empleados",
"\\Ventas"
], ],
"SelectedNode": "\\admin\\crud.cs",
"PreviewInSolutionExplorer": false "PreviewInSolutionExplorer": false
} }
Binary file not shown.
+14 -6
View File
@@ -415,16 +415,24 @@ namespace compabetov2
private void btnVentasDia_Click(object sender, EventArgs e) private void btnVentasDia_Click(object sender, EventArgs e)
{ {
RegistroVentas ventana = new RegistroVentas(resumen["dia"],this); if(resumen != null)
ventana.Owner = this; {
ventana.Show(); RegistroVentas ventana = new RegistroVentas(resumen["dia"], this);
ventana.Owner = this;
ventana.Show();
}
} }
private void btnVentasMes_Click(object sender, EventArgs e) private void btnVentasMes_Click(object sender, EventArgs e)
{ {
RegistroVentas ventana = new RegistroVentas(resumen["mes"], this); if(resumen != null)
ventana.Owner = this; {
ventana.Show(); RegistroVentas ventana = new RegistroVentas(resumen["mes"], this);
ventana.Owner = this;
ventana.Show();
}
} }
private void lbTotalDia_Click(object sender, EventArgs e) private void lbTotalDia_Click(object sender, EventArgs e)
+2 -1
View File
@@ -98,11 +98,12 @@
this.pictureBox1.BackColor = System.Drawing.Color.Transparent; this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.pictureBox1.Image = global::compabetov2.Properties.Resources.cancel1; this.pictureBox1.Image = global::compabetov2.Properties.Resources.cancel1;
this.pictureBox1.Location = new System.Drawing.Point(3, 2); this.pictureBox1.Location = new System.Drawing.Point(777, 105);
this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(112, 77); this.pictureBox1.Size = new System.Drawing.Size(112, 77);
this.pictureBox1.TabIndex = 23; this.pictureBox1.TabIndex = 23;
this.pictureBox1.TabStop = false; this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click_1);
// //
// RegistroVentas // RegistroVentas
// //
+10
View File
@@ -168,5 +168,15 @@ namespace compabetov2
{ {
Close(); Close();
} }
private void button2_Click(object sender, EventArgs e)
{
Close();
}
private void pictureBox1_Click_1(object sender, EventArgs e)
{
Close();
}
} }
} }
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+6 -2
View File
@@ -1239,7 +1239,7 @@ namespace compabetov2.database
try try
{ {
string sqlVenta = "INSERT INTO venta (fecha, total) VALUES(@fecha, @total);"; 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 sqlCuenta = "UPDATE cuenta SET estado ='SALDADO' WHERE idCuenta = @idCuenta;";
string sqlIdVenta = "SELECT idVenta FROM venta ORDER BY idVenta DESC LIMIT 1"; 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)"; 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("@idVenta", idVenta);
commandEmpleado.Parameters.AddWithValue("@fk_variante", detalleCuenta.producto.idVariante); commandEmpleado.Parameters.AddWithValue("@fk_variante", detalleCuenta.producto.idVariante);
commandEmpleado.Parameters.AddWithValue("@cantidada", detalleCuenta.cantidad); commandEmpleado.Parameters.AddWithValue("@cantidada", detalleCuenta.cantidad);
commandEmpleado.Parameters.AddWithValue("@precioCompra", detalleCuenta.producto.precioCompra);
commandEmpleado.Parameters.AddWithValue("@precioVenta", detalleCuenta.producto.precio);
commandEmpleado.ExecuteNonQuery(); commandEmpleado.ExecuteNonQuery();
} }
@@ -1697,7 +1699,7 @@ namespace compabetov2.database
try try
{ {
string sqlVenta = "INSERT INTO venta (fecha, total,responzable) VALUES(@fecha, @total,@responzable);"; 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 sqlEnvio = "UPDATE envios SET estado ='CONCLUIDO' WHERE idEnvios = @idEnvios;";
string sqlIdVenta = "SELECT idVenta FROM venta ORDER BY idVenta DESC LIMIT 1"; string sqlIdVenta = "SELECT idVenta FROM venta ORDER BY idVenta DESC LIMIT 1";
string sqlStock = "select stock from Producto p where idproducto = @idProducto"; 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("@idVenta", idVenta);
commandEmpleado.Parameters.AddWithValue("@fk_variante", detalleEnvio.producto.idVariante); commandEmpleado.Parameters.AddWithValue("@fk_variante", detalleEnvio.producto.idVariante);
commandEmpleado.Parameters.AddWithValue("@cantidada", detalleEnvio.cantidad); commandEmpleado.Parameters.AddWithValue("@cantidada", detalleEnvio.cantidad);
commandEmpleado.Parameters.AddWithValue("@precioCompra", detalleEnvio.producto.precioCompra);
commandEmpleado.Parameters.AddWithValue("@precioVenta", detalleEnvio.producto.precio);
commandEmpleado.ExecuteNonQuery(); commandEmpleado.ExecuteNonQuery();
//actualizar stock //actualizar stock
Binary file not shown.
@@ -1 +1 @@
7667a5999934c1a74b47acd40b7c90e3bc381844d0d29d1440ec77954ef70622 6a22a36c0265b88bc3f6a8149bb506605fc8ddf4703d40c20fff9c23a270cc8f
@@ -169,3 +169,14 @@ C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.RegistroVentas.res
C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.RegistroVentas.resources C:\Users\Googl\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.RegistroVentas.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.admin.visualizarImportes.resources C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.admin.visualizarImportes.resources
C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.admin.AgregarImporte.resources C:\Users\carsu\source\repos\compabetoOG\obj\Debug\compabetov2.admin.AgregarImporte.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.addvariante.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.AgregarImporte.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.agregarproducto.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.crud.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.editar.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.editarvariante.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.Variantes.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.admin.visualizarImportes.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.RegistroVentas.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.Ventas.Importe.resources
C:\Users\compa\Source\Repos\aspermaster23yeh\compabetoOG\obj\Debug\compabetov2.Ventas.Importe1.resources
Binary file not shown.
Binary file not shown.
Binary file not shown.