use of org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm in project head by mifos.
the class ApproveTransactions method preview.
public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ViewStageTransactionActionForm actionForm = (ViewStageTransactionActionForm) form;
if (actionForm.getStageTrxnType().equals("CP") || actionForm.getStageTrxnType().equals("CR")) {
actionForm.setChequeDate(null);
actionForm.setStageChequeNo(null);
actionForm.setStageBankName(null);
actionForm.setStageankBranch(null);
}
storingSession(request, "viewtransactionstageactionform", actionForm);
return mapping.findForward("preview_success");
}
use of org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm in project head by mifos.
the class ApproveTransactions method loadAccountHeads.
public ActionForward loadAccountHeads(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ViewStageTransactionActionForm actionForm = (ViewStageTransactionActionForm) form;
List<GLCodeDto> accountingDtos = null;
accountingDtos = accountingServiceFacade.accountHead(actionForm.getStageMainAccount());
storingSession(request, "AccountHeadGlCodes", accountingDtos);
return mapping.findForward("load_stage_success");
}
use of org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm in project head by mifos.
the class AuditTransactionAction method audit.
public ActionForward audit(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 (!actionForm.getStageTrxnType().equals("CP") || !actionForm.getStageTrxnType().equals("CR")) {
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();
}
// else if (actionForm.getStageTrxnType().equals("BR")
// || actionForm.getStageTrxnType().equals("BP")) {
// accountingDtos = accountingServiceFacade.mainAccountForBank();
//
// }else if (actionForm.getStageTrxnType().equals("JV")){
// accountingDtos = accountingServiceFacade.mainAccountForCash();
// }
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(viewStageTransactionsDto.getTransactionAmount());
storingSession(request, "ViewStageTransactionsDto", viewStageTransactionsDto);
List<GLCodeDto> accountingGlDtos = null;
accountingGlDtos = accountingServiceFacade.accountHead(actionForm.getStageMainAccount());
storingSession(request, "AccountHeadGlCodes", accountingGlDtos);
return mapping.findForward("audit_success");
}
use of org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm in project head by mifos.
the class AuditTransactionAction method process.
public ActionForward process(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ViewStageTransactionActionForm actionForm = (ViewStageTransactionActionForm) form;
accountingServiceFacade.addAuditComments(actionForm.getStageTransactionNo(), actionForm.getAudit(), actionForm.getAuditComments());
return mapping.findForward("submit_success");
}
use of org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm in project head by mifos.
the class AuditTransactionAction method pickDate.
public ActionForward pickDate(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ViewStageTransactionActionForm actionForm = (ViewStageTransactionActionForm) form;
// Number of records show on per page
int noOfRecordsPerPage = 10;
// Number of pages index shown
int noOfPagesIndex = 10;
/*
* this program displays the pagination concept as view page displaying
* limited number of page links(number of page links value carrying with
* noOfPagesIndex)
*/
int totalNoOfRowsForPagination = nullIntconv(request.getParameter("totalNoOfRowsForPagination"));
int iTotalPages = nullIntconv(request.getParameter("iTotalPages"));
int iPageNo = nullIntconv(request.getParameter("iPageNo"));
int cPageNo = nullIntconv(request.getParameter("cPageNo"));
int startRecordCurrentPage = 0;
int endRecordCurrentPage = 0;
if (iPageNo == 0) {
iPageNo = 0;
} else {
iPageNo = Math.abs((iPageNo - 1) * noOfRecordsPerPage);
}
actionForm.getToTrxnDate();
actionForm.getFromTrxnDate();
List<ViewStageTransactionsDto> viewStageTransactionsDtos = accountingServiceFacade.getStageAccountingTransactions(DateUtils.getDate(actionForm.getFromTrxnDate()), DateUtils.getDate(actionForm.getToTrxnDate()), iPageNo, noOfRecordsPerPage);
storingSession(request, "ViewStageTransactionsDtos", viewStageTransactionsDtos);
// this will count total number of rows
totalNoOfRowsForPagination = accountingServiceFacade.getNumberOfStageTransactions(DateUtils.getDate(actionForm.getFromTrxnDate()), DateUtils.getDate(actionForm.getToTrxnDate()));
// // calculate next record start record and end record
if (totalNoOfRowsForPagination < (iPageNo + noOfRecordsPerPage)) {
endRecordCurrentPage = totalNoOfRowsForPagination;
} else {
endRecordCurrentPage = (iPageNo + noOfRecordsPerPage);
}
startRecordCurrentPage = (iPageNo + 1);
iTotalPages = ((int) (Math.ceil((double) totalNoOfRowsForPagination / noOfRecordsPerPage)));
// // index of pages
int cPage = 0;
cPage = ((int) (Math.ceil((double) endRecordCurrentPage / (noOfPagesIndex * noOfRecordsPerPage))));
int prePageNo = (cPage * noOfPagesIndex) - // we can say it as
((noOfPagesIndex - 1) + noOfPagesIndex);
// pre cPage
int i = (cPage * noOfPagesIndex) + 1;
ViewGlTransactionPaginaitonVariablesDto dto = new ViewGlTransactionPaginaitonVariablesDto();
dto.setcPageNo(cPageNo);
dto.setI(i);
dto.setcPage(cPage);
dto.setPrePageNo(prePageNo);
dto.setNoOfPagesIndex(noOfPagesIndex);
dto.setiPageNo(iPageNo);
dto.setNoOfRecordsPerPage(noOfRecordsPerPage);
dto.setiTotalPages(iTotalPages);
dto.setStartRecordCurrentPage(startRecordCurrentPage);
dto.setEndRecordCurrentPage(endRecordCurrentPage);
dto.setTotalNoOfRowsForPagination(totalNoOfRowsForPagination);
storingSession(request, "ViewGlTransactionPaginaitonVariablesDto", dto);
return mapping.findForward("load_success");
}
Aggregations