use of org.mifos.accounting.struts.actionform.VoucherBranchMappingActionForm in project head by mifos.
the class VoucherBranchMappingAction method preview.
public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
VoucherBranchMappingActionForm actionForm = (VoucherBranchMappingActionForm) form;
String[] coanames = actionForm.getCoaname();
String[] amounts = actionForm.getAmount();
String[] notes = actionForm.getTransactionnotes();
List<GLCodeDto> coaNameslist = null;
int sno = 1;
double total = 0;
coaNameslist = new ArrayList<GLCodeDto>();
for (int i = 0; i < coanames.length; i++) {
total = total + Double.parseDouble(amounts[i]);
GLCodeDto GLcodedto = new GLCodeDto();
GLcodedto.setSno(sno);
sno++;
GLcodedto.setCoaName(coanames[i]);
GLcodedto.setTrannotes(notes[i]);
GLcodedto.setAmounts(amounts[i]);
coaNameslist.add(GLcodedto);
}
actionForm.setTotal(String.format("%.2f", total));
storingSession(request, "coaNamesList", coaNameslist);
storingSession(request, "VoucherBranchMappingActionForm", actionForm);
return mapping.findForward(ActionForwards.preview_success.toString());
}
Aggregations