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);
}
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);
}
}
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;
}
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]);
}
}
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]);
}
}
Aggregations