Search in sources :

Example 1 with LoanActivityEntity

use of org.mifos.accounts.loan.business.LoanActivityEntity in project head by mifos.

the class GroupLoanAccountServiceFacadeWebTier 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;
}
Also used : LoanActivityEntity(org.mifos.accounts.loan.business.LoanActivityEntity) LoanActivityDto(org.mifos.dto.domain.LoanActivityDto) LoanBO(org.mifos.accounts.loan.business.LoanBO) ArrayList(java.util.ArrayList)

Example 2 with LoanActivityEntity

use of org.mifos.accounts.loan.business.LoanActivityEntity in project head by mifos.

the class LoanRepayTagIntegrationTest method getLoanAccount.

private LoanBO getLoanAccount(AccountState state, Date startDate, int disbursalType) {
    MeetingBO meeting = TestObjectFactory.createMeeting(TestObjectFactory.getTypicalMeeting());
    center = TestObjectFactory.createWeeklyFeeCenter("Center", meeting);
    group = TestObjectFactory.createWeeklyFeeGroupUnderCenter("Group", CustomerStatus.GROUP_ACTIVE, center);
    client = TestObjectFactory.createClient("Client", CustomerStatus.CLIENT_ACTIVE, group);
    LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(startDate, meeting);
    accountBO = TestObjectFactory.createLoanAccountWithDisbursement("99999999999", group, state, startDate, loanOffering, disbursalType);
    LoanActivityEntity loanActivity = new LoanActivityEntity(accountBO, TestObjectFactory.getPersonnel(userContext.getId()), "testing", new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), startDate);
    accountBO.addLoanActivity(loanActivity);
    TestObjectFactory.updateObject(accountBO);
    return accountBO;
}
Also used : LoanActivityEntity(org.mifos.accounts.loan.business.LoanActivityEntity) Money(org.mifos.framework.util.helpers.Money) MeetingBO(org.mifos.application.meeting.business.MeetingBO) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO)

Example 3 with LoanActivityEntity

use of org.mifos.accounts.loan.business.LoanActivityEntity in project head by mifos.

the class LoanAccountActionStrutsTest method getLoanAccount.

private AccountBO getLoanAccount(AccountState state, Date startDate, int disbursalType) {
    LoanOfferingBO loanOffering = TestObjectFactory.createLoanOffering(startDate, meeting);
    accountBO = TestObjectFactory.createLoanAccountWithDisbursement("99999999999", group, state, startDate, loanOffering, disbursalType);
    LoanActivityEntity loanActivity = new LoanActivityEntity(accountBO, TestObjectFactory.getPersonnel(userContext.getId()), "testing", new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), new Money(getCurrency(), "100"), startDate);
    ((LoanBO) accountBO).addLoanActivity(loanActivity);
    addNotes();
    TestObjectFactory.updateObject(accountBO);
    return accountBO;
}
Also used : LoanActivityEntity(org.mifos.accounts.loan.business.LoanActivityEntity) Money(org.mifos.framework.util.helpers.Money) LoanBO(org.mifos.accounts.loan.business.LoanBO) LoanOfferingBO(org.mifos.accounts.productdefinition.business.LoanOfferingBO)

Example 4 with LoanActivityEntity

use of org.mifos.accounts.loan.business.LoanActivityEntity 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;
}
Also used : LoanActivityEntity(org.mifos.accounts.loan.business.LoanActivityEntity) LoanActivityDto(org.mifos.dto.domain.LoanActivityDto) LoanBO(org.mifos.accounts.loan.business.LoanBO) ArrayList(java.util.ArrayList)

Example 5 with LoanActivityEntity

use of org.mifos.accounts.loan.business.LoanActivityEntity 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;
}
Also used : LoanActivityEntity(org.mifos.accounts.loan.business.LoanActivityEntity) LoanActivityDto(org.mifos.dto.domain.LoanActivityDto) LoanBO(org.mifos.accounts.loan.business.LoanBO) ArrayList(java.util.ArrayList)

Aggregations

LoanActivityEntity (org.mifos.accounts.loan.business.LoanActivityEntity)5 LoanBO (org.mifos.accounts.loan.business.LoanBO)4 ArrayList (java.util.ArrayList)3 LoanActivityDto (org.mifos.dto.domain.LoanActivityDto)3 LoanOfferingBO (org.mifos.accounts.productdefinition.business.LoanOfferingBO)2 Money (org.mifos.framework.util.helpers.Money)2 MeetingBO (org.mifos.application.meeting.business.MeetingBO)1