Package com.centraview.account.helper

Examples of com.centraview.account.helper.AccountHelperHome


        logger.error("[Exception] ViewSourceSettingHandler.Execute Handler ", e);
      }
    }

    if (setting != null && setting.equals("Tax")) {
      AccountHelperHome home = (AccountHelperHome)CVUtility.getHomeObject("com.centraview.account.helper.AccountHelperHome", "AccountHelper");
      try {
        AccountHelper remote = home.create();
        remote.setDataSource(dataSource);
        Vector taxClass = remote.getTaxClasses();
        Vector taxJurisdiction = remote.getTaxJurisdiction();
        HashMap taxMatrix = remote.getTaxMartix();
        dynaform.set("taxClassVec",taxClass);
View Full Code Here


  public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException, CommunicationException, NamingException
  {
    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    AccountHelperHome accountHelperHome = (AccountHelperHome) CVUtility.getHomeObject("com.centraview.account.helper.AccountHelperHome","AccountHelper");
    try
    {
      InvoiceForm invoiceform = (InvoiceForm)form;
      invoiceform.convertItemLines();
      ItemLines itemLines=null;

      HttpSession session = request.getSession(true);
      UserObject  userobjectd = (UserObject)session.getAttribute( "userobject" );
      int individualID = userobjectd.getIndividualID();
      session.setAttribute("highlightmodule", "account");

      request.setAttribute(AccountConstantKeys.TYPEOFSUBMODULE, AccountConstantKeys.INVOICE);
      request.setAttribute("body", AccountConstantKeys.ADD );
      String ordernameStr = request.getParameter("OrderName");
      String entityidStr = request.getParameter("EntityID");
      String orderidStr = request.getParameter("OrderID");

      if ((ordernameStr != null) && (entityidStr != null) && (orderidStr !=null)) {
        ((InvoiceForm)form).setOrderid(orderidStr);
        ((InvoiceForm)form).setCustomerId(entityidStr);
        ((InvoiceForm)form).setOrdername(ordernameStr);
      }// end of if ((ordernameStr != null) && (entityidStr != null) && (orderidStr !=null))

      //Call EJb  Account Helper to set ItemLines
      AccountHelper accHelper = (AccountHelper) accountHelperHome.create();
      accHelper.setDataSource(dataSource);

      Vector taxJurisdiction = accHelper.getTaxJurisdiction();
      ((InvoiceForm)form).setJurisdictionVec(taxJurisdiction);
View Full Code Here

    String tempTaxJurisdictionsID = (String) dynaform.get("taxJurisdictionsID");

    FORWARD_final = FORWARD_save;

    if (actionType != null && actionType.equals("ADD")){
      AccountHelperHome home = (AccountHelperHome)CVUtility.getHomeObject("com.centraview.account.helper.AccountHelperHome", "AccountHelper");
      try {
        AccountHelper remote = home.create();
        remote.setDataSource(dataSource);
        if (taxClassValue != null && ! taxClassValue.equals("")) {
          remote.insertTaxClassOrJurisdiction(taxClassValue,"taxClass");
        }
        if (taxJurisdictionsValue != null && !taxJurisdictionsValue.equals("")) {
          remote.insertTaxClassOrJurisdiction(taxJurisdictionsValue,"taxJurisdiction");
        }
      } catch (Exception e) {
        logger.error("[Exception] ViewSourceSettingHandler.Execute Handler ", e);
      }
    }
   
    if (actionType != null && actionType.equals("REMOVE")) {
      AccountHelperHome home = (AccountHelperHome)CVUtility.getHomeObject("com.centraview.account.helper.AccountHelperHome", "AccountHelper");
      try {
        AccountHelper remote = home.create();
        remote.setDataSource(dataSource);
        if (tempTaxClassID != null && !tempTaxClassID.equals("")) {
          int taxClassID = Integer.parseInt(tempTaxClassID);
          remote.removeTaxClassOrJurisdiction(taxClassID, "taxClass");
        }
        if (tempTaxJurisdictionsID != null && !tempTaxJurisdictionsID.equals("")) {
          int taxJurisdictionsID = Integer.parseInt(tempTaxJurisdictionsID);
          remote.removeTaxClassOrJurisdiction(taxJurisdictionsID,"taxJurisdiction");
        }
      } catch (Exception e) {
        logger.error("[Exception] ViewSourceSettingHandler.Execute Handler ", e);
      }
    }
    if (actionType != null && actionType.startsWith("SAVE")) {
      AccountHelperHome home = (AccountHelperHome)CVUtility.getHomeObject("com.centraview.account.helper.AccountHelperHome", "AccountHelper");
      try {
        AccountHelper remote = home.create();
        remote.setDataSource(dataSource);
        Vector taxClass = remote.getTaxClasses();
        Vector taxJurisdiction = remote.getTaxJurisdiction();
        ArrayList taxMatrixValue = new ArrayList();
       
View Full Code Here

          if (proposalVO.getShippingaddressid() != null) {
            shipToId = Integer.parseInt(proposalVO.getShippingaddressid());
          }

          if (shipToId != 0) {
            AccountHelperHome hm = (AccountHelperHome) ic.lookup("local/AccountHelper");
            AccountHelper accHelper = hm.create();
            accHelper.setDataSource(this.dataSource);

            ContactHelperLocalHome home1 = (ContactHelperLocalHome) ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home1.create();
            contactHelperLocal.setDataSource(this.dataSource);

            if (taxJurisdictionId != 0) {
              taxRate = accHelper.getTax(taxClassId, taxJurisdictionId);
            } // end if (taxJurisdictionId != 0)
          } // end if (shipToId != 0)

          ((FloatMember) ie.get("UnitTaxrate")).setMemberValue(taxRate);

        } // end try block
        catch (Exception e) {
          ((FloatMember) ie.get("UnitTaxrate")).setMemberValue(0.0f);
        } // end of catch block (Exception)
      } // end of while loop (itr.hasNext())
    } // end of if statement (counter != 0)

    if (newItemID != null && !newItemID.equals("")) {
      st = new StringTokenizer(newItemID, ",");

      while (st.hasMoreTokens()) {
        try {
          float taxRate = 0.0f;
          token = st.nextToken();
          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();

          float promotionPrice = 0.0f;

          CVDal dl = new CVDal(this.dataSource);
          dl.setSqlQueryToNull();
          dl.setSql("promotion.getpromotionitem");
          dl.setInt(1, intToken);
          Collection col = dl.executeQuery();

          if (col != null && col.size() != 0) {
            Iterator it = col.iterator();
            HashMap hm = (HashMap) it.next();
            if (hm != null) {
              promotionPrice = ((Number) hm.get("Price")).floatValue();
              // FIXME promotions broken here!
              Date promotionStartdate = ((Date) hm.get("Startdate"));
              Date promotionEnddate = ((Date) hm.get("Enddate"));
            }
          }

          dl.clearParameters();
          dl.destroy();

          ItemLocalHome home = (ItemLocalHome) ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);
          ItemVO item = itemLocal.getItem(userId, intToken);

          // Get the Required Fields from the Item VO
          String name = item.getItemName();
          String sku = item.getSku();
          float price = 0.0f;
          if (promotionPrice != 0.0f) {
            price = promotionPrice;
            name = name + " / " + item.getItemDesc() + " (Reflects Promotional Pricing) ";
          } else {
            price = (float) item.getPrice();
            name = name + " / " + item.getItemDesc();
          }

          int id = item.getItemId();
          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;
          int shipToId = 0;

          if (proposalVO.getShippingaddressid() != null) {
            shipToId = Integer.parseInt(proposalVO.getShippingaddressid());
          } // end of if statement (proposalVO.getShippingaddressid() != null)

          if (shipToId != 0) {
            try {
              AccountHelperHome hm = (AccountHelperHome) ic.lookup("local/AccountHelper");
              AccountHelper accHelper = hm.create();
              accHelper.setDataSource(this.dataSource);

              ContactHelperLocalHome home2 = (ContactHelperLocalHome) ic.lookup("local/ContactHelper");
              ContactHelperLocal contactHelperLocal = home2.create();
              contactHelperLocal.setDataSource(this.dataSource);
View Full Code Here

TOP

Related Classes of com.centraview.account.helper.AccountHelperHome

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.