use of org.mifos.reports.branchreport.BranchReportLoanArrearsAgingBO in project head by mifos.
the class BranchReportHelperIntegrationTest method find.
private boolean find(BranchReportLoanArrearsAgingBO loanArrearsAging, List<BranchReportLoanArrearsAgingBO> retrievedLoanArrearsAgingReports) {
boolean result = false;
for (BranchReportLoanArrearsAgingBO bo : retrievedLoanArrearsAgingReports) {
if (bo.getArrearsAgingId().equals(loanArrearsAging.getArrearsAgingId())) {
Assert.assertEquals(bo.getPeriodDescription(), loanArrearsAging.getPeriodDescription());
Assert.assertEquals(bo.getAgingPeriod(), loanArrearsAging.getAgingPeriod());
bo.getAmountAging();
// causes NPE at MoneyUtils.java:46
loanArrearsAging.getAmountAging();
Assert.assertEquals(bo.getAmountAging(), loanArrearsAging.getAmountAging());
Assert.assertEquals(bo.getAmountOutstandingAging(), loanArrearsAging.getAmountOutstandingAging());
result = true;
return result;
}
}
return result;
}
use of org.mifos.reports.branchreport.BranchReportLoanArrearsAgingBO in project head by mifos.
the class BranchReportPersistenceIntegrationTest method testExtractingLoanArrears.
@Test
public void testExtractingLoanArrears() throws Exception {
BranchReportLoanArrearsAgingBO result = branchReportPersistence.extractLoanArrearsAgingInfoInPeriod(LoanArrearsAgingPeriod.ONE_WEEK, Short.valueOf("2"), DEFAULT_CURRENCY);
Assert.assertNotNull(result);
}
use of org.mifos.reports.branchreport.BranchReportLoanArrearsAgingBO in project head by mifos.
the class BranchReportPersistenceIntegrationTest method testSaveLoanArrearsBOWithLargeValueForAmountOutstanding.
@Test
public void testSaveLoanArrearsBOWithLargeValueForAmountOutstanding() throws Exception {
BranchReportLoanArrearsAgingBO branchReportLoanArrearsAgingBO = new BranchReportLoanArrearsAgingBO(LoanArrearsAgingPeriod.FIVE_TO_EIGHT_WEEK, Integer.valueOf(1), Integer.valueOf(2), createMoney(TestUtils.RUPEE, 15724323.10), createMoney(TestUtils.RUPEE, 1283439.70), createMoney(TestUtils.RUPEE, 459625.70));
BranchReportBO branchReport = BranchReportBOFixture.createBranchReport(null, Short.valueOf("2"), DateUtils.currentDate());
branchReport.addLoanArrearsAging(branchReportLoanArrearsAgingBO);
try {
session.save(branchReport);
session.flush();
// transaction = session.beginTransaction();
deleteBranchReport(branchReport.getBranchReportId());
} catch (Exception e) {
e.printStackTrace(System.out);
Assert.fail("Should not throw error when saving: " + e);
}
}
use of org.mifos.reports.branchreport.BranchReportLoanArrearsAgingBO in project head by mifos.
the class BranchReportServiceIntegrationTest method testExtractLoanArrearsAgingInPeriod.
// TODO TW Add test data and have better test
@Test
public void testExtractLoanArrearsAgingInPeriod() throws Exception {
BranchReportLoanArrearsAgingBO loanArrearsAgingInfoInPeriod = branchReportService.extractLoanArrearsAgingInfoInPeriod(BRANCH_ID_SHORT, LoanArrearsAgingPeriod.ONE_WEEK, DEFAULT_CURRENCY);
Assert.assertNotNull(loanArrearsAgingInfoInPeriod);
// TODO TW more assertions based on test data
}
use of org.mifos.reports.branchreport.BranchReportLoanArrearsAgingBO 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);
}
}
}
Aggregations