Exemple #1
0
  public ActionForward getWcrDetailsForInvoice(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws AppException {

    ActionForward forward = null;
    WcrForm wcrForm = (WcrForm) form;
    WcrAdd wcrAdd = new WcrAdd();
    WcrManager wcrMgr = new WcrManager();
    CommonManager cmgr = new CommonManager();
    String flag = "S";
    String mode = wcrForm.getMode();
    wcrAdd.setInvoiceMode("Billed");
    String buttonFlag = wcrForm.getButtonFlag();
    wcrAdd.setButtonFlag(buttonFlag);
    System.out.println(wcrForm.getMode());
    wcrAdd.setSowName(wcrForm.getSowName());
    wcrAdd.setWonNo(wcrForm.getWonNo());
    wcrAdd.setPoNo(wcrForm.getPoNo());
    if (!(wcrAdd.getWonNo().equals("")) && !(wcrAdd.getPoNo().equals(""))) {
      flag = "SWP";
    } else if ((wcrAdd.getPoNo().equals("") && !(wcrAdd.getWonNo().equals("")))) {
      flag = "SW";
    }
    try {
      wcrForm.setWcrDetailsList(wcrMgr.getWcrDetails(wcrAdd, flag));
      wcrForm.setTotalSize(wcrForm.getWcrDetailsList().size());
    } catch (Exception ex) {
      ex.printStackTrace();
    }

    if ("SWP".equalsIgnoreCase(flag)) {
      String[] inParams = {wcrAdd.getSowName()};
      System.out.println("array length" + inParams.length);
      wcrForm.setWonList(cmgr.getDropdownValuesByQuery("wonQuery", inParams));
      String[] inParamsPo = {wcrForm.getWonNo()};
      wcrForm.setPoList(cmgr.getDropdownValuesByQuery("poQuery", inParamsPo));
    } else if ("SW".equalsIgnoreCase(flag)) {
      String[] inParams = {wcrAdd.getSowName()};
      System.out.println("array length" + inParams.length);
      wcrForm.setWonList(cmgr.getDropdownValuesByQuery("wonQuery", inParams));
    }
    wcrForm.setVisibility("true");

    wcrForm.setDisplayFlag("");
    forward = mapping.findForward("BilledWCRJsp");

    return forward;
  }
Exemple #2
0
  // ver 1.1 ends here
  public void formToEntity(WcrForm wcrForm, WcrAdd wcrAdd) {

    wcrAdd.setSowName(wcrForm.getSowName());
    wcrAdd.setWonNo(wcrForm.getWonNo());
    wcrAdd.setPoNo(wcrForm.getPoNo());
    wcrAdd.setSelectedIndex(wcrForm.getSelectedIndex());
    wcrAdd.setMilestoneDtlsList(wcrForm.getMilestoneDtlsList());
    wcrAdd.setToDate(wcrForm.getToDate());
    wcrAdd.setFromDate(wcrForm.getFromDate());
    wcrAdd.setApprovedBy(wcrForm.getApprovedBy());
    wcrAdd.setAuthorisedBy(wcrForm.getAuthorisedBy());
    wcrAdd.setPreparedBy(wcrForm.getPreparedBy());
    wcrAdd.setFlowFlag(wcrForm.getFlowFlag());
    wcrAdd.setBusinessUnit(wcrForm.getBusinessUnit());
    wcrAdd.setWcrRefId(wcrForm.getWcrRefId());
  }
Exemple #3
0
  public ActionForward getMilestoneDetails(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws AppException {

    ActionForward forward = null;
    WcrForm wcrForm = (WcrForm) form;
    WcrManager wcrManager = new WcrManager();
    CommonManager cmgr = new CommonManager();
    WcrAdd wcrAdd = new WcrAdd();
    String Dt[] = new String[3];

    wcrForm.setVisibility("True");

    wcrAdd.setSowName(wcrForm.getSowName());

    try {
      wcrAdd.setWonNo(wcrForm.getWonNo());
      wcrAdd.setPoNo(wcrForm.getPoNo());

      String[] inParams = {wcrAdd.getSowName()};
      System.out.println("array length" + inParams.length);
      wcrForm.setWonList(cmgr.getDropdownValuesByQuery("wonQuery", inParams));
      String[] inParamsPo = {wcrForm.getWonNo()};
      wcrForm.setPoList(cmgr.getDropdownValuesByQuery("poQuery", inParamsPo));

      Calendar currentDate = Calendar.getInstance();
      SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy");
      String dateNow = formatter.format(currentDate.getTime());
      System.out.println("Date ====> " + dateNow);

      int lastDate = currentDate.getActualMaximum(Calendar.DATE);

      System.out.println("lastDate ====> " + lastDate);

      Dt = dateNow.split("-");
      String mnth = Dt[1];
      String year = Dt[2];

      wcrForm.setFromDate("1-" + mnth + "-" + year);
      wcrForm.setToDate(lastDate + "-" + mnth + "-" + year);
      wcrAdd.setWcrRefId(wcrForm.getWcrRefId());
      wcrAdd.setFlowFlag(wcrForm.getFlowFlag());
      wcrForm.setMilestoneDtlsList(wcrManager.getMilestones(wcrAdd, null, null, null));
      wcrForm.setTotalSize(wcrForm.getMilestoneDtlsList().size());
      wcrAdd = wcrManager.getPersonDetails(wcrAdd);

      wcrForm.setPreparedBy(wcrAdd.getPreparedBy());
      wcrForm.setApprovedBy(wcrAdd.getApprovedBy());
      wcrForm.setAuthorisedBy(wcrAdd.getAuthorisedBy());
      wcrForm.setAppByDesig(wcrAdd.getAppByDesig());
      wcrForm.setPrepByDesig(wcrAdd.getPrepByDesig());
      wcrForm.setAuthByDesig(wcrAdd.getAuthByDesig());
      //	wcrForm.setBuList(cmgr.getDropdownValuesByQuery(BuQuery,null));

    } catch (Exception ex) {
      ex.printStackTrace();
    }
    forward = mapping.findForward("WCRjsp");

    return forward;
  }
Exemple #4
0
  public ActionForward previewWcr(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws AppException {
    ActionForward forward = null;
    CommonManager commonManager = new CommonManager();
    WcrForm wcrForm = (WcrForm) form;
    WcrManager wcrMgr = new WcrManager();
    WcrAdd wcrAdd = new WcrAdd();
    WcrAdd wcrAdd1 = new WcrAdd();

    String poNo = (String) request.getParameter("poNo");
    String wonNo = (String) request.getParameter("wonNo");
    String refId = (String) request.getParameter("refId");

    wcrAdd.setSowName(wcrForm.getSowName());
    wcrAdd.setPoNo(poNo);
    wcrAdd.setWonNo(wonNo);
    wcrAdd.setWcrRefId(Integer.parseInt(refId));

    try {
      wcrForm.setMilestoneDtlsList(wcrMgr.getMilestoneDtlsForPrvw(wcrAdd));
      wcrAdd = wcrMgr.getPersonDetails(wcrAdd);
    } catch (Exception ex) {
      ex.printStackTrace();
    }

    wcrAdd1 = (WcrAdd) wcrForm.getMilestoneDtlsList().get(0);
    wcrForm.setFromDate(wcrAdd1.getFromDate());
    wcrForm.setToDate(wcrAdd1.getToDate());
    wcrForm.setWcrRefId(wcrAdd.getWcrRefId());
    wcrForm.setPreparedBy(wcrAdd.getPreparedBy());
    wcrForm.setApprovedBy(wcrAdd.getApprovedBy());
    wcrForm.setAuthorisedBy(wcrAdd.getAuthorisedBy());
    wcrForm.setAppByDesig(wcrAdd.getAppByDesig());
    wcrForm.setPrepByDesig(wcrAdd.getPrepByDesig());
    wcrForm.setAuthByDesig(wcrAdd.getAuthByDesig());
    wcrForm.setVisibility("False");

    int j = 0;
    double amt = 0;
    NumberFormat nf = NumberFormat.getInstance(Locale.ENGLISH); // ver 1.1
    nf.setGroupingUsed(true); // ver 1.1
    if (wcrForm.getMilestoneDtlsList() != null && wcrForm.getMilestoneDtlsList().size() > 0) {
      for (int i = 0; i < wcrForm.getMilestoneDtlsList().size(); i++) {

        WcrAdd wr = (WcrAdd) wcrForm.getMilestoneDtlsList().get(i);

        wr.setMilestoneAmtFormatted(commonManager.amtWithComma(wr.getMilestoneAmnt()));
        j++;
        amt = amt + Double.parseDouble(wr.getMilestoneAmnt());
      }
      String amount = Double.toString(amt);
      // String Totalamount=commonManager.amtWithComma(amount);
      wcrForm.setTotalAmt(amount);
      System.out.println("size of j" + j);
      wcrForm.setListSize(j);
    }

    forward = mapping.findForward("wcrPreviewjsp");
    return forward;
  }