protected decimal caclMensualidad() { decimal lres = 0.0M; if (this.partidasAbiertas == null) { return(lres); } int lno_elementos = this.partidasAbiertas.Count; CZcmlPabiertas lpa = null; Decimal mens_actual = 0.0M; Decimal mens_anterior = 0.0M; DateTime lfcontable = DateTime.MinValue; DateTime lahora = DateTime.Now; DateTime lanterior = DateTime.Now; int anio_ant = lahora.Year; int mes_ant = lahora.Month; // mes anterior { if (mes_ant == 1) { mes_ant = 12; anio_ant--; } else { mes_ant--; } } for (int va = 0; va < lno_elementos; va++) { lpa = this.partidasAbiertas[va]; lfcontable = Convert.ToDateTime(lpa.Budat); /*Mes actual*/ if (lfcontable.Year == lahora.Year && lfcontable.Month == lahora.Month) { this._mnsGenerada = true; /*Obtener de mensualidad*/ if (lpa.Shkzg.Equals("s") || lpa.Shkzg.Equals("S")) { mens_actual += lpa.ImpReev; } } /*Mes anterior*/ else if (lfcontable.Year == anio_ant && lfcontable.Month == mes_ant) { /*Obtener de mensualidad*/ if (lpa.Shkzg.Equals("s") || lpa.Shkzg.Equals("S")) { mens_anterior += lpa.ImpReev; } } } lres = (0.0M < mens_actual ? mens_actual : mens_anterior); return(lres); }
protected decimal totalAdecudo() { decimal lres = 0.0M; try { if (this.partidasAbiertas == null) { return(lres); } int lno_elementos = this.partidasAbiertas.Count; CZcmlPabiertas lpa = null; for (int va = 0; va < lno_elementos; va++) { lpa = this.partidasAbiertas[va]; if (lpa.Shkzg.Equals("s") || lpa.Shkzg.Equals("S")) { lres += lpa.ImpReev; } else if (lpa.Shkzg.Equals("h") || lpa.Shkzg.Equals("H")) { lres -= lpa.ImpReev; } } } catch (Exception aexception) { lres = 0.0M; System.Diagnostics.Debug.WriteLine(aexception.Message); } return(lres); }
protected decimal sumaAmotizaciones() { decimal lres = 0.0M; if (this.partidasAbiertas == null) { return(lres); } int lno_elementos = this.partidasAbiertas.Count; CZcmlPabiertas lpa = null; for (int va = 0; va < lno_elementos; va++) { lpa = this.partidasAbiertas[va]; if (!this.esAmortizacion(lpa.Vbewa)) { continue; } lres += lpa.ImpReev; } return(lres); }