Search in sources :

Example 1 with LoanArrearsAgingPeriod

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);
        }
    }
}
Also used : BranchReportLoanArrearsAgingBO(org.mifos.reports.branchreport.BranchReportLoanArrearsAgingBO) LoanArrearsAgingPeriod(org.mifos.reports.branchreport.LoanArrearsAgingPeriod) BatchJobException(org.mifos.framework.components.batchjobs.exceptions.BatchJobException) ServiceException(org.mifos.framework.exceptions.ServiceException)

Example 2 with LoanArrearsAgingPeriod

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());
}
Also used : LoanArrearsAgingPeriod(org.mifos.reports.branchreport.LoanArrearsAgingPeriod) OfficeBO(org.mifos.customers.office.business.OfficeBO) BranchReportBO(org.mifos.reports.branchreport.BranchReportBO) Test(org.junit.Test)

Aggregations

LoanArrearsAgingPeriod (org.mifos.reports.branchreport.LoanArrearsAgingPeriod)2 Test (org.junit.Test)1 OfficeBO (org.mifos.customers.office.business.OfficeBO)1 BatchJobException (org.mifos.framework.components.batchjobs.exceptions.BatchJobException)1 ServiceException (org.mifos.framework.exceptions.ServiceException)1 BranchReportBO (org.mifos.reports.branchreport.BranchReportBO)1 BranchReportLoanArrearsAgingBO (org.mifos.reports.branchreport.BranchReportLoanArrearsAgingBO)1