Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        public ActionResult ReportePlanPagos(int pCreditoId)
        {
            var credito   = CreditoBL.Obtener(x => x.CreditoId == pCreditoId, "Persona");
            var oPlanPago = CreditoBL.ReportePlanPago(pCreditoId);
            var rd        = new ReportDataSource("dsSimuladorPlanPago", oPlanPago);

            string pModalidad = string.Empty;

            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("Monto", credito.MontoCredito.ToString()),
                new ReportParameter("Cuotas", credito.NumeroCuotas.ToString()),
                new ReportParameter("Producto", ProductoBL.Obtener(credito.ProductoId).Denominacion),
                new ReportParameter("Fecha", credito.FechaPrimerPago.ToShortDateString()),
                new ReportParameter("Modalidad", pModalidad),
                new ReportParameter("Cliente", credito.Persona.NombreCompleto)
            };

            return(Reporte("PDF", "rptSimuladorPlanPago.rdlc", rd, "A4Vertical0.25", parametros));
        }
Exemplo n.º 3
0
        public ActionResult ReporteCreditoMovimiento(int pCreditoId)
        {
            var credito = CreditoBL.Obtener(x => x.CreditoId == pCreditoId, "Persona");
            var oMov    = CreditoBL.ReporteCreditoMovimiento(pCreditoId);
            var rd      = new ReportDataSource("dsCreditoMov", oMov);

            var parametros = new List <ReportParameter>
            {
                new ReportParameter("CreditoId", pCreditoId.ToString()),
                new ReportParameter("Cliente", credito.Persona.NombreCompleto),
                new ReportParameter("Articulo", credito.Descripcion)
            };

            return(Reporte("PDF", "rptCreditoMov.rdlc", rd, "A4Vertical0.25", parametros));
        }
Exemplo n.º 4
0
        public ActionResult ValidarDesembolso(int pCreditoId)
        {
            if (CuentaxCobrarBL.Contar(x => x.CreditoId == pCreditoId && x.Estado == "PEN") > 0)
            {
                return(Json(new { error = true, mensaje = "Tiene Cuentas por cobrar Pendientes!" }, JsonRequestBehavior.AllowGet));
            }

            var pImporte = CreditoBL.Obtener(pCreditoId).MontoDesembolso;

            if (pImporte > CajaDiarioBL.Obtener(VendixGlobal.GetCajaDiarioId()).SaldoFinal)
            {
                return(Json(new { error = true, mensaje = "Saldo Insuficiente!" }, JsonRequestBehavior.AllowGet));
            }

            return(Json(new { error = false }, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 5
0
        public ActionResult ObservarCredito(int pCreditoId, string pObs)
        {
            var c = CreditoBL.Obtener(pCreditoId);

            c.Observacion = pObs;
            CreditoBL.Actualizar(c);
            return(Json(true));
            //using (var scope = new TransactionScope())
            //{
            //    try
            //    {
            //        CreditoBL.ActualizarParcial(new Credito { CreditoId = pCreditoId, Observacion = pObs }, x => x.Observacion);
            //        scope.Complete();
            //        return Json(true);
            //    }
            //    catch (Exception ex)
            //    {
            //        scope.Dispose();
            //        return Json(ex.InnerException.Message);
            //    }
            //}
        }
Exemplo n.º 6
0
        public ActionResult CondonarCredito(int pCreditoId, decimal pMontocxc, string pObs)
        {
            using (var scope = new TransactionScope())
            {
                try
                {
                    var cxc = CuentaxCobrarBL.Obtener(x => x.CreditoId == pCreditoId);
                    if (cxc == null)
                    {
                        CuentaxCobrarBL.Crear(new CuentaxCobrar
                        {
                            Operacion = "CDN",
                            Monto     = pMontocxc,
                            Estado    = "PEN",
                            CreditoId = pCreditoId
                        });
                    }
                    else
                    {
                        cxc.CreditoId = pCreditoId;
                        cxc.Operacion = "CDN";
                        cxc.Monto     = pMontocxc;
                        cxc.Estado    = "PEN";
                        CuentaxCobrarBL.Actualizar(cxc);
                    }

                    var c = CreditoBL.Obtener(pCreditoId);
                    c.Observacion = VendixGlobal.GetFecha().ToString() + " " + pObs;
                    CreditoBL.Actualizar(c);
                    scope.Complete();
                    return(Json(true));
                }
                catch (Exception ex)
                {
                    scope.Dispose();
                    return(Json(ex.InnerException.Message));
                }
            }
        }