Package com.centraview.sale.salefacade

Examples of com.centraview.sale.salefacade.SaleFacade


      }
     
      if ((oppId != null) && (oppTitle != null)) {
        proposalListForm.setOpportunityid(oppId);
        proposalListForm.setOpportunity(oppTitle);
        SaleFacade remote = (SaleFacade)sfh.create();
        remote.setDataSource(dataSource);
       
        int opportunityId = (new Integer(oppId)).intValue();
        OpportunityVO oppVO = remote.getOpportunity(individualID, opportunityId);
        proposalListForm.setIndividualid(String.valueOf(oppVO.getIndividualID()));
        proposalListForm.setIndividual(oppVO.getIndividualname());
        proposalListForm.setEntityID(oppVO.getEntityID());
        proposalListForm.setEntity(oppVO.getEntityname());
      }
View Full Code Here


    String dataSource = Settings.getInstance().getSiteInfo(CVUtility.getHostName(super.getServlet().getServletContext())).getDataSource();
    try
    {
      SaleFacadeHome sfh = (SaleFacadeHome) CVUtility.getHomeObject("com.centraview.sale.salefacade.SaleFacadeHome",
          "SaleFacade");
      SaleFacade remote = (SaleFacade) sfh.create();
      remote.setDataSource(dataSource);
      remote.updateProposal(userid, proposallistform);
    }
    catch (Exception e)
    {
      System.out.println("[Exception] UpdateForeCastAmtHandler.updateList: " + e.toString());
      //System.out.println(e);
View Full Code Here

    int listid = 0;
    SaleFacadeHome sfh = (SaleFacadeHome)
      CVUtility.getHomeObject("com.centraview.sale.salefacade.SaleFacadeHome", "SaleFacade");
    try
    {
      SaleFacade remote = (SaleFacade) sfh.create();
      remote.setDataSource(dataSource);
      int billingAddressID = 0;
      int jurisdictionID = 0;
      if(proposallistform.getBillingaddressid() != null && !((proposallistform.getBillingaddressid()).equals(""))){
        billingAddressID = Integer.parseInt(proposallistform.getBillingaddressid());
      }//end of if(proposallistform.getBillingaddressid() != null && !((proposallistform.getBillingaddressid()).equals("")))
      jurisdictionID = proposallistform.getJurisdictionID();
      if(billingAddressID != 0 && jurisdictionID != 0){
        remote.setJurisdictionForAddress(billingAddressID,jurisdictionID);
      }//end of if(billingAddressID != 0 && jurisdictionID != 0)

      listid = remote.addProposal(individualID, proposallistform);
    }
    catch (Exception e)
    {
      logger.error("[Exception] AddProposal.saveList  ", e);
    }
View Full Code Here

    SaleFacadeHome mfh = (SaleFacadeHome)CVUtility.getHomeObject(
        "com.centraview.sale.salefacade.SaleFacadeHome", "SaleFacade");

    try {
      SaleFacade remote = mfh.create();
      remote.setDataSource(dataSource);

      OpportunityForm opportunityForm = (OpportunityForm)form;
      OpportunityVO opportunityVO = new OpportunityVO();

      ActivityVO activityVO = new ActivityVO();
      activityVO.setStatus(Integer.parseInt(opportunityForm.getStatusid()));
      activityVO.setTitle(opportunityForm.getTitle());
      activityVO.setActivityDetails(opportunityForm.getDescription());
      activityVO.setCreatedBy(ownerId);
      activityVO.setOwner(ownerId);

      opportunityVO.setActivityVO(activityVO);
      opportunityVO.setTitle(opportunityForm.getTitle());
      opportunityVO.setDescription(opportunityForm.getDescription());

      int entityIdInt = 0;
      String entityId = opportunityForm.getEntityid();
      try {
        entityIdInt = Integer.parseInt(entityId);
      } catch (NumberFormatException nfe) {}

      if (entityIdInt <= 0) {
        allErrors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
            "error.general.requiredField", "Entity"));
      }

      opportunityVO.setEntityID(entityIdInt);

      if (!opportunityForm.getIndividualid().trim().equals("")) {
        opportunityVO.setIndividualID(Integer.parseInt(opportunityForm.getIndividualid()));
      }

      opportunityVO.setOpportunityTypeID(Integer.parseInt(opportunityForm.getOpportunitytypeid()));
      opportunityVO.setStatusID(Integer.parseInt(opportunityForm.getStatusid()));
      opportunityVO.setStageID(Integer.parseInt(opportunityForm.getStageid()));

      if (!opportunityForm.getTotalamount().trim().equals("")) {
        String Totalamount = opportunityForm.getTotalamount();
        if (Totalamount != null) {
          Totalamount = Totalamount.replaceAll(" ", "");// remove empty spaces
          NumberFormat nf = NumberFormat.getInstance();
          Totalamount = nf.parse(Totalamount).toString();
        }
        opportunityVO.setActualAmount(Float.parseFloat(Totalamount));
      }

      String ForecastedAmount = opportunityForm.getForecastedamount();
      if (ForecastedAmount != null) {
        ForecastedAmount = ForecastedAmount.replaceAll(" ", "");// remove empty
                                                                // spaces
        NumberFormat nf = NumberFormat.getInstance();
        ForecastedAmount = nf.parse(ForecastedAmount).toString();
      }
      opportunityVO.setForecastedAmount(Float.parseFloat(ForecastedAmount));
      opportunityVO.setProbability(Integer.parseInt(opportunityForm.getProbabilityid()));

      if ((opportunityForm.getSourceid() != null)
          && ((opportunityForm.getSourceid()).length() > 0)) {
        opportunityVO.setSourceID(Integer.parseInt(opportunityForm.getSourceid()));
      }
      opportunityVO.setSource(opportunityForm.getSourcename());

      if (opportunityForm.getAcctmgrid() != null
          && !opportunityForm.getAcctmgrid().trim().equals("")
          && !opportunityForm.getAcctmgrid().trim().equals("0")) {
        opportunityVO.setAcctMgr(Integer.parseInt(opportunityForm.getAcctmgrid()));
      } else {
        opportunityVO.setAcctMgr(ownerId);
      }

      if (!opportunityForm.getAcctteamid().trim().equals("")) {
        opportunityVO.setAcctTeam(Integer.parseInt(opportunityForm.getAcctteamid()));
      }

      if ((opportunityForm.getEstimatedclosemonth() != null)
          && (opportunityForm.getEstimatedcloseday() != null)
          && (opportunityForm.getEstimatedcloseyear() != null)) {
        String estimatedclosemonth = opportunityForm.getEstimatedclosemonth();
        String estimatedcloseday = opportunityForm.getEstimatedcloseday();
        String estimatedcloseyear = opportunityForm.getEstimatedcloseyear();

        try {
          Timestamp eClose = DateUtility.createTimestamp(estimatedcloseyear, estimatedclosemonth,
              estimatedcloseday);
          opportunityVO.setEstimatedClose(eClose);
        } catch (Exception e) {
          logger.error("[execute]: Exception", e);
        }
      }

      if (!allErrors.isEmpty()) {
        this.saveErrors(request, allErrors);
        return mapping.findForward(".view.sales.new_opportunity");
      }

      int recordID = remote.addOpportunity(ownerId, opportunityVO);
      rowID = recordID;

      request.setAttribute(SaleConstantKeys.CURRENTTAB, SaleConstantKeys.DETAIL);
      request.setAttribute(SaleConstantKeys.TYPEOFOPERATION, SaleConstantKeys.ADD);
      request.setAttribute(SaleConstantKeys.WINDOWID, "1");
View Full Code Here

    String rowId[] = request.getParameterValues("rowId");
    SaleFacadeHome saleFacadeHome = (SaleFacadeHome)CVUtility.getHomeObject("com.centraview.sale.salefacade.SaleFacadeHome", "SaleFacade");
    try
    {
      SaleFacade remote = (SaleFacade) saleFacadeHome.create();
      remote.setDataSource(dataSource);
      for (int i=0; i<rowId.length; i++)
      {
        if(rowId[i] != null && !rowId[i].equals(""))
        {         
          int elementId = Integer.parseInt(rowId[i]);
          try
          {
            remote.deleteOpportunity(individualId, elementId);
          } catch(AuthorizationFailedException ae) {
            String errorMessage = ae.getExceptionDescription();
            deleteLog.add(errorMessage);
          }
        }
View Full Code Here

      request.setAttribute("emailDisableFlag", emailDisableFlag);

      if (!(viewOperation.equalsIgnoreCase(ProposalConstantKeys.REMOVEITEM) || viewOperation
          .equalsIgnoreCase(ProposalConstantKeys.ADDITEM))) {

        SaleFacade remote = sfh.create();
        remote.setDataSource(dataSource);

        HashMap hm = remote.viewProposal(individualID, row, proposallistform);

        itemLines = (ItemLines) hm.get("itemLines");
        proposallistform = (ProposalListForm) hm.get("dyna");
        proposallistform.setItemLines((ItemLines) hm.get("itemLines"));
        int iOpportunityId;
        iOpportunityId = Integer.parseInt(proposallistform.getOpportunityid());

        // **************** set the opportunity form bean start *************
        OpportunityVO opportunityVO = remote.getOpportunity(individualID, iOpportunityId);
        OpportunityForm opportunityForm = new OpportunityForm();

        if (opportunityVO != null) {
          opportunityForm.setEntityid("" + opportunityVO.getEntityID());
          opportunityForm.setTitle(opportunityVO.getTitle());
View Full Code Here

    AccountFacadeHome afh = (AccountFacadeHomeCVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome", "AccountFacade");
    SaleFacadeHome sfh = (SaleFacadeHome) CVUtility.getHomeObject("com.centraview.sale.salefacade.SaleFacadeHome","SaleFacade");
   
    try  {
      SaleFacade saleRemote =(SaleFacade) sfh.create();
      saleRemote.setDataSource(dataSource);
     
      AccountFacade orderRemote = (AccountFacade) afh.create();
      orderRemote.setDataSource(dataSource);
      HashMap hm  = (HashMap) saleRemote.viewProposal(individualID, proposalID , proposallistform);
      ItemLines itemLines = (ItemLines)hm.get("itemLines");
      proposallistform = (ProposalListForm) hm.get("dyna");
     
      com.centraview.account.common.ItemLines accItemLines = new com.centraview.account.common.ItemLines();
     
      if (itemLines != null) {
        Set s = itemLines.keySet();
        Iterator itr = s.iterator();
        int id = 0;
        int counter = 0;
       
        while (itr.hasNext()) {
          ItemElement ie2 = (ItemElement)itemLines.get(itr.next());
          IntMember LineId = (IntMember)ie2.get("LineId");
          IntMember ItemId = (IntMember)ie2.get("ItemId");
          StringMember SKU = (StringMember)ie2.get("SKU");
          StringMember Description = (StringMember)ie2.get("Description");
          IntMember Quantity = (IntMember)ie2.get("Quantity");
          FloatMember PriceEach = (FloatMember)ie2.get("Price");
          FloatMember PriceExtended = (FloatMember)ie2.get("PriceExtended");
          FloatMember taxAmount = (FloatMember)ie2.get("TaxAmount");
          com.centraview.account.common.ItemElement ie = new com.centraview.account.common.ItemElement(counter);
          ie.put("LineId", LineId);
          ie.put("ItemId", ItemId);
          ie.put("SKU", SKU);
          ie.put("Description", Description);
          ie.put("Quantity", Quantity);
          ie.put("Price", PriceEach);
          ie.put("PriceExtended", PriceExtended);
          ie.put("TaxAmount", taxAmount);
          accItemLines.put(new Integer(counter), ie);
          counter++;
        }
      }
     
      of.setItemLines(accItemLines);
     
      int billingID = 0;
      int shippingID = 0;
      if (proposallistform.getBillingaddressid() != null && !proposallistform.getBillingaddressid().equals("")) {
        billingID = Integer.parseInt(proposallistform.getBillingaddressid());
      }
     
      if (proposallistform.getShippingaddressid() != null && !proposallistform.getShippingaddressid().equals("")) {
        shippingID = Integer.parseInt(proposallistform.getShippingaddressid());
      }
     
      of.setShipToAddIdValue(shippingID);
      of.setBillToAddIdValue(billingID);
      of.setCustomerIdValue(entityID);
      of.setOrderDate(new java.sql.Date(System.currentTimeMillis()));
      of.setJurisdictionID(new Integer(proposallistform.getJurisdictionID()));
      of.setNotes(proposallistform.getProposal() + "-" + proposallistform.getProdescription());
     
      GlobalMasterLists gml = GlobalMasterLists.getGlobalMasterLists(dataSource);
      Vector statusVector = null;
      statusVector = (Vector)gml.get("AccountingStatus");
     
      for (int i = 0; i < statusVector.size(); i++) {
        if (((DDNameValue) statusVector.get(i)).getName().equals("Pending")) {
          of.setStatusIdValue(((DDNameValue) statusVector.get(i)).getId());
          break;
        }
      }
     
      // hardcoded to today() as orderDate will be today when order is created
      // set after calling convert.. as that method sets date from day month yr var.s
      // and that date will be null
      OrderForm createdForm = orderRemote.createOrder(of, individualID);
      int orderID = createdForm.getOrderIdValue();
      request.setAttribute("GeneratedOrderId",new Integer(orderID));
     
      if (orderID != 0) {
        saleRemote.setOrderIsGenerated(true,proposalID,orderID);
      }
    } catch (Exception e) {
      logger.error("[Exception] AutoGenerateOrderHandler.Execute Handler ", e);
    }
    // even if this is failure or success ViewProposal only is to be called
View Full Code Here

      UserObject userObject = (UserObject) session.getAttribute("userobject");
      int individualId = userObject.getIndividualID();
      ProposalListForm pf = (ProposalListForm) form;
      proposalid = Integer.parseInt(pf.getProposalid());

      SaleFacade remote = (SaleFacade) aa.create();
      remote.setDataSource(dataSource);

      boolean b = remote.deleteProposal(individualId, proposalid);
      FORWARD_final = FORWARD_Proposal;
    }
    catch (Exception e)
    {
      System.out.println("[Exception] DeleteProposal.execute: " + e.toString());
View Full Code Here

TOP

Related Classes of com.centraview.sale.salefacade.SaleFacade

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.