use of org.mifos.config.exceptions.ConfigurationException in project head by mifos.
the class ProcessFlowRules method initSavingsPendingApprovalState.
private static void initSavingsPendingApprovalState() throws ConfigurationException {
LegacyAccountDao ap = ApplicationContextProvider.getBean(LegacyAccountDao.class);
AccountStateEntity ase = ap.loadPersistentObject(AccountStateEntity.class, AccountState.SAVINGS_PENDING_APPROVAL.getValue());
boolean fromDb = isSavingPendingApprovalStateEnabledOnDatabaseConfig(ase);
boolean fromCfg = isSavingsPendingApprovalStateEnabled();
if (databaseAndCustomConfigurationAreNotTheSame(fromDb, fromCfg)) {
int count = ApplicationContextProvider.getBean(LegacyLoanDao.class).countOfSavingsAccounts();
if (count > 0) {
String errMsg = getBadOverrideMsg(SAVINGS_PENDING_APPROVAL, "Records for savings accounts in the 'pending approval' state" + " may already exist.");
throw new ConfigurationException(errMsg);
}
makeDatabaseConfigurationMatchPropertiesFileConfiguration(ap, ase, fromCfg);
}
}
use of org.mifos.config.exceptions.ConfigurationException in project head by mifos.
the class ProcessFlowRules method initGroupPendingApprovalState.
private static void initGroupPendingApprovalState() throws ConfigurationException {
CustomerDao customerDao = ApplicationContextProvider.getBean(CustomerDao.class);
CustomerStatusEntity cse = customerDao.findGroupPendingStatus();
boolean fromDb = isGroupPendingApprovalStateEnabledOnDatabaseConfiguration(cse);
boolean fromCfg = isGroupPendingApprovalStateEnabled();
if (databaseAndCustomConfigurationAreNotTheSame(fromDb, fromCfg)) {
int count = customerDao.countOfGroups();
if (count > 0) {
final String errMsg = getBadOverrideMsg(GROUP_PENDING_APPROVAL, "Records for groups in the 'pending approval' state" + " may already exist.");
throw new ConfigurationException(errMsg);
}
makeDatabaseConfigurationMatchPropertiesFileConfiguration(customerDao, cse, fromCfg);
}
}
use of org.mifos.config.exceptions.ConfigurationException in project head by mifos.
the class ProcessFlowRules method initClientPendingApprovalState.
private static void initClientPendingApprovalState() throws ConfigurationException {
CustomerDao customerDao = ApplicationContextProvider.getBean(CustomerDao.class);
CustomerStatusEntity cse = customerDao.findClientPendingStatus();
boolean fromDb = isClientPendingApprovalStateEnabledOnDatabaseConfiguration(cse);
boolean fromCfg = isClientPendingApprovalStateEnabled();
if (databaseAndCustomConfigurationAreNotTheSame(fromDb, fromCfg)) {
int count = customerDao.countOfClients();
if (count > 0) {
final String errMsg = getBadOverrideMsg(CLIENT_PENDING_APPROVAL, "Records for clients in the 'pending approval' state" + " may already exist.");
throw new ConfigurationException(errMsg);
}
makeDatabaseConfigurationMatchPropertiesFileConfiguration(customerDao, cse, fromCfg);
}
}
Aggregations