use of org.mifos.reports.business.dto.BranchReportHeaderDTO in project head by mifos.
the class BranchReportService method getBranchReportHeaderDTO.
@Override
public BranchReportHeaderDTO getBranchReportHeaderDTO(Integer branchId, String runDate) throws ServiceException {
Short officeId = convertIntegerToShort(branchId);
PersonnelBO branchManager = CollectionUtils.first(personnelBusinessService.getActiveBranchManagersUnderOffice(officeId));
try {
return new BranchReportHeaderDTO(officeBusinessService.getOffice(officeId), branchManager == null ? null : branchManager.getDisplayName(), ReportUtils.parseReportDate(runDate));
} catch (ParseException e) {
throw new ServiceException(e);
}
}
use of org.mifos.reports.business.dto.BranchReportHeaderDTO in project head by mifos.
the class BranchReportServiceIntegrationTest method testServiceReturnsHeaderInformation.
@Test
public void testServiceReturnsHeaderInformation() throws Exception {
session.save(branchReport);
OfficeBO office = OfficecFixture.createOffice(BRANCH_ID_SHORT);
expect(officeBusinessServiceMock.getOffice(BRANCH_ID_SHORT)).andReturn(office);
replay(officeBusinessServiceMock);
BranchReportHeaderDTO returnedHeaderDTO = branchReportService.getBranchReportHeaderDTO(BRANCH_ID, RUN_DATE_STR);
verify(officeBusinessServiceMock);
Assert.assertEquals(new BranchReportHeaderDTO(office, null, ReportUtils.parseReportDate(RUN_DATE_STR)), returnedHeaderDTO);
}
Aggregations