use of org.mifos.accounting.struts.actionform.ConsolidatedTransactionActionForm in project head by mifos.
the class ConsolidatedTransactionAction method load.
public ActionForward load(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("start Load method of loan Product Action");
ConsolidatedTransactionActionForm actionForm = (ConsolidatedTransactionActionForm) form;
java.util.Date trxnDate = DateUtils.getCurrentDateWithoutTimeStamp();
List<OfficeGlobalDto> officeDetailsDtos = null;
UserContext context = getUserContext(request);
actionForm.setOfficeLevelId(String.valueOf(context.getOfficeLevelId()));
List<OfficesList> offices = new ArrayList<OfficesList>();
short branches = 5;
officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(branches);
List<GLCodeDto> accountingDtos = accountingServiceFacade.coaBranchAccountHead();
storingSession(request, "viewStageTransactionsDtoCRBRListValues", null);
storingSession(request, "viewStageTransactionsDtoCPBPListValues", null);
storingSession(request, "viewStageTransactionsDtoCRMisListValues", null);
storingSession(request, "viewStageTransactionsDtoCPMisListValues", null);
storingSession(request, "viewStageTransactionsDtoInterOfficeList", null);
storingSession(request, "OfficesOnHierarchy", null);
actionForm.setTransactiondate("");
actionForm.setCptotal("0");
actionForm.setCrtotal("0");
actionForm.setBranch("");
storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.accounting.struts.actionform.ConsolidatedTransactionActionForm in project head by mifos.
the class ConsolidatedTransactionAction method reject.
public ActionForward reject(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ConsolidatedTransactionActionForm actionForm = (ConsolidatedTransactionActionForm) form;
String[] Transactionno = actionForm.getTransactionNo();
if (Transactionno != null) {
for (int i = 0; i < Transactionno.length; i++) {
int transactioncrbrNoValue = Integer.parseInt(Transactionno[i]);
accountingServiceFacade.approveStageAccountingTransactions(transactioncrbrNoValue, ConsolidatedTransactionActionForm.rejectStage);
}
}
String[] cpbpTransactionNO = actionForm.getTransactionCpBpNo();
if (cpbpTransactionNO != null) {
for (int i = 0; i < cpbpTransactionNO.length; i++) {
int transactioncpbpNoValue = Integer.parseInt(cpbpTransactionNO[i]);
accountingServiceFacade.approveStageAccountingTransactions(transactioncpbpNoValue, ConsolidatedTransactionActionForm.rejectStage);
}
}
return mapping.findForward("submit_success");
}
use of org.mifos.accounting.struts.actionform.ConsolidatedTransactionActionForm in project head by mifos.
the class ConsolidatedTransactionAction method approve.
public ActionForward approve(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ConsolidatedTransactionActionForm actionForm = (ConsolidatedTransactionActionForm) form;
String[] Transactionno = actionForm.getTransactionNo();
if (Transactionno != null) {
for (int i = 0; i < Transactionno.length; i++) {
String transactionNoValue = Transactionno[i];
approveCRBRTransactions(actionForm, transactionNoValue, request);
}
}
String[] cpbpTransactionNO = actionForm.getTransactionCpBpNo();
if (cpbpTransactionNO != null) {
for (int i = 0; i < cpbpTransactionNO.length; i++) {
String transactioncpbpNoValue = cpbpTransactionNO[i];
approveCPBPTransactions(actionForm, transactioncpbpNoValue, request);
}
}
return mapping.findForward("submit_success");
}
use of org.mifos.accounting.struts.actionform.ConsolidatedTransactionActionForm in project head by mifos.
the class ConsolidatedTransactionAction method loadConsolidatedTransaction.
public ActionForward loadConsolidatedTransaction(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("start Load method of loan Product Action");
ConsolidatedTransactionActionForm actionForm = (ConsolidatedTransactionActionForm) form;
String[] s = null;
actionForm.setTransactionCpBpNo(s);
actionForm.setTransactionNo(s);
String lastupdatedateStringvalue = accountingServiceFacade.getLastProcessUpdatedDate(actionForm.getBranch());
//LocalDate localDate=new LocalDate(lastupdatedateStringvalue).plusDays(1);
//Date date=localDate.toDateMidnight().toDate();
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<ViewStageTransactionsDto> viewStageTransactionsDtos = accountingServiceFacade.getConsolidatedTransactions(actionForm.getBranch());
List<ViewStageTransactionsDto> viewStageTransactionsDtoCRBRList = new ArrayList<ViewStageTransactionsDto>();
List<ViewStageTransactionsDto> viewStageTransactionsDtoCPBPList = new ArrayList<ViewStageTransactionsDto>();
List<ViewStageTransactionsDto> viewStageTransactionsDtoCPMisList = new ArrayList<ViewStageTransactionsDto>();
List<ViewStageTransactionsDto> viewStageTransactionsDtoCRMisList = new ArrayList<ViewStageTransactionsDto>();
List<ViewStageTransactionsDto> viewStageTransactionsDtoInterOfficeList = new ArrayList<ViewStageTransactionsDto>();
//Cash Payment
double crbrTotal = 0;
double cpbpTotal = 0;
for (ViewStageTransactionsDto viewStageTransactionsDtosvalues : viewStageTransactionsDtos) {
if (viewStageTransactionsDtosvalues.getTransactionType().equalsIgnoreCase("Cash Receipt")) {
if (viewStageTransactionsDtosvalues.getNarration().equalsIgnoreCase("Mis Processing")) {
crbrTotal = crbrTotal + Double.parseDouble(viewStageTransactionsDtosvalues.getTransactionAmount());
viewStageTransactionsDtoCRMisList.add(viewStageTransactionsDtosvalues);
}
} else if (viewStageTransactionsDtosvalues.getTransactionType().equalsIgnoreCase("Cash Payment")) {
if (viewStageTransactionsDtosvalues.getNarration().equalsIgnoreCase("Mis Processing")) {
cpbpTotal = cpbpTotal + Double.parseDouble(viewStageTransactionsDtosvalues.getTransactionAmount());
viewStageTransactionsDtoCPMisList.add(viewStageTransactionsDtosvalues);
}
} else if (viewStageTransactionsDtosvalues.getMainAccount().equalsIgnoreCase("Inter office Transfers")) {
crbrTotal = crbrTotal + Double.parseDouble(viewStageTransactionsDtosvalues.getTransactionAmount());
viewStageTransactionsDtoInterOfficeList.add(viewStageTransactionsDtosvalues);
}
}
for (ViewStageTransactionsDto viewStageTransactionsDtosvalues : viewStageTransactionsDtos) {
if (viewStageTransactionsDtosvalues.getTransactionType().equalsIgnoreCase("Cash Receipt") || viewStageTransactionsDtosvalues.getTransactionType().equalsIgnoreCase("Bank Receipt")) {
if (!viewStageTransactionsDtosvalues.getNarration().equalsIgnoreCase("Mis Processing")) {
crbrTotal = crbrTotal + Double.parseDouble(viewStageTransactionsDtosvalues.getTransactionAmount());
viewStageTransactionsDtoCRBRList.add(viewStageTransactionsDtosvalues);
}
} else if (viewStageTransactionsDtosvalues.getTransactionType().equalsIgnoreCase("Bank Payment") || viewStageTransactionsDtosvalues.getTransactionType().equalsIgnoreCase("Cash Payment")) {
if (!viewStageTransactionsDtosvalues.getNarration().equalsIgnoreCase("Mis Processing")) {
cpbpTotal = cpbpTotal + Double.parseDouble(viewStageTransactionsDtosvalues.getTransactionAmount());
viewStageTransactionsDtoCPBPList.add(viewStageTransactionsDtosvalues);
}
}
}
actionForm.setCrtotal(Double.toString(crbrTotal));
actionForm.setCptotal(Double.toString(cpbpTotal));
storingSession(request, "ConsolidatedTransactionActionForm", actionForm);
storingSession(request, "viewStageTransactionsDtoCRBRListValues", viewStageTransactionsDtoCRBRList);
storingSession(request, "viewStageTransactionsDtoCPBPListValues", viewStageTransactionsDtoCPBPList);
storingSession(request, "viewStageTransactionsDtoCRMisListValues", viewStageTransactionsDtoCRMisList);
storingSession(request, "viewStageTransactionsDtoCPMisListValues", viewStageTransactionsDtoCPMisList);
storingSession(request, "viewStageTransactionsDtoInterOfficeList", viewStageTransactionsDtoInterOfficeList);
return mapping.findForward(ActionForwards.load_success.toString());
}
Aggregations