示例#1
0
        public ActionResult Anular(decimal IdEmpleado, decimal IdPrestamo)
        {
            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion
            int IdEmpresa          = Convert.ToInt32(SessionFixed.IdEmpresa);
            ro_prestamo_Info model = bus_prestamos.get_info(IdEmpresa, IdEmpleado, IdPrestamo);
            model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession);
            if (model == null)
            {
                return(RedirectToAction("Index"));
            }
            model.lst_detalle = bus_detalle.get_list(IdEmpresa, IdPrestamo);
            Lis_ro_prestamo_detalle_lst.set_list(model.lst_detalle, model.IdTransaccionSession);

            #region Validacion Periodo
            ViewBag.MostrarBoton = true;
            if (!bus_periodo.ValidarFechaTransaccion(IdEmpresa, model.Fecha, cl_enumeradores.eModulo.RRHH, 0, ref mensaje))
            {
                ViewBag.mensaje      = mensaje;
                ViewBag.MostrarBoton = false;
            }
            #endregion

            cargar_combos();
            return(View(model));
        }
示例#2
0
        public bool Abono(ro_prestamo_Info info)
        {
            try
            {
                using (Entities_rrhh Context = new Entities_rrhh())
                {
                    ro_prestamo Entity = Context.ro_prestamo.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdEmpleado == info.IdEmpleado && q.IdPrestamo == info.IdPrestamo);
                    if (Entity == null)
                    {
                        return(false);
                    }
                    Entity.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                    Entity.Fecha_UltAnu    = info.Fecha_UltAnu = DateTime.Now;
                    foreach (var item in info.lst_detalle)
                    {
                        ro_prestamo_detalle Entity_det = Context.ro_prestamo_detalle.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdPrestamo == info.IdPrestamo &&
                                                                                                    q.NumCuota == item.NumCuota);
                        Entity_det.EstadoPago = item.EstadoPago;
                        Entity_det.Saldo      = Entity_det.Saldo - item.ValorAplicado;
                        Context.SaveChanges();
                    }
                    Context.SaveChanges();
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public ActionResult Modificar(ro_prestamo_Info model)
        {
            model.lst_detalle     = Lis_ro_prestamo_detalle_lst.get_list(model.IdTransaccionSession);
            model.IdUsuarioUltMod = Session["IdUsuario"].ToString();
            if (model.lst_detalle == null || model.lst_detalle.Count() == 0)
            {
                ViewBag.mensaje = "No existe detalle del prestamo";
                cargar_combos();
                return(View(model));
            }
            decimal diferencia = Convert.ToDecimal((model.MontoSol - model.lst_detalle.Sum(v => v.TotalCuota)));

            if (Convert.ToInt32(diferencia) != 0)
            {
                ViewBag.mensaje = "Monto del prestamo no coincide con la suma del detalle";
                cargar_combos();
                return(View(model));
            }
            if (!validar(model))
            {
                cargar_combos();
                return(View(model));
            }
            model.IdEmpresa = Convert.ToInt32(Session["IdEmpresa"]);
            foreach (var item in model.lst_detalle)
            {
                item.TotalCuota = Math.Round(item.TotalCuota, 2);
            }
            if (!bus_prestamos.modificarDB(model))
            {
                cargar_combos();
                return(View(model));
            }
            return(RedirectToAction("Index"));
        }
示例#4
0
 public ActionResult Abono(decimal IdEmpleado, decimal IdPrestamo)
 {
     #region Validar Session
     if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
     {
         return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
     }
     SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
     SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
     #endregion
     int IdEmpresa          = Convert.ToInt32(SessionFixed.IdEmpresa);
     ro_prestamo_Info model = bus_prestamos.get_info(IdEmpresa, IdEmpleado, IdPrestamo);
     model.IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession);
     if (model == null)
     {
         return(RedirectToAction("Index"));
     }
     model.lst_detalle = bus_detalle.get_list(IdEmpresa, IdPrestamo);
     if (model.lst_detalle.Count() > 0)
     {
         model.Valor_pendiente = model.lst_detalle.Where(v => v.EstadoPago == "PEN").Sum(v => v.TotalCuota);
     }
     Lis_ro_prestamo_detalle_lst.set_list(model.lst_detalle, model.IdTransaccionSession);
     cargar_combos();
     return(View(model));
 }
        public void Set(ro_prestamo_Info info)
        {
            try
            {
                cmbEmpleados.EditValue = info.IdEmpleado;
                cmbRubro.EditValue     = info.IdRubro;
                cmbTipoNomi.EditValue  = info.IdNomina_Tipo;
                txtObservacion.Text    = info.Observacion;
                info.Detalle           = Prestamo_Detalle_Bus.ConsultaxIdPrestamo(param.IdEmpresa, info.IdPrestamo);
                DetallePrestamo        = info.Detalle.Where(v => v.EstadoPago == "PEN").ToList();

                gridControlDetalle.DataSource = DetallePrestamo;

                if (DetallePrestamo.Count() > 0)
                {
                    txtTotal_Pendiente.Text   = DetallePrestamo.Sum(v => v.TotalCuota).ToString();
                    txtNumCuotaPendiente.Text = DetallePrestamo.Count().ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
示例#6
0
        public ActionResult Nuevo()
        {
            #region Validar Session
            if (string.IsNullOrEmpty(SessionFixed.IdTransaccionSession))
            {
                return(RedirectToAction("Login", new { Area = "", Controller = "Account" }));
            }
            SessionFixed.IdTransaccionSession       = (Convert.ToDecimal(SessionFixed.IdTransaccionSession) + 1).ToString();
            SessionFixed.IdTransaccionSessionActual = SessionFixed.IdTransaccionSession;
            #endregion
            ro_prestamo_Info model = new ro_prestamo_Info
            {
                IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession),

                IdEmpresa         = Convert.ToInt32(Session["IdEmpresa"]),
                Fecha             = DateTime.Now,
                Fecha_PriPago     = DateTime.Now,
                descuento_mensual = true
            };
            model.lst_detalle = new List <ro_prestamo_detalle_Info>();
            Lis_ro_prestamo_detalle_lst.set_list(model.lst_detalle, model.IdTransaccionSession);
            cargar_combos();
            cargar_combos_detalle();
            return(View(model));
        }
示例#7
0
 public bool modificarDB(ro_prestamo_Info info)
 {
     try
     {
         odata          = new ro_prestamo_Data();
         info.NumCuotas = info.lst_detalle.Count();
         info.Fecha     = info.Fecha_PriPago;
         if (odata.modificarDB(info))
         {
             info.IdPrestamo = info.IdPrestamo;
             odata_det       = new ro_prestamo_detalle_Data();
             info.lst_detalle.ForEach(v => { v.IdEmpresa = info.IdEmpresa; v.IdPrestamo = info.IdPrestamo; });
             odata_det.eliminarDB(info);
             return(odata_det.guardarDB(info.lst_detalle));
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         tb_LogError_Bus LogData = new tb_LogError_Bus();
         LogData.GuardarDB(new tb_LogError_Info {
             Descripcion = ex.Message, InnerException = ex.InnerException == null ? null : ex.InnerException.Message, Clase = "ro_prestamo_Bus", Metodo = "modificarDB", IdUsuario = info.IdUsuario
         });
         return(false);
     }
 }
示例#8
0
 public bool guardarDB(ro_prestamo_Info info)
 {
     try
     {
         if (info.descuento_mensual)
         {
             get_calculomensual(info);
         }
         if (info.descuento_quincena)
         {
             get_calculoquincenal(info);
         }
         info.NumCuotas = info.lst_detalle.Count();
         info.Fecha     = info.Fecha_PriPago;
         if (odata.guardarDB(info))
         {
             info.IdPrestamo = info.IdPrestamo;
             odata_det       = new ro_prestamo_detalle_Data();
             info.lst_detalle.ForEach(v => { v.IdEmpresa = info.IdEmpresa; v.IdPrestamo = info.IdPrestamo; });
             return(odata_det.guardarDB(info.lst_detalle));
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         tb_LogError_Bus LogData = new tb_LogError_Bus();
         LogData.GuardarDB(new tb_LogError_Info {
             Descripcion = ex.Message, InnerException = ex.InnerException == null ? null : ex.InnerException.Message, Clase = "ro_prestamo_Bus", Metodo = "guardarDB", IdUsuario = info.IdUsuario
         });
         return(false);
     }
 }
示例#9
0
        public Boolean ModificarCamposOP(ro_prestamo_Info Info)
        {
            try
            {
                using (EntitiesRoles Entity = new EntitiesRoles())
                {
                    var prestamo = Entity.ro_prestamo.First(v => v.IdPrestamo == Info.IdPrestamo && v.IdEmpresa == Info.IdEmpresa);

                    prestamo.IdOrdenPago = Info.IdOrdenPago;
                    prestamo.IdTipo_Pago = Info.IdTipo_Pago;
                    prestamo.IdCbteCble  = Info.IdCbteCble;

                    Entity.SaveChanges();
                }


                return(true);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
        private void pu_AbrirPrestamos()
        {
            try
            {
                ro_prestamo_Info cab    = new ro_prestamo_Info();
                ro_periodo_Info  period = new ro_periodo_Info();

                if (period != null)
                {
                    cab.IdEmpleado = Info.IdEmpleado;
                }
                cab.IdNomina_Tipo = _idNominaTipo;


                frmRo_Prestamos frmPrestamo = new frmRo_Prestamos();
                frmPrestamo = new frmRo_Prestamos(Cl_Enumeradores.eTipo_action.grabar);
                frmPrestamo.setCabPrestamo(cab);

                frmPrestamo.ShowDialog();

                //btnRefresh_Click(sender, e);

                //setInfo();

                //this.CargaEmpSalNeg();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
示例#11
0
        public Boolean AnularPrestamo(ro_prestamo_Info _Info)
        {
            try
            {
                using (EntitiesRoles Entity = new EntitiesRoles())
                {
                    ro_prestamo cabecera = Entity.ro_prestamo.First(v => v.IdPrestamo == _Info.IdPrestamo && v.IdEmpresa == _Info.IdEmpresa);

                    // Entity.ro_prestamo.Remove(cabecera);
                    cabecera.IdUsuarioUltAnu = _Info.IdUsuarioUltAnu;
                    cabecera.Fecha_UltAnu    = _Info.Fecha_UltAnu;
                    cabecera.MotiAnula       = _Info.MotiAnula;

                    cabecera.Estado = "I";
                    Entity.SaveChanges();
                }

                return(true);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
示例#12
0
 void ucGe_Menu_Mantenimiento_x_usuario_event_btnModificar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     // var Info = (vwRo_Prestamo_Info)this.gridViewCons.GetFocusedRow();
     try
     {
         Info = (ro_prestamo_Info)this.gridViewCons.GetFocusedRow();
         if (Info == null)
         {
             MessageBox.Show("Seleccione un registro", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             if (Info.Estado == "I")
             {
                 MessageBox.Show("No se Puede modificar El Registro Esta Anulado", "Sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
             else
             {
                 frmMant = new frmRo_Prestamos(Cl_Enumeradores.eTipo_action.actualizar);
                 frmMant.event_frmRo_Prestamos_FormClosing += frmMant_event_frmRo_Prestamos_FormClosing;
                 frmMant.Text     = frmMant.Text + " ***ACTUALIZAR REGISTRO***";
                 frmMant.SETINFO_ = Info;
                 frmMant.ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
示例#13
0
 public bool modificarDB(ro_prestamo_Info info)
 {
     try
     {
         odata          = new ro_prestamo_Data();
         info.NumCuotas = info.lst_detalle.Count();
         info.Fecha     = info.Fecha_PriPago;
         if (odata.modificarDB(info))
         {
             info.IdPrestamo = info.IdPrestamo;
             odata_det       = new ro_prestamo_detalle_Data();
             info.lst_detalle.ForEach(v => { v.IdEmpresa = info.IdEmpresa; v.IdPrestamo = info.IdPrestamo; });
             odata_det.eliminarDB(info);
             return(odata_det.guardarDB(info.lst_detalle));
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#14
0
        private bool validar(ro_prestamo_Info model)
        {
            bool bandera = true;

            if (model.descuento_quincena && model.Fecha_PriPago.Day > 15)
            {
                ViewBag.mensaje = "La fecha del primer pago debe estar entre el [01 al 15] de cada mes";
                bandera         = false;
            }

            if (model.descuento_men_quin && model.Fecha_PriPago.Day != 15 && model.descuento_men_quin && model.Fecha_PriPago.Day != 30)
            {
                ViewBag.mensaje = "La fecha del primer pago debe ser [15 o 30] de cada mes";
                bandera         = false;
            }
            if (model.MontoSol == 0 | model.MontoSol < 0)
            {
                ViewBag.mensaje = "El monto del prestamo debe ser mayor a cero";
                bandera         = false;
            }
            if (model.NumCuotas == 0 | model.NumCuotas < 0)
            {
                ViewBag.mensaje = "El n'umerode cuota debe ser mayor a cero";
                bandera         = false;
            }
            return(bandera);
        }
示例#15
0
 public bool guardarDB(ro_prestamo_Info info)
 {
     try
     {
         if (info.descuento_mensual)
         {
             get_calculomensual(info);
         }
         if (info.descuento_quincena)
         {
             get_calculoquincenal(info);
         }
         info.NumCuotas = info.lst_detalle.Count();
         info.Fecha     = info.Fecha_PriPago;
         if (odata.guardarDB(info))
         {
             info.IdPrestamo = info.IdPrestamo;
             odata_det       = new ro_prestamo_detalle_Data();
             info.lst_detalle.ForEach(v => { v.IdEmpresa = info.IdEmpresa; v.IdPrestamo = info.IdPrestamo; });
             return(odata_det.guardarDB(info.lst_detalle));
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#16
0
        public ro_prestamo_Info get_calculomensual(ro_prestamo_Info info)
        {
            try
            {
                info.lst_detalle = new List <ro_prestamo_detalle_Info>();
                int      periodo     = Convert.ToInt32(info.NumCuotas);
                double   valor_cuota = info.MontoSol / info.NumCuotas;
                double   saldo       = info.MontoSol;
                DateTime fecha_pago  = info.Fecha_PriPago;
                info.MontoSol = info.MontoSol;
                List <ro_prestamo_detalle_Info> listaDetalle = new List <ro_prestamo_detalle_Info>();
                for (int i = 1; i <= periodo; i++)
                {
                    ro_prestamo_detalle_Info item = new ro_prestamo_detalle_Info();

                    if (i == 1)
                    {
                        item.FechaPago = fecha_pago;
                    }
                    else
                    {
                        fecha_pago = fecha_pago.AddMonths(1);
                    }

                    item.FechaPago         = info.Fecha_PriPago;
                    item.NumCuota          = i;
                    item.TotalCuota        = valor_cuota;
                    item.Saldo             = info.MontoSol;
                    item.Saldo             = saldo - item.TotalCuota;
                    item.FechaPago         = fecha_pago;
                    item.EstadoPago        = "PEN";
                    item.Observacion_det   = "Cuota número " + i + " fecha pago " + fecha_pago.ToString("dd/MM/yyyy");
                    item.IdNominaTipoLiqui = 2;

                    saldo           = saldo - valor_cuota;
                    item.TotalCuota = Math.Round(item.TotalCuota, 2);
                    item.Saldo      = Math.Round(item.Saldo, 2);

                    info.lst_detalle.Add(item);
                }

                double diferencia = info.MontoSol - info.lst_detalle.Sum(v => v.TotalCuota);
                if (diferencia != 0)
                {
                    foreach (var item in info.lst_detalle)
                    {
                        item.TotalCuota = item.TotalCuota + diferencia;
                        break;
                    }
                }

                return(info);
            }
            catch (Exception)
            {
                throw;
            }
        }
        }//haac 02/10/13

        public List <ro_prestamo_Info> GetListConsultarPrestamoXEmpleado(int idEmpresa, int idEmpleado)
        {
            try
            {
                using (EntitiesRoles db = new EntitiesRoles())
                {
                    // fechaInicio = Convert.ToDateTime(fechaInicio.ToShortDateString());
                    //fechaFin = Convert.ToDateTime(fechaFin.ToShortDateString());

                    List <ro_prestamo_Info> ListaPrestamo = new List <ro_prestamo_Info>();


                    var Consulta = from q in db.vwRo_Prestamo
                                   where q.IdEmpresa == idEmpresa && q.IdEmpleado == idEmpleado
                                   select q;
                    foreach (var item in Consulta)
                    {
                        ro_prestamo_Info info = new ro_prestamo_Info();

                        info.IdEmpresa          = item.IdEmpresa;
                        info.IdPrestamo         = item.IdPrestamo;
                        info.descuento_men_quin = item.descuento_men_quin;
                        info.descuento_mensual  = item.descuento_mensual;
                        info.descuento_quincena = item.descuento_quincena;
                        info.IdEmpleado         = item.IdEmpleado;
                        info.pe_nombre          = item.pe_nombre;
                        info.IdRubro            = item.IdRubro;
                        info.ru_descripcion     = item.ru_descripcion;
                        info.IdEmpleado_Aprueba = item.IdEmpleado_Aprueba;
                        info.pe_nombre_apru     = item.pe_nombre_apru;
                        info.Estado             = item.Estado;
                        info.Fecha         = item.Fecha;
                        info.MontoSol      = item.MontoSol;
                        info.TasaInteres   = item.TasaInteres;
                        info.NumCuotas     = item.NumCuotas;
                        info.Observacion   = item.Observacion;
                        info.TotalPrestamo = Convert.ToDouble(item.MontoSol);
                        info.TotalCobrado  = item.TotalCobrado;
                        info.SaldoPrestamo = item.Valor_pendiente;
                        info.Fecha_PriPago = item.Fecha_PriPago;
                        info.Tipo_Calculo  = item.Tipo_Calculo;
                        info.MotiAnula     = item.MotiAnula;
                        ListaPrestamo.Add(info);
                    }

                    return(ListaPrestamo);
                }
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
示例#18
0
        public ActionResult EditingDelete([ModelBinder(typeof(DevExpressEditorsBinder))] ro_prestamo_detalle_Info info_det)
        {
            Lis_ro_prestamo_detalle_lst.DeleteRow(info_det.NumCuota, Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual));
            ro_prestamo_Info model = new ro_prestamo_Info();

            model.lst_detalle = Lis_ro_prestamo_detalle_lst.get_list(Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual));
            cargar_combos_detalle();
            return(PartialView("_GridViewPartial_prestamos_det", model));
        }
示例#19
0
        public List <ro_prestamo_Info> ConsultarCabeceraPrestamoxIdPrestamo(int IdEmpresa, decimal IdPrestamo)
        {
            try
            {
                using (EntitiesRoles oen = new EntitiesRoles())
                {
                    List <ro_prestamo_Info> ListaPrestamo = new List <ro_prestamo_Info>();
                    var Consulta = from q in oen.vwRo_Prestamo
                                   where q.IdEmpresa == IdEmpresa && q.IdPrestamo == IdPrestamo
                                   select q;
                    foreach (var item in Consulta)
                    {
                        ro_prestamo_Info info = new ro_prestamo_Info();

                        info.IdEmpresa          = item.IdEmpresa;
                        info.IdPrestamo         = item.IdPrestamo;
                        info.IdNomina_Tipo      = item.IdNomina_Tipo;
                        info.nomi_descripcion   = item.nomi_descripcion;
                        info.IdEmpleado         = item.IdEmpleado;
                        info.pe_nombre          = item.pe_nombre;
                        info.IdRubro            = item.IdRubro;
                        info.ru_descripcion     = item.ru_descripcion;
                        info.IdEmpleado_Aprueba = item.IdEmpleado_Aprueba;
                        info.pe_nombre_apru     = item.pe_nombre_apru;
                        info.Codigo             = item.Codigo;
                        info.ca_descripcion     = item.ca_descripcion;
                        info.Estado             = item.Estado;
                        info.Fecha         = item.Fecha;
                        info.MontoSol      = item.MontoSol;
                        info.TasaInteres   = item.TasaInteres;
                        info.NumCuotas     = item.NumCuotas;
                        info.cod_pago      = item.cod_pago;
                        info.peri_pago     = item.peri_pago;
                        info.Observacion   = item.Observacion;
                        info.TotalPrestamo = Convert.ToDouble(item.TotalPrestamo);
                        info.TotalCobrado  = item.TotalCobrado;
                        info.SaldoPrestamo = item.SaldoPrestamo;
                        info.Fecha_PriPago = item.Fecha_PriPago;
                        info.Tipo_Calculo  = item.Tipo_Calculo;
                        info.MotiAnula     = item.MotiAnula;
                        ListaPrestamo.Add(info);
                    }
                    return(ListaPrestamo);
                }
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }//haac 08/10/13
示例#20
0
 public bool Abono(ro_prestamo_Info info)
 {
     try
     {
         return(odata.Abono(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public bool anularDB(ro_prestamo_Info info)
 {
     try
     {
         return(odata.eliminarDB(info));
     }
     catch (Exception)
     {
         throw;
     }
 }
 private Boolean fx_Verificar_Reg_Repetidos(ro_prestamo_Info Info_det, Boolean eliminar, int tipo)
 {
     try
     {/*
       * int cont = 0;
       *
       *
       *
       * if (banderaCargaBatch)
       * {
       *     cont = (from C in BindList_Ing_egr_inve_det
       *             where C.cod_producto == Info_det.cod_producto
       *             && C.dm_cantidad == Info_det.dm_cantidad
       *             && C.mv_costo == Info_det.mv_costo
       *             select C).Count();
       * }
       * else
       * {
       *     cont = (from C in lista_IngEgrInv
       *             where C.cod_producto == Info_det.cod_producto
       *             && C.dm_cantidad == Info_det.dm_cantidad
       *             && C.mv_costo == Info_det.mv_costo
       *             select C).Count();
       * }
       *
       *
       * if (cont == tipo)
       * {
       *     return true;
       * }
       * else
       * {
       *     if (eliminar == true)
       *     {
       *         gridViewProductos.DeleteRow(gridViewProductos.FocusedRowHandle);
       *         MessageBox.Show("El producto con la misma cantidad y costo  ya se encuentra ingresado, se procederá con su eliminación.", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Warning);
       *     }
       *     else
       *     {
       *         MessageBox.Show("El producto ya se encuentra ingresado.", "ATENCION", MessageBoxButtons.OK, MessageBoxIcon.Stop);
       *     }
       *     return false;
       *
       * }
       * */
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
         Log_Error_bus.Log_Error(ex.ToString()); return(false);
     }
 }
示例#23
0
        public ro_prestamo_Info ObtenerPrestamo(int IdEmpresa, decimal IdPrestamo, decimal IdEmpleado)
        {
            try
            {
                //lista = new List<ro_Empleado_Novedad_Cab_Info>();

                EntitiesRoles ORol = new EntitiesRoles();

                var item = ORol.vwRo_Prestamo.First(A => A.IdEmpresa == IdEmpresa &&
                                                    A.IdPrestamo == IdPrestamo &&
                                                    A.IdEmpleado == IdEmpleado);

                ro_prestamo_Info Reg = new ro_prestamo_Info();

                Reg.IdEmpresa          = item.IdEmpresa;
                Reg.IdPrestamo         = item.IdPrestamo;
                Reg.IdNomina_Tipo      = item.IdNomina_Tipo;
                Reg.nomi_descripcion   = item.nomi_descripcion;
                Reg.IdEmpleado         = item.IdEmpleado;
                Reg.pe_nombre          = item.pe_nombre;
                Reg.IdRubro            = item.IdRubro;
                Reg.ru_descripcion     = item.ru_descripcion;
                Reg.IdEmpleado_Aprueba = item.IdEmpleado_Aprueba;
                Reg.pe_nombre_apru     = item.pe_nombre_apru;
                Reg.Codigo             = item.Codigo;
                Reg.ca_descripcion     = item.ca_descripcion;
                Reg.Estado             = item.Estado;
                Reg.Fecha         = item.Fecha;
                Reg.MontoSol      = item.MontoSol;
                Reg.TasaInteres   = item.TasaInteres;
                Reg.NumCuotas     = item.NumCuotas;
                Reg.cod_pago      = item.cod_pago;
                Reg.peri_pago     = item.peri_pago;
                Reg.Observacion   = item.Observacion;
                Reg.TotalPrestamo = Convert.ToDouble(item.TotalPrestamo);
                Reg.TotalCobrado  = item.TotalCobrado;
                Reg.SaldoPrestamo = item.SaldoPrestamo;
                Reg.Fecha_PriPago = item.Fecha_PriPago;


                return(Reg);
            }
            catch (Exception ex)
            {
                string array = 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(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
示例#24
0
 //capturo el registro de la grilla
 private void gridViewCons_FocusedRowChanged_1(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         Info = new ro_prestamo_Info();
         Info = this.gridViewCons.GetFocusedRow() as ro_prestamo_Info;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
示例#25
0
 public ro_prestamo_Info get_info(int IdEmpresa, decimal IdPrestamo)
 {
     try
     {
         ro_prestamo_Info info = new ro_prestamo_Info();
         info = odata.get_info(IdEmpresa, IdPrestamo);
         return(info);
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#26
0
 public ro_prestamo_Info get_info(int IdEmpresa, decimal IdEmpleado, decimal IdPrestamo)
 {
     try
     {
         ro_prestamo_Info info_ = new ro_prestamo_Info();
         info_             = odata.get_info(IdEmpresa, IdEmpleado, IdPrestamo);
         info_.lst_detalle = odata_det.get_list(IdEmpresa, IdPrestamo);
         return(info_);
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#27
0
 public ActionResult GenerarPrestamo(double MontoSol, DateTime Fecha_PriPago, int NumCuotas = 0, bool descuento_mensual = false, bool descuento_quincena = false, bool descuento_men_quin = false)
 {
     IdEmpresa               = Convert.ToInt32(Session["IdEmpresa"].ToString());
     info.IdEmpresa          = IdEmpresa;
     info.MontoSol           = MontoSol;
     info.NumCuotas          = NumCuotas;
     info.Fecha_PriPago      = Fecha_PriPago;
     info.descuento_mensual  = descuento_mensual;
     info.descuento_men_quin = descuento_men_quin;
     info.descuento_quincena = descuento_quincena;
     info = bus_prestamos.get_calculo_prestamo(info);
     Lis_ro_prestamo_detalle_lst.set_list(info.lst_detalle, Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual));
     return(Json("", JsonRequestBehavior.AllowGet));
 }
示例#28
0
        public ActionResult Abono(ro_prestamo_Info model)
        {
            model.lst_detalle = Lis_ro_prestamo_detalle_lst.get_list(model.IdTransaccionSession);

            model.IdEmpresa       = Convert.ToInt32(Session["IdEmpresa"]);
            model.IdUsuarioUltAnu = Session["IdUsuario"].ToString();
            model.Fecha_UltAnu    = DateTime.Now;

            if (!bus_prestamos.Abono(model))
            {
                cargar_combos();
                return(View(model));
            }
            return(RedirectToAction("Index"));
        }
示例#29
0
 public Boolean ModificarCabeceraPrestamo(ro_prestamo_Info Info)
 {
     try
     {
         return(oData.ModificarCabeceraPrestamo(Info));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ModificarCabeceraPrestamo", ex.Message), ex)
               {
                   EntityType = typeof(ro_prestamo_Bus)
               };
     }
 }
示例#30
0
        public ro_prestamo_Info get_calculoquincenal(ro_prestamo_Info info)
        {
            try
            {
                info.lst_detalle = new List <ro_prestamo_detalle_Info>();
                int      periodo     = Convert.ToInt32(info.NumCuotas);
                double   valor_cuota = info.MontoSol / info.NumCuotas;
                double   saldo       = info.MontoSol;
                DateTime fecha_pago  = info.Fecha_PriPago;
                info.MontoSol = info.MontoSol;
                List <ro_prestamo_detalle_Info> listaDetalle = new List <ro_prestamo_detalle_Info>();
                for (int i = 1; i <= periodo; i++)
                {
                    ro_prestamo_detalle_Info item = new ro_prestamo_detalle_Info();

                    if (i == 1)
                    {
                        //item.FechaPago = fecha_pago;
                        fecha_pago = new DateTime(fecha_pago.Year, fecha_pago.Month, 15);
                    }
                    else
                    {
                        var fecha_pago_sgte = fecha_pago.AddMonths(1);
                        fecha_pago = new DateTime(fecha_pago_sgte.Year, fecha_pago_sgte.Month, 15);
                    }

                    item.FechaPago         = info.Fecha_PriPago;
                    item.NumCuota          = i;
                    item.TotalCuota        = valor_cuota;
                    item.Saldo             = info.MontoSol;
                    item.Saldo             = saldo - item.TotalCuota;
                    item.FechaPago         = fecha_pago;
                    item.EstadoPago        = "PEN";
                    item.Observacion_det   = "Cuota número " + i + " fecha pago " + fecha_pago.ToString("dd/MM/yyyy");
                    item.IdNominaTipoLiqui = 1;

                    saldo           = saldo - valor_cuota;
                    item.TotalCuota = Math.Round(item.TotalCuota, 2);
                    item.Saldo      = Math.Round(item.Saldo, 2);
                    info.lst_detalle.Add(item);
                }
                return(info);
            }
            catch (Exception)
            {
                throw;
            }
        }