Search in sources :

Example 1 with BranchReportStaffSummaryBO

use of org.mifos.reports.branchreport.BranchReportStaffSummaryBO 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);
}
Also used : BranchReportStaffSummaryBO(org.mifos.reports.branchreport.BranchReportStaffSummaryBO) BranchReportBO(org.mifos.reports.branchreport.BranchReportBO) BranchReportService(org.mifos.reports.business.service.BranchReportService) Test(org.junit.Test)

Example 2 with BranchReportStaffSummaryBO

use of org.mifos.reports.branchreport.BranchReportStaffSummaryBO in project head by mifos.

the class BranchReportPersistenceIntegrationTest method testExtractStaffSummaryGetsOnlyLoanOfficers.

@Test
public void testExtractStaffSummaryGetsOnlyLoanOfficers() throws Exception {
    List<BranchReportStaffSummaryBO> staffSummaries = branchReportPersistence.extractBranchReportStaffSummary(BRANCH_ID, Integer.valueOf(1), DEFAULT_CURRENCY);
    for (BranchReportStaffSummaryBO summaryBO : staffSummaries) {
        PersonnelLevel retrievedPersonnelLevel = new PersonnelBusinessService().getPersonnel(summaryBO.getPersonnelId()).getLevelEnum();
        Assert.assertEquals(PersonnelLevel.LOAN_OFFICER, retrievedPersonnelLevel);
    }
}
Also used : PersonnelBusinessService(org.mifos.customers.personnel.business.service.PersonnelBusinessService) BranchReportStaffSummaryBO(org.mifos.reports.branchreport.BranchReportStaffSummaryBO) PersonnelLevel(org.mifos.customers.personnel.util.helpers.PersonnelLevel) Test(org.junit.Test)

Example 3 with BranchReportStaffSummaryBO

use of org.mifos.reports.branchreport.BranchReportStaffSummaryBO in project head by mifos.

the class BranchReportPersistenceIntegrationTest method createStaffSummariesMap.

private Map<Short, BranchReportStaffSummaryBO> createStaffSummariesMap() {
    Set<BranchReportStaffSummaryBO> staffSummaries = branchReportWithStaffSummary.getStaffSummaries();
    HashMap<Short, BranchReportStaffSummaryBO> map = new HashMap<Short, BranchReportStaffSummaryBO>();
    for (BranchReportStaffSummaryBO summaryBO : staffSummaries) {
        map.put(summaryBO.getPersonnelId(), summaryBO);
    }
    return map;
}
Also used : BranchReportStaffSummaryBO(org.mifos.reports.branchreport.BranchReportStaffSummaryBO) HashMap(java.util.HashMap)

Example 4 with BranchReportStaffSummaryBO

use of org.mifos.reports.branchreport.BranchReportStaffSummaryBO in project head by mifos.

the class BranchReportPersistence method populateCustomerCounts.

private void populateCustomerCounts(Map<Short, BranchReportStaffSummaryBO> staffSummaries, Map<String, Object> params) throws PersistenceException {
    List<Object[]> loanOfficerCenterAndClientCountResultset = executeNamedQuery(EXTRACT_BRANCH_REPORT_STAFF_SUMMARY_CENTER_AND_CLIENT_COUNT, params);
    for (Object[] loanOfficerCenterAndClientCount : loanOfficerCenterAndClientCountResultset) {
        BranchReportStaffSummaryBO staffSummary = staffSummaries.get(loanOfficerCenterAndClientCount[0]);
        staffSummary.setCenterCount((Integer) loanOfficerCenterAndClientCount[1]);
        staffSummary.setClientCount((Integer) loanOfficerCenterAndClientCount[2]);
    }
}
Also used : BranchReportStaffSummaryBO(org.mifos.reports.branchreport.BranchReportStaffSummaryBO)

Example 5 with BranchReportStaffSummaryBO

use of org.mifos.reports.branchreport.BranchReportStaffSummaryBO in project head by mifos.

the class BranchReportPersistence method populatePortfolioAtRiskPercentage.

private void populatePortfolioAtRiskPercentage(Map<Short, BranchReportStaffSummaryBO> staffSummaries, Map<String, Object> params) throws PersistenceException {
    List<Object[]> resultSet = executeNamedQuery(EXTRACT_BRANCH_REPORT_STAFF_SUMMARY_PAR, params);
    for (Object[] result : resultSet) {
        BranchReportStaffSummaryBO staffSummary = staffSummaries.get(result[0]);
        staffSummary.setPortfolioAtRisk((BigDecimal) result[1]);
    }
}
Also used : BranchReportStaffSummaryBO(org.mifos.reports.branchreport.BranchReportStaffSummaryBO)

Aggregations

BranchReportStaffSummaryBO (org.mifos.reports.branchreport.BranchReportStaffSummaryBO)9 Test (org.junit.Test)3 HashMap (java.util.HashMap)2 BranchReportBO (org.mifos.reports.branchreport.BranchReportBO)2 BigDecimal (java.math.BigDecimal)1 ArrayList (java.util.ArrayList)1 PersonnelBusinessService (org.mifos.customers.personnel.business.service.PersonnelBusinessService)1 PersonnelLevel (org.mifos.customers.personnel.util.helpers.PersonnelLevel)1 BatchJobException (org.mifos.framework.components.batchjobs.exceptions.BatchJobException)1 ServiceException (org.mifos.framework.exceptions.ServiceException)1 BranchReportService (org.mifos.reports.business.service.BranchReportService)1