Package com.centraview.account.common

Examples of com.centraview.account.common.ItemElement


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


      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

          StringMember SKU = new StringMember("SKU",sku,'D',"",'T',false);
          StringMember Description = new StringMember("Description",description,'D',"",'T',false);
          FloatMember  PriceExtended = new FloatMember("PriceExtended",new Float(priceExtended),'D',"",'T',false,20);
          FloatMember  TaxAmount = new FloatMember("TaxAmount",new Float(taxTotal),'D',"",'T',false,20);

          ItemElement ie = new ItemElement(11);
          ie.put ("LineId",LineId);
          ie.put ("ItemId",ItemId);
          ie.put ("Quantity",Quantity);
          ie.put ("Price",PriceEach);
          ie.put ("SKU",SKU);
          ie.put ("Description",Description);
          ie.put ("PriceExtended",PriceExtended);
          ie.put ("TaxAmount",TaxAmount);
          ie.setLineStatus(status);
          itemLines.put(""+count,ie);
          count ++;
        }
        this.invoiceVO.setItemLines(itemLines);
      }// end of if
View Full Code Here

        Set listkey = itemLines.keySet();
        Iterator it =  listkey.iterator();
        while (it.hasNext())
        {
          Object str = ( Object)it.next();
          ItemElement ele  = ( ItemElement)itemLines.get( str );
          String status    = ele.getLineStatus();

          if(status == null)
            status = "";

          status = status.trim();
View Full Code Here

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

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

          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",description,'D',"",'T',false);
          FloatMember  PriceExtended = new FloatMember("PriceExtended",new Float(priceExtended),'D',"",'T',false,20);

          ItemElement ie = new ItemElement(11);
          ie.put ("LineId",LineId);
          ie.put ("ItemId",ItemId);
          ie.put ("Quantity",Quantity);
          ie.put ("Price",PriceEach);
          ie.put ("SKU",SKU);
          ie.put ("Description",Description);
          ie.put ("PriceExtended",PriceExtended);
          ie.setLineStatus(status);
          itemLines.put(""+count,ie);
          count ++;
        }
        this.purchaseorderVO.setItemLines(itemLines);
      }// end of if
View Full Code Here

        Set listkey = itemLines.keySet();
        Iterator it =  listkey.iterator();
        while (it.hasNext())
        {
          Object str = ( Object)it.next();
          ItemElement ele  = ( ItemElement)itemLines.get( str );
          String status    = ele.getLineStatus();

          if(status == null)
            status = "";
          status = status.trim();
View Full Code Here

      Set listkey = paymentLines.keySet();
        Iterator it =  listkey.iterator();
      while (it.hasNext())
      {
        Object str = ( Object )it.next();
        ItemElement ele  = ( ItemElement)paymentLines.get(str);

        this.addApplyPayment(ele,paymentID);
      }

            InitialContext ic = CVUtility.getInitialContext();
View Full Code Here

          }

          DoubleMember dblAmtDue = new DoubleMember( "AmountDue"  ,amtDue , 10 , "", 'T' , false , 10 );


          ItemElement ie = new ItemElement(11);

          ie.put ("LineId",LineId);
          ie.put ("InvoiceId",invoiceID);
          ie.put ("InvoiceNum",invoiceNum);
          ie.put ("Date",invDate);
          ie.put ("Total",dblTotal);
          ie.put ("AmountDue",dblAmtDue);
          ie.put ("AmountApplied",dblAppAmt);

          ie.setLineStatus("Active");

          double totalPayament = total.doubleValue();
          double amountApplied = amtApp.doubleValue();

          if (amountApplied > 0.0d){
View Full Code Here

        Set listkey = paymentLines.keySet();
        Iterator it =  listkey.iterator();
        while (it.hasNext())
        {
          Object str = ( Object )it.next();
          ItemElement ele  = ( ItemElement)paymentLines.get( str );
          this.updateApplyPayment(ele,paymentVO.getPaymentID());
        }


        cvdal.setSql("account.payment.selectApplypaymentamount");
View Full Code Here

TOP

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

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.