use of org.mifos.dto.domain.OfficeGlobalDto in project head by mifos.
the class InterOfficeTransferAction method loadFromOffices.
public ActionForward loadFromOffices(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
InterOfficeTransferActionForm actionForm = (InterOfficeTransferActionForm) form;
List<OfficeGlobalDto> fromOfficeDetailsDtos = null;
if (actionForm.getFromOfficeHierarchy().equals("")) {
fromOfficeDetailsDtos = null;
} else if (actionForm.getFromOfficeHierarchy().equals("6")) {
// to
// recognize
// center
fromOfficeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("3"));
} else if (actionForm.getFromOfficeHierarchy().equals("7")) {
// to
// recognize
// group
fromOfficeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("2"));
} else {
fromOfficeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(Short.valueOf(actionForm.getFromOfficeHierarchy()));
}
storingSession(request, "IOFromOfficeHierarchy", fromOfficeDetailsDtos);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.domain.OfficeGlobalDto 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.OfficeGlobalDto 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.OfficeGlobalDto 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.OfficeGlobalDto in project head by mifos.
the class ViewStageTransactionAction method edit.
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ViewStageTransactionActionForm actionForm = (ViewStageTransactionActionForm) form;
String stageTransactionNo = request.getParameter("txnNo");
ViewStageTransactionsDto viewStageTransactionsDto = accountingServiceFacade.getstagedAccountingTransactions(stageTransactionNo);
actionForm.setStageTrxnDate(changeDateFormat(viewStageTransactionsDto.getTransactionDate().toString()));
actionForm.setStageOfficeHierarchy(this.getOfficeHierarchy(viewStageTransactionsDto.getOfficeLevel()));
actionForm.setStageTrxnType(getTranType(viewStageTransactionsDto.getTransactionType()));
actionForm.setStageMainAccount(viewStageTransactionsDto.getMainAccount());
viewStageTransactionsDto.getSubAccount();
actionForm.setStageAccountHead(viewStageTransactionsDto.getSubAccount());
actionForm.setStageOffice(viewStageTransactionsDto.getFromOfficeId());
short s = new Integer(actionForm.getStageOfficeHierarchy()).shortValue();
GlDetailDto glDetailDto = accountingServiceFacade.getChequeDetails(stageTransactionNo);
if (glDetailDto != null) {
actionForm.setStageChequeNo(glDetailDto.getChequeNo());
if (glDetailDto.getChequeDate() != null) {
actionForm.setChequeDate(changeDateFormat(glDetailDto.getChequeDate().toString()));
}
actionForm.setStageBankName(glDetailDto.getBankName());
actionForm.setStageankBranch(glDetailDto.getBankBranch());
}
// load offices
List<OfficeGlobalDto> officeDetailsDtos = null;
if (actionForm.getStageOfficeHierarchy() == "0") {
officeDetailsDtos = null;
// To recognize center
} else if (actionForm.getStageOfficeHierarchy() == "6") {
officeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("3"));
// to recognize group
} else if (actionForm.getStageOfficeHierarchy() == "7") {
officeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("2"));
} else {
officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(s);
}
storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
// load main accounts
List<GLCodeDto> accountingDtos = null;
if (actionForm.getStageTrxnType().equals("CR") || actionForm.getStageTrxnType().equals("CP") || actionForm.getStageTrxnType().equals("BR") || actionForm.getStageTrxnType().equals("BP") || actionForm.getStageTrxnType().equals("JV")) {
accountingDtos = accountingServiceFacade.auditAccountHeads();
}
storingSession(request, "MainAccountGlCodes", accountingDtos);
storingSession(request, "stageTransactionNo", stageTransactionNo);
actionForm.setTransactionDetailID(new Integer(viewStageTransactionsDto.getTransactionID()).toString());
actionForm.setStageMainAccount(viewStageTransactionsDto.getMainAccount());
actionForm.setStageAccountHead(viewStageTransactionsDto.getSubAccount());
actionForm.setStageNotes(viewStageTransactionsDto.getNarration());
actionForm.setStageAmount(String.format("%.2f", Double.parseDouble(viewStageTransactionsDto.getTransactionAmount())));
storingSession(request, "ViewStageTransactionsDto", viewStageTransactionsDto);
List<GLCodeDto> accountingGlDtos = null;
accountingGlDtos = accountingServiceFacade.accountHead(actionForm.getStageMainAccount());
storingSession(request, "AccountHeadGlCodes", accountingGlDtos);
return mapping.findForward("edit_success");
}
Aggregations