Examples of ItemElement


Examples of com.centraview.account.common.ItemElement

          FloatMember  TaxRate = new FloatMember("UnitTaxrate",new Float(taxRate),10,"",'T',false,20);
          FloatMember  OrderQuantity = new FloatMember("OrderQuantity",new Float(1.0f),10,"",'T',false,20);
          FloatMember  PendingQuantity = new FloatMember("PendingQuantity",new Float(0.0f),10,"",'T',false,20);


          ItemElement ie = new ItemElement(counter);
          ie.put ("LineId",LineId);
          ie.put ("ItemId",ItemId);
          ie.put ("SKU",SKU);
          ie.put ("Description",Description);
          ie.put ("Quantity",Quantity);
          ie.put ("PriceEach",PriceEach);
          ie.put ("PriceExtended",PriceExtended);
          ie.put ("UnitTax",UnitTax);
          ie.put ("UnitTaxrate",TaxRate);
          ie.put ("OrderQuantity",OrderQuantity);
          ie.put ("PendingQuantity",PendingQuantity);

          ie.setLineStatus("New");

          itemLines.put(new Integer(counter), ie);
        }catch(Exception e)
        {
          System.out.println("[Exception][AccountHelperEJB.calculateExpenseItems] Exception Thrown: "+e);
View Full Code Here

Examples of com.centraview.marketing.ItemElement

      Iterator itr = s.iterator();

      while ( itr.hasNext())
      {
        Object o = itr.next();
        ItemElement ele = (ItemElement) itemlines.get(o);

        dl.clearParameters();
        dl.setSql( "promotion.addpromotion2" );

        //PromotionID
        dl.setInt( 1 , promotionid );

        //ItemID
        ListElementMember sm  = ( ListElementMember )ele.get( "ItemId" );
        int value = ((Integer)sm.getMemberValue()).intValue() ;
        dl.setInt( 2 , value );

        //Quantity
        sm = ( ListElementMember )ele.get( "Value" );
        value = ((Integer)sm.getMemberValue()).intValue() ;
        dl.setInt( 3 , value );

        //Rule
        sm = ( ListElementMember )ele.get( "Type" );
        dl.setString( 4 , ( String ) sm.getMemberValue() );

        //Price
        sm = ( ListElementMember )ele.get( "DiscountedPrice" );
        float price =  ((Float)sm.getMemberValue()).floatValue() ;
        dl.setFloat( 5 , value );

        dl.executeUpdate();
View Full Code Here

Examples of com.centraview.marketing.ItemElement

      Iterator itr = s.iterator();

      while ( itr.hasNext())
      {
        Object o = itr.next();
        ItemElement ele = (ItemElement) itemlines.get(o);
        dl.clearParameters();
        dl.setSql( "promotion.addpromotion2" );

        //PromotionID
        dl.setInt( 1 , PromotionID );

        //ItemID
        ListElementMember sm = ( ListElementMember )ele.get( "ItemId" );
        int value =  ((Integer)sm.getMemberValue()).intValue() ;
        dl.setInt( 2 , value );

        //Quantity
        sm = ( ListElementMember )ele.get( "Value" );
        value = ((Integer)sm.getMemberValue()).intValue() ;
        dl.setInt( 3 , value );

        //Rule
        sm = ( ListElementMember )ele.get( "Type" );
        dl.setString( 4 , ( String ) sm.getMemberValue() );

        //Price
        sm = ( ListElementMember )ele.get( "DiscountedPrice" );
        float fvalue =  ((Float)sm.getMemberValue()).floatValue() ;
        dl.setInt( 5 , value );
        dl.executeUpdate();

      }
View Full Code Here

Examples of com.centraview.marketing.ItemElement

            FloatMember four = new  FloatMember "Price" , new Float( price ) , 10 , "", 'T' , true , 10 );

            FloatMember listprice = new  FloatMember "ListPrice" , new Float( lprice ) , 10 , "", 'T' , true , 10 );
            FloatMember cost = new  FloatMember "Cost" , new Float( costprice ) , 10 , "", 'T' , true , 10 );

            ItemElement ele = new ItemElement( promotionID );
            ele.put("LineId", lineid );
            ele.put("PromotionID", one );
            ele.put("ItemId", two );
            ele.put("Value" ,  three );// Quantity
            ele.put("Type" , Rule );//Rule
            ele.put("DiscountedPrice" , four );//Price
            ele.put("Description" , desc );//Desc
            ele.put("SKU" , sku );//SKU

            ele.put("ListPrice" , listprice );//ListPrice
            ele.put("Cost" , cost );//Cost

            StringBuffer sb = new StringBuffer("00000000000");
            sb.setLength(11);
            String str = (new Integer(i)).toString();
            sb.replace((sb.length()-str.length()),(sb.length()),str);
View Full Code Here

Examples of com.centraview.sale.proposal.ItemElement

      Set s = itemLines.keySet();
      Iterator itr = s.iterator();
      while (itr.hasNext()) {
        float taxRate = 0.0f;
        // ItemElement ie = (ItemElement)itr.next();
        ItemElement ie = (ItemElement) itemLines.get(itr.next());
        int id = ((Integer) ((IntMember) ie.get("ItemId")).getMemberValue()).intValue();
        try {
          InitialContext ic = CVUtility.getInitialContext();
          ItemLocalHome home = (ItemLocalHome) ic.lookup("local/Item");
          ItemLocal itemLocal = home.create();
          itemLocal.setDataSource(this.dataSource);

          ItemVO item = itemLocal.getItem(userId, id);

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

          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);
              AddressVO addVO = contactHelperLocal.getAddress(shipToId);
              // FIXME I assume the addVO is gotten here so the taxJurisdictionId can be
              // found, unfortunately that doesn't happen.
              if (taxJurisdictionId != 0) {
                taxRate = accHelper.getTax(taxClassId, taxJurisdictionId);
              }// if (taxJurisdictionId !=0)
            } catch (Exception e) {
              System.out.println("[Exception]: SaleHelperEJB.calculateProposalItems: " + e.toString());
              e.printStackTrace();
            }
          } // end of if statement (shipToId != 0)

          // Form the ItemLines
          counter += 1;
          IntMember LineId = new IntMember("LineId", counter, 'D', "", 'T', false, 20);
          IntMember ItemId = new IntMember("ItemId", id, 'D', "", 'T', false, 20);
          StringMember SKU = new StringMember("SKU", sku, 'D', "", 'T', false);
          StringMember Description = new StringMember("Description", name, 'D', "", 'T', false);
          FloatMember Quantity = new FloatMember("Quantity", new Float(1.0f), 'D', "", 'T', false, 20);
          FloatMember PriceEach = new FloatMember("PriceEach", new Float(price), 'D', "", 'T', false, 20);
          FloatMember PriceExtended = new FloatMember("PriceExtended", new Float(0.0f), 'D', "", 'T', false, 20);
          FloatMember UnitTax = new FloatMember("UnitTax", new Float(0.0f), 'D', "", 'T', false, 20);
          FloatMember TaxRate = new FloatMember("UnitTaxrate", new Float(taxRate), 'D', "", 'T', false, 20);
          FloatMember OrderQuantity = new FloatMember("OrderQuantity", new Float(1.0f), 'D', "", 'T', false, 20);
          FloatMember PendingQuantity = new FloatMember("PendingQuantity", new Float(0.0f), 'D', "", 'T', false, 20);

          ItemElement ie = new ItemElement(counter);
          ie.put("LineId", LineId);
          ie.put("ItemId", ItemId);
          ie.put("SKU", SKU);
          ie.put("Description", Description);
          ie.put("Quantity", Quantity);
          ie.put("PriceEach", PriceEach);
          ie.put("PriceExtended", PriceExtended);
          ie.put("UnitTax", UnitTax);
          ie.put("UnitTaxrate", TaxRate);
          ie.put("OrderQuantity", OrderQuantity);
          ie.put("PendingQuantity", PendingQuantity);

          ie.setLineStatus("New");

          itemLines.put(new Integer(counter), ie);
        } // end of try block
        catch (Exception e) {
          System.out.println("[Exception]: SaleHelperEJB.calculateProposalItems: " + e.toString());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.