public void cargar_reporte(factura_Ride_Info InfoFactura)
 {
     try
     {
         listaDatasource.Add(InfoFactura);
         this.DataSource = listaDatasource.ToArray();
     }
     catch (Exception ex)
     {
     }
 }
        public void cargar_reporte(factura_Ride_Info InfoFactura)
        {
            try
            {
                if (InfoFactura.factura.infoTributaria.ambiente == "1")
                {
                    string ambiente = InfoFactura.factura.infoTributaria.ambiente;
                }

                List <factura_Ride_Info> listaDatasource = new List <factura_Ride_Info>();
                listaDatasource.Add(InfoFactura);
                this.DataSource = listaDatasource.ToArray();
            }
            catch (Exception ex)
            {
            }
        }
        public void cargar_reporte(factura_Ride_Info InfoFactura)
        {
            try
            {
                List <factura_Ride_Info> listaDatasource = new List <factura_Ride_Info>();
                listaDatasource.Add(InfoFactura);
                this.DataSource = listaDatasource.ToArray();

                xRpt_Ride_Factura_DatosAdicionales rep = new xRpt_Ride_Factura_DatosAdicionales();
                rep.cargar_reporte(InfoFactura);

                xrSubreport1.ReportSource = rep;
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 4
0
        public void cargar_reporte(factura_Ride_Info InfoFactura)
        {
            try
            {
                listaDatasource.Add(InfoFactura);

                foreach (var item in listaDatasource)
                {
                    foreach (var item_ in item.factura.infoFactura.totalConImpuestos)
                    {
                        if (item_.codigoPorcentaje == "3")
                        {
                            InfoFactura.por_iva = 14;
                        }
                        if (item_.codigoPorcentaje == "2")
                        {
                            InfoFactura.por_iva = 12;
                        }
                        if (item_.codigoPorcentaje == "0")
                        {
                            if (Convert.ToDateTime(InfoFactura.factura.infoFactura.fechaEmision) < Convert.ToDateTime("01/06/2016"))
                            {
                                InfoFactura.por_iva = 12;
                            }
                            else
                            if (Convert.ToDateTime(InfoFactura.factura.infoFactura.fechaEmision) > Convert.ToDateTime("31/05/2016"))
                            {
                                InfoFactura.por_iva = 14;
                            }
                        }
                    }
                    InfoFactura.numeros_en_letras = Funciones.NumeroALetras(InfoFactura.factura.infoFactura.importeTotal);
                }
                this.DataSource = listaDatasource.ToArray();
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 5
0
        public DevExpress.XtraReports.UI.XtraReport Optener_reporte(tb_Comprobante_Info InfoCbte, ref string mensajeErrorOut)
        {
            try
            { // consulto si hay reporte guardado para esa empresa por documento
                Info = data_.consultar_tipo(InfoCbte.IdEmpresa, Convert.ToString(InfoCbte.IdTipoDocumento), ref mensajeErrorOut);
                //**********************

                tb_Comprobante_Data DataCbte = new tb_Comprobante_Data();
                XtraReport          Reporte  = new XtraReport();
                Image Logo = null;

                Instanciando_clases_reporte(InfoCbte.IdEmpresa, ref mensajeErrorOut);


                #region Opteniendo Logo

                var q = from c in listEmpresa
                        where c.IdEmpresa == InfoCbte.IdEmpresa
                        select c;


                foreach (var item in q)
                {
                    Logo = Funciones.ArrayAImage(item.logo);
                }

                #endregion


                switch (InfoCbte.IdTipoDocumento)
                {
                case "01":
                    factura_Ride_Info InfoFactura = new factura_Ride_Info();

                    //  si no esta guardado el reporte en la bd
                    if (Info.ReporteBy == null)
                    {
                        InfoFactura      = DataCbte.consultar_Factura_ride(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut);
                        InfoFactura.Logo = Logo;
                        InfoFactura.numeros_en_letras = funciones.NumeroALetras(InfoFactura.factura.infoFactura.importeTotal.ToString());

                        Reporte = OBusReporteFactura.Optener_reporte(InfoFactura);
                        using (MemoryStream stream = new MemoryStream())
                        {
                            byte[] data;
                            Reporte.SaveLayout(stream);
                            data = stream.ToArray();



                            // grabar bd
                            InfoComprobanteem.IdEmpresa          = InfoCbte.IdEmpresa;
                            InfoComprobanteem.idComprobante_tipo = InfoCbte.IdTipoDocumento;
                            InfoComprobanteem.File_disenio_rpt   = data;
                            IBusComprobanteem.ModificarDB(InfoComprobanteem, ref mensajeErrorOut);
                        }
                    }
                    else
                    {
                        InfoFactura      = DataCbte.consultar_Factura_ride(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut);
                        InfoFactura.Logo = Logo;
                        InfoFactura.numeros_en_letras = funciones.NumeroALetras(InfoFactura.factura.infoFactura.importeTotal.ToString());
                        File.WriteAllBytes(Ruta_Reporte_Fac, Info.ReporteBy);
                        Reporte = OBusReporteFactura.Optener_reporte(InfoFactura);
                        Reporte.LoadLayout(Ruta_Reporte_Fac);
                    }



                    break;

                case "04":
                    notaCredito_Ride_Info InfoNotaCred = new notaCredito_Ride_Info();
                    //  si no esta guardado el reporte en la bd
                    if (Info.ReporteBy == null)
                    {
                        InfoNotaCred = DataCbte.consultar_NotaCredito_Ride(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut);
                        InfoNotaCred.numeros_en_letras = funciones.NumeroALetras(InfoNotaCred.notaCredito.infoNotaCredito.valorModificacion.ToString());
                        InfoNotaCred.Logo = Logo;
                        Reporte           = OBusReporteNotaCred.Optener_reporte(InfoNotaCred);
                        using (MemoryStream stream = new MemoryStream())
                        {
                            byte[] data;
                            Reporte.SaveLayout(stream);
                            data = stream.ToArray();
                            // grabar bd
                            InfoComprobanteem.IdEmpresa          = InfoCbte.IdEmpresa;
                            InfoComprobanteem.idComprobante_tipo = InfoCbte.IdTipoDocumento;
                            InfoComprobanteem.File_disenio_rpt   = data;
                            IBusComprobanteem.ModificarDB(InfoComprobanteem, ref mensajeErrorOut);
                        }
                    }
                    else
                    {
                        InfoNotaCred      = DataCbte.consultar_NotaCredito_Ride(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut);
                        InfoNotaCred.Logo = Logo;
                        InfoNotaCred.numeros_en_letras = funciones.NumeroALetras(InfoNotaCred.notaCredito.infoNotaCredito.valorModificacion.ToString());

                        File.WriteAllBytes(Ruta_Reporte_NC, Info.ReporteBy);
                        Reporte = OBusReporteNotaCred.Optener_reporte(InfoNotaCred);
                        Reporte.LoadLayout(Ruta_Reporte_NC);
                    }

                    break;

                case "05":
                    notaDebito_Ride_Info InfoNotaDeb = new notaDebito_Ride_Info();

                    //  si no esta guardado el reporte en la bd
                    if (Info.ReporteBy == null)
                    {
                        InfoNotaDeb = DataCbte.consultar_NotaDebito(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut);
                        InfoNotaDeb.numeros_en_letras = funciones.NumeroALetras(InfoNotaDeb.notaDebito.infoNotaDebito.valorTotal.ToString());

                        InfoNotaDeb.Logo = Logo;
                        Reporte          = OBusReporteNotaDeb.Optener_reporte(InfoNotaDeb);
                        using (MemoryStream stream = new MemoryStream())
                        {
                            byte[] data;
                            Reporte.SaveLayout(stream);
                            data = stream.ToArray();
                            // grabar bd
                            InfoComprobanteem.IdEmpresa          = InfoCbte.IdEmpresa;
                            InfoComprobanteem.idComprobante_tipo = InfoCbte.IdTipoDocumento;
                            InfoComprobanteem.File_disenio_rpt   = data;
                            IBusComprobanteem.ModificarDB(InfoComprobanteem, ref mensajeErrorOut);
                        }
                    }
                    else
                    {
                        InfoNotaDeb      = DataCbte.consultar_NotaDebito(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut);
                        InfoNotaDeb.Logo = Logo;
                        InfoNotaDeb.numeros_en_letras = funciones.NumeroALetras(InfoNotaDeb.notaDebito.infoNotaDebito.valorTotal.ToString());

                        File.WriteAllBytes(Ruta_Reporte_ND, Info.ReporteBy);
                        Reporte = OBusReporteNotaDeb.Optener_reporte(InfoNotaDeb);
                        Reporte.LoadLayout(Ruta_Reporte_ND);
                    }



                    break;

                case "06":
                    guiaRemision_Ride_Info InfoGuia = new guiaRemision_Ride_Info();


                    //  si no esta guardado el reporte en la bd
                    if (Info.ReporteBy == null)
                    {
                        InfoGuia      = DataCbte.consultar_Guia(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut);
                        InfoGuia.Logo = Logo;
                        Reporte       = OBusReporteGuia_Remi.Optener_reporte(InfoGuia);
                        using (MemoryStream stream = new MemoryStream())
                        {
                            byte[] data;
                            Reporte.SaveLayout(stream);
                            data = stream.ToArray();
                            // grabar bd
                            InfoComprobanteem.IdEmpresa          = InfoCbte.IdEmpresa;
                            InfoComprobanteem.idComprobante_tipo = InfoCbte.IdTipoDocumento;
                            InfoComprobanteem.File_disenio_rpt   = data;
                            IBusComprobanteem.ModificarDB(InfoComprobanteem, ref mensajeErrorOut);
                        }
                    }
                    else
                    {
                        InfoGuia      = DataCbte.consultar_Guia(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut);
                        InfoGuia.Logo = Logo;
                        File.WriteAllBytes(Ruta_Reporte_Guia, Info.ReporteBy);
                        Reporte = OBusReporteGuia_Remi.Optener_reporte(InfoGuia);
                        Reporte.LoadLayout(Ruta_Reporte_Guia);
                    }



                    break;

                case "07":
                    comprobanteRetencion_Ride_Info InfoCbteRet = new comprobanteRetencion_Ride_Info();

                    //  si no esta guardado el reporte en la bd
                    if (Info.ReporteBy == null)
                    {
                        InfoCbteRet      = DataCbte.consultar_Retencion(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut);
                        InfoCbteRet.Logo = Logo;
                        Reporte          = OBusReporteRetencion.Optener_reporte(InfoCbteRet);
                        using (MemoryStream stream = new MemoryStream())
                        {
                            byte[] data;
                            Reporte.SaveLayout(stream);
                            data = stream.ToArray();
                            // grabar bd
                            InfoComprobanteem.IdEmpresa          = InfoCbte.IdEmpresa;
                            InfoComprobanteem.idComprobante_tipo = InfoCbte.IdTipoDocumento;
                            InfoComprobanteem.File_disenio_rpt   = data;
                            IBusComprobanteem.ModificarDB(InfoComprobanteem, ref mensajeErrorOut);
                        }
                    }
                    else
                    {
                        InfoCbteRet      = DataCbte.consultar_Retencion(InfoCbte.IdEmpresa, InfoCbte.IdComprobante, InfoCbte.IdTipoDocumento, InfoCbte.IdEstado_cbte, ref mensajeErrorOut);
                        InfoCbteRet.Logo = Logo;
                        File.WriteAllBytes(Ruta_Reporte_Ret, Info.ReporteBy);
                        Reporte = OBusReporteRetencion.Optener_reporte(InfoCbteRet);
                        Reporte.LoadLayout(Ruta_Reporte_Ret);
                    }


                    break;
                }

                return(Reporte);
            }
            catch (Exception ex)
            {
                return(new XtraReport());
            }
        }
        public void cargar_reporte(factura_Ride_Info InfoFactura)
        {
            try
            {
                //foreach (var item in InfoFactura.factura.infoAdicional)
                //{
                //if (item.nombre == "MAIL")
                //{
                //    this.campo_adicional_mail.Expression = "\'" + item.Value + "\'";

                //}

                //if (item.nombre == "OBRA")
                //{
                //    this.campo_adicional_obra.Expression = "\'" + item.Value + "\'";

                //}


                //if (item.nombre == "FORMA_PAGO")
                //{
                //    this.campo_adicional_forma_pago.Expression = "\'" + item.Value + "\'";

                //}

                //if (item.nombre == "REFERENCIA")
                //{
                //    this.campo_adicional_referencia.Expression = "\'" + item.Value + "\'";

                //}

                //if (item.nombre == "FECHA_VENCI")
                //{
                //    this.campo_adicional_fecha_vencimiento.Expression = "\'" + item.Value + "\'";

                //}

                //if (item.nombre == "observaciones")
                //{
                //    this.campo_adicional_observaciones.Expression = "\'" + item.Value + "\'";

                //}

                //if (item.nombre == "DIRECCION_CLIENTE")
                //{
                //    this.campo_adicional_direccion.Expression = "\'" + item.Value + "\'";

                //}

                //  }


                listaDatasource.Add(InfoFactura);

                foreach (var item in listaDatasource)
                {
                    foreach (var item_ in item.factura.infoFactura.totalConImpuestos)
                    {
                        if (item_.codigoPorcentaje == "3")
                        {
                            InfoFactura.por_iva = 14;
                        }
                        if (item_.codigoPorcentaje == "2")
                        {
                            InfoFactura.por_iva = 12;
                        }
                    }
                }
                this.DataSource = listaDatasource.ToArray();
            }
            catch (Exception ex)
            {
            }
        }