Example #1
0
        public decimal ObtenerImporteDeInteres(DateTime FechaActa, decimal TotalDeuda, decimal interes_)
        {
            Func_Utiles fu         = new Func_Utiles();
            DateTime    FechaDesde = FechaActa;
            string      dia        = fu.GetDia31DelMes(fu.generar_ceros(FechaDesde.Month.ToString(), 2));

            FechaDesde = Convert.ToDateTime(dia + "/" + fu.generar_ceros(FechaDesde.Month.ToString(), 2) + "/" + FechaDesde.Year.ToString());
            double  dias              = Convert.ToInt32((DateTime.Today.Date - FechaDesde.Date).TotalDays);
            decimal meses             = Convert.ToDecimal(dias / 30);
            decimal interes           = Convert.ToDecimal(meses * interes_);
            decimal ImporteDelInteres = Convert.ToDecimal((TotalDeuda * (interes / 100)));

            return(ImporteDelInteres > 0 ? ImporteDelInteres : 0);
        }
Example #2
0
        public fechas ObtenerIntervaloDeFechas(string desde, string hasta)
        {
            Func_Utiles fu = new Func_Utiles();


            if (desde == "  /" && hasta == "  /")
            {
                IntervaloDeFechas.Desde = Convert.ToDateTime("01/01/2000");// new DateTime(01/01/2000);
                IntervaloDeFechas.Hasta = Convert.ToDateTime(fu.GetDia31DelMes(fu.generar_ceros(DateTime.Now.Month.ToString(), 2)) + "/" + fu.generar_ceros(DateTime.Now.Month.ToString(), 2) + "/" + DateTime.Now.Year.ToString()).Date;
            }

            if (desde == "  /" && hasta != "  /")
            {
                IntervaloDeFechas.Desde = Convert.ToDateTime("01/01/2000");// new DateTime(01/01/2000);
                IntervaloDeFechas.Hasta = Convert.ToDateTime(fu.GetDia31DelMes(hasta.Substring(0, 2)) + "/" + hasta);
            }

            if (desde != "  /" && hasta == "  /")
            {
                IntervaloDeFechas.Desde = Convert.ToDateTime("01" + "/" + desde);
                IntervaloDeFechas.Hasta = Convert.ToDateTime("01/01/3000");// new DateTime(01/01/2000);
            }

            if (desde != "  /" && hasta != "  /")
            {
                //string fecha_2 = fu.GetDia31DelMes(hasta.Substring(0, 2));
                IntervaloDeFechas.Desde = Convert.ToDateTime("01/" + desde);
                IntervaloDeFechas.Hasta = Convert.ToDateTime(fu.GetDia31DelMes(hasta.Substring(0, 2)) + "/" + hasta);// new DateTime(01/01/2000);
            }
            return(IntervaloDeFechas);
        }
Example #3
0
        public List <empresas_con_deuda> get_empresas()
        {
            var empresa_deuda = from a in db_sindicato.maeemp
                                //join l in db_sindicato.localidad on a.MAEEMP_CODLOC equals l.MAELOC_CODLOC
                                //where a.MAEEMP_CODLOC == 2216
                                select new
            {
                cuit      = a.MEEMP_CUIT_STR,
                empresa   = a.MAEEMP_RAZSOC,
                domicilio = a.MAEEMP_CALLE.Trim() + " " + a.MAEEMP_NRO,
                loc       = "SGO",
                telefono  = a.MAEEMP_TEL,
                estudio   = a.MAEEMP_ESTUDIO_CONTACTO          // l.MAELOC_NOMBRE,
            };

            if (empresa_deuda.Count() > 0)
            {
                foreach (var empresa in empresa_deuda.ToList())
                {
                    Func_Utiles        func_utiles    = new Func_Utiles();
                    empresas_con_deuda emp_deu        = new empresas_con_deuda();
                    DateTime           ultimo_periodo = obtener_periodo(empresa.cuit);


                    if (ultimo_periodo.Date == Convert.ToDateTime("01/01/1900").Date)
                    {
                        DateTime cinco_atras = DateTime.Now.AddYears(-5);
                        ultimo_periodo = Convert.ToDateTime("01/" + func_utiles.generar_ceros(cinco_atras.Month.ToString(), 2) + "/" + cinco_atras.Year.ToString());
                    }
                    //if (ultimo_periodo.Date != Convert.ToDateTime("01/01/1900").Date)
                    //{
                    emp_deu.cuit      = empresa.cuit;
                    emp_deu.empresa   = empresa.empresa.Trim();
                    emp_deu.domicilio = empresa.domicilio.Trim();
                    emp_deu.localidad = empresa.loc.Trim();
                    emp_deu.telefono  = empresa.telefono;
                    emp_deu.estudio   = empresa.estudio;
                    emp_deu.deuda     = obtener_deudas(ultimo_periodo, empresa.cuit);
                    lista_emp_deuda.Add(emp_deu);
                    emp_deu.ultimo_periodo = ultimo_periodo;
                    //}
                }
            }
            return(lista_emp_deuda);
        }