use of org.mifos.reports.branchreport.LoanArrearsAgingPeriod in project head by mifos.
the class BranchReportLoanArrearsAgingHelper method populateLoanArrearsAging.
public void populateLoanArrearsAging() throws BatchJobException {
LoanArrearsAgingPeriod[] values = LoanArrearsAgingPeriod.values();
for (LoanArrearsAgingPeriod period : values) {
try {
BranchReportLoanArrearsAgingBO loanArrears = branchReportService.extractLoanArrearsAgingInfoInPeriod(branchReport.getBranchId(), period, branchReportConfigService.getCurrency());
branchReport.addLoanArrearsAging(loanArrears);
} catch (ServiceException e) {
throw new BatchJobException(e);
}
}
}
use of org.mifos.reports.branchreport.LoanArrearsAgingPeriod in project head by mifos.
the class BranchReportLoanArrearsAgingHelperIntegrationTest method testLoanArrearsAgingHelperPopulatesAgingFields.
@Test
public void testLoanArrearsAgingHelperPopulatesAgingFields() throws Exception {
BranchReportBO branchReportLoanArrearsBatchBO = BranchReportBOFixture.createBranchReport(Integer.valueOf(1), Short.valueOf("3"), DateUtils.currentDate());
OfficeBO office = OfficecFixture.createOffice(Short.valueOf("3"));
for (LoanArrearsAgingPeriod period : expectedPeriods) {
expect(branchReportServiceMock.extractLoanArrearsAgingInfoInPeriod(office.getOfficeId(), period, DEFAULT_CURRENCY)).andReturn(BranchReportBOFixture.createLoanArrearsAging(period));
expect(branchReportConfigServiceMock.getCurrency()).andReturn(DEFAULT_CURRENCY);
}
replay(branchReportServiceMock);
replay(branchReportConfigServiceMock);
new BranchReportLoanArrearsAgingHelper(branchReportLoanArrearsBatchBO, branchReportServiceMock, branchReportConfigServiceMock).populateLoanArrearsAging();
verify(branchReportServiceMock);
verify(branchReportConfigServiceMock);
assertLoanArrearsAgingPopulated(branchReportLoanArrearsBatchBO.getLoanArrearsAging());
}
Aggregations