Package com.centraview.account.common

Examples of com.centraview.account.common.ItemLines


    }
  }

  public void convertArrayToItemLines()
  {
    itemLines = new ItemLines();
    if(itemid != null)
    {
      for(int i = 0; i < itemid.length; i++)
      {
        ItemElement ie = new ItemElement();
View Full Code Here


      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) {
        Set itemSet = itemLines.keySet();
        Iterator iter = itemSet.iterator();
        while (iter.hasNext()) {
          HashMap formItemInfo = new HashMap();
          String treeMapKey = (String)iter.next();
          ItemElement myItem = (ItemElement)itemLines.get(treeMapKey);

          formItemInfo.put("itemSku", (String)(myItem.getMember("SKU")).getMemberValue());
          formItemInfo.put("description", (String)(myItem.getMember("Description")).getMemberValue());

          Number lineQuantityFloat = (Number)(myItem.getMember("Quantity")).getMemberValue();
View Full Code Here

      int termID = invoiceVO.getTermId();
      invoiceForm.set("terms", termID+"");
      invoiceForm.set("accountManager", invoiceVO.getAccountManagerName());

      ItemLines itemLines = (ItemLines)invoiceVO.getItemLines();
      ArrayList invoiceItems = new ArrayList();
     
      int totalItems = 0;
      Float invoiceSubTotal = new Float(0.00);
      if (itemLines != null)
      {
        Set itemSet = itemLines.keySet();
        Iterator iter = itemSet.iterator();
        while (iter.hasNext())
        {
          HashMap formItemInfo = new HashMap();
          String treeMapKey = (String)iter.next();
          ItemElement myItem = (ItemElement)itemLines.get(treeMapKey);

          formItemInfo.put("itemSku", (String)(myItem.getMember("SKU")).getMemberValue());
          formItemInfo.put("description", (String)(myItem.getMember("Description")).getMemberValue());
         
          Float lineQuantityFloat = (Float)(myItem.getMember("Quantity")).getMemberValue();
View Full Code Here

        String removeIDs = request.getParameter("removeID");
        StringTokenizer st;
        Iterator itr;
        Vector removeKeys = new Vector();

        ItemLines itemLines = ((InvoiceForm)form).getItemLines();
        if (itemLines != null)
        {
          st = new StringTokenizer(removeIDs, ",");
          while (st.hasMoreTokens())
          {
            String str = st.nextToken();
            int removeToken = Integer.parseInt(str);

            itr = itemLines.keySet().iterator();
            while (itr.hasNext())
            {
              Object obj = itr.next();
              ItemElement ILE = (ItemElement)itemLines.get(obj);
              IntMember ItemId = (IntMember)ILE.get("ItemId");
              Integer currItemId = (Integer)ItemId.getMemberValue();
              if ( currItemId.intValue() == removeToken)
              {
                String status = ILE.getLineStatus();
                if (status.equals("Active"))
                {
                  ILE.setLineStatus("Deleted");
                }//end of if (status.equals("Active"))
                else  if (status.equals("New"))
                {
                  removeKeys.add(obj);
                }//end of else  if (status.equals("New"))
              }//end of if ( currItemId.intValue() == removeToken)
            }//end of while (itr.hasNext())
          }//end of while (st.hasMoreTokens())

          for(int i=0; i<removeKeys.size(); i++)
          {
            itemLines.remove(removeKeys.get(i));
          }//end of for(int i=0; i<removeKeys.size(); i++)
        }//end of if (itemLines != null)
        ((InvoiceForm)form).setJurisdictionVec(taxJurisdiction);
        ((InvoiceForm)form).setItemLines(itemLines);
        request.setAttribute(AccountConstantKeys.TYPEOFOPERATION,"REMOVEITEM");
      }// end of else if ( request.getParameter(AccountConstantKeys.TYPEOFOPERATION).equals("REMOVEITEM") )
      else if ( request.getParameter(AccountConstantKeys.TYPEOFOPERATION).equals("ADDITEM") )
      {

        String newItemID = request.getParameter("theitemid");

        ItemList IL = null ;

        ListGenerator lg = ListGenerator.getListGenerator(dataSource);//get the List Generator object for Listing
        IL = (ItemList )lg.getItemList( individualID , 1, 10 , "" , "ItemID");//called when the request for the list is for first time


        StringTokenizer st;
        String token, nextItr;
        if (newItemID != null)
        {
          st = new StringTokenizer(newItemID, ",");
          ItemLines itemLines = ((InvoiceForm)form).getItemLines();
          Integer intJurisdictionID = ((InvoiceForm)form).getJurisdictionID();
          int jurisdictionID = intJurisdictionID.intValue();

          if(itemLines == null)
            itemLines = new ItemLines();
          int counter = itemLines.size();
          while (st.hasMoreTokens())
          {
            token   = (String)st.nextToken();
            int intToken = Integer.parseInt(token);

            Iterator itr = IL.keySet().iterator();
            while (itr.hasNext())
            {
              nextItr = (String)itr.next();
              ListElement ile = (ListElement)IL.get(nextItr);
              IntMember smid = (IntMember)ile.get("ItemID");
              Integer listItemid = (Integer)smid.getMemberValue();

              if ( listItemid.intValue() == intToken )
              {

                StringMember smName = (StringMember)ile.get("Name"); // name = description
                String name = (String) smName.getMemberValue();

                StringMember smSku  = (StringMember) ile.get("SKU");
                String sku = (String)smSku.getMemberValue();
                FloatMember dmprice  = (FloatMember) ile.get("Price");

                float price = Float.parseFloat((dmprice.getMemberValue()).toString());

                int id = ile.getElementID();

                IntMember LineId = new IntMember("LineId",0,'D',"",'T',false,20);
                IntMember ItemId = new IntMember("ItemId",id,'D',"",'T',false,20);
                IntMember  Quantity = new IntMember("Quantity",1,'D',"",'T',false,20);
                FloatMember  PriceEach = new FloatMember("Price",new Float(price),'D',"",'T',false,20);
                StringMember SKU = new StringMember("SKU",sku,'D',"",'T',false);
                StringMember Description = new StringMember("Description",name,'D',"",'T',false);
                FloatMember  PriceExtended = new FloatMember("PriceExtended",new Float(0.0f),'D',"",'T',false,20);
                FloatMember  TaxAmount = new FloatMember("TaxAmount",new Float(0.0f),'D',"",'T',false,20);

                ItemElement ie = new ItemElement(0);
                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);

                ie.setLineStatus("New");
                counter += 1;
                itemLines.put(new Integer(counter), ie);
                break;
              }// end of if ( listItemid.intValue() == intToken )
            }// end of while (itr.hasNext())
          }// end of while (st.hasMoreTokens())
          ((InvoiceForm)form).setJurisdictionVec(taxJurisdiction);
View Full Code Here

  private int modifiedBy;

  public void  convertItemLines()
  {
    int count;
    itemLines= new ItemLines();

    if (itemid != null)
    {
      for (int i=0;i<itemid.length;i++)
      {
View Full Code Here

      boolean itemPresent = false;
      int counter = 0;

      if (this.itemid != null)
      {
        ItemLines lines = this.getItemLines();

        for (int i=0;i<this.linestatus.length;i++)
        {
          if (this.linestatus[i] != null && this.linestatus[i].equalsIgnoreCase("Deleted"))
          {
View Full Code Here

    try
    {
      PurchaseOrderForm purchaseform = (PurchaseOrderForm)form;
      purchaseform.convertItemLines();

      ItemLines itemLines = null;

      HttpSession session = request.getSession(true);
      UserObject  userobjectd = (UserObject)session.getAttribute( "userobject" );//get the user object
      int individualID = userobjectd.getIndividualID();

      request.setAttribute(AccountConstantKeys.TYPEOFSUBMODULE, AccountConstantKeys.PURCHASEORDER);
      request.setAttribute("body",AccountConstantKeys.ADD);

      String typeOfOperation = request.getParameter(AccountConstantKeys.TYPEOFOPERATION);

      if (typeOfOperation != null && typeOfOperation.equals("ADD"))
      {
        form = PurchaseOrderForm.clearForm((PurchaseOrderForm)form);
        request.setAttribute(AccountConstantKeys.TYPEOFOPERATION,"ADDITEM");
      }// end of if (typeOfOperation != null) && typeOfOperation.equals("ADD"))

      if(typeOfOperation != null && typeOfOperation.equals("REMOVEITEM") )
      {
        String removeIDs = request.getParameter("removeID");
        StringTokenizer st;
        Iterator itr;
        Vector removeKeys = new Vector();

        itemLines = ((PurchaseOrderForm)form).getItemLines();
        if (itemLines != null)
        {
          st = new StringTokenizer(removeIDs, ",");
          while (st.hasMoreTokens())
          {
            String str = st.nextToken();
            int removeToken = Integer.parseInt(str);

            itr = itemLines.keySet().iterator();
            while (itr.hasNext())
            {
              Object obj = itr.next();
              ItemElement ILE = (ItemElement)itemLines.get(obj);
              IntMember ItemId = (IntMember)ILE.get("ItemId");
              Integer currItemId = (Integer)ItemId.getMemberValue();
              if ( currItemId.intValue() == removeToken)
              {
                String status = ILE.getLineStatus();
                if (status.equals("Active"))
                {
                  ILE.setLineStatus("Deleted");
                }//end of if (status.equals("Active"))
                else  if (status.equals("New"))
                {
                   removeKeys.add(obj);
                }//end of else  if (status.equals("New"))
              }//end of if ( currItemId.intValue() == removeToken)
            }//end of while (itr.hasNext())
          }//end of while (st.hasMoreTokens())

          for(int i=0; i<removeKeys.size(); i++)
          {
            itemLines.remove(removeKeys.get(i));
          }//end of for(int i=0; i<removeKeys.size(); i++)
        }//end of if (itemLines != null)

          ((PurchaseOrderForm)form).setItemLines(itemLines);
                request.setAttribute(AccountConstantKeys.TYPEOFOPERATION,"REMOVEITEM");
      } // end of if(typeOfOperation != null && typeOfOperation.equals("REMOVEITEM") )
      else if (typeOfOperation != null &&typeOfOperation.equals("ADDITEM"))
      {

        String newItemID = request.getParameter("theitemid");
        ItemList IL = null ;
        ListGenerator lg = ListGenerator.getListGenerator(dataSource);//get the List Generator object for Listing
        IL = (ItemList )lg.getItemList( individualID , 1, 10 , "" , "ItemID");//called when the request for the list is for first time

        StringTokenizer st;
        String token, nextItr;

        if (newItemID != null)
        {
          st = new StringTokenizer(newItemID, ",");
          itemLines = ((PurchaseOrderForm)form).getItemLines();

          if(itemLines == null)
            itemLines = new ItemLines();
          int counter = itemLines.size();
          while (st.hasMoreTokens())
          {
            token   = (String)st.nextToken();
            int intToken = Integer.parseInt(token);
            Iterator itr = IL.keySet().iterator();
            while (itr.hasNext())
            {
              nextItr = (String)itr.next();
              ListElement ile = (ListElement)IL.get(nextItr);
              IntMember smid = (IntMember)ile.get("ItemID");
              Integer listItemid = (Integer)smid.getMemberValue();

              if ( listItemid.intValue() == intToken )
              {

                StringMember smName = (StringMember)ile.get("Name"); // name = description
                String name = (String) smName.getMemberValue();

                StringMember smSku  = (StringMember) ile.get("SKU");
                String sku = (String)smSku.getMemberValue();
                FloatMember dmprice  = (FloatMember) ile.get("Price");

                float price = Float.parseFloat((dmprice.getMemberValue()).toString());

                int id = ile.getElementID();

                IntMember LineId = new IntMember("LineId",0,'D',"",'T',false,20);
                IntMember ItemId = new IntMember("ItemId",id,'D',"",'T',false,20);
                IntMember  Quantity = new IntMember("Quantity",1,'D',"",'T',false,20);
                FloatMember  PriceEach = new FloatMember("Price",new Float(price),'D',"",'T',false,20);
                StringMember SKU = new StringMember("SKU",sku,'D',"",'T',false);
                StringMember Description = new StringMember("Description",name,'D',"",'T',false);
                FloatMember  PriceExtended = new FloatMember("PriceExtended",new Float(0.0f),'D',"",'T',false,20);

                ItemElement ie = new ItemElement(0);
                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.setLineStatus("New");
                counter += 1;
                itemLines.put(new Integer(counter), ie);
                break;
              }// end of if ( listItemid.intValue() == intToken )
            }// end of while (itr.hasNext())
          }// end of while (st.hasMoreTokens())
          ((PurchaseOrderForm)form).setItemLines(itemLines);
View Full Code Here

    try
    {
      PurchaseOrderForm purchaseform = (PurchaseOrderForm)form;
      purchaseform.convertItemLines();

      ItemLines itemLines = null;

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

      request.setAttribute(AccountConstantKeys.TYPEOFSUBMODULE, AccountConstantKeys.PURCHASEORDER);
      request.setAttribute("body",AccountConstantKeys.ADD);

      //  -------------  Remove item
      String typeOfOperation = request.getParameter(AccountConstantKeys.TYPEOFOPERATION);
      if( typeOfOperation != null && typeOfOperation.equals("REMOVEITEM") )
      {
        String removeIDs = request.getParameter("removeID");
        StringTokenizer st;
        Iterator itr;
        Vector removeKeys = new Vector();

        itemLines = ((PurchaseOrderForm)form).getItemLines();
        if (itemLines != null)
        {
          st = new StringTokenizer(removeIDs, ",");
          while (st.hasMoreTokens())
          {
            String str = st.nextToken();
            int removeToken = Integer.parseInt(str);

            itr = itemLines.keySet().iterator();
            while (itr.hasNext())
            {
              Object obj = itr.next();
              ItemElement ILE = (ItemElement)itemLines.get(obj);
              IntMember ItemId = (IntMember)ILE.get("ItemId");
              Integer currItemId = (Integer)ItemId.getMemberValue();
              if ( currItemId.intValue() == removeToken)
              {
                String status = ILE.getLineStatus();
                if (status.equals("Active"))
                {
                  ILE.setLineStatus("Deleted");
                }// end of if (status.equals("Active"))
                else  if (status.equals("New"))
                {
                   removeKeys.add(obj);
                }// end of else  if (status.equals("New"))
              }// end of if ( currItemId.intValue() == removeToken)
            }// end of while (itr.hasNext())
          }// end of while (st.hasMoreTokens())

          for(int i=0; i<removeKeys.size(); i++)
          {
            itemLines.remove(removeKeys.get(i));
          }// end of for(int i=0; i<removeKeys.size(); i++)
        }// end of if (itemLines != null)

         ((PurchaseOrderForm)form).setItemLines(itemLines);
      }// end of if( typeOfOperation != null && typeOfOperation.equals("REMOVEITEM") )
      //----------  ADD item
      else if (typeOfOperation != null &&  typeOfOperation.equals("ADDITEM") )
      {

        String newItemID = request.getParameter("theitemid");
        ItemList IL = null ;
        ListGenerator lg = ListGenerator.getListGenerator(dataSource);//get the List Generator object for Listing
        IL = (ItemList )lg.getItemList( individualID , 1, 10 , "" , "ItemID");//called when the request for the list is for first time

        StringTokenizer st;
        String token, nextItr;

        if (newItemID != null)
        {
          st = new StringTokenizer(newItemID, ",");
          itemLines = ((PurchaseOrderForm)form).getItemLines();

          if(itemLines == null)
            itemLines = new ItemLines();
          int counter = itemLines.size();
          while (st.hasMoreTokens())
          {
            token   = (String)st.nextToken();
            int intToken = Integer.parseInt(token);

            Iterator itr = IL.keySet().iterator();
            while (itr.hasNext())
            {
              nextItr = (String)itr.next();
              ListElement ile = (ListElement)IL.get(nextItr);
              IntMember smid = (IntMember)ile.get("ItemID");
              Integer listItemid = (Integer)smid.getMemberValue();

              if ( listItemid.intValue() == intToken )
              {

                StringMember smName = (StringMember)ile.get("Name"); // name = description
                String name = (String) smName.getMemberValue();

                StringMember smSku  = (StringMember) ile.get("SKU");
                String sku = (String)smSku.getMemberValue();
                FloatMember dmprice  = (FloatMember) ile.get("Price");

                float price = Float.parseFloat((dmprice.getMemberValue()).toString());

                int id = ile.getElementID();

                IntMember LineId = new IntMember("LineId",0,'D',"",'T',false,20);
                IntMember ItemId = new IntMember("ItemId",id,'D',"",'T',false,20);
                IntMember  Quantity = new IntMember("Quantity",1,'D',"",'T',false,20);
                FloatMember  PriceEach = new FloatMember("Price",new Float(price),'D',"",'T',false,20);
                StringMember SKU = new StringMember("SKU",sku,'D',"",'T',false);
                StringMember Description = new StringMember("Description",name,'D',"",'T',false);
                FloatMember  PriceExtended = new FloatMember("PriceExtended",new Float(0.0f),'D',"",'T',false,20);

                ItemElement ie = new ItemElement(0);
                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.setLineStatus("New");
                counter += 1;
                itemLines.put(new Integer(counter), ie);
                break;
              }// end of if ( listItemid.intValue() == intToken )
            }// end of while (itr.hasNext())
          }// end of while (st.hasMoreTokens())
          ((PurchaseOrderForm)form).setItemLines(itemLines);
View Full Code Here

    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);

      if (request.getParameter(AccountConstantKeys.TYPEOFOPERATION) != null) {
        /*  Remove item  */
        if (request.getParameter(AccountConstantKeys.TYPEOFOPERATION).equals(AccountConstantKeys.REMOVEITEM)) {
          String removeIDs = request.getParameter("removeID");
          StringTokenizer st;
          Iterator itr;
          Vector removeKeys = new Vector();
          itemLines = ((InvoiceForm)form).getItemLines();
          if (itemLines != null) {

            st = new StringTokenizer(removeIDs, ",");
            while (st.hasMoreTokens()) {
              String str = st.nextToken();
              int removeToken = Integer.parseInt(str);
              itr = itemLines.keySet().iterator();
              while (itr.hasNext()) {

                Object obj = itr.next();
                ItemElement ILE = (ItemElement)itemLines.get(obj);
                IntMember ItemId = (IntMember)ILE.get("ItemId");
                Integer currItemId = (Integer)ItemId.getMemberValue();
                if ( currItemId.intValue() == removeToken) {

                  String status = ILE.getLineStatus();
                  if (status.equals("Active")) {
                    ILE.setLineStatus("Deleted");
                  }//end of if (status.equals("Active"))
                  else  if (status.equals("New")) {
                    removeKeys.add(obj);
                  }//end of else  if (status.equals("New"))
                }//end of if ( currItemId.intValue() == removeToken)
              }//end of while (itr.hasNext())
            }//end of while (st.hasMoreTokens())
            for(int i=0; i<removeKeys.size(); i++) {
              itemLines.remove(removeKeys.get(i));
            }
          }//end of if (itemLines != null)
          invoiceform.convertItemLines();
          ((InvoiceForm)form).setItemLines(itemLines);
        }// end of if (request.getParameter(AccountConstantKeys.TYPEOFOPERATION).equals(AccountConstantKeys.REMOVEITEM))
        /*   ADD item */
        else if (request.getParameter(AccountConstantKeys.TYPEOFOPERATION).equals(AccountConstantKeys.ADDITEM)) {

          String newItemID = request.getParameter("theitemid");
          ItemList IL = null ;
          ListGenerator lg = ListGenerator.getListGenerator(dataSource);//get the List Generator object for Listing
          IL = (ItemList )lg.getItemList( individualID , 1, 10 , "" , "ItemID");//called when the request for the list is for first time

          StringTokenizer st;
          String token, nextItr;
          if (newItemID != null)
          {
            st = new StringTokenizer(newItemID, ",");
            itemLines = ((InvoiceForm)form).getItemLines();

            if(itemLines == null)
              itemLines = new ItemLines();
            int counter = itemLines.size();
            while (st.hasMoreTokens())
            {
              token   = (String)st.nextToken();
              int intToken = Integer.parseInt(token);

              Iterator itr = IL.keySet().iterator();
              while (itr.hasNext())
              {
                nextItr = (String)itr.next();
                ListElement ile = (ListElement)IL.get(nextItr);
                IntMember smid = (IntMember)ile.get("ItemID");
                Integer listItemid = (Integer)smid.getMemberValue();

                if ( listItemid.intValue() == intToken )
                {

                  StringMember smName = (StringMember)ile.get("Name"); // name = description
                  String name = (String) smName.getMemberValue();

                  StringMember smSku  = (StringMember) ile.get("SKU");
                  String sku = (String)smSku.getMemberValue();
                  FloatMember dmprice  = (FloatMember) ile.get("Price");

                  float price = Float.parseFloat((dmprice.getMemberValue()).toString());

                  int id = ile.getElementID();

                  IntMember LineId = new IntMember("LineId",0,'D',"",'T',false,20);
                  IntMember ItemId = new IntMember("ItemId",id,'D',"",'T',false,20);
                  IntMember  Quantity = new IntMember("Quantity",1,'D',"",'T',false,20);
                  FloatMember  PriceEach = new FloatMember("Price",new Float(price),'D',"",'T',false,20);
                  StringMember SKU = new StringMember("SKU",sku,'D',"",'T',false);
                  StringMember Description = new StringMember("Description",name,'D',"",'T',false);
                  FloatMember  PriceExtended = new FloatMember("PriceExtended",new Float(0.0f),'D',"",'T',false,20);
                  FloatMember  TaxAmount = new FloatMember("TaxAmount",new Float(0.0f),'D',"",'T',false,20);

                  ItemElement ie = new ItemElement(0);
                  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);

                  ie.setLineStatus("New");
                  counter += 1;
                  itemLines.put(new Integer(counter), ie);
                  break;
                }// end of if ( listItemid.intValue() == intToken )
              }// end of while (itr.hasNext())
            }// end of while (st.hasMoreTokens())
            ((InvoiceForm)form).setJurisdictionVec(taxJurisdiction);
View Full Code Here

    this.dataSource = ds;

    CVDal dl = new CVDal(ds);
    try
    {
      ItemLines itemLines =  invoiceVO.getItemLines();
      itemLines.calculate();
      dl.setSql("invoice.addinvoice");
      dl.setInt(1,invoiceVO.getOrderId()); //orderID
      dl.setInt(2,invoiceVO.getBillToId());//billaddress
      dl.setInt(3,invoiceVO.getShipToId());//shipaddress
      dl.setInt(4,invoiceVO.getStatusId()); // statusid
      dl.setInt(5,invoiceVO.getTermId());// termid
      dl.setInt(6,invoiceVO.getAccountManagerId()); //accmanager
      dl.setInt(7,invoiceVO.getProjectId()); //project id
      dl.setString(8,invoiceVO.getPo());// ponumber
      dl.setInt(9,userID);

      dl.setDate(10,invoiceVO.getInvoiceDate()); // invoiceDate DateObject

      dl.setFloat(11,itemLines.getSubtotal()); // sub total
      dl.setFloat(12,itemLines.getTax()); //tax
      dl.setFloat(13,itemLines.getTotal()); // total
      dl.setFloat(14,invoiceVO.getCustomerId()); // customer id
      dl.setString(15,invoiceVO.getDescription()); // Notes
      dl.setString(16,invoiceVO.getExternalId()); // externalID
      dl.setInt(17,userID); // Owner
      dl.executeUpdate();
      invoiceID  = dl.getAutoGeneratedKey();
      this.invoiceVO =invoiceVO;

      invoiceVO.setInvoiceId(invoiceID);
      dl.clearParameters();

      Set listkey = itemLines.keySet();
      Iterator it =  listkey.iterator();
      while (it.hasNext())
      {
        Object str = ( Object )it.next();
        ItemElement ele  = ( ItemElement)itemLines.get( str );
        this.addInvoiceItem(ele,invoiceID);
      }// end of while

      InitialContext ic = CVUtility.getInitialContext();
      AuthorizationLocalHome authorizationHome = (AuthorizationLocalHome)ic.lookup("local/Authorization");
View Full Code Here

TOP

Related Classes of com.centraview.account.common.ItemLines

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.