Package org.jallinone.warehouse.availability.java

Examples of org.jallinone.warehouse.availability.java.ItemAvailabilityVO


        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          // fill in the grid v.o., according to the selected item settings...
          ItemAvailabilityVO vo = (ItemAvailabilityVO)filterPanel.getVOModel().getValueObject();
          if (vo.getItemCodeItm01WAR03()==null || vo.getItemCodeItm01WAR03().equals("")) {
            grid.getOtherGridParams().remove(ApplicationConsts.ITEM_PK);
          }
          else {
            grid.getOtherGridParams().put(ApplicationConsts.ITEM_PK,new ItemPK(
                vo.getCompanyCodeSys01WAR03(),
                vo.getItemCodeItm01WAR03()
            ));
          }
        }

        public void beforeLookupAction(ValueObject parentVO) { }
View Full Code Here


      Enumeration en = comps.keys();
      GridParams gridParams = new GridParams();
      gridParams.getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,prodVO.getCompanyCodeSys01DOC23());
      gridParams.getOtherGridParams().put(ApplicationConsts.WAREHOUSE_CODE,prodVO.getWarehouseCodeWar01DOC22());
      gridParams.getOtherGridParams().put(ApplicationConsts.LOAD_ALL,Boolean.TRUE);
      ItemAvailabilityVO availVO = null;
      BigDecimal availability,altAvailability,delta;
      String itemCode = null;
      ArrayList list,availList;
      AltComponentVO altVO = null;
      ArrayList alternativeComps = new ArrayList();
      ArrayList compsToRemove = new ArrayList();
      ProdOrderComponentVO altComponentVO = null;
      HashSet altCodes = null; // list of alternative component item codes...
      BigDecimal altQty = null;
      while(en.hasMoreElements()) {
        itemCode = en.nextElement().toString();
        componentVO = (ProdOrderComponentVO)comps.get(itemCode);

        gridParams.getOtherGridParams().put(ApplicationConsts.ITEM_PK,new ItemPK(prodVO.getCompanyCodeSys01DOC23(),itemCode));
        res = avail.loadItemAvailabilities(variant1Descriptions,variant2Descriptions,variant3Descriptions,variant4Descriptions,variant5Descriptions,gridParams,serverLanguageId,username,companiesList);
        if (res.isError())
          throw new Exception(res.getErrorMessage());

        availList = new ArrayList(((VOListResponse)res).getRows());
        componentVO.setAvailabilities(availList);
        availability = new BigDecimal(0);
        for(int i=0;i<availList.size();i++) {
          availVO = (ItemAvailabilityVO)availList.get(i);
          availability = availability.add(availVO.getAvailableQtyWAR03());
        }
        componentVO.setAvailableQty(availability);

        if (componentVO.getQtyDOC24().doubleValue()>componentVO.getAvailableQty().doubleValue()) {
          // check if there exist some alternative component...
          res = bean.loadAltComponents(gridParams,serverLanguageId,username);
          if (res.isError())
            throw new Exception(res.getErrorMessage());

          list = new ArrayList(((VOListResponse)res).getRows());
          for(int i=0;i<list.size();i++) {
            altVO = (AltComponentVO)list.get(i);
            gridParams.getOtherGridParams().put(ApplicationConsts.ITEM_PK,new ItemPK(prodVO.getCompanyCodeSys01DOC23(),altVO.getItemCodeItm01ITM04()));
            res = avail.loadItemAvailabilities(variant1Descriptions,variant2Descriptions,variant3Descriptions,variant4Descriptions,variant5Descriptions,gridParams,serverLanguageId,username,companiesList);
            if (res.isError())
              throw new Exception(res.getErrorMessage());

            availList = new ArrayList(((VOListResponse)res).getRows());
            altAvailability = new BigDecimal(0);
            for(int j=0;j<availList.size();j++) {
              availVO = (ItemAvailabilityVO)availList.get(j);
              altAvailability = altAvailability.add(availVO.getAvailableQtyWAR03());
            }
            if (altAvailability.doubleValue()>0) {
              altComponentVO = new ProdOrderComponentVO();
              altComponentVO.setAvailabilities(availList);
              altComponentVO.setAvailableQty(altAvailability);
View Full Code Here

       ProdOrderComponentVO compVO = null;
       ProdOrderComponentVO auxCompVO = null;


       // check components availability in the specified warehouse and remove components from it...
       ItemAvailabilityVO availVO = null;
       java.util.List list = null;
       BigDecimal availability = new BigDecimal(0);
       BigDecimal qty,delta;
       WarehouseMovementVO movVO = null;
       int i;
       ArrayList serialNumbers = new ArrayList();
       for(int j=0;j<components.size();j++) {
         compVO = (ProdOrderComponentVO)components.get(j);
         qty = compVO.getQtyDOC24();
         list = compVO.getAvailabilities();
         availability = new BigDecimal(0);
         for(i=0;i<list.size();i++) {
           availVO = (ItemAvailabilityVO)list.get(i);
           availability = availability.add(availVO.getAvailableQtyWAR03());
         }
         if (availability.doubleValue()<qty.doubleValue()) {
           return new VOResponse(
               compVO.getItemCodeItm01DOC24()+" "+
               t1+".\n"+
               t2+": "+availability.doubleValue()+" "+
               t3+": "+qty.doubleValue()
           );
         }
         // the current component is available: it will be removed...
         i=0;
         while(qty.doubleValue()>0) {
           availVO = (ItemAvailabilityVO)list.get(i);
           if (qty.doubleValue()>availVO.getAvailableQtyWAR03().doubleValue()) {
             delta = availVO.getAvailableQtyWAR03();
             qty = qty.subtract(delta);
           }
           else {
             delta = qty;
             qty = new BigDecimal(0);
           }

           // insert record in DOC24...
           compVO.setProgressiveHie01DOC24(availVO.getProgressiveHie01WAR03());
           compVO.setLocationDescriptionSYS10(availVO.getLocationDescriptionSYS10());
           pstmt2.setString(1, vo.getCompanyCodeSys01DOC22());
           pstmt2.setBigDecimal(2, vo.getDocYearDOC22());
           pstmt2.setBigDecimal(3, vo.getDocNumberDOC22());
           pstmt2.setString(4, compVO.getItemCodeItm01DOC24());
           pstmt2.setBigDecimal(5, delta);
           pstmt2.setBigDecimal(6, compVO.getProgressiveHie01DOC24());
           pstmt2.setString(7,username);
           pstmt2.setTimestamp(8,new java.sql.Timestamp(System.currentTimeMillis()));
           pstmt2.execute();

           // create a warehouse movement...
           movVO = new WarehouseMovementVO(
               availVO.getProgressiveHie01WAR03(),
               delta,
               vo.getCompanyCodeSys01DOC22(),
               vo.getWarehouseCodeWar01DOC22(),
               compVO.getItemCodeItm01DOC24(),
               ApplicationConsts.WAREHOUSE_MOTIVE_UNLOAD_BY_PRODUCTION,
View Full Code Here

TOP

Related Classes of org.jallinone.warehouse.availability.java.ItemAvailabilityVO

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.