Пример #1
0
        public void Imprimir()
        {
            string  cliente   = "";
            string  direccion = "";
            string  nroDoc    = "";
            string  mesa      = "";
            string  salon     = "";
            string  tel       = "";
            string  fecha     = "";
            decimal totalDcto = 00.00m;


            this.dataDetalle.DataSource = NVenta.reporteDetalleVenta(Convert.ToInt32(this.lblIdVenta.Text));

            for (int i = 0; i < dataDetalle.Rows.Count; i++)
            {
                totalDcto = totalDcto + Convert.ToInt32(dataDetalle.Rows[i].Cells[4].Value);
                dataDetalle.Columns[6].DefaultCellStyle.Format = "N2";
            }


            decimal subTotal  = Convert.ToDecimal(this.lblTotalVenta.Text) - Convert.ToDecimal(this.lblIgv.Text);
            decimal efectivo1 = 00.00m;

            if (this.lblForma.Text == "EFECTIVO")
            {
                efectivo1 = Convert.ToDecimal(this.lblTotalVenta.Text) + Convert.ToDecimal(this.lblVuelto.Text);
            }
            else if (this.lblForma.Text == "TARJETA")
            {
                efectivo1 = 00.00m;
            }
            else if (this.lblForma.Text == "MIXTO")
            {
                efectivo1 = Convert.ToDecimal(this.lblEfectivo.Text);
            }

            if (lblComprobante.Text == "FACTURA MANUAL" || lblComprobante.Text == "BOLETA MANUAL")
            {
                NImprimir_Comprobante.imprimirComRepetidoManual(this.lblSerie.Text, this.lblNumero.Text, this.lblComprobante.Text, cliente, direccion, nroDoc, salon, mesa, dataDetalle, totalDcto.ToString(), this.lblDcto.Text,
                                                                subTotal.ToString(), this.lblIgv.Text, this.lblTotalVenta.Text, efectivo1.ToString(),
                                                                this.lblTarjeta.Text, this.lblForma.Text, "Detallado", this.lblRedondeo.Text, tel, lblVuelto.Text, DateTime.Now.ToString());
                this.dataListado.ClearSelection();
            }
            else
            {
                NImprimir_Comprobante.imprimirComRepetido(this.lblNumero.Text, this.lblComprobante.Text, lblCliente.Text, lblDireccion.Text, nroDoc, salon, mesa, dataDetalle, totalDcto.ToString(),
                                                          this.lblDcto.Text, subTotal.ToString(), this.lblIgv.Text, this.lblTotalVenta.Text, efectivo1.ToString(),
                                                          this.lblTarjeta.Text, this.lblForma.Text, "Detallado", this.lblRedondeo.Text, tel, lblVuelto.Text, lblFechaGene.Text,
                                                          frmPrincipal.f1.lblUsuario.Text + frmPrincipal.f1.lblApellidos.Text, NAliento.MensajeAliento(), lblAdelanto.Text, lblSaldo.Text);
                this.dataListado.ClearSelection();
            }
        }
Пример #2
0
        public void Imprimir()
        {
            DataTable dtCliente = NVenta.mostrarClienteVenta(Convert.ToInt32(this.lblIdVenta.Text));
            string    cliente   = "";
            string    direccion = "";
            string    nroDoc    = "";
            string    mesa      = "";
            string    salon     = "";
            string    tel       = "";
            string    fecha     = "";
            decimal   totalDcto = 00.00m;

            if (dtCliente.Rows.Count == 1)
            {
                cliente = "PUBLICO GENERAL";
                mesa    = dtCliente.Rows[0][0].ToString();
                salon   = dtCliente.Rows[0][1].ToString();
                fecha   = dtCliente.Rows[0][2].ToString();
            }
            else
            {
                cliente   = dtCliente.Rows[0][0].ToString();
                direccion = dtCliente.Rows[0][1].ToString();
                nroDoc    = dtCliente.Rows[0][2].ToString();
                tel       = dtCliente.Rows[0][3].ToString();
                mesa      = dtCliente.Rows[1][0].ToString();
                salon     = dtCliente.Rows[1][1].ToString();
                fecha     = dtCliente.Rows[1][4].ToString();
            }

            this.dataDetalle.DataSource = NVenta.reporteDetalleVenta(Convert.ToInt32(this.lblIdVenta.Text));
            for (int i = 0; i < dataDetalle.Rows.Count; i++)
            {
                totalDcto = totalDcto + Convert.ToInt32(dataDetalle.Rows[i].Cells[4].Value);
            }

            decimal subTotal  = Convert.ToDecimal(this.lblTotalVenta.Text) - Convert.ToDecimal(this.lblIgv.Text);
            decimal efectivo1 = 00.00m;

            if (this.lblForma.Text == "EFECTIVO")
            {
                efectivo1 = Convert.ToDecimal(this.lblTotalVenta.Text) + Convert.ToDecimal(this.lblVuelto.Text);
            }
            else if (this.lblForma.Text == "TARJETA")
            {
                efectivo1 = 00.00m;
            }
            else if (this.lblForma.Text == "MIXTO")
            {
                efectivo1 = Convert.ToDecimal(this.lblEfectivo.Text);
            }

            if (lblComprobante.Text == "FACTURA MANUAL" || lblComprobante.Text == "BOLETA MANUAL")
            {
                NImprimir_Comprobante.imprimirComRepetidoManual(this.lblSerie.Text, this.lblNumero.Text, this.lblComprobante.Text, cliente, direccion, nroDoc, salon, mesa, dataDetalle, totalDcto.ToString(), this.lblDcto.Text,
                                                                subTotal.ToString(), this.lblIgv.Text, this.lblTotalVenta.Text, efectivo1.ToString(),
                                                                this.lblTarjeta.Text, this.lblForma.Text, "Detallado", this.lblRedondeo.Text, tel, lblVuelto.Text, DateTime.Now.ToString());
                this.dataListado.ClearSelection();
            }
            else
            {
                NImprimir_Comprobante.imprimirComRepetido(this.lblNumero.Text, this.lblComprobante.Text, cliente, direccion, nroDoc, salon, mesa, dataDetalle, totalDcto.ToString(), this.lblDcto.Text,
                                                          subTotal.ToString(), this.lblIgv.Text, this.lblTotalVenta.Text, efectivo1.ToString(),
                                                          this.lblTarjeta.Text, this.lblForma.Text, "Detallado", this.lblRedondeo.Text, tel, lblVuelto.Text, DateTime.Now.ToString(), frmPrincipal.f1.lblUsuario.Text + frmPrincipal.f1.lblApellidos.Text);
                this.dataListado.ClearSelection();
            }
        }