Exemple #1
0
        public List <XBAN_Rpt015_Info> Get_Data_Reporte(int IdEmpresa, int IdTipocbte, decimal IdCbteCble, ref string MensajeError)
        {
            try
            {
                List <XBAN_Rpt015_Info> lstRpt = new List <XBAN_Rpt015_Info>();



                using (EntitiesBancos_Reporte_Ge listado = new EntitiesBancos_Reporte_Ge())
                {
                    var select = from q in listado.vwBAN_Rpt015
                                 where q.mba_IdEmpresa == IdEmpresa &&
                                 q.mba_IdTipocbte == IdTipocbte &&
                                 q.mba_IdCbteCble == IdCbteCble
                                 select q;

                    foreach (var item in select)
                    {
                        XBAN_Rpt015_Info infoRpt = new XBAN_Rpt015_Info();


                        infoRpt.mba_IdEmpresa  = item.mba_IdEmpresa;
                        infoRpt.mba_IdCbteCble = item.mba_IdCbteCble;
                        infoRpt.mba_IdTipocbte = item.mba_IdTipocbte;
                        infoRpt.IdEmpresa      = item.IdEmpresa;
                        infoRpt.nom_sucursal   = item.nom_sucursal;
                        infoRpt.IdCbteCble     = item.IdCbteCble;
                        infoRpt.IdTipocbte     = item.IdTipocbte;
                        infoRpt.nom_Tipocbte   = item.nom_Tipocbte;
                        infoRpt.Beneficiario   = item.Beneficiario;
                        infoRpt.IdCobro_tipo   = item.IdCobro_tipo;
                        infoRpt.Fecha_Cobro    = item.Fecha_Cobro;
                        infoRpt.cr_Valor       = item.cr_Valor;

                        infoRpt.cm_observacion = item.cm_observacion;
                        infoRpt.mcj_Secuencia  = item.mcj_Secuencia;


                        lstRpt.Add(infoRpt);
                    }
                }

                return(lstRpt);
            }
            catch (Exception ex)
            {
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt015_Data)
                      };
            }
        }
Exemple #2
0
        public List <XBAN_Rpt010_Info> Get_Data_Reporte(int IdEmpresa, int IdBanco, DateTime FechaIni, DateTime FechaFin, ref string MensajeError)
        {
            try
            {
                List <XBAN_Rpt010_Info> lstRpt = new List <XBAN_Rpt010_Info>();

                using (EntitiesBancos_Reporte_Ge listado = new EntitiesBancos_Reporte_Ge())
                {
                    var select = from q in listado.spBAN_Rpt010(IdEmpresa, IdBanco, FechaIni, FechaFin)
                                 select q;


                    foreach (var item in select)
                    {
                        XBAN_Rpt010_Info info = new XBAN_Rpt010_Info();

                        info.IdEmpresa            = item.IdEmpresa;
                        info.IdTipoCbte           = item.IdTipoCbte;
                        info.IdCbteCble           = item.IdCbteCble;
                        info.secuencia            = item.secuencia;
                        info.cb_Fecha             = item.cb_Fecha;
                        info.cb_Observacion       = item.cb_Observacion;
                        info.dc_Observacion       = item.dc_Observacion;
                        info.Observacion_girado_a = item.Observacion_girado_a;
                        info.Referencia           = item.Referencia;
                        info.cb_giradoA           = item.cb_giradoA;
                        info.CodTipoCbte          = item.CodTipoCbte;
                        info.tc_TipoCbte          = item.tc_TipoCbte;
                        info.IdCtaCble            = item.IdCtaCble;
                        info.pc_Cuenta            = item.pc_Cuenta;
                        info.Saldo_inicial        = item.Saldo_inicial;
                        info.Debe  = item.Debe;
                        info.Haber = item.Haber;
                        info.Saldo = item.Saldo;


                        info.Origen = item.Origen;

                        lstRpt.Add(info);
                    }
                }

                return(lstRpt);
            }
            catch (Exception ex)
            {
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }
Exemple #3
0
        public List <XBAN_Rpt008_Info> get_ReporteFlujoCajaResumido(int IdEmpresa, DateTime FechaIni, DateTime FechaFin)
        {
            try
            {
                List <XBAN_Rpt008_Info> lstRpt = new List <XBAN_Rpt008_Info>();

                using (EntitiesBancos_Reporte_Ge listado = new EntitiesBancos_Reporte_Ge())
                {
                    var select = from q in listado.spBAN_Rpt008(IdEmpresa, FechaIni, FechaFin)
                                 select q;

                    foreach (var item in select)
                    {
                        XBAN_Rpt008_Info infoRpt = new XBAN_Rpt008_Info();
                        infoRpt.IdEmpresa         = item.IdEmpresa;
                        infoRpt.idTipoFlujo       = item.idTipoFlujo;
                        infoRpt.descripcion_flujo = item.descripcion_flujo;
                        infoRpt.Des_tipo_cbte     = item.Des_tipo_cbte;
                        infoRpt.dc_Valor          = item.dc_Valor;
                        infoRpt.ba_descripcion    = item.ba_descripcion;
                        infoRpt.ba_Num_Cuenta     = item.ba_Num_Cuenta;
                        infoRpt.Orden             = item.Orden;
                        infoRpt.id_Des_tipo_cbte  = item.id_Des_tipo_cbte;

                        lstRpt.Add(infoRpt);
                    }
                }

                return(lstRpt);
            }
            catch (Exception ex)
            {
                string MensajeError = "";
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }
Exemple #4
0
        public List <XBAN_Rpt009_Info> get_ReporteSaldoBancos(int IdEmpresa, DateTime Fecha_ini, DateTime Fecha_fin)
        {
            try
            {
                List <XBAN_Rpt009_Info> lstRpt = new List <XBAN_Rpt009_Info>();

                using (EntitiesBancos_Reporte_Ge listado = new EntitiesBancos_Reporte_Ge())
                {
                    var select = from q in listado.spBAN_Rpt009(IdEmpresa, Fecha_ini, Fecha_fin)
                                 select q;

                    foreach (var item in select)
                    {
                        XBAN_Rpt009_Info infoRpt = new XBAN_Rpt009_Info();
                        infoRpt.IdEmpresa      = item.IdEmpresa;
                        infoRpt.IdCtaCble      = item.IdCtaCble;
                        infoRpt.Saldo_anterior = item.Saldo_anterior;
                        infoRpt.Ingreso        = item.Ingreso;
                        infoRpt.Egreso         = item.Egreso;
                        infoRpt.Saldo_final    = item.Saldo_final;
                        infoRpt.fecha_ini      = item.fecha_ini;
                        infoRpt.fecha_fin      = item.fecha_fin;
                        infoRpt.nom_Banco      = item.nom_Banco;
                        lstRpt.Add(infoRpt);
                    }
                }

                return(lstRpt);
            }
            catch (Exception ex)
            {
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }
Exemple #5
0
        public List <XBAN_Rpt019_Info> GetData(int IdEmpresa, int IdTipocbte, decimal IdCbteCble, ref string MensajeError)
        {
            try
            {
                List <XBAN_Rpt019_Info> Result = new List <XBAN_Rpt019_Info>();
                using (EntitiesBancos_Reporte_Ge conexion = new EntitiesBancos_Reporte_Ge())
                {
                    var Select = from q in conexion.vwBAN_Rpt019
                                 where q.IdEmpresa == IdEmpresa &&
                                 q.IdCbteCble == IdCbteCble &&
                                 q.IdTipocbte == IdTipocbte
                                 select q;
                    foreach (var item in Select)
                    {
                        XBAN_Rpt019_Info infoRpt = new XBAN_Rpt019_Info();

                        infoRpt.IdEmpresa        = item.IdEmpresa;
                        infoRpt.IdTipocbte       = item.IdTipocbte;
                        infoRpt.IdCbteCble       = item.IdCbteCble;
                        infoRpt.IdCbteCble_Ogiro = item.IdCbteCble_Ogiro;
                        infoRpt.Referencia       = item.Referencia;
                        infoRpt.MontoAplicado    = item.MontoAplicado;
                        infoRpt.co_observacion   = item.co_observacion;
                        infoRpt.co_fecha         = item.co_fecha;

                        Result.Add(infoRpt);
                    }
                    return(Result);
                }
            }
            catch (Exception ex)
            {
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt005_Data)
                      };
            }
        }
Exemple #6
0
        public List <XBAN_Rpt007_saldos_Info> Get_List(int IdEmpresa, DateTime FechaIni, DateTime FechaFin, String IdUsuario)
        {
            try
            {
                FechaIni = FechaIni.Date;
                FechaFin = FechaFin.Date;
                List <XBAN_Rpt007_saldos_Info> list = new List <XBAN_Rpt007_saldos_Info>();
                using (EntitiesBancos_Reporte_Ge context = new EntitiesBancos_Reporte_Ge())
                {
                    var lst = from q in context.spBAN_Rpt007_saldos(IdEmpresa, FechaIni, FechaFin, IdUsuario)
                              select q;
                    foreach (var info in lst)
                    {
                        XBAN_Rpt007_saldos_Info entity = new XBAN_Rpt007_saldos_Info();
                        entity.IdEmpresa        = info.IdEmpresa;
                        entity.IdBanco          = info.IdBanco;
                        entity.IdUsuario        = info.IdUsuario;
                        entity.nom_cuenta_banco = info.nom_cuenta_banco;
                        entity.Saldo_inicial    = info.Saldo_inicial;
                        entity.Saldo_final      = info.Saldo_final;
                        list.Add(entity);
                    }
                }

                return(list);
            }

            catch (Exception ex)
            {
                string MensajeError = "";
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }
Exemple #7
0
        public List <XBAN_Rpt013_Info> Get_Data_Reporte(int IdEmpresa, int IdTipocbte, decimal IdCbteCble, ref string MensajeError)
        {
            try
            {
                List <XBAN_Rpt013_Info> lstRpt = new List <XBAN_Rpt013_Info>();



                using (EntitiesBancos_Reporte_Ge listado = new EntitiesBancos_Reporte_Ge())
                {
                    var select = from q in listado.vwBAN_Rpt013
                                 where q.IdEmpresa == IdEmpresa &&
                                 q.IdCbteCble == IdCbteCble &&
                                 q.IdTipocbte == IdTipocbte
                                 select q;

                    foreach (var item in select)
                    {
                        XBAN_Rpt013_Info infoRpt = new XBAN_Rpt013_Info();

                        infoRpt.IdEmpresa             = item.IdEmpresa;
                        infoRpt.nom_empresa           = item.nom_empresa;
                        infoRpt.ruc_empresa           = item.ruc_empresa;
                        infoRpt.IdCbteCble            = item.IdCbteCble;
                        infoRpt.IdTipocbte            = item.IdTipocbte;
                        infoRpt.IdBanco               = item.IdBanco;
                        infoRpt.nom_banco             = item.nom_banco;
                        infoRpt.ba_Num_Cuenta         = item.ba_Num_Cuenta;
                        infoRpt.IdCtaCble_ban         = item.IdCtaCble_ban;
                        infoRpt.cb_Fecha              = item.cb_Fecha;
                        infoRpt.IdPeriodo             = item.IdPeriodo;
                        infoRpt.cb_Observacion        = item.cb_Observacion;
                        infoRpt.cb_Valor              = item.cb_Valor;
                        infoRpt.Estado                = item.Estado;
                        infoRpt.ValorEnLetras         = item.ValorEnLetras;
                        infoRpt.secuencia             = item.secuencia;
                        infoRpt.IdCtaCble             = item.IdCtaCble;
                        infoRpt.nom_cuenta            = item.nom_cuenta;
                        infoRpt.debito                = item.debito;
                        infoRpt.credito               = item.credito;
                        infoRpt.dc_Observacion        = item.dc_Observacion;
                        infoRpt.nom_punto_cargo       = item.nom_punto_cargo;
                        infoRpt.nom_punto_cargo_grupo = item.nom_punto_cargo_grupo;

                        lstRpt.Add(infoRpt);
                    }
                }

                return(lstRpt);
            }
            catch (Exception ex)
            {
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }
Exemple #8
0
        public List <XBAN_Rpt004_Info> Cargar_data(int idempresa, DateTime FechaIni, DateTime FechaFin, int idBancoIni, int idBancoFin, string TipoCbte)
        {
            try
            {
                List <XBAN_Rpt004_Info> lista = new List <XBAN_Rpt004_Info>();
                FechaIni = Convert.ToDateTime(FechaIni.ToShortDateString());
                FechaFin = Convert.ToDateTime(FechaFin.ToShortDateString());

                TipoCbte = TipoCbte == "DEPO" ? "DEP" : TipoCbte;
                TipoCbte = TipoCbte == "CHEQ" ? "CHE" : TipoCbte;
                TipoCbte = TipoCbte == "NCBA" ? "NCB" : TipoCbte;
                TipoCbte = TipoCbte == "NDBA" ? "NDB" : TipoCbte;

                using (EntitiesBancos_Reporte_Ge ListadoCbte = new EntitiesBancos_Reporte_Ge())
                {
                    lista = (from q in ListadoCbte.vwBAN_Rpt004
                             where q.IdEmpresa == idempresa &&
                             idBancoIni <= q.IdBanco && q.IdBanco <= idBancoFin &&
                             FechaIni <= q.cb_Fecha && q.cb_Fecha <= FechaFin &&
                             q.CodTipoCbte.Contains(TipoCbte)
                             select new XBAN_Rpt004_Info
                    {
                        IdRow = q.IdRow,
                        IdEmpresa = q.IdEmpresa,
                        IdTipocbte = q.IdTipocbte,
                        IdCbteCble = q.IdCbteCble,
                        cb_Fecha = q.cb_Fecha,
                        cb_Observacion = q.cb_Observacion,
                        cb_Cheque = q.cb_Cheque,
                        cb_Valor = q.cb_Valor,
                        debe = q.debe,
                        haber = q.haber,
                        saldo = q.saldo,
                        CodTipoCbte = q.CodTipoCbte,
                        tc_TipoCbte = q.tc_TipoCbte,
                        pe_nombreCompleto = q.pe_nombreCompleto,
                        Estado = q.Estado,
                        IdEmpresa_cxp = q.IdEmpresa_cxp,
                        IdTipoCbte_cxp = q.IdTipoCbte_cxp,
                        IdCbteCble_cxp = q.IdCbteCble_cxp,
                        observacion_deuda = q.observacion_deuda,
                        fecha_deuda = q.fecha_deuda,
                        num_querry = q.num_querry,
                        orden = q.orden,
                        IdBanco = q.IdBanco,
                        ba_descripcion = q.ba_descripcion
                    }).ToList();
                }
                return(lista);
            }
            catch (Exception ex)
            {
                string MensajeError = "";
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }
Exemple #9
0
        public List <XBAN_Rpt001_Info> Cargar_data(int idempresa, DateTime FechaIni, DateTime FechaFin)
        {
            try
            {
                List <XBAN_Rpt001_Info> listadedatos = new List <XBAN_Rpt001_Info>();
                FechaIni = Convert.ToDateTime(FechaIni.ToShortDateString());
                FechaFin = Convert.ToDateTime(FechaFin.ToShortDateString());


                using (EntitiesBancos_Reporte_Ge ListadoCbte = new EntitiesBancos_Reporte_Ge())
                {
                    var select = from h in ListadoCbte.vwBAN_Rpt001
                                 where h.IdEmpresa == idempresa &&
                                 h.Fch_Cbte >= FechaIni && h.Fch_Cbte <= FechaFin
                                 select h;

                    foreach (var item in select)
                    {
                        XBAN_Rpt001_Info itemInfo = new XBAN_Rpt001_Info();


                        itemInfo.IdEmpresa        = item.IdEmpresa;
                        itemInfo.Tipo_Cbte        = item.Tipo_Cbte;
                        itemInfo.Num_Cbte         = item.Num_Cbte;
                        itemInfo.IdBanco          = item.IdBanco;
                        itemInfo.Banco            = item.Banco;
                        itemInfo.Fch_Cbte         = item.Fch_Cbte;
                        itemInfo.Observacion      = item.Observacion;
                        itemInfo.Valor            = item.Valor;
                        itemInfo.Cheque           = item.Cheque;
                        itemInfo.Chq_Girado_A     = item.Chq_Girado_A;
                        itemInfo.IdTipoFlujo      = item.IdTipoFlujo;
                        itemInfo.Tipo_Flujo       = item.Tipo_Flujo;
                        itemInfo.IdTipoNota       = item.IdTipoNota;
                        itemInfo.Tipo_Nota        = item.Tipo_Nota;
                        itemInfo.Fch_PostFechado  = item.Fch_PostFechado;
                        itemInfo.Es_Chq_Impreso   = item.Es_Chq_Impreso;
                        itemInfo.Fch_Chq          = item.Fch_Chq;
                        itemInfo.Cta_Cble_Banco   = item.Cta_Cble_Banco;
                        itemInfo.IdCalendario     = item.IdCalendario;
                        itemInfo.AnioFiscal       = item.AnioFiscal;
                        itemInfo.NombreMes        = item.NombreMes;
                        itemInfo.NombreCortoFecha = item.NombreCortoFecha;
                        itemInfo.IdMes            = item.IdMes;
                        itemInfo.pc_Cuenta        = item.pc_Cuenta;


                        listadedatos.Add(itemInfo);
                    }
                }
                return(listadedatos);
            }
            catch (Exception ex)
            {
                string MensajeError = "";
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }
Exemple #10
0
        public List <XBAN_Rpt011_Info> Get_Data_Reporte(int IdEmpresa, int IdBanco, int IdConciliacion, ref string MensajeError)
        {
            try
            {
                List <XBAN_Rpt011_Info> lstRpt = new List <XBAN_Rpt011_Info>();

                double? Saldo          = 0;
                Boolean PrimerRegistro = true;


                using (EntitiesBancos_Reporte_Ge listado = new EntitiesBancos_Reporte_Ge())
                {
                    var select = from q in listado.spBAN_Rpt011(IdEmpresa, IdBanco, IdConciliacion)
                                 select q;

                    foreach (var item in select)
                    {
                        if (PrimerRegistro)
                        {
                            Saldo          = (item.SaldoInicial == null) ? 0 : Convert.ToDouble(item.SaldoInicial);
                            PrimerRegistro = false;
                        }
                        XBAN_Rpt011_Info infoRpt = new XBAN_Rpt011_Info();
                        infoRpt.IdEmpresa         = item.IdEmpresa;
                        infoRpt.IdConciliacion    = item.IdConciliacion;
                        infoRpt.IdBanco           = item.IdBanco;
                        infoRpt.IdPeriodo         = Convert.ToInt32(item.IdPeriodo);
                        infoRpt.nom_banco         = item.nom_banco;
                        infoRpt.ba_Num_Cuenta     = item.ba_Num_Cuenta;
                        infoRpt.IdCtaCble         = item.IdCtaCble;
                        infoRpt.Fecha             = item.Fecha == null ? DateTime.Now : (DateTime)item.Fecha;
                        infoRpt.CodTipoCbte       = item.CodTipoCbte;
                        infoRpt.Tipo_Cbte         = item.Tipo_Cbte;
                        infoRpt.IdCbteCble        = item.IdCbteCble;
                        infoRpt.IdTipocbte        = item.IdTipoCbte;
                        infoRpt.SecuenciaCbte     = item.SecuenciaCbte;
                        infoRpt.Valor             = item.Valor;
                        infoRpt.Observacion       = item.Observacion;
                        infoRpt.Cheque            = item.Cheque;
                        infoRpt.Titulo_grupo      = item.Titulo_grupo;
                        infoRpt.referencia        = item.referencia;
                        infoRpt.ruc_empresa       = item.ruc_empresa;
                        infoRpt.nom_empresa       = item.nom_empresa;
                        infoRpt.GiradoA           = item.GiradoA;
                        infoRpt.Total_Conciliado  = item.Total_Conciliado;
                        infoRpt.IdTipoFlujo       = item.IdTipoFlujo;
                        infoRpt.nom_tipo_flujo    = item.nom_tipo_flujo;
                        infoRpt.SaldoBanco_EstCta = item.SaldoBanco_EstCta;
                        infoRpt.FechaIni          = item.FechaIni;
                        infoRpt.FechaFin          = item.FechaFin;
                        infoRpt.SaldoFinal        = item.SaldoFinal;
                        infoRpt.SaldoInicial      = item.SaldoInicial;
                        lstRpt.Add(infoRpt);
                    }
                }
                return(lstRpt);
            }
            catch (Exception ex)
            {
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }
Exemple #11
0
        public List <XBAN_Rpt007_Info> Get_list_reporte(int IdEmpresa, List <int> lst_IdTipoFlujo, DateTime FechaIni, DateTime FechaFin, bool Mostrar_detallado, int IdBanco, bool Mostrar_solo_conciliado, bool Mostrar_beneficiario)
        {
            try
            {
                List <XBAN_Rpt007_Info> lstRpt = new List <XBAN_Rpt007_Info>();

                FechaIni = FechaIni.Date;
                FechaFin = FechaFin.Date;

                int IdBanco_ini = IdBanco;
                int IdBanco_fin = IdBanco == 0 ? 9999 : IdBanco;

                using (EntitiesBancos_Reporte_Ge Context = new EntitiesBancos_Reporte_Ge())
                {
                    foreach (var item_tipoFlujo in lst_IdTipoFlujo)
                    {
                        var lst = from q in Context.spBAN_Rpt007(IdEmpresa, FechaIni, FechaFin, item_tipoFlujo, item_tipoFlujo, IdBanco_ini, IdBanco_fin, Mostrar_detallado, Mostrar_solo_conciliado)
                                  select q;

                        foreach (var item in lst)
                        {
                            XBAN_Rpt007_Info info = new XBAN_Rpt007_Info();
                            info.IdEmpresa_cxp   = item.IdEmpresa_cxp;
                            info.IdTipoCbte_cxp  = item.IdTipoCbte_cxp;
                            info.Tipo_cbte_cxp   = item.Tipo_cbte_cxp;
                            info.IdCbteCble_cxp  = item.IdCbteCble_cxp;
                            info.IdEmpresa_pago  = item.IdEmpresa_pago;
                            info.IdTipoCbte_pago = item.IdTipoCbte_pago;
                            info.Tipo_cbte_pago  = item.Tipo_cbte_pago;
                            info.IdCbteCble_pago = item.IdCbteCble_pago;
                            info.co_observacion  = Mostrar_beneficiario == true ? item.pe_nombreCompleto : item.co_observacion;
                            info.cb_Fecha        = item.cb_Fecha;
                            info.IdTipoFlujo     = item.IdTipoFlujo;
                            info.nom_tipo_flujo  = item.nom_tipo_flujo;
                            info.cod_flujo       = item.cod_flujo;
                            info.Tipo            = item.Tipo;
                            info.dc_Valor        = item.dc_Valor;
                            info.IdBanco         = item.IdBanco;
                            info.nom_banco       = item.nom_banco;
                            info.Tipo_movi       = item.Tipo_movi;
                            info.orden           = item.orden;
                            lstRpt.Add(info);
                        }
                    }
                }

                return(lstRpt);
            }
            catch (Exception ex)
            {
                string MensajeError = "";
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }
Exemple #12
0
        public List <XBAN_Rpt016_Info> Get_Lista_Reporte(int idEmpresa, int idPersonaIni, int idPersonaFin, int idBancoIni, int idBancoFin, DateTime FechaIni, DateTime FechaFin)
        {
            try
            {
                List <XBAN_Rpt016_Info> Lista = new List <XBAN_Rpt016_Info>();

                using (EntitiesBancos_Reporte_Ge Conexion = new EntitiesBancos_Reporte_Ge())
                {
                    Lista = (from q in Conexion.vwBAN_Rpt016
                             where idEmpresa == q.IdEmpresa &&
                             idPersonaIni <= q.IdPersona_Girado_a && q.IdPersona_Girado_a <= idPersonaFin &&
                             idBancoIni <= q.IdBanco && q.IdBanco <= idBancoFin &&
                             FechaIni <= q.cb_Fecha && q.cb_Fecha <= FechaFin
                             select new XBAN_Rpt016_Info
                    {
                        IdEmpresa = q.IdEmpresa,
                        IdCbteCble = q.IdCbteCble,
                        IdTipocbte = q.IdTipocbte,
                        Cod_Cbtecble = q.Cod_Cbtecble,
                        IdPeriodo = q.IdPeriodo,
                        IdBanco = q.IdBanco,
                        IdProveedor = q.IdProveedor,
                        cb_Fecha = q.cb_Fecha,
                        cb_Observacion = q.cb_Observacion,
                        cb_secuencia = q.cb_secuencia,
                        cb_Valor = q.cb_Valor,
                        cb_Cheque = q.cb_Cheque,
                        cb_ChequeImpreso = q.cb_ChequeImpreso,
                        cb_FechaCheque = q.cb_FechaCheque,
                        IdUsuario = q.IdUsuario,
                        IdUsuario_Anu = q.IdUsuario_Anu,
                        FechaAnulacion = q.FechaAnulacion,
                        Fecha_Transac = q.Fecha_Transac,
                        Fecha_UltMod = q.Fecha_UltMod,
                        IdUsuarioUltMod = q.IdUsuarioUltMod,
                        Estado = q.Estado,
                        MotivoAnulacion = q.MotivoAnulacion,
                        ip = q.ip,
                        nom_pc = q.nom_pc,
                        IdPersona_Girado_a = q.IdPersona_Girado_a,
                        cb_giradoA = q.cb_giradoA,
                        cb_ciudadChq = q.cb_ciudadChq,
                        IdCbteCble_Anulacion = q.IdCbteCble_Anulacion,
                        IdTipoCbte_Anulacion = q.IdTipoCbte_Anulacion,
                        IdTipoFlujo = q.IdTipoFlujo,
                        IdTipoNota = q.IdTipoNota,
                        IdTransaccion = q.IdTransaccion,
                        Por_Anticipo = q.Por_Anticipo,
                        PosFechado = q.PosFechado,
                        ValorEnLetras = q.ValorEnLetras,
                        IdSucursal = q.IdSucursal,
                        Tipo_Conciliacion = q.Tipo_Conciliacion,
                        ba_descripcion = q.ba_descripcion
                    }).ToList();
                }

                return(Lista);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #13
0
        public List <XBAN_Rpt006_Info> Get_Data_Reporte(int IdEmpresa, int IdTipoCbte, decimal IdCbteCble, ref string MensajeError)
        {
            try
            {
                List <XBAN_Rpt006_Info> lstRpt = new List <XBAN_Rpt006_Info>();
                using (EntitiesBancos_Reporte_Ge listado = new EntitiesBancos_Reporte_Ge())
                {
                    var select = from q in listado.vwBAN_Rpt006
                                 where q.IdEmpresa == IdEmpresa &&
                                 q.IdTipocbte == IdTipoCbte &&
                                 q.IdCbteCble == IdCbteCble
                                 select q;

                    foreach (var item in select)
                    {
                        XBAN_Rpt006_Info infoRpt = new XBAN_Rpt006_Info();

                        infoRpt.IdEmpresa            = item.IdEmpresa;
                        infoRpt.IdPeriodo            = Convert.ToInt32(item.IdPeriodo);
                        infoRpt.IdBanco              = item.IdBanco;
                        infoRpt.ba_descripcion       = item.ba_descripcion;
                        infoRpt.tc_TipoCbte          = item.tc_TipoCbte;
                        infoRpt.IdCbteCble           = item.IdCbteCble;
                        infoRpt.IdTipocbte           = item.IdTipocbte;
                        infoRpt.Cod_Cbtecble         = item.Cod_Cbtecble;
                        infoRpt.IdProveedor          = item.IdProveedor;
                        infoRpt.NombreProveedor      = item.NombreProveedor;
                        infoRpt.cb_Fecha             = item.cb_Fecha;
                        infoRpt.cb_Observacion       = item.cb_Observacion;
                        infoRpt.cb_secuencia         = item.cb_secuencia;
                        infoRpt.cb_Valor             = item.cb_Valor;
                        infoRpt.ValorEnLetras        = item.ValorEnLetras;
                        infoRpt.cb_Cheque            = item.cb_Cheque;
                        infoRpt.cb_FechaCheque       = item.cb_FechaCheque;
                        infoRpt.Estado               = item.Estado;
                        infoRpt.MotivoAnulacion      = item.MotivoAnulacion;
                        infoRpt.cb_giradoA           = item.cb_giradoA;
                        infoRpt.cb_ciudadChq         = item.cb_ciudadChq;
                        infoRpt.IdCbteCble_Anulacion = item.IdCbteCble_Anulacion;
                        infoRpt.IdTipoCbte_Anulacion = item.IdTipoCbte_Anulacion;
                        infoRpt.IdTipoFlujo          = item.IdTipoFlujo;
                        infoRpt.IdTipoNota           = item.IdTipoNota;
                        infoRpt.NomTipoNota          = item.NomTipoNota;
                        infoRpt.Por_Anticipo         = item.Por_Anticipo;
                        infoRpt.PosFechado           = item.PosFechado;
                        infoRpt.IdPersona_Girado_a   = item.IdPersona_Girado_a;
                        infoRpt.nom_ciudadChq        = item.nom_ciudadChq;


                        lstRpt.Add(infoRpt);
                        break;
                    }
                }
                return(lstRpt);
            }
            catch (Exception ex)
            {
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt006_Data)
                      };
            }
        }
Exemple #14
0
        public List <XBAN_Rpt003_Info> Cargar_data(int idempresa, DateTime FechaIni, DateTime FechaFin, int idBancoIni, int idBancoFin, string TipoCbte, /*string girado_A*/ decimal IdPersona_Girado, string SchkImpreso, string Schkfacs, string Cheque)
        {
            try
            {
                List <XBAN_Rpt003_Info> lista = new List <XBAN_Rpt003_Info>();

                FechaIni = Convert.ToDateTime(FechaIni.ToShortDateString());
                FechaFin = Convert.ToDateTime(FechaFin.ToShortDateString());


                decimal idPersona_GiradoIni = 0;

                decimal idPersona_GiradoFin = 0;



                using (EntitiesBancos_Reporte_Ge ListadoCbte = new EntitiesBancos_Reporte_Ge())
                {
                    if (IdPersona_Girado == 0)
                    {
                        IQueryable <XBAN_Rpt003_Info> consulta = from h in ListadoCbte.vwBAN_Rpt003
                                                                 where h.IdEmpresa == idempresa &&
                                                                 h.Fch_Cbte >= FechaIni && h.Fch_Cbte <= FechaFin &&
                                                                 h.IdBanco >= idBancoIni && h.IdBanco <= idBancoFin &&
                                                                 h.Tipo_Cbte.Contains(TipoCbte)
                                                                 //&& (girado_A != "" ? h.Chq_Girado_A.Contains(girado_A) : true)
                                                                 // && h.IdPersona_Girado_a >= idPersona_GiradoIni && h.IdPersona_Girado_a <= idPersona_GiradoFin
                                                                 && h.Es_Chq_Impreso.StartsWith(SchkImpreso) &&
                                                                 h.TipoRegistro.Contains(Schkfacs) &&
                                                                 h.Cheque.Contains(Cheque)
                                                                 orderby h.IdReg

                                                                 select new XBAN_Rpt003_Info
                        {
                            IdEmpresa           = h.IdEmpresa,
                            Tipo_Cbte           = h.Tipo_Cbte,
                            Num_Cbte            = h.Num_Cbte,
                            IdBanco             = h.IdBanco,
                            Banco               = h.Banco,
                            Fch_Cbte            = h.Fch_Cbte,
                            Observacion         = h.Observacion,
                            Valor               = h.Valor,
                            Cheque              = h.Cheque,
                            Chq_Girado_A        = h.Chq_Girado_A,
                            IdTipoFlujo         = h.IdTipoFlujo,
                            Tipo_Flujo          = h.Tipo_Flujo,
                            IdTipoNota          = h.IdTipoNota,
                            Tipo_Nota           = h.Tipo_Nota,
                            Fch_PostFechado     = h.Fch_PostFechado,
                            Es_Chq_Impreso      = h.Es_Chq_Impreso,
                            Fch_Chq             = h.Fch_Chq,
                            Cta_Cble_Banco      = h.Cta_Cble_Banco,
                            IdCalendario        = h.IdCalendario,
                            AnioFiscal          = h.AnioFiscal,
                            NombreMes           = h.NombreMes,
                            NombreCortoFecha    = h.NombreCortoFecha,
                            IdMes               = h.IdMes,
                            pc_Cuenta           = h.pc_Cuenta,
                            MontoAplicado       = h.MontoAplicado,
                            IdOrdenPago_op      = h.IdOrdenPago_op,
                            Secuencia_op        = h.Secuencia_op,
                            Referencia          = h.Referencia,
                            Fecha_Venc_Fac_Prov = h.Fecha_Venc_Fac_Prov,
                            Observacion_FP      = h.Observacion_FP,
                            TipoRegistro        = h.TipoRegistro,
                            debe  = h.debe,
                            haber = h.haber,
                            saldo = h.saldo,
                            IdPersona_Girado_a = h.IdPersona_Girado_a
                        };

                        lista = consulta.ToList();

                        if (String.IsNullOrEmpty(Schkfacs))
                        {
                            List <XBAN_Rpt004_Info> lista2 = new List <XBAN_Rpt004_Info>();
                            listadedatos = lista.FindAll(q => q.MontoAplicado != 0);
                        }
                        else
                        {
                            listadedatos = lista;
                        }
                    }
                    else
                    {
                        idPersona_GiradoIni = IdPersona_Girado;
                        idPersona_GiradoFin = IdPersona_Girado;



                        IQueryable <XBAN_Rpt003_Info> consulta = from h in ListadoCbte.vwBAN_Rpt003
                                                                 where h.IdEmpresa == idempresa &&
                                                                 h.Fch_Cbte >= FechaIni && h.Fch_Cbte <= FechaFin &&
                                                                 h.IdBanco >= idBancoIni && h.IdBanco <= idBancoFin &&
                                                                 h.Tipo_Cbte.Contains(TipoCbte)
                                                                 //&& (girado_A != "" ? h.Chq_Girado_A.Contains(girado_A) : true)
                                                                 && h.IdPersona_Girado_a >= idPersona_GiradoIni && h.IdPersona_Girado_a <= idPersona_GiradoFin &&
                                                                 h.Es_Chq_Impreso.StartsWith(SchkImpreso) &&
                                                                 h.TipoRegistro.Contains(Schkfacs) &&
                                                                 h.Cheque.Contains(Cheque)
                                                                 orderby h.IdReg

                                                                 select new XBAN_Rpt003_Info
                        {
                            IdEmpresa           = h.IdEmpresa,
                            Tipo_Cbte           = h.Tipo_Cbte,
                            Num_Cbte            = h.Num_Cbte,
                            IdBanco             = h.IdBanco,
                            Banco               = h.Banco,
                            Fch_Cbte            = h.Fch_Cbte,
                            Observacion         = h.Observacion,
                            Valor               = h.Valor,
                            Cheque              = h.Cheque,
                            Chq_Girado_A        = h.Chq_Girado_A,
                            IdTipoFlujo         = h.IdTipoFlujo,
                            Tipo_Flujo          = h.Tipo_Flujo,
                            IdTipoNota          = h.IdTipoNota,
                            Tipo_Nota           = h.Tipo_Nota,
                            Fch_PostFechado     = h.Fch_PostFechado,
                            Es_Chq_Impreso      = h.Es_Chq_Impreso,
                            Fch_Chq             = h.Fch_Chq,
                            Cta_Cble_Banco      = h.Cta_Cble_Banco,
                            IdCalendario        = h.IdCalendario,
                            AnioFiscal          = h.AnioFiscal,
                            NombreMes           = h.NombreMes,
                            NombreCortoFecha    = h.NombreCortoFecha,
                            IdMes               = h.IdMes,
                            pc_Cuenta           = h.pc_Cuenta,
                            MontoAplicado       = h.MontoAplicado,
                            IdOrdenPago_op      = h.IdOrdenPago_op,
                            Secuencia_op        = h.Secuencia_op,
                            Referencia          = h.Referencia,
                            Fecha_Venc_Fac_Prov = h.Fecha_Venc_Fac_Prov,
                            Observacion_FP      = h.Observacion_FP,
                            TipoRegistro        = h.TipoRegistro,
                            debe  = h.debe,
                            haber = h.haber,
                            saldo = h.saldo,
                            IdPersona_Girado_a = h.IdPersona_Girado_a
                        };

                        lista = consulta.ToList();

                        if (String.IsNullOrEmpty(Schkfacs))
                        {
                            List <XBAN_Rpt004_Info> lista2 = new List <XBAN_Rpt004_Info>();
                            listadedatos = lista.FindAll(q => q.MontoAplicado != 0);
                        }
                        else
                        {
                            listadedatos = lista;
                        }
                    }
                }
                return(listadedatos);
            }
            catch (Exception ex)
            {
                string MensajeError = "";
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }
Exemple #15
0
        public List <XBAN_Rpt005_Info> GetData(int IdEmpresa, decimal IdComprobante, int IdTipoComprobante, ref string MensajeError)
        {
            try
            {
                List <XBAN_Rpt005_Info> Result = new List <XBAN_Rpt005_Info>();
                using (EntitiesBancos_Reporte_Ge conexion = new EntitiesBancos_Reporte_Ge())
                {
                    var Select = from q in conexion.vwBAN_Rpt005
                                 where q.IdEmpresa == IdEmpresa && q.IdCbteCble == IdComprobante && q.IdTipocbte == IdTipoComprobante
                                 select q;
                    foreach (var item in Select)
                    {
                        XBAN_Rpt005_Info infoRpt = new XBAN_Rpt005_Info();
                        infoRpt.IdEmpresa        = item.IdEmpresa;
                        infoRpt.IdCbteCble       = item.IdCbteCble;
                        infoRpt.IdTipocbte       = item.IdTipocbte;
                        infoRpt.Cod_Cbtecble     = item.Cod_Cbtecble;
                        infoRpt.cb_Observacion   = item.cb_Observacion;
                        infoRpt.cb_secuencia     = item.cb_secuencia;
                        infoRpt.cb_Valor         = item.cb_Valor;
                        infoRpt.cb_Cheque        = item.cb_Cheque;
                        infoRpt.cb_ChequeImpreso = item.cb_ChequeImpreso;
                        infoRpt.cb_FechaCheque   = item.cb_FechaCheque;
                        infoRpt.Fecha_Transac    = item.Fecha_Transac;
                        infoRpt.Estado           = item.Estado;
                        infoRpt.cb_giradoA       = item.cb_giradoA;
                        infoRpt.cb_ciudadChq     = item.cb_ciudadChq;
                        infoRpt.CodTipoCbteBan   = item.CodTipoCbteBan;
                        infoRpt.cb_Fecha         = item.cb_Fecha;
                        infoRpt.con_Fecha        = item.con_Fecha;
                        infoRpt.con_Valor        = item.con_Valor;
                        infoRpt.con_Observacion  = item.con_Observacion;
                        infoRpt.con_IdCbteCble   = item.con_IdCbteCble;
                        infoRpt.IdCtaCble        = item.IdCtaCble;
                        infoRpt.pc_Cuenta        = item.pc_Cuenta;
                        infoRpt.ValorEnLetras    = item.ValorEnLetras;
                        infoRpt.dc_Valor         = item.dc_Valor;
                        infoRpt.nom_ciudad       = item.nom_ciudad;
                        if (infoRpt.dc_Valor < 0)
                        {
                            infoRpt.dc_ValorHaber = infoRpt.dc_Valor * -1;
                        }
                        else
                        {
                            infoRpt.dc_ValorDebe = infoRpt.dc_Valor;
                        }

                        Result.Add(infoRpt);
                    }

                    return(Result);
                }
            }
            catch (Exception ex)
            {
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt005_Data)
                      };
            }
        }
Exemple #16
0
        public List <XBAN_Rpt002_Info> Cargar_data(int idempresa, DateTime FechaIni, DateTime FechaFin, int idBancoIni, int idBancoFin, string TipoCbte, decimal IdPersona_Girado)
        {
            try
            {
                decimal IdPersona_GiradoIni = 0;
                decimal IdPersona_GiradoFin = 0;

                List <XBAN_Rpt002_Info> listadedatos = new List <XBAN_Rpt002_Info>();


                FechaIni = Convert.ToDateTime(FechaIni.ToShortDateString());
                FechaFin = Convert.ToDateTime(FechaFin.ToShortDateString());



                using (EntitiesBancos_Reporte_Ge ListadoCbte = new EntitiesBancos_Reporte_Ge())
                {
                    if (IdPersona_Girado == 0)
                    {
                        IQueryable <XBAN_Rpt002_Info> consulta = from h in ListadoCbte.vwBAN_Rpt002
                                                                 where h.IdEmpresa == idempresa &&
                                                                 h.Fch_Cbte >= FechaIni && h.Fch_Cbte <= FechaFin &&
                                                                 h.IdBanco >= idBancoIni && h.IdBanco <= idBancoFin &&
                                                                 h.Tipo_Cbte.Contains(TipoCbte)
                                                                 //&& (girado_A != "" ? h.Chq_Girado_A.Contains(girado_A) : true)

                                                                 select new XBAN_Rpt002_Info
                        {
                            IdEmpresa        = h.IdEmpresa,
                            Tipo_Cbte        = h.Tipo_Cbte,
                            Num_Cbte         = h.Num_Cbte,
                            IdBanco          = h.IdBanco,
                            Banco            = h.Banco,
                            Fch_Cbte         = h.Fch_Cbte,
                            Observacion      = h.Observacion,
                            Valor            = h.Valor,
                            Cheque           = h.Cheque,
                            Chq_Girado_A     = h.Chq_Girado_A,
                            IdTipoFlujo      = h.IdTipoFlujo,
                            Tipo_Flujo       = h.Tipo_Flujo,
                            IdTipoNota       = h.IdTipoNota,
                            Tipo_Nota        = h.Tipo_Nota,
                            Fch_PostFechado  = h.Fch_PostFechado,
                            Es_Chq_Impreso   = h.Es_Chq_Impreso,
                            Fch_Chq          = h.Fch_Chq,
                            Cta_Cble_Banco   = h.Cta_Cble_Banco,
                            IdCalendario     = h.IdCalendario,
                            AnioFiscal       = h.AnioFiscal,
                            NombreMes        = h.NombreMes,
                            NombreCortoFecha = h.NombreCortoFecha,
                            IdMes            = h.IdMes,
                            pc_Cuenta        = h.pc_Cuenta,
                            //  SFch_Cbte = h.Fch_Cbte.ToString(format),
                            debe  = h.debe,
                            haber = h.haber,
                            saldo = h.saldo,
                            IdPersona_Girado_a = h.IdPersona_Girado_a
                        };

                        listadedatos = consulta.ToList();
                    }
                    else
                    {
                        IdPersona_GiradoIni = IdPersona_Girado;
                        IdPersona_GiradoFin = IdPersona_Girado;

                        IQueryable <XBAN_Rpt002_Info> consulta = from h in ListadoCbte.vwBAN_Rpt002
                                                                 where h.IdEmpresa == idempresa &&
                                                                 h.Fch_Cbte >= FechaIni && h.Fch_Cbte <= FechaFin &&
                                                                 h.IdBanco >= idBancoIni && h.IdBanco <= idBancoFin &&
                                                                 h.Tipo_Cbte.Contains(TipoCbte)
                                                                 //&& (girado_A != "" ? h.Chq_Girado_A.Contains(girado_A) : true)
                                                                 && h.IdPersona_Girado_a >= IdPersona_GiradoIni && h.IdPersona_Girado_a <= IdPersona_GiradoFin

                                                                 select new XBAN_Rpt002_Info
                        {
                            IdEmpresa        = h.IdEmpresa,
                            Tipo_Cbte        = h.Tipo_Cbte,
                            Num_Cbte         = h.Num_Cbte,
                            IdBanco          = h.IdBanco,
                            Banco            = h.Banco,
                            Fch_Cbte         = h.Fch_Cbte,
                            Observacion      = h.Observacion,
                            Valor            = h.Valor,
                            Cheque           = h.Cheque,
                            Chq_Girado_A     = h.Chq_Girado_A,
                            IdTipoFlujo      = h.IdTipoFlujo,
                            Tipo_Flujo       = h.Tipo_Flujo,
                            IdTipoNota       = h.IdTipoNota,
                            Tipo_Nota        = h.Tipo_Nota,
                            Fch_PostFechado  = h.Fch_PostFechado,
                            Es_Chq_Impreso   = h.Es_Chq_Impreso,
                            Fch_Chq          = h.Fch_Chq,
                            Cta_Cble_Banco   = h.Cta_Cble_Banco,
                            IdCalendario     = h.IdCalendario,
                            AnioFiscal       = h.AnioFiscal,
                            NombreMes        = h.NombreMes,
                            NombreCortoFecha = h.NombreCortoFecha,
                            IdMes            = h.IdMes,
                            pc_Cuenta        = h.pc_Cuenta,
                            // SFch_Cbte = h.Fch_Cbte.ToString(format),
                            debe  = h.debe,
                            haber = h.haber,
                            saldo = h.saldo,
                            IdPersona_Girado_a = h.IdPersona_Girado_a
                        };

                        listadedatos = consulta.ToList();
                    }
                }
                return(listadedatos);
            }
            catch (Exception ex)
            {
                string MensajeError = "";
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", "", "", "", "", "", "", DateTime.Now);
                MensajeError = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);

                Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
                throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "Get_Data_Reporte", ex.Message), ex)
                      {
                          EntityType = typeof(XBAN_Rpt014_Data)
                      };
            }
        }