public ActionResult ReporteEstadoCredito(int pCreditoId) { string pModalidad = string.Empty; var credito = CreditoBL.Obtener(x => x.CreditoId == pCreditoId, includeProperties: "Persona,Producto"); var data = CreditoBL.ListarEstadoPlanPago(pCreditoId); var rd = new ReportDataSource("dsEstadoCredito", data); switch (credito.FormaPago) { case "D": pModalidad = "DIARIO"; break; case "S": pModalidad = "SEMANAL"; break; case "Q": pModalidad = "QUINCENAL"; break; case "M": pModalidad = "MENSUAL"; break; } var parametros = new List <ReportParameter> { new ReportParameter("Producto", credito.Producto.Denominacion), new ReportParameter("MontoProducto", credito.MontoProducto.ToString()), new ReportParameter("MontoInicial", credito.MontoInicial.ToString()), new ReportParameter("MontoCredito", credito.MontoCredito.ToString()), new ReportParameter("Modalidad", pModalidad), new ReportParameter("Cuotas", credito.NumeroCuotas.ToString()), new ReportParameter("Interes", credito.Interes.ToString()), new ReportParameter("Estado", credito.Estado), new ReportParameter("Cliente", credito.Persona.NumeroDocumento + " " + credito.Persona.NombreCompleto), new ReportParameter("Analista", UsuarioBL.ObtenerNombre(credito.UsuarioRegId)), new ReportParameter("GastoAdm", credito.MontoGastosAdm.ToString()), new ReportParameter("Desembolso", credito.MontoDesembolso.ToString()) }; return(Reporte("PDF", "rptEstadoCredito.rdlc", rd, "A4Vertical0.25", parametros)); }
public ActionResult ObtenerCreditoPendiente(int pCreditoId) { var lstGrd = CreditoBL.ListarEstadoPlanPago(pCreditoId); var lstGrdPen = lstGrd.Where(x => x.Estado == "PEN").ToList(); var pendiente = new usp_EstadoPlanPago_Result() { Amortizacion = lstGrdPen.Sum(x => x.Amortizacion), Interes = lstGrdPen.Sum(x => x.Interes) + lstGrdPen.Sum(x => x.GastosAdm), ImporteMora = lstGrdPen.Sum(x => x.ImporteMora) + lstGrdPen.Sum(x => x.InteresMora), Cargo = lstGrdPen.Sum(x => x.Cargo) }; return(Json(pendiente, JsonRequestBehavior.AllowGet)); }
public ActionResult ListarPlanPagoActGrd(GridDataRequest request) { var lstGrd = CreditoBL.ListarEstadoPlanPago(int.Parse(request.DataFilters()["pCreditoId"])); int totalRecords = lstGrd.Count; var lstGrdPen = lstGrd.Where(x => x.Estado == "PAG").ToList(); lstGrd.Add(new usp_EstadoPlanPago_Result() { PlanPagoId = -1, Amortizacion = lstGrdPen.Sum(x => x.Amortizacion), Interes = lstGrdPen.Sum(x => x.Interes), GastosAdm = lstGrdPen.Sum(x => x.GastosAdm), Cuota = lstGrdPen.Sum(x => x.Cuota), ImporteMora = lstGrdPen.Sum(x => x.ImporteMora), InteresMora = lstGrdPen.Sum(x => x.InteresMora), PagoCuota = lstGrdPen.Sum(x => x.PagoCuota) }); lstGrdPen = lstGrd.Where(x => x.Estado == "PEN").ToList(); lstGrd.Add(new usp_EstadoPlanPago_Result() { PlanPagoId = -2, Amortizacion = lstGrdPen.Sum(x => x.Amortizacion), Interes = lstGrdPen.Sum(x => x.Interes), GastosAdm = lstGrdPen.Sum(x => x.GastosAdm), Cuota = lstGrdPen.Sum(x => x.Cuota), ImporteMora = lstGrdPen.Sum(x => x.ImporteMora), InteresMora = lstGrdPen.Sum(x => x.InteresMora), PagoCuota = lstGrdPen.Sum(x => x.PagoCuota) }); lstGrdPen = lstGrd.Where(x => x.Estado == "PEN" || x.Estado == "PAG" || x.Estado == "CRE").ToList(); lstGrd.Add(new usp_EstadoPlanPago_Result() { PlanPagoId = 0, Amortizacion = lstGrdPen.Sum(x => x.Amortizacion), Interes = lstGrdPen.Sum(x => x.Interes), GastosAdm = lstGrdPen.Sum(x => x.GastosAdm), Cuota = lstGrdPen.Sum(x => x.Cuota), ImporteMora = lstGrdPen.Sum(x => x.ImporteMora), InteresMora = lstGrdPen.Sum(x => x.InteresMora), PagoCuota = lstGrdPen.Sum(x => x.PagoCuota) }); var productsData = new { total = (int)Math.Ceiling((float)totalRecords / (float)request.rows), page = request.page, records = totalRecords, rows = (from item in lstGrd select new { id = item.PlanPagoId, cell = new string[] { item.PlanPagoId <= 0?String.Empty:item.Numero.ToString(), item.PlanPagoId <= 0?String.Empty:item.Capital.ToString(), item.PlanPagoId > 0?item.FechaVencimiento.ToShortDateString():(item.PlanPagoId == 0?"TOTAL":(item.PlanPagoId == -1?"PAGADO":"PENDIENTE")), item.Amortizacion.ToString(), item.Interes.ToString(), item.GastosAdm.ToString(), item.Cuota.ToString(), item.DiasAtrazo.ToString(), item.ImporteMora.ToString(), item.InteresMora.ToString(), item.Cargo.ToString(), item.PagoLibre.ToString(), item.PagoCuota.ToString(), item.Estado, item.FechaPagoCuota.HasValue?item.FechaPagoCuota.Value.ToShortDateString():string.Empty } } ).ToArray() }; return(Json(productsData, JsonRequestBehavior.AllowGet)); }