Exemplo n.º 1
0
        public static void CheckDBVersion()
        {
            ApplicationSettingInfo dbVersion = ApplicationSettingInfo.Get(Settings.Default.DB_VERSION_VARIABLE);

            //Version de base de datos equivalente o no existe la variable
            if ((dbVersion.Value == string.Empty) ||
                (String.CompareOrdinal(dbVersion.Value, ModulePrincipal.GetDBVersion()) == 0))
            {
                return;
            }
            //Version de base de datos superior
            else if (String.CompareOrdinal(dbVersion.Value, ModulePrincipal.GetDBVersion()) > 0)
            {
                throw new iQException(String.Format(moleQule.Resources.Messages.DB_VERSION_HIGHER,
                                                    dbVersion.Value,
                                                    ModulePrincipal.GetDBVersion(),
                                                    Settings.Default.NAME),
                                      iQExceptionCode.DB_VERSION_MISSMATCH);
            }
            //Version de base de datos inferior
            else if (String.CompareOrdinal(dbVersion.Value, ModulePrincipal.GetDBVersion()) < 0)
            {
                throw new iQException(String.Format(moleQule.Resources.Messages.DB_VERSION_LOWER,
                                                    dbVersion.Value,
                                                    ModulePrincipal.GetDBVersion(),
                                                    Settings.Default.NAME),
                                      iQExceptionCode.DB_VERSION_MISSMATCH);
            }
        }
Exemplo n.º 2
0
        protected void CreateAssociatedExpenses()
        {
            TipoGastoList tipos = TipoGastoList.GetList(false, true);

            Expense       gasto = Gastos.NewItem(this, ECategoriaGasto.SeguroSocial);
            TipoGastoInfo tipo  = tipos.GetItem(ModulePrincipal.GetDefaultSegurosSetting());

            if (tipo.Oid == 0)
            {
                throw new iQException(Resources.Messages.NO_TIPOGASTO_SEGUROS, iQExceptionCode.INVALID_OBJECT);
            }

            gasto.OidTipo       = tipo.Oid;
            gasto.PrevisionPago = Common.EnumFunctions.GetPrevisionPago(tipo.EFormaPago, Fecha, tipo.DiasPago);

            gasto = Gastos.NewItem(this, ECategoriaGasto.Impuesto);
            tipo  = tipos.GetItem(ModulePrincipal.GetDefaultIRPFSetting());

            if (tipo.Oid == 0)
            {
                throw new iQException(Resources.Messages.NO_TIPOGASTO_IRPF, iQExceptionCode.INVALID_OBJECT);
            }

            gasto.OidTipo       = tipo.Oid;
            gasto.PrevisionPago = Common.EnumFunctions.GetPrevisionPago(tipo.EFormaPago, Fecha, tipo.DiasPago);

            InsertStaff();

            CalculateTotal();
        }
Exemplo n.º 3
0
        protected void UpdateAssociatedExpenses()
        {
            if (Gastos.Count == 0)
            {
                return;
            }

            EmployeeList empleados = EmployeeList.GetList(false, true);

            TipoGastoList tipos = TipoGastoList.GetList(false, true);

            foreach (Payroll item in Nominas)
            {
                if (empleados.GetItem(item.OidEmpleado) == null)
                {
                    Cache.Instance.Remove(typeof(EmployeeList));
                    empleados = EmployeeList.GetList(false, true);
                }

                item.Fecha         = Fecha;
                item.PrevisionPago = PrevisionPago;
                item.Descripcion   = String.Format(Resources.Messages.GASTO_NOMINA, empleados.GetItem(item.OidEmpleado).NombreCompleto.ToUpper());
                item.Observaciones = Descripcion;
            }

            foreach (Expense item in Gastos)
            {
                if (item.EEstado == EEstado.Baja)
                {
                    return;
                }

                item.Observaciones = String.Format(Resources.Messages.GASTO_ASOCIADO, Descripcion);

                switch (item.ECategoriaGasto)
                {
                case ECategoriaGasto.SeguroSocial:
                {
                    TipoGastoInfo tipo = tipos.GetItem(ModulePrincipal.GetDefaultSegurosSetting());
                    item.Fecha         = Fecha;
                    item.PrevisionPago = Common.EnumFunctions.GetPrevisionPago(tipo.EFormaPago, Fecha, tipo.DiasPago);
                    item.Total         = Seguro;
                    item.Descripcion   = tipo.Nombre + " " + item.Fecha.ToString("MMMM") + " " + item.Fecha.ToString("yyyy");
                }
                break;

                case ECategoriaGasto.Impuesto:
                {
                    TipoGastoInfo tipo = tipos.GetItem(ModulePrincipal.GetDefaultIRPFSetting());
                    item.Fecha         = Fecha;
                    item.PrevisionPago = Common.EnumFunctions.GetPrevisionPago(tipo.EFormaPago, Fecha, tipo.DiasPago);
                    item.Total         = IRPF;
                    item.Descripcion   = tipo.Nombre + " " + GetPeriod(item.Fecha) + " " + item.Fecha.ToString("yyyy");
                }
                break;
                }
            }
        }
Exemplo n.º 4
0
 public static void UpgradeSettings()
 {
     ModulePrincipal.UpgradeSettings();
 }