Exemple #1
0
        public List <XCXC_GRAF_Rpt003_Info> Get_list_reporte(int IdEmpresa, decimal IdCliente)
        {
            try
            {
                List <XCXC_GRAF_Rpt003_Info> Lista = new List <XCXC_GRAF_Rpt003_Info>();

                using (EntitiesCuentasxCobrar_GRAF_Rpt Context = new EntitiesCuentasxCobrar_GRAF_Rpt())
                {
                    var lst = from q in Context.vwCXC_GRAF_Rpt003
                              where q.IdEmpresa == IdEmpresa &&
                              q.IdCliente == IdCliente
                              select q;

                    foreach (var item in lst)
                    {
                        XCXC_GRAF_Rpt003_Info info = new XCXC_GRAF_Rpt003_Info();
                        info.IdRow             = item.IdRow;
                        info.IdEmpresa         = item.IdEmpresa;
                        info.IdSucursal        = item.IdSucursal;
                        info.IdBodega          = item.IdBodega;
                        info.IdCbteVta         = item.IdCbteVta;
                        info.CodCbteVta        = item.CodCbteVta;
                        info.vt_tipoDoc        = item.vt_tipoDoc;
                        info.IdCliente         = item.IdCliente;
                        info.IdPersona         = item.IdPersona;
                        info.pe_nombreCompleto = item.pe_nombreCompleto;
                        info.vt_NumFactura     = item.vt_NumFactura;
                        info.vt_total          = item.vt_total;
                        info.dc_ValorPago      = item.dc_ValorPago;
                        info.Saldo             = item.Saldo;
                        info.vt_fecha          = item.vt_fecha;
                        info.vt_fech_venc      = item.vt_fech_venc;
                        info.Dias_en_credito   = item.Dias_en_credito;
                        info.Dias_vencido      = item.Dias_vencido;
                        Lista.Add(info);
                    }
                }

                return(Lista);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                string arreglo = ToString();
                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(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemple #2
0
        public List <XCXC_GRAF_Rpt001_Info> Get_list_x_empresa(int IdEmpresa, int IdVendedor, DateTime Fecha_ini, DateTime Fecha_fin, List <string> lst_TipoCobro)
        {
            try
            {
                int IdVendedorIni, IdVendedorFin;

                IdVendedorIni = (IdVendedor == 0) ? 0 : IdVendedor;
                IdVendedorFin = (IdVendedor == 0) ? 999999999 : IdVendedor;
                List <XCXC_GRAF_Rpt001_Info> Lista = new List <XCXC_GRAF_Rpt001_Info>();

                using (EntitiesCuentasxCobrar_GRAF_Rpt Context = new EntitiesCuentasxCobrar_GRAF_Rpt())
                {
                    var lst = from q in Context.vwCXC_GRAF_Rpt001
                              where q.IdEmpresa_cbr == IdEmpresa &&
                              q.IdVendedor >= IdVendedorIni &&
                              q.IdVendedor <= IdVendedorFin &&
                              Fecha_ini <= q.cr_fechaCobro &&
                              q.cr_fechaCobro <= Fecha_fin &&
                              lst_TipoCobro.Contains(q.IdCobro_tipo)
                              select q;

                    foreach (var item in lst)
                    {
                        XCXC_GRAF_Rpt001_Info info = new XCXC_GRAF_Rpt001_Info();
                        info.IdEmpresa_cbr   = item.IdEmpresa_cbr;
                        info.IdSucursal_cbr  = item.IdSucursal_cbr;
                        info.IdCobro_cbr     = item.IdCobro_cbr;
                        info.Secuencial_cbr  = item.Secuencial_cbr;
                        info.porc_comision   = item.porc_comision == null ? 0 : (double)item.porc_comision;
                        info.Porc_pagado     = item.Porc_pagado == null ? 0 : (double)item.Porc_pagado;
                        info.Valor_pagado    = item.Valor_pagado == null ? 0 : (double)item.Valor_pagado;
                        info.IdCobro_tipo    = item.IdCobro_tipo;
                        info.cr_fechaCobro   = item.cr_fechaCobro;
                        info.Pago            = item.Pago;
                        info.IdEmpresa_fact  = item.IdEmpresa_fact;
                        info.IdSucursal_fact = item.IdSucursal_fact;
                        info.IdBodega_fact   = item.IdBodega_fact;
                        info.IdCbteVta_fact  = item.IdCbteVta_fact;
                        info.IdVendedor      = item.IdVendedor;
                        info.Ve_Vendedor     = item.Ve_Vendedor;
                        info.fecha_fact      = item.fecha_fact;
                        info.fecha_vcto_fact = item.fecha_vcto_fact;
                        info.nom_Cliente     = item.nom_Cliente;
                        info.Fa_total        = item.Fa_total;
                        info.Dias_atraso     = item.Dias_atraso;
                        info.Base_com        = item.Base_com;
                        info.IdCliente       = item.IdCliente;
                        info.vt_NumFactura   = item.vt_NumFactura;
                        info.Dias_Vct        = item.Dias_Vct;
                        info.com_negociada   = item.com_negociada;
                        info.Esta_en_base    = item.Esta_en_base == null ? false : (bool)item.Esta_en_base;
                        info.num_op          = item.num_op;
                        info.num_cotizacion  = item.num_cotizacion;
                        info.vt_tipoDoc      = item.vt_tipoDoc;
                        Lista.Add(info);
                    }
                }
                return(Lista);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                string arreglo = ToString();
                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(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemple #3
0
        public List <XCXC_GRAF_Rpt002_Info> Get_list_reporte(int IdEmpresa, decimal IdCliente, decimal IdVendedor, DateTime FechaCorte, bool Mostrar_solo_vencidas)
        {
            try
            {
                decimal IdClienteIni = IdCliente;
                decimal IdClienteFin = IdCliente == 0 ? 99999 : IdCliente;

                decimal IdVendedorIni = IdVendedor;
                decimal IdVendedorFin = IdVendedor == 0 ? 99999 : IdVendedor;

                List <XCXC_GRAF_Rpt002_Info> Lista = new List <XCXC_GRAF_Rpt002_Info>();

                using (EntitiesCuentasxCobrar_GRAF_Rpt Context = new EntitiesCuentasxCobrar_GRAF_Rpt())
                {
                    var lst = from q in Context.spCXC_GRAF_Rpt002(IdEmpresa, IdClienteIni, IdClienteFin, IdVendedorIni, IdVendedorFin, FechaCorte)
                              select q;

                    if (Mostrar_solo_vencidas)
                    {
                        lst = lst.Where(q => q.Dias_vcdos > 0);
                    }

                    foreach (var item in lst)
                    {
                        XCXC_GRAF_Rpt002_Info info = new XCXC_GRAF_Rpt002_Info();
                        info.IdEmpresa         = item.IdEmpresa;
                        info.IdSucursal        = item.IdSucursal;
                        info.IdBodega          = item.IdBodega;
                        info.IdCbteVta         = item.IdCbteVta;
                        info.vt_Subtotal       = item.vt_Subtotal;
                        info.vt_iva            = item.vt_iva;
                        info.vt_total          = item.vt_total;
                        info.vt_por_iva        = item.vt_por_iva;
                        info.IdCliente         = item.IdCliente;
                        info.IdPersona         = item.IdPersona;
                        info.pe_nombreCompleto = item.pe_nombreCompleto;
                        info.dc_ValorPago      = item.dc_ValorPago;
                        info.Saldo             = item.Saldo;
                        info.vt_fecha          = item.vt_fecha;
                        info.vt_fech_venc      = item.vt_fech_venc;
                        info.Ve_Vendedor       = item.Ve_Vendedor;
                        info.IdVendedor        = item.IdVendedor;
                        info.CodCbteVta        = item.CodCbteVta;
                        info.Dias_vcdos        = item.Dias_vcdos;
                        info.pe_telefonoOfic   = item.pe_telefonoOfic;
                        Lista.Add(info);
                    }
                }

                return(Lista);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                string arreglo = ToString();
                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(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }