/// <summary>
 /// Deprecated Method for adding a new object to the retiros_aportaciones EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToretiros_aportaciones(retiro_aportaciones retiro_aportaciones)
 {
     base.AddObject("retiros_aportaciones", retiro_aportaciones);
 }
Example #2
0
        /// <summary>
        /// Inserta la transacción del retiro aportación en la tabla de aportaciones como salida (retiro).
        /// </summary>
        /// <param name="RetiroDeAportaciones"></param>
        /// <param name="db"></param>
        public void InsertarTransaccionAportacionesDeSocio(retiro_aportaciones RetiroDeAportaciones, colinasEntities db)
        {
            try
            {
                reporte_total_aportaciones_por_socio asocInventory = this.GetAportacionesXSocio(RetiroDeAportaciones.SOCIOS_ID);

                decimal saldo_aportaciones_ordinaria = asocInventory == null ? 0 : asocInventory.APORTACIONES_ORDINARIA_SALDO;
                decimal saldo_aportaciones_extraordinaria = asocInventory == null ? 0 : asocInventory.APORTACIONES_EXTRAORDINARIA_SALDO;
                decimal saldo_aportaciones_capitalizacion_retencion = asocInventory == null ? 0 : asocInventory.APORTACIONES_CAPITALIZACION_RETENCION_SALDO;
                decimal saldo_aportaciones_intereses_aportaciones = asocInventory == null ? 0 : asocInventory.APORTACIONES_INTERESES_S_APORTACION_SALDO;
                decimal saldo_aportaciones_excedente_periodo = asocInventory == null ? 0 : asocInventory.APORTACIONES_EXCEDENTE_PERIODO_SALDO;

                decimal saldo_aportaciones_total = asocInventory == null ? 0 : asocInventory.APORTACIONES_SALDO_TOTAL;

                decimal liquidacion_aportacion_extraordinaria = RetiroDeAportaciones.RETIROS_AP_EXTRAORDINARIA;

                aportacion_socio aportacionDeSocio = new aportacion_socio();

                aportacionDeSocio.SOCIOS_ID = RetiroDeAportaciones.SOCIOS_ID;
                aportacionDeSocio.DOCUMENTO_ID = RetiroDeAportaciones.RETIROS_AP_ID;
                aportacionDeSocio.DOCUMENTO_TIPO = "SALIDA";//Los retiros de aportaciones son tomadas como salidas para las aportaciones

                aportacionDeSocio.APORTACIONES_ORDINARIA_SALDO = saldo_aportaciones_ordinaria - RetiroDeAportaciones.RETIROS_AP_ORDINARIA;
                aportacionDeSocio.APORTACIONES_EXTRAORDINARIA_SALDO = saldo_aportaciones_extraordinaria - liquidacion_aportacion_extraordinaria;
                aportacionDeSocio.APORTACIONES_CAPITALIZACION_RETENCION_SALDO = saldo_aportaciones_capitalizacion_retencion - RetiroDeAportaciones.RETIROS_AP_CAPITALIZACION_RETENCION;
                aportacionDeSocio.APORTACIONES_INTERESES_S_APORTACION_SALDO = saldo_aportaciones_intereses_aportaciones + RetiroDeAportaciones.RETIROS_AP_INTERESES_S_APORTACION;
                aportacionDeSocio.APORTACIONES_EXCEDENTE_PERIODO_SALDO = saldo_aportaciones_excedente_periodo + RetiroDeAportaciones.RETIROS_AP_EXCEDENTE_PERIODO;

                aportacionDeSocio.APORTACIONES_CANTIDAD = - RetiroDeAportaciones.RETIROS_AP_TOTAL_RETIRADO;
                aportacionDeSocio.APORTACIONES_SALDO_TOTAL = saldo_aportaciones_total + aportacionDeSocio.APORTACIONES_CANTIDAD;

                aportacionDeSocio.CREADO_POR = RetiroDeAportaciones.CREADO_POR;
                aportacionDeSocio.FECHA_CREACION = RetiroDeAportaciones.FECHA_CREACION;

                db.aportaciones_socio.AddObject(aportacionDeSocio);

                db.SaveChanges();
            }
            catch (Exception ex)
            {
                log.Fatal("Error fatal al insertar transaccion de aportaciones de socio. Retiro de Aportaciones.", ex);
                throw;
            }
        }
 /// <summary>
 /// Create a new retiro_aportaciones object.
 /// </summary>
 /// <param name="rETIROS_AP_ID">Initial value of the RETIROS_AP_ID property.</param>
 /// <param name="sOCIOS_ID">Initial value of the SOCIOS_ID property.</param>
 /// <param name="rETIROS_AP_FECHA">Initial value of the RETIROS_AP_FECHA property.</param>
 /// <param name="rETIROS_AP_ORDINARIA">Initial value of the RETIROS_AP_ORDINARIA property.</param>
 /// <param name="rETIROS_AP_EXTRAORDINARIA">Initial value of the RETIROS_AP_EXTRAORDINARIA property.</param>
 /// <param name="rETIROS_AP_CAPITALIZACION_RETENCION">Initial value of the RETIROS_AP_CAPITALIZACION_RETENCION property.</param>
 /// <param name="rETIROS_AP_INTERESES_S_APORTACION">Initial value of the RETIROS_AP_INTERESES_S_APORTACION property.</param>
 /// <param name="rETIROS_AP_EXCEDENTE_PERIODO">Initial value of the RETIROS_AP_EXCEDENTE_PERIODO property.</param>
 /// <param name="rETIROS_AP_TOTAL_RETIRADO">Initial value of the RETIROS_AP_TOTAL_RETIRADO property.</param>
 /// <param name="cREADO_POR">Initial value of the CREADO_POR property.</param>
 /// <param name="fECHA_CREACION">Initial value of the FECHA_CREACION property.</param>
 public static retiro_aportaciones Createretiro_aportaciones(global::System.Int32 rETIROS_AP_ID, global::System.String sOCIOS_ID, global::System.DateTime rETIROS_AP_FECHA, global::System.Decimal rETIROS_AP_ORDINARIA, global::System.Decimal rETIROS_AP_EXTRAORDINARIA, global::System.Decimal rETIROS_AP_CAPITALIZACION_RETENCION, global::System.Decimal rETIROS_AP_INTERESES_S_APORTACION, global::System.Decimal rETIROS_AP_EXCEDENTE_PERIODO, global::System.Decimal rETIROS_AP_TOTAL_RETIRADO, global::System.String cREADO_POR, global::System.DateTime fECHA_CREACION)
 {
     retiro_aportaciones retiro_aportaciones = new retiro_aportaciones();
     retiro_aportaciones.RETIROS_AP_ID = rETIROS_AP_ID;
     retiro_aportaciones.SOCIOS_ID = sOCIOS_ID;
     retiro_aportaciones.RETIROS_AP_FECHA = rETIROS_AP_FECHA;
     retiro_aportaciones.RETIROS_AP_ORDINARIA = rETIROS_AP_ORDINARIA;
     retiro_aportaciones.RETIROS_AP_EXTRAORDINARIA = rETIROS_AP_EXTRAORDINARIA;
     retiro_aportaciones.RETIROS_AP_CAPITALIZACION_RETENCION = rETIROS_AP_CAPITALIZACION_RETENCION;
     retiro_aportaciones.RETIROS_AP_INTERESES_S_APORTACION = rETIROS_AP_INTERESES_S_APORTACION;
     retiro_aportaciones.RETIROS_AP_EXCEDENTE_PERIODO = rETIROS_AP_EXCEDENTE_PERIODO;
     retiro_aportaciones.RETIROS_AP_TOTAL_RETIRADO = rETIROS_AP_TOTAL_RETIRADO;
     retiro_aportaciones.CREADO_POR = cREADO_POR;
     retiro_aportaciones.FECHA_CREACION = fECHA_CREACION;
     return retiro_aportaciones;
 }
Example #4
0
        /// <summary>
        /// Inserta el retiro de aportacion.
        /// </summary>
        /// <param name="SOCIOS_ID"></param>
        /// <param name="RETIROS_AP_FECHA"></param>
        /// <param name="RETIROS_AP_ORDINARIA"></param>
        /// <param name="RETIROS_AP_EXTRAORDINARIA"></param>
        /// <param name="RETIROS_AP_CAPITALIZACION_RETENCION"></param>
        /// <param name="RETIROS_AP_INTERESES_S_APORTACION"></param>
        /// <param name="RETIROS_AP_EXCEDENTE_PERIODO"></param>
        /// <param name="CREADO_POR"></param>
        /// <param name="FECHA_CREACION"></param>
        /// <param name="MODIFICADO_POR"></param>
        /// <param name="FECHA_MODIFICACION"></param>
        public void InsertarRetiroDeAportaciones
            (string SOCIOS_ID,
            DateTime RETIROS_AP_FECHA,
             decimal RETIROS_AP_ORDINARIA,
             decimal RETIROS_AP_EXTRAORDINARIA,
            decimal RETIROS_AP_CAPITALIZACION_RETENCION,
            decimal RETIROS_AP_INTERESES_S_APORTACION,
            decimal RETIROS_AP_EXCEDENTE_PERIODO,
            string CREADO_POR,
            DateTime FECHA_CREACION,
            string MODIFICADO_POR,
            DateTime FECHA_MODIFICACION)
        {
            try
            {
                using (var db = new colinasEntities())
                {
                    using (var scope1 = new TransactionScope())
                    {
                        retiro_aportaciones retiro_aportacion = new retiro_aportaciones();

                        retiro_aportacion.SOCIOS_ID = SOCIOS_ID;
                        retiro_aportacion.RETIROS_AP_FECHA = RETIROS_AP_FECHA;

                        retiro_aportacion.RETIROS_AP_ORDINARIA = RETIROS_AP_ORDINARIA;
                        retiro_aportacion.RETIROS_AP_EXTRAORDINARIA = RETIROS_AP_EXTRAORDINARIA;
                        retiro_aportacion.RETIROS_AP_CAPITALIZACION_RETENCION = RETIROS_AP_CAPITALIZACION_RETENCION;
                        retiro_aportacion.RETIROS_AP_INTERESES_S_APORTACION = RETIROS_AP_INTERESES_S_APORTACION;
                        retiro_aportacion.RETIROS_AP_EXCEDENTE_PERIODO = RETIROS_AP_INTERESES_S_APORTACION;

                        retiro_aportacion.RETIROS_AP_TOTAL_RETIRADO =
                            RETIROS_AP_ORDINARIA +
                            RETIROS_AP_EXTRAORDINARIA +
                            RETIROS_AP_CAPITALIZACION_RETENCION +
                            RETIROS_AP_INTERESES_S_APORTACION +
                            RETIROS_AP_INTERESES_S_APORTACION;

                        retiro_aportacion.CREADO_POR = retiro_aportacion.MODIFICADO_POR = CREADO_POR;
                        retiro_aportacion.FECHA_CREACION = DateTime.Today;
                        retiro_aportacion.FECHA_MODIFICACION = retiro_aportacion.FECHA_CREACION;

                        db.retiros_aportaciones.AddObject(retiro_aportacion);

                        db.SaveChanges();

                        AportacionLogic aportacionlogic = new AportacionLogic();
                        aportacionlogic.InsertarTransaccionAportacionesDeSocio(retiro_aportacion, db);

                        scope1.Complete();
                    }
                }
            }
            catch (Exception ex)
            {
                log.Fatal("Error fatal al insertar retiro de aportaciones.", ex);
                throw;
            }
        }