Search in sources :

Example 56 with MifosConfigurationManager

use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.

the class AccountingRules method getCurrencyRoundingMode.

public static RoundingMode getCurrencyRoundingMode() {
    MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
    String modeStr = configMgr.getString(AccountingRulesConstants.CURRENCY_ROUNDING_MODE);
    return getRoundingModeFromString(modeStr, "CurrencyRoundingMode", DEFAULT_CURRENCY_ROUNDING_MODE);
}
Also used : MifosConfigurationManager(org.mifos.config.business.MifosConfigurationManager)

Example 57 with MifosConfigurationManager

use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.

the class AccountingRules method getFinalRoundOffMultiple.

public static BigDecimal getFinalRoundOffMultiple() {
    MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
    String modeStr = configMgr.getString(AccountingRulesConstants.FINAL_ROUND_OFF_MULTIPLE);
    return getRoundOffMultipleFromString(modeStr, DEFAULT_FINAL_ROUNDOFF_MULTIPLE);
}
Also used : MifosConfigurationManager(org.mifos.config.business.MifosConfigurationManager)

Example 58 with MifosConfigurationManager

use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.

the class PasswordRules method getPasswordExpirationDatePrelongationFromConfig.

private static int getPasswordExpirationDatePrelongationFromConfig() throws ConfigurationException {
    int passwordExpirationDateProlongation = 90;
    MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
    if (configMgr.containsKey(PASSWORD_EXPIRATION_DATE_PRELONGATION)) {
        passwordExpirationDateProlongation = Integer.parseInt(configMgr.getString(PASSWORD_EXPIRATION_DATE_PRELONGATION));
    }
    if (passwordExpirationDateProlongation < 0) {
        throw new ConfigurationException("The PasswordRules.PasswordExpirationDatePrelongation defined in the " + MifosConfigurationManager.DEFAULT_CONFIG_PROPS_FILENAME + " must be a positive numer.");
    }
    return passwordExpirationDateProlongation;
}
Also used : ConfigurationException(org.mifos.config.exceptions.ConfigurationException) MifosConfigurationManager(org.mifos.config.business.MifosConfigurationManager)

Example 59 with MifosConfigurationManager

use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.

the class ProcessFlowRules method initFromDB.

public static void initFromDB() {
    MifosConfigurationManager cm = MifosConfigurationManager.getInstance();
    CustomerDao customerDao = ApplicationContextProvider.getBean(CustomerDao.class);
    LegacyAccountDao ap = ApplicationContextProvider.getBean(LegacyAccountDao.class);
    CustomerStatusEntity cse = customerDao.findClientPendingStatus();
    cm.setProperty(CLIENT_PENDING_APPROVAL, isClientPendingApprovalStateEnabledOnDatabaseConfiguration(cse));
    cse = customerDao.findGroupPendingStatus();
    cm.setProperty(GROUP_PENDING_APPROVAL, isGroupPendingApprovalStateEnabledOnDatabaseConfiguration(cse));
    AccountStateEntity ase = ap.loadPersistentObject(AccountStateEntity.class, AccountState.LOAN_PENDING_APPROVAL.getValue());
    cm.setProperty(LOAN_PENDING_APPROVAL, isLoanPendingApprovalStateEnabledOnDatabaseConfig(ase));
    ase = ap.loadPersistentObject(AccountStateEntity.class, AccountState.SAVINGS_PENDING_APPROVAL.getValue());
    cm.setProperty(SAVINGS_PENDING_APPROVAL, isSavingPendingApprovalStateEnabledOnDatabaseConfig(ase));
}
Also used : LegacyAccountDao(org.mifos.accounts.persistence.LegacyAccountDao) CustomerStatusEntity(org.mifos.customers.business.CustomerStatusEntity) AccountStateEntity(org.mifos.accounts.business.AccountStateEntity) CustomerDao(org.mifos.customers.persistence.CustomerDao) MifosConfigurationManager(org.mifos.config.business.MifosConfigurationManager)

Example 60 with MifosConfigurationManager

use of org.mifos.config.business.MifosConfigurationManager in project head by mifos.

the class GeneralConfig method getOutputIntervalForBatchJobs.

public static int getOutputIntervalForBatchJobs() {
    // default value is 1000
    int outputRecordIntervalForBatchJobs = 1000;
    MifosConfigurationManager configMgr = MifosConfigurationManager.getInstance();
    if (configMgr.containsKey(OutputIntervalForBatchJobs)) {
        outputRecordIntervalForBatchJobs = configMgr.getInt(OutputIntervalForBatchJobs);
    }
    return outputRecordIntervalForBatchJobs;
}
Also used : MifosConfigurationManager(org.mifos.config.business.MifosConfigurationManager)

Aggregations

MifosConfigurationManager (org.mifos.config.business.MifosConfigurationManager)66 Test (org.junit.Test)18 ConfigurationException (org.mifos.config.exceptions.ConfigurationException)8 Properties (java.util.Properties)5 MifosRuntimeException (org.mifos.core.MifosRuntimeException)5 PersistenceException (org.mifos.framework.exceptions.PersistenceException)5 ApplicationException (org.mifos.framework.exceptions.ApplicationException)4 RoundingMode (java.math.RoundingMode)3 ConfigurationPersistence (org.mifos.config.persistence.ConfigurationPersistence)3 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)3 SystemException (org.mifos.framework.exceptions.SystemException)3 BigDecimal (java.math.BigDecimal)2 Ignore (org.junit.Ignore)2 AccountBO (org.mifos.accounts.business.AccountBO)2 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)2 ConfigurationKeyValue (org.mifos.config.business.ConfigurationKeyValue)2 CurrencyMismatchException (org.mifos.core.CurrencyMismatchException)2 PersonnelBO (org.mifos.customers.personnel.business.PersonnelBO)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1