private void formatearFactura(String qr)
        {
            objListNotaReporte  = new List <NotaReporteDTO>();
            objListDocumentoDet = objDocumentoDao.detalleReporte(objDocumentoCab.DocumentoCabSerie,
                                                                 objDocumentoCab.DocumentoCabNro, Ventas.UNIDADNEGOCIO);
            if (objListDocumentoDet.Count > 0)
            {
                for (int i = 0; i < objListDocumentoDet.Count; i++)
                {
                    objNotaReporte               = new NotaReporteDTO();
                    objNotaReporte.Cantidad      = objListDocumentoDet[i].DocumentoDetCantidad.ToString("C").Substring(3);
                    objNotaReporte.Direccion     = objDocumentoCab.DocumentoCabClienteDireccion;
                    objNotaReporte.FechaEmision  = objDocumentoCab.DocumentoCabFecha.ToShortDateString();
                    objNotaReporte.SerieRef      = objDocumentoCab.DocumentoCabSerieRef;
                    objNotaReporte.NumeroRef     = objDocumentoCab.DocumentoCabNroRef;
                    objNotaReporte.FechaRef      = objDocumentoCab.DocumentoCabFechaDocRef.ToShortDateString();
                    objNotaReporte.IGV           = objDocumentoCab.DocumentoCabIGV.ToString("C").Substring(3);
                    objNotaReporte.Letras        = objDocumentoDao.numeroALetras(convertToDouble(objDocumentoCab.DocumentoCabTotal.ToString())) + " " + objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                    objNotaReporte.Moneda        = objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                    objNotaReporte.Numero        = objDocumentoCab.DocumentoCabNro.TrimEnd();
                    objNotaReporte.Serie         = objDocumentoCab.DocumentoCabSerie;
                    objNotaReporte.Qr            = qr;
                    objNotaReporte.Tipo          = "la Nota de Débito Electrónica";
                    objNotaReporte.Descripcion   = objDocumentoCab.DocumentoCabGlosa.TrimEnd();
                    objNotaReporte.TOTAL         = objDocumentoCab.DocumentoCabTotal.ToString("C").Substring(3);
                    objNotaReporte.TotalSinIGV   = objDocumentoCab.DocumentoCabTotalSinIGV.ToString("C").Substring(3);
                    objNotaReporte.UM            = objListDocumentoDet[i].DocumentoProdUMcorta;
                    objNotaReporte.ValorUnitario = objListDocumentoDet[i].DocumentoDetPrecioSinIGV.ToString("C").Substring(3);
                    objNotaReporte.Importe       = objListDocumentoDet[i].DocumentoDetSubTotal.ToString("C").Substring(3);
                    objNotaReporte.Descr         = objListDocumentoDet[i].DocumentoDesProducto.TrimEnd() + " - " + objListDocumentoDet[i].DocumentoDetGlosa.TrimEnd();
                    objNotaReporte.RazonSocial   = objDocumentoCab.DocumentoCabCliente;
                    objNotaReporte.RUC           = objDocumentoCab.DocumentoCabClienteDocumento;
                    objNotaReporte.Motivo        = objDocumentoCab.DocumentoCabNotaDebito;
                    objNotaReporte.TipoDocumento = "NOTA DE DÉBITO";
                    objNotaReporte.TipoCambio    = objMoneda.getTipoCambioVenta(objNotaReporte.FechaEmision).ToString().PadRight(5, '0');

                    if (objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                    {
                        objNotaReporte.Simbolo = "$";
                    }
                    else
                    {
                        objNotaReporte.Simbolo = "S/";
                    }
                    objListNotaReporte.Add(objNotaReporte);
                }
            }
            else
            {
                objNotaReporte = new NotaReporteDTO();

                objNotaReporte.Direccion    = objDocumentoCab.DocumentoCabClienteDireccion;
                objNotaReporte.FechaEmision = objDocumentoCab.DocumentoCabFecha.ToShortDateString();
                objNotaReporte.SerieRef     = objDocumentoCab.DocumentoCabSerieRef;
                objNotaReporte.NumeroRef    = objDocumentoCab.DocumentoCabNroRef;
                objNotaReporte.FechaRef     = objDocumentoCab.DocumentoCabFechaDocRef.ToShortDateString();
                objNotaReporte.IGV          = objDocumentoCab.DocumentoCabIGV.ToString("C").Substring(3);
                objNotaReporte.Letras       = objDocumentoDao.numeroALetras(convertToDouble(objDocumentoCab.DocumentoCabTotal.ToString())) + " " + objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                objNotaReporte.Moneda       = objDocumentoCab.DocumentoCabMoneda.TrimEnd();
                objNotaReporte.Numero       = objDocumentoCab.DocumentoCabNro.TrimEnd();
                objNotaReporte.Serie        = objDocumentoCab.DocumentoCabSerie;
                objNotaReporte.Descripcion  = objDocumentoCab.DocumentoCabGlosa.TrimEnd();
                objNotaReporte.TOTAL        = objDocumentoCab.DocumentoCabTotal.ToString("C").Substring(3);
                objNotaReporte.TotalSinIGV  = objDocumentoCab.DocumentoCabTotalSinIGV.ToString("C").Substring(3);
                objNotaReporte.Motivo       = objDocumentoCab.DocumentoCabNotaDebito;
                objNotaReporte.Tipo         = "la Nota de Débito Electrónica";
                objNotaReporte.RazonSocial  = objDocumentoCab.DocumentoCabCliente;
                objNotaReporte.RUC          = objDocumentoCab.DocumentoCabClienteDocumento;

                objNotaReporte.TipoDocumento = "NOTA DE CRÉDITO";
                if (objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                {
                    objNotaReporte.Simbolo = "$";
                }
                else
                {
                    objNotaReporte.Simbolo = "S/";
                }
                objListNotaReporte.Add(objNotaReporte);
            }
        }
        private void formatearFactura(String qr)
        {
            objListNotaReporte = new List <NotaReporteDTO>();
            if (objListDocumentoDet.Count > 0)
            {
                for (int i = 0; i < objListDocumentoDet.Count; i++)
                {
                    objNotaReporte               = new NotaReporteDTO();
                    objNotaReporte.Cantidad      = objListDocumentoDet[i].DocumentoDetCantidad.ToString("C").Substring(3);
                    objNotaReporte.Direccion     = txt_Direccion.Text;
                    objNotaReporte.FechaEmision  = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabFecha.ToShortDateString();
                    objNotaReporte.SerieRef      = txt_SerieBuscar.Text;
                    objNotaReporte.NumeroRef     = txt_NumeroBuscar.Text;
                    objNotaReporte.FechaRef      = dpck_Fechadcto.Value.ToShortDateString();
                    objNotaReporte.IGV           = txt_IGV.Text;
                    objNotaReporte.Letras        = lblTotal.Text.TrimEnd();
                    objNotaReporte.Moneda        = txt_Moneda.Text.TrimEnd();
                    objNotaReporte.Numero        = txt_Numero.Text.TrimEnd();
                    objNotaReporte.Serie         = txt_Serie.Text;
                    objNotaReporte.Motivo        = txt_Motivo.Text;
                    objNotaReporte.TOTAL         = txt_TotalsinPercep.Text;
                    objNotaReporte.TotalSinIGV   = txt_ValorVenta.Text;
                    objNotaReporte.UM            = objListDocumentoDet[i].DocumentoProdUMcorta;
                    objNotaReporte.ValorUnitario = objListDocumentoDet[i].DocumentoDetPrecioSinIGV.ToString("C").Substring(3);
                    objNotaReporte.Importe       = objListDocumentoDet[i].DocumentoDetSubTotal.ToString("C").Substring(3);
                    objNotaReporte.Descr         = objListDocumentoDet[i].DocumentoDetGlosa.TrimEnd();
                    objNotaReporte.RazonSocial   = txt_Cliente.Text;
                    objNotaReporte.RUC           = txt_Ruc.Text;
                    objNotaReporte.Tipo          = "la Nota de Débito Electrónica";
                    objNotaReporte.Qr            = qr;
                    objNotaReporte.Descripcion   = txt_GlosaCab.Text;
                    objNotaReporte.TipoDocumento = tipoDocumento;
                    objNotaReporte.TipoCambio    = objMoneda.getTipoCambioVenta(objNotaReporte.FechaEmision).ToString().PadRight(5, '0');

                    if (ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                    {
                        objNotaReporte.Simbolo = "$";
                    }
                    else
                    {
                        objNotaReporte.Simbolo = "S/";
                    }
                    objListNotaReporte.Add(objNotaReporte);
                }
            }
            else
            {
                objNotaReporte = new NotaReporteDTO();

                objNotaReporte.Direccion     = txt_Direccion.Text;
                objNotaReporte.FechaEmision  = ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabFecha.ToShortDateString();
                objNotaReporte.IGV           = txt_IGV.Text;
                objNotaReporte.Letras        = lblTotal.Text.TrimEnd();
                objNotaReporte.Moneda        = txt_Moneda.Text.TrimEnd();
                objNotaReporte.Numero        = txt_Numero.Text.TrimEnd();
                objNotaReporte.Serie         = txt_Serie.Text;
                objNotaReporte.TOTAL         = txt_TotalsinPercep.Text;
                objNotaReporte.TotalSinIGV   = txt_ValorVenta.Text;
                objNotaReporte.RazonSocial   = txt_Cliente.Text;
                objNotaReporte.RUC           = txt_Ruc.Text;
                objNotaReporte.Descripcion   = txt_GlosaCab.Text;
                objNotaReporte.SerieRef      = txt_SerieBuscar.Text;
                objNotaReporte.NumeroRef     = txt_NumeroBuscar.Text;
                objNotaReporte.FechaRef      = dpck_Fechadcto.Value.ToShortDateString();
                objNotaReporte.Motivo        = txt_Motivo.Text;
                objNotaReporte.Tipo          = "la Nota de Débito Electrónica";
                objNotaReporte.Qr            = qr;
                objNotaReporte.TipoDocumento = tipoDocumento;
                if (ReporteDocumentosPorFecha.objDocumentoCab.DocumentoCabTipoMoneda == "USD")
                {
                    objNotaReporte.Simbolo = "$";
                }
                else
                {
                    objNotaReporte.Simbolo = "S/";
                }
                objListNotaReporte.Add(objNotaReporte);
            }
        }