From eb59d052945dc0e1dd300c33dc17c67e01ef33ba Mon Sep 17 00:00:00 2001 From: Michael Robles Date: Tue, 2 Jul 2024 13:48:42 -0700 Subject: [PATCH] subo cambiosvineconsefe1 --- RegistroVentas.Designer.cs | 4 ++-- Ventas/datosEnvio.cs | 14 +++++++++++--- Ventas/vender.cs | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/RegistroVentas.Designer.cs b/RegistroVentas.Designer.cs index a1ad558..2d5e92a 100644 --- a/RegistroVentas.Designer.cs +++ b/RegistroVentas.Designer.cs @@ -98,9 +98,9 @@ this.pictureBox1.BackColor = System.Drawing.Color.Transparent; this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.pictureBox1.Image = global::compabetov2.Properties.Resources.cancel1; - this.pictureBox1.Location = new System.Drawing.Point(746, 101); + this.pictureBox1.Location = new System.Drawing.Point(3, 2); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(100, 69); + this.pictureBox1.Size = new System.Drawing.Size(112, 77); this.pictureBox1.TabIndex = 23; this.pictureBox1.TabStop = false; // diff --git a/Ventas/datosEnvio.cs b/Ventas/datosEnvio.cs index f3d953f..ea04b77 100644 --- a/Ventas/datosEnvio.cs +++ b/Ventas/datosEnvio.cs @@ -98,7 +98,7 @@ namespace compabetov2.Ventas } - private void ImprimirContenidoEnvio(PrintPageEventArgs e) + private void ImprimirContenidoEnvio(PrintPageEventArgs e, int paginasImpresas) { string responsable = envio.responsable; @@ -163,11 +163,19 @@ namespace compabetov2.Ventas return direccion; // Devuelve la dirección sin cambios si no es necesario ajustarla } - public void ImprimirTicketEnvio() + private void ImprimirTicketEnvio() { using (PrintDocument documentoImpresion = new PrintDocument()) { - documentoImpresion.PrintPage += (sender, e) => ImprimirContenidoEnvio(e); + int paginasImpresas = 0; + + documentoImpresion.PrintPage += (sender, e) => + { + ImprimirContenidoEnvio(e, paginasImpresas); + paginasImpresas++; + e.HasMorePages = paginasImpresas < 2; // Indica que hay más páginas por imprimir + }; + using (PrintDialog printDialog = new PrintDialog()) { printDialog.Document = documentoImpresion; diff --git a/Ventas/vender.cs b/Ventas/vender.cs index c7e3485..2f45104 100644 --- a/Ventas/vender.cs +++ b/Ventas/vender.cs @@ -661,8 +661,8 @@ namespace compabetov2 // Incrementa el número de página numeroPagina++; - // Imprime solo dos páginas - if (numeroPagina <= 2) + // Imprime solo 1 página + if (numeroPagina <= 1) { e.HasMorePages = true; }