Package com.centraview.account.order

Examples of com.centraview.account.order.OrderForm


      AccountFacadeHome home = (AccountFacadeHome)CVUtility.getHomeObject("com.centraview.account.accountfacade.AccountFacadeHome", "AccountFacade");
      AccountFacade remote = (AccountFacade)home.create();
      remote.setDataSource(dataSource);
     
      OrderForm cvOrderForm = (OrderForm)remote.getOrderForm(orderID, individualID);

      orderForm.set("entityName", cvOrderForm.getCustomerName());
      orderForm.set("billingAddress", cvOrderForm.getBillToAdd());
      orderForm.set("shippingAddress", cvOrderForm.getShipToAdd());
      orderForm.set("status", cvOrderForm.getStatus());

      Date orderDate = (Date)cvOrderForm.getOrderDate();
      String formattedDate = "";
      orderForm.set("date", formattedDate);

      orderForm.set("terms", cvOrderForm.getTerms());
      orderForm.set("accountManager", cvOrderForm.getAcctMgr());

      ItemLines itemLines = (ItemLines)cvOrderForm.getItemLines();
      ArrayList orderItems = new ArrayList();
     
      int totalItems = 0;
      Float orderSubTotal = new Float(0.00);
      if (itemLines != null) {
View Full Code Here


    HttpSession session = request.getSession();
    UserObject userObject = (UserObject) session.getAttribute("userobject");
    int individualID =userObject.getIndividualID();
    ProposalListForm proposallistform = (ProposalListForm) form;

    OrderForm of = new OrderForm();

    int proposalID = 0;

    try {
      proposalID = Integer.parseInt(request.getParameter("eventid"));
    } catch (Exception ex) {
      proposalID = Integer.parseInt(proposallistform.getProposalid());
    }
    String entityid = request.getParameter("entityID");

    int entityID = 0;
    if (entityid != null) {
      entityID = Integer.parseInt(entityid);
    } else {
      entityID = proposallistform.getEntityID();
    }

    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);
      }
View Full Code Here

    if (!flagProposal && !flagOrder) {
      throw new AuthorizationFailedException(
          "We didn't have privilege for viewing either Proposal or Order module ");
    }

    OrderForm returnForm = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      OrderLocalHome home = (OrderLocalHome) ic.lookup("local/Order");
      OrderLocal order = home.create(orderDetail, userID, this.dataSource);
      order.setDataSource(this.dataSource);
View Full Code Here

  {
    if (!CVUtility.isModuleVisible("OrderHistory", individualID, this.dataSource)) {
      throw new AuthorizationFailedException("Order- getOrder");
    }

    OrderForm orderForm = null;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      OrderLocalHome home = (OrderLocalHome) ic.lookup("local/Order");
      OrderLocal order = home.findByPrimaryKey(new OrderPK(orderId, this.dataSource));
      order.setDataSource(this.dataSource);
View Full Code Here

           invoiceL.setDataSource(this.dataSource);

           ContactHelperLocalHome chlh = (ContactHelperLocalHome) ic.lookup("local/ContactHelper");
           chl = chlh.create();

           OrderForm of = new OrderForm();
           int primAddId = 0;

           for ( int i=0;i<IVOs.size();i++)
           {
             ivo = (InvoiceVO) IVOs.get(i);
             if (ivo.getDescription()== null)
               ivo.setDescription("");
             of.setItemLines(ivo.getItemLines());
             of.setCustomerIdValue(ivo.getCustomerId());
             primAddId = ((AddressVO)chl.getPrimaryAddressForContact(indId,ivo.getCustomerId(),1)).getAddressID();

             of.setBillToAddIdValue(primAddId);
             of.setShipToAddIdValue(1);
             of.setOrderDate(ivo.getInvoiceDate());
             of.setInvoiceIsGenerated(true);

             of = invoiceL.createOrder(of,indId);
             ivo.setOrderId(of.getOrderIdValue());
             ivo.setBillToId(primAddId);
             invoiceL.createInvoice(ivo,indId);
             logger.info("Added " +/* ivo.getInvoiceId()*/ 1+ " invoice record");
           }
         }catch(Exception e)
View Full Code Here

TOP

Related Classes of com.centraview.account.order.OrderForm

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.