use of org.mifos.dto.domain.LoanActivityDto in project head by mifos.
the class ReverseLoanDisbursalAction method load.
@TransactionDemarcate(joinToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("Inside load method");
ReverseLoanDisbursalActionForm actionForm = (ReverseLoanDisbursalActionForm) form;
String searchString = actionForm.getSearchString();
String globalAccountNum = searchString;
if (StringUtils.isNotEmpty(globalAccountNum)) {
globalAccountNum = globalAccountNum.trim();
}
List<LoanActivityDto> payments = this.loanAccountServiceFacade.retrieveLoanPaymentsForReversal(globalAccountNum);
LoanBO loan = this.loanDao.findByGlobalAccountNum(globalAccountNum);
SessionUtils.setAttribute(Constants.BUSINESS_KEY, loan, request);
SessionUtils.setCollectionAttribute(LoanConstants.PAYMENTS_LIST, payments, request);
SessionUtils.setAttribute(LoanConstants.PAYMENTS_SIZE, payments.size(), request);
logger.debug("Outside load method");
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.domain.LoanActivityDto in project head by mifos.
the class LoanActivityEntity method sumGroupToDto.
public LoanActivityDto sumGroupToDto(Money interestOutstanding, Money principalOutstanding, Money feeOutstanding, Money penaltyOutstanding) {
LoanActivityDto loanActivityDto = new LoanActivityDto();
loanActivityDto.setId(this.account.getAccountId());
loanActivityDto.setActionDate(this.trxnCreatedDate);
loanActivityDto.setActivity(this.comments);
loanActivityDto.setPrincipal(removeSign(this.principal).toString());
loanActivityDto.setInterest(removeSign(this.interest).toString());
loanActivityDto.setPenalty(removeSign(this.penalty).toString());
loanActivityDto.setFees(removeSign(this.fee).toString());
Money total = removeSign(this.fee).add(removeSign(this.penalty)).add(removeSign(this.principal)).add(removeSign(this.interest));
loanActivityDto.setTotal(total.toString());
loanActivityDto.setTotalValue(total.getAmount().doubleValue());
loanActivityDto.setTimeStamp(this.trxnCreatedDate);
loanActivityDto.setRunningBalanceInterest(interestOutstanding.toString());
loanActivityDto.setRunningBalancePrinciple(principalOutstanding.toString());
loanActivityDto.setRunningBalanceFees(feeOutstanding.toString());
loanActivityDto.setRunningBalancePenalty(penaltyOutstanding.toString());
loanActivityDto.setRunningBalancePrincipleWithInterestAndFees(principalOutstanding.add(interestOutstanding).add(feeOutstanding).toString());
return loanActivityDto;
}
use of org.mifos.dto.domain.LoanActivityDto in project head by mifos.
the class LoanActivityEntity method toDto.
public LoanActivityDto toDto() {
LoanActivityDto loanActivityDto = new LoanActivityDto();
loanActivityDto.setId(this.account.getAccountId());
loanActivityDto.setActionDate(this.trxnCreatedDate);
loanActivityDto.setActivity(this.comments);
loanActivityDto.setPrincipal(removeSign(this.principal).toString());
loanActivityDto.setInterest(removeSign(this.interest).toString());
loanActivityDto.setPenalty(removeSign(this.penalty).toString());
loanActivityDto.setFees(removeSign(this.fee).toString());
Money total = removeSign(this.fee).add(removeSign(this.penalty)).add(removeSign(this.principal)).add(removeSign(this.interest));
loanActivityDto.setTotal(total.toString());
loanActivityDto.setTotalValue(total.getAmount().doubleValue());
loanActivityDto.setTimeStamp(this.trxnCreatedDate);
loanActivityDto.setRunningBalanceInterest(this.interestOutstanding.toString());
loanActivityDto.setRunningBalancePrinciple(this.principalOutstanding.toString());
loanActivityDto.setRunningBalanceFees(this.feeOutstanding.toString());
loanActivityDto.setRunningBalancePenalty(this.penaltyOutstanding.toString());
loanActivityDto.setRunningBalancePrincipleWithInterestAndFees(this.principalOutstanding.add(this.interestOutstanding).add(this.feeOutstanding).toString());
return loanActivityDto;
}
use of org.mifos.dto.domain.LoanActivityDto in project head by mifos.
the class LoanAccountServiceFacadeWebTier method getRecentActivityView.
private List<LoanActivityDto> getRecentActivityView(final String globalAccountNumber) {
LoanBO loanBO = loanDao.findByGlobalAccountNum(globalAccountNumber);
List<LoanActivityEntity> loanAccountActivityDetails = loanBO.getLoanActivityDetails();
List<LoanActivityDto> recentActivityView = new ArrayList<LoanActivityDto>();
int count = 0;
for (LoanActivityEntity loanActivity : loanAccountActivityDetails) {
recentActivityView.add(getLoanActivityView(loanActivity));
if (++count == 3) {
break;
}
}
return recentActivityView;
}
use of org.mifos.dto.domain.LoanActivityDto in project head by mifos.
the class LoanAccountServiceFacadeWebTier method retrieveAllLoanAccountActivities.
@Override
public List<LoanActivityDto> retrieveAllLoanAccountActivities(String globalAccountNum) {
LoanBO loan = this.loanDao.findByGlobalAccountNum(globalAccountNum);
List<LoanActivityEntity> loanAccountActivityDetails = loan.getLoanActivityDetails();
List<LoanActivityDto> loanActivityViewSet = new ArrayList<LoanActivityDto>();
for (LoanActivityEntity loanActivity : loanAccountActivityDetails) {
loanActivityViewSet.add(loanActivity.toDto());
}
return loanActivityViewSet;
}
Aggregations