use of org.mifos.accounts.util.helpers.AccountState in project head by mifos.
the class SavingsAccountRESTController method createSavingsAccount.
@RequestMapping(value = "/account/savings/create", method = RequestMethod.POST)
@ResponseBody
public Map<String, String> createSavingsAccount(@RequestParam String globalCustomerNum, @RequestParam(required = false) String amount, @RequestParam Integer productId) throws Throwable {
CustomerBO customer = validateGlobalCustNum(globalCustomerNum);
SavingsOfferingBO product = validateProductId(productId);
String recommendedAmount = null != amount ? amount : product.getRecommendedAmount().toString();
Integer customerId = customer.getCustomerId();
AccountState accountState = AccountState.SAVINGS_PENDING_APPROVAL;
SavingsAccountCreationDto savingsAccountCreation = new SavingsAccountCreationDto(productId, customerId, accountState.getValue(), recommendedAmount);
Long savings = savingsServiceFacade.createSavingsAccount(savingsAccountCreation);
SavingsAccountDetailDto details = savingsServiceFacade.retrieveSavingsAccountDetails(savings);
Map<String, String> map = new HashMap<String, String>();
map.put("customerName", customer.getDisplayName());
map.put("productName", product.getPrdOfferingName());
map.put("interesRate", details.getProductDetails().getInterestRate().toString());
map.put("interestRatePeriod", details.getProductDetails().getInterestCalculationFrequency().toString());
map.put("recommendedAmount", recommendedAmount);
return map;
}
use of org.mifos.accounts.util.helpers.AccountState in project head by mifos.
the class LoanBO method openGroupLoanForAccount.
public static LoanBO openGroupLoanForAccount(LoanBO parentLoan, LoanOfferingBO loanProduct, ClientBO member, MeetingBO repaymentDayMeeting, LoanSchedule loanSchedule, LoanProductOverridenDetail overridenDetail, LoanScheduleConfiguration configuration, InstallmentRange installmentRange, AmountRange loanAmountRange, CreationDetail creationDetail, PersonnelBO createdBy, Boolean groupLoan) {
AccountState loanState = AccountState.LOAN_PENDING_APPROVAL;
LoanBO standardLoan = new LoanBO(loanProduct, member, loanState, overridenDetail, repaymentDayMeeting, loanSchedule, configuration, installmentRange, loanAmountRange, creationDetail, AccountTypes.GROUP_LOAN_ACCOUNT);
standardLoan.setParentAccount(parentLoan);
standardLoan.addAccountStatusChangeHistory(new AccountStatusChangeHistoryEntity(standardLoan.getAccountState(), standardLoan.getAccountState(), createdBy, standardLoan));
return standardLoan;
}
use of org.mifos.accounts.util.helpers.AccountState in project head by mifos.
the class LoanBO method isOpen.
@Override
public boolean isOpen() {
AccountState loanAccountState = AccountState.fromShort(getAccountState().getId());
List<AccountState> notOpenAccountStates = Arrays.asList(AccountState.LOAN_CANCELLED, AccountState.LOAN_CLOSED_RESCHEDULED, AccountState.LOAN_CLOSED_OBLIGATIONS_MET, AccountState.LOAN_CLOSED_WRITTEN_OFF);
return !notOpenAccountStates.contains(loanAccountState);
}
use of org.mifos.accounts.util.helpers.AccountState in project head by mifos.
the class LoanAccountServiceFacadeWebTier method retrieveLoanApplicationState.
@Override
public LoanApplicationStateDto retrieveLoanApplicationState() {
AccountState applicationState = AccountState.LOAN_APPROVED;
boolean loanPendingApprovalEnabled = ProcessFlowRules.isLoanPendingApprovalStateEnabled();
if (loanPendingApprovalEnabled) {
applicationState = AccountState.LOAN_PENDING_APPROVAL;
}
return new LoanApplicationStateDto(AccountState.LOAN_PARTIAL_APPLICATION.getValue().intValue(), applicationState.getValue().intValue());
}
Aggregations