use of org.mifos.reports.branchreport.BranchReportBO in project head by mifos.
the class BranchReportHelper method createBranchReport.
BranchReportBO createBranchReport(Session session, OfficeBO branchOffice, Date runDate) throws BatchJobException {
BranchReportBO branchReport = new BranchReportBO(branchOffice.getOfficeId(), runDate);
new BranchReportClientSummaryHelper(customerBusinessService, branchReportService, branchReportConfigService).populateClientSummary(branchReport, branchOffice);
new BranchReportLoanArrearsAgingHelper(branchReport, branchReportService, branchReportConfigService).populateLoanArrearsAging();
new BranchReportStaffSummaryHelper(branchReport, branchReportService, branchReportConfigService).populateStaffSummary();
new BranchReportStaffingLevelSummaryHelper(branchReport, branchReportService).populateStaffingLevelSummary();
new BranchReportLoanDetailsHelper(branchReport, branchReportService, branchReportConfigService).populateLoanDetails();
new BranchReportLoanArrearsProfileHelper(branchReport, branchReportService, branchReportConfigService).populateLoanArrearsProfile();
session.save(branchReport);
session.flush();
session.clear();
return branchReport;
}
use of org.mifos.reports.branchreport.BranchReportBO in project head by mifos.
the class BranchReportClientSummaryHelperIntegrationTest method testPopulatesClientSummary.
@Test
public void testPopulatesClientSummary() throws Exception {
BranchReportBO branchReport = BranchReportBOFixture.createBranchReport(Integer.valueOf(1), BRANCH_ID, DateUtils.currentDate());
new BranchReportClientSummaryHelper(getCustomerBusinessServiceStub(), getBranchReportServiceStub(), getBranchReportConfigServiceStub()).populateClientSummary(branchReport, OfficecFixture.createOffice(BRANCH_ID));
assertClientSummary(branchReport);
}
use of org.mifos.reports.branchreport.BranchReportBO in project head by mifos.
the class BranchReportStaffSummaryHelperIntegrationTest method testPopulateStaffSummary.
@Test
public void testPopulateStaffSummary() throws BatchJobException {
BranchReportBO branchReportBO = new BranchReportBO(BRANCH_ID_SHORT, RUN_DATE);
BranchReportStaffSummaryHelper staffSummaryHelper = new BranchReportStaffSummaryHelper(branchReportBO, new BranchReportService(), getConfigServiceStub());
staffSummaryHelper.populateStaffSummary();
Set<BranchReportStaffSummaryBO> staffSummaries = branchReportBO.getStaffSummaries();
Assert.assertNotNull(staffSummaries);
}
use of org.mifos.reports.branchreport.BranchReportBO 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.BranchReportBO in project head by mifos.
the class BranchReportPersistenceIntegrationTest method testGetBranchReportBatchForDateAndBranch.
@Test
public void testGetBranchReportBatchForDateAndBranch() throws Exception {
BranchReportBO branchReportBO = new BranchReportBO(BRANCH_ID, runDate);
session.save(branchReportBO);
List<BranchReportBO> retrievedBranchReports = branchReportPersistence.getBranchReport(BRANCH_ID, runDate);
assertListSizeAndTrueCondition(1, retrievedBranchReports, PredicateUtils.equalPredicate(branchReportBO));
}
Aggregations