use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class LegacyLoanDao method getLoanOffering.
public LoanOfferingBO getLoanOffering(final Short loanOfferingId, final Short localeId) throws PersistenceException {
LoanOfferingBO loanOffering = getPersistentObject(LoanOfferingBO.class, loanOfferingId);
if (loanOffering.getLoanOfferingFunds() != null && loanOffering.getLoanOfferingFunds().size() > 0) {
for (LoanOfferingFundEntity loanOfferingFund : loanOffering.getLoanOfferingFunds()) {
loanOfferingFund.getFund().getFundId();
loanOfferingFund.getFund().getFundName();
}
}
return loanOffering;
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class AdminServiceFacadeWebTier method createLoanProduct.
@Override
public PrdOfferingDto createLoanProduct(LoanProductRequest loanProductRequest) {
MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
LoanOfferingBO loanProduct = this.loanProductAssembler.fromDto(user, loanProductRequest);
HibernateTransactionHelper transactionHelper = new HibernateTransactionHelperForStaticHibernateUtil();
try {
transactionHelper.startTransaction();
this.loanProductDao.save(loanProduct);
transactionHelper.commitTransaction();
return loanProduct.toDto();
} catch (Exception e) {
transactionHelper.rollbackTransaction();
throw new MifosRuntimeException(e);
} finally {
transactionHelper.closeSession();
}
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class AdminServiceFacadeWebTier method retrieveLoanProductDetails.
@Override
public LoanProductRequest retrieveLoanProductDetails(Integer productId) {
LoanOfferingBO loanProduct = this.loanProductDao.findById(productId);
boolean multiCurrencyEnabled = AccountingRules.isMultiCurrencyEnabled();
LoanProductRequest productDetails = loanProduct.toFullDto();
productDetails.setMultiCurrencyEnabled(multiCurrencyEnabled);
return productDetails;
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class GroupPerformanceHistoryEntity method updateOnDisbursement.
public void updateOnDisbursement(LoanBO loan, Money disburseAmount) throws AccountException {
LoanOfferingBO loanOffering = loan.getLoanOffering();
updateLoanCounter(loanOffering, YesNoFlag.YES);
try {
if ((configService.isNewGlimEnabled() || configService.isGlimEnabled()) && loan.getAccountId() != null) {
CollectionUtils.forAllDo(accountBusinessService.getCoSigningClientsForGlim(loan.getAccountId()), new UpdateClientPerfHistoryForGroupLoanOnDisbursement(loan));
}
} catch (ServiceException e) {
throw new AccountException(e);
}
}
use of org.mifos.accounts.productdefinition.business.LoanOfferingBO in project head by mifos.
the class GroupLoanAccountServiceFacadeWebTier method assembleLoanAccountDetail.
private LoanAccountDetail assembleLoanAccountDetail(CreateGroupLoanAccount loanAccountInfo) {
CustomerBO customer = this.customerDao.findCustomerById(loanAccountInfo.getGroupLoanAccountDetails().getCustomerId());
LoanOfferingBO loanProduct = this.loanProductDao.findById(loanAccountInfo.getGroupLoanAccountDetails().getProductId());
Money loanAmount = new Money(loanProduct.getCurrency(), loanAccountInfo.getGroupLoanAccountDetails().getLoanAmount());
AccountState accountStateType = AccountState.fromShort(loanAccountInfo.getGroupLoanAccountDetails().getAccountState().shortValue());
FundBO fund = null;
if (loanAccountInfo.getGroupLoanAccountDetails().getSourceOfFundId() != null) {
fund = this.fundDao.findById(loanAccountInfo.getGroupLoanAccountDetails().getSourceOfFundId().shortValue());
}
return new LoanAccountDetail(customer, loanProduct, loanAmount, accountStateType, fund);
}
Aggregations