use of org.mifos.dto.domain.GLCodeDto in project head by mifos.
the class CoaBranchMappingAction method findCoaNames.
public ActionForward findCoaNames(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("start Load method of loan Product Action");
CoaBranchMappingActionForm actionform = (CoaBranchMappingActionForm) form;
List<GLCodeDto> accountingDtos = null;
accountingDtos = accountingServiceFacade.coaBranchAccountHead();
List<GLCodeDto> remainingvalues = accountingServiceFacade.loadRemainingCoaNames(actionform.getBranchoffice());
List<GLCodeDto> coabranchvalues = accountingServiceFacade.loadCoaBranchNames(actionform.getBranchoffice());
storingSession(request, "CoaNamesList", accountingDtos);
storingSession(request, "emptycoanames", coabranchvalues);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.domain.GLCodeDto in project head by mifos.
the class ConsolidatedTransactionAction method approveCRBRTransactions.
public void approveCRBRTransactions(ConsolidatedTransactionActionForm actionForm, String Transactionno, HttpServletRequest request) {
ViewStageTransactionsDto viewStageTransactionsDto = accountingServiceFacade.getstagedAccountingTransactions(Transactionno);
try {
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());
} catch (Exception e) {
e.printStackTrace();
}
GlDetailDto glDetailDto = accountingServiceFacade.getChequeDetails(Transactionno);
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());
}
short s = new Integer(actionForm.getStageOfficeHierarchy()).shortValue();
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();
}
actionForm.setTransactionDetailID(viewStageTransactionsDto.getTransactionID());
actionForm.setStageMainAccount(viewStageTransactionsDto.getMainAccount());
actionForm.setStageAccountHead(viewStageTransactionsDto.getSubAccount());
actionForm.setStageNotes(viewStageTransactionsDto.getNarration());
actionForm.setStageAmount(viewStageTransactionsDto.getTransactionAmount());
String[] Transactionno1 = actionForm.getTransactionNo();
String[] cpbpTransactionNO1 = actionForm.getTransactionCpBpNo();
for (int j = 0; j < Transactionno1.length; j++) {
GlMasterBO glMasterBO = new GlMasterBO();
int stage = 1;
List<String> amountActionList = getAmountAction(actionForm);
List<GlDetailBO> glDetailBOList = getGlDetailBOList(actionForm, amountActionList, Integer.parseInt(actionForm.getTransactionDetailID()));
glMasterBO.setTransactionMasterId(Integer.parseInt(Transactionno1[j]));
glMasterBO.setTransactionDate(DateUtils.getDate(actionForm.getStageTrxnDate()));
glMasterBO.setTransactionType(actionForm.getStageTrxnType());
glMasterBO.setFromOfficeLevel(new Integer(actionForm.getStageOfficeHierarchy()));
glMasterBO.setFromOfficeId(actionForm.getStageOffice());
glMasterBO.setToOfficeLevel(new Integer(actionForm.getStageOfficeHierarchy()));
glMasterBO.setToOfficeId(actionForm.getStageOffice());
glMasterBO.setMainAccount(actionForm.getStageMainAccount());
glMasterBO.setTransactionAmount(new BigDecimal(actionForm.getStageAmount()));
glMasterBO.setAmountAction(amountActionList.get(0));
glMasterBO.setTransactionNarration(actionForm.getStageNotes());
glMasterBO.setStage(stage);
glMasterBO.setGlDetailBOList(glDetailBOList);
// default value
glMasterBO.setStatus("");
// default value
glMasterBO.setTransactionBy(0);
glMasterBO.setCreatedBy(getUserContext(request).getId());
glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
accountingServiceFacade.savingAccountingTransactions(glMasterBO);
}
}
use of org.mifos.dto.domain.GLCodeDto in project head by mifos.
the class InterOfficeTransferAction method load.
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
InterOfficeTransferActionForm actionForm = (InterOfficeTransferActionForm) form;
java.util.Date trxnDate = DateUtils.getCurrentDateWithoutTimeStamp();
actionForm.setTrxnDate(trxnDate);
List<GLCodeDto> interOfficeAccountingDtos = null;
List<GLCodeDto> accountingDtos = null;
interOfficeAccountingDtos = accountingServiceFacade.loadInterOfficeDebitAccounts();
storingSession(request, "InterOfficeDebitAccountGlCodes", interOfficeAccountingDtos);
storingSession(request, "IOFromOfficeHierarchy", null);
storingSession(request, "IOToOfficeHierarchy", null);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.domain.GLCodeDto in project head by mifos.
the class VoucherBranchMappingAction method loadCoaNames.
public ActionForward loadCoaNames(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
VoucherBranchMappingActionForm actionForm = (VoucherBranchMappingActionForm) form;
String lastupdatedateStringvalue = accountingServiceFacade.getLastProcessUpdatedDate(actionForm.getBranch());
DateFormat df = new SimpleDateFormat("dd/mm/yyyy");
String date1 = "01/01/2012";
Date startDate;
try {
startDate = df.parse(lastupdatedateStringvalue);
startDate.setDate(startDate.getDate() + 1);
String newDateString = df.format(startDate);
Date date2 = df.parse(date1);
if (date1.equalsIgnoreCase(lastupdatedateStringvalue)) {
actionForm.setLastProcessDate(accountingServiceFacade.getLastProcessUpdatedDate(actionForm.getBranch()));
actionForm.setTransactiondate(accountingServiceFacade.getLastProcessUpdatedDate(actionForm.getBranch()));
} else {
actionForm.setLastProcessDate(newDateString);
actionForm.setTransactiondate(newDateString);
}
} catch (ParseException e) {
e.printStackTrace();
}
//List<CoaNamesDto> coaNamesDtos=accountingServiceFacade.loadCoaNames(actionForm.getBranch());
List<GLCodeDto> coabranchvalues = accountingServiceFacade.loadCoaBranchNames(actionForm.getBranch());
List<GLCodeDto> coaNameslist = null;
coaNameslist = new ArrayList<GLCodeDto>();
int sno = 1;
for (GLCodeDto coanamesdto : coabranchvalues) {
GLCodeDto coanames = new GLCodeDto();
coanames.setSno(sno);
coanames.setCoaName(coanamesdto.getGlname());
coaNameslist.add(coanames);
sno++;
}
storingSession(request, "coaNamesList", coaNameslist);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.domain.GLCodeDto 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