Subo cambios en plena produccion9

This commit is contained in:
Michael Robles
2024-02-02 20:40:14 -07:00
parent b109697e87
commit 253dfd3643
7 changed files with 63 additions and 1 deletions
+63 -1
View File
@@ -505,6 +505,8 @@ namespace compabetov2
MessageBox.Show("Venta hecha");
eliminarProductosTocket();
llenarLayout();
total= 0;
}
}
@@ -538,6 +540,63 @@ namespace compabetov2
}
}
private void ImprimirTicketEnvio()
{
using (PrintDocument documentoImpresion = new PrintDocument())
{
documentoImpresion.PrintPage += (sender, e) => ImprimirContenidoEnvio(e);
using (PrintDialog printDialog = new PrintDialog())
{
printDialog.Document = documentoImpresion;
if (printDialog.ShowDialog() == DialogResult.OK)
{
documentoImpresion.Print();
}
}
}
}
private void ImprimirContenidoEnvio(PrintPageEventArgs e)
{
string responsable = responsablecb.SelectedItem.ToString();
// Contenido que deseas imprimir
string contenido = " Mini Súper\n" +
" Compa BETO\n" +
" Saturnino Peña #44\n" +
" Lomas de la Laguna\n" +
" 311 169 2829\n" +
$" Fecha: {DateTime.Now.ToString("dd/MM/yyyy")}\n" +
$" Hora: {DateTime.Now.ToString("hh:mm:ss")}\n" +
$" Atendió:\n " +
$" {responsable}\n" +
$" ENVIO:\n " +
$" EN CAMINO:\n " +
"Producto | Precio | Cantidad\n" +
"------------------------------------\n";
contenido += crearContenidoImprimir();
contenido += $"------------------------------------\n" +
$" Total: ${total}\n" +
"------------------------------------\n" +
" Mini Súper\n" +
" Compa BETO\n" +
" ¡Gracias por su compra!";
// Configuración de la fuente y del área de impresión
Font fuente = new Font("Arial", 10); // Ajustar el tamaño de fuente según sea necesario
PointF posicion = new PointF(0, e.MarginBounds.Top);
// Imprimir el contenido
e.Graphics.DrawString(contenido, fuente, Brushes.Black, posicion);
}
private void ImprimirContenido(PrintPageEventArgs e)
{
@@ -566,7 +625,7 @@ namespace compabetov2
// Configuración de la fuente y del área de impresión
Font fuente = new Font("Arial", 10); // Ajustar el tamaño de fuente según sea necesario
Font fuente = new Font("Arial", 8); // Ajustar el tamaño de fuente según sea necesario
PointF posicion = new PointF(0, e.MarginBounds.Top);
// Imprimir el contenido
@@ -830,6 +889,8 @@ namespace compabetov2
MessageBox.Show("Envio hecho");
eliminarProductosTocket();
llenarLayout();
ImprimirTicketEnvio();
}
else
{
@@ -847,6 +908,7 @@ namespace compabetov2
flowLayoutPanel1.Controls.Remove(c);
}
label1.Text = "Total: 0";
txtbusqueda.Text = "";
}
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.