Package com.centraview.account.item

Examples of com.centraview.account.item.ItemVO


        {
          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;
          if (purchaseOrderVO.getShipToId()!=0)
          {
            ContactHelperLocalHome home1 = ( ContactHelperLocalHome )ic.lookup("local/ContactHelper");
            ContactHelperLocal contactHelperLocal = home1.create();
            contactHelperLocal.setDataSource(this.dataSource);
            AddressVO addVO = contactHelperLocal.getAddress(purchaseOrderVO.getShipToId());
            taxJurisdictionId = 0;
            if (taxJurisdictionId !=0)
            {
              taxRate = getTax(taxClassId, taxJurisdictionId);
            }//if (taxJurisdictionId !=0)
          }//if InvoiceVO.shipToId!=null
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(taxRate);
        }catch (Exception e)
        {
          ((FloatMember)ie.get("UnitTaxrate")).setMemberValue(0.0f);
          System.out.println("[Exception][AccountHelperEJB.calculatePurchaseOrderItems] Exception Thrown: "+e);
        }
      }//while


    }//if counter!=0


    if (newItemID != null && !newItemID.equals("") )
      {
        st = new StringTokenizer(newItemID, ",");

        while (st.hasMoreTokens())
        {
          try
          {
          float taxRate = 0.0f;
          token   = (String)st.nextToken();
          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();
          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 = (float)item.getPrice();
          int id = item.getItemId();
          int taxClassId = item.getTaxClassId();
          int taxJurisdictionId = 0;
          if (purchaseOrderVO.getShipToId()!=0)
          {
            try
            {
View Full Code Here


          int intToken = Integer.parseInt(token);
          InitialContext ic = CVUtility.getInitialContext();
          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 = (float)item.getPrice();
          int id = item.getItemId();

          //Form the ItemLines
          counter += 1;
          IntMember LineId = new IntMember("LineId",counter,10,"",'T',false,20);
          IntMember ItemId = new IntMember("ItemId",id,10,"",'T',false,20);
View Full Code Here

        * @param params HashMap operation type + last synchronization date
        * @return ArrayList with items from CV side
        */
       public ArrayList getItems(HashMap params,int indId)
       {
         ItemVO itemVO = null;
         ArrayList items = new ArrayList();

         try
         {
           String syncDatePrKeyField[] = {""};
View Full Code Here

        * @param indId int individual id
        * @return boolean status of operation
        */
       public boolean addItems(ArrayList IVOs,int indId)
       {
         ItemVO ivo = null;
         int newId = 0;

         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
           ItemLocal itemL = home.create();

           int size = IVOs.size();

            for ( int i=0;i<size;i++) {

             ivo = (ItemVO) IVOs.get(i);
                if (null != ivo.getParentExternalID())
                    ivo.setSubItemOfId(getItemId(ivo.getParentExternalID()));
             newId = itemL.addItem(indId,ivo);
             logger.info("Added " + newId + " item record");
           }
         }catch(Exception e)
         {
View Full Code Here

        * @param userID int individual id
        * @return boolean status of operation
        */
       public boolean updateItems(ArrayList IVOs,int userID)
       {
         ItemVO ivo = null;
         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           ItemLocalHome home = (ItemLocalHome)ic.lookup("local/Item");
           ItemLocal itemL = home.create();

           int size = IVOs.size();

           for ( int i=0;i<size;i++)
           {
             ivo = (ItemVO) IVOs.get(i);
             itemL.updateItem(userID,ivo);
             logger.info("Updated " + ivo.getItemId() + " item record");
           }
         }catch(Exception e)
         {
           logger.debug("Error in updating Item : "+e);
           e.printStackTrace();
View Full Code Here

        * @param arl ArrayList list with items
        * @param indId int individual id
        */
       public void deleteItems(String modulename, ArrayList arl, int indId)
       {
         ItemVO ivo = new ItemVO();
         String extId = "";
         int intId = 0;

         Iterator it = arl.iterator();

         AccountFacadeLocal helperL = null;
         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           AccountFacadeLocalHome home = (AccountFacadeLocalHome ) ic.lookup("local/AccountFacade");
           helperL = home.create();

           while(it.hasNext())
           {
             ivo = (ItemVO)it.next();
             extId = ivo.getExternalID();
             intId = this.getCVidForExtid(modulename,extId);
             helperL.deleteInvoice(indId, intId);
             logger.info("Item " + intId +" object deleted");
           }

View Full Code Here

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

TOP

Related Classes of com.centraview.account.item.ItemVO

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.