use of org.mifos.dto.domain.DynamicOfficeDto in project head by mifos.
the class JournalVoucherAction method loadOffices.
public ActionForward loadOffices(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
JournalVoucherActionForm actionForm = (JournalVoucherActionForm) form;
UserContext userContext = getUserContext(request);
//List<OfficeGlobalDto> officeDetailsDtos = null;
List<OfficeGlobalDto> dynamicOfficeDetailsDtos = null;
List<OfficesList> offices = new ArrayList<OfficesList>();
// list of offices for a single parent office
List<DynamicOfficeDto> listOfOffices = null;
listOfOffices = accountingServiceFacade.getOfficeDetails(String.valueOf(userContext.getBranchId()), String.valueOf(userContext.getOfficeLevelId()));
OfficesList officesList = null;
for (DynamicOfficeDto officeDto : listOfOffices) {
if (actionForm.getOfficeHierarchy().equals("")) {
offices = null;
// to recognise center and group
} else if (actionForm.getOfficeHierarchy().equals("6") || actionForm.getOfficeHierarchy().equals("7")) {
if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
officesList = new OfficesList(officeDto.getCustomerId(), officeDto.getDisplayName(), officeDto.getCustomerLevelId(), officeDto.getGlobalCustomerNumber());
offices.add(officesList);
}
} else {
if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
officesList = new OfficesList(officeDto.getOfficeId(), officeDto.getDisplayName(), officeDto.getOfficeLevelId(), officeDto.getGlobalOfficeNumber());
offices.add(officesList);
}
}
}
// storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
storingSession(request, "DynamicOfficesOnHierarchy", offices);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.domain.DynamicOfficeDto in project head by mifos.
the class MultipleGeneralLedgerAction method loadOffices.
public ActionForward loadOffices(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
MultipleGeneralLedgerActionForm actionForm = (MultipleGeneralLedgerActionForm) form;
UserContext userContext = getUserContext(request);
//List<OfficeGlobalDto> officeDetailsDtos = null;
List<OfficeGlobalDto> dynamicOfficeDetailsDtos = null;
List<OfficesList> offices = new ArrayList<OfficesList>();
// list of offices for a single parent office
List<DynamicOfficeDto> listOfOffices = null;
listOfOffices = accountingServiceFacade.getOfficeDetails(String.valueOf(userContext.getBranchId()), String.valueOf(userContext.getOfficeLevelId()));
OfficesList officesList = null;
for (DynamicOfficeDto officeDto : listOfOffices) {
if (actionForm.getOfficeHierarchy().equals("")) {
offices = null;
// to recognise center and group
} else if (actionForm.getOfficeHierarchy().equals("6") || actionForm.getOfficeHierarchy().equals("7")) {
if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
officesList = new OfficesList(officeDto.getCustomerId(), officeDto.getDisplayName(), officeDto.getCustomerLevelId(), officeDto.getGlobalCustomerNumber());
offices.add(officesList);
}
// officeDetailsDtos = accountingServiceFacade
// .loadCustomerForLevel(new Short("3"));
// } else if (actionForm.getOfficeHierarchy().equals("7")) { // to
// // recognize
// // group
// officeDetailsDtos = accountingServiceFacade
// .loadCustomerForLevel(new Short("2"));
} else {
if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
officesList = new OfficesList(officeDto.getOfficeId(), officeDto.getDisplayName(), officeDto.getOfficeLevelId(), officeDto.getGlobalOfficeNumber());
offices.add(officesList);
}
}
}
// storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
storingSession(request, "DynamicOfficesOnHierarchy", offices);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.domain.DynamicOfficeDto in project head by mifos.
the class SingleGeneralLedgerAction method loadOffices.
public ActionForward loadOffices(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
SingleGeneralLedgerActionForm actionForm = (SingleGeneralLedgerActionForm) form;
UserContext userContext = getUserContext(request);
//List<OfficeGlobalDto> officeDetailsDtos = null;
List<OfficeGlobalDto> dynamicOfficeDetailsDtos = null;
List<OfficesList> offices = new ArrayList<OfficesList>();
// list of offices for a single parent office
List<DynamicOfficeDto> listOfOffices = null;
/*listOfOffices = accountingServiceFacade.getOfficeDetails(String.valueOf(userContext.getBranchId()),String.valueOf(userContext.getOfficeLevelId()));
OfficesList officesList = null;
for(DynamicOfficeDto officeDto :listOfOffices){
if(actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))){
officesList = new OfficesList(officeDto.getOfficeId(), officeDto.displayName, officeDto.officeLevelId, officeDto.globalOfficeNumber);
offices.add(officesList);
}
}*/
listOfOffices = accountingServiceFacade.getOfficeDetails(String.valueOf(userContext.getBranchId()), String.valueOf(userContext.getOfficeLevelId()));
OfficesList officesList = null;
for (DynamicOfficeDto officeDto : listOfOffices) {
if (actionForm.getOfficeHierarchy().equals("")) {
offices = null;
// to recognise center and group
} else if (actionForm.getOfficeHierarchy().equals("6") || actionForm.getOfficeHierarchy().equals("7")) {
if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
officesList = new OfficesList(officeDto.getCustomerId(), officeDto.getDisplayName(), officeDto.getCustomerLevelId(), officeDto.getGlobalCustomerNumber());
offices.add(officesList);
}
// officeDetailsDtos = accountingServiceFacade
// .loadCustomerForLevel(new Short("3"));
// } else if (actionForm.getOfficeHierarchy().equals("7")) { // to
// // recognize
// // group
// officeDetailsDtos = accountingServiceFacade
// .loadCustomerForLevel(new Short("2"));
} else {
if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
officesList = new OfficesList(officeDto.getOfficeId(), officeDto.getDisplayName(), officeDto.getOfficeLevelId(), officeDto.getGlobalOfficeNumber());
offices.add(officesList);
}
}
}
// storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
storingSession(request, "DynamicOfficesOnHierarchy", offices);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.domain.DynamicOfficeDto in project head by mifos.
the class ProcessAccountingTransactionsAction method load.
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ProcessAccountingTransactionsActionForm actionForm = (ProcessAccountingTransactionsActionForm) form;
UserContext context = getUserContext(request);
actionForm.setOfficeLevelId(String.valueOf(context.getOfficeLevelId()));
actionForm.setOffice("");
List<OfficesList> offices = new ArrayList<OfficesList>();
List<DynamicOfficeDto> listOfOffices = null;
listOfOffices = accountingServiceFacade.getOfficeDetails(String.valueOf(context.getBranchId()), String.valueOf(context.getOfficeLevelId()));
OfficesList officesList = null;
OfficeGlobalDto officeGlobalDto = null;
for (DynamicOfficeDto officeDto : listOfOffices) {
if (officeDto.getOfficeLevelId() == 5) {
officesList = new OfficesList(officeDto.getOfficeId(), officeDto.displayName, officeDto.officeLevelId, officeDto.globalOfficeNumber);
offices.add(officesList);
}
}
if ("1".equals(String.valueOf(getUserContext(request).getOfficeLevelId()))) {
storingSession(request, "officeLevelId", actionForm.getOfficeLevelId());
storingSession(request, "DynamicOfficesOnHierarchy", offices);
} else if ("5".equals(String.valueOf(getUserContext(request).getOfficeLevelId()))) {
if (offices.size() > 0 && (offices.get(0) != null)) {
officeGlobalDto = new OfficeGlobalDto(offices.get(0).globalOfficeNumber, offices.get(0).displayName);
}
actionForm.setOffice(offices.get(0).globalOfficeNumber);
storingSession(request, "officeLevelId", actionForm.getOfficeLevelId());
storingSession(request, "DynamicOfficesOnHierarchy", officeGlobalDto);
actionForm.setLastProcessDate(accountingServiceFacade.getLastProcessUpdatedDate(getUserContext(request).getBranchGlobalNum()));
} else {
storingSession(request, "DynamicOfficesOnHierarchy", offices);
}
return mapping.findForward(ActionForwards.load_success.toString());
}
Aggregations