Package org.jallinone.warehouse.tables.movements.java

Examples of org.jallinone.warehouse.tables.movements.java.MovementVO


        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          // fill in the grid v.o., according to the selected war settings...
          MovementVO vo = (MovementVO)manualMovForm.getVOModel().getValueObject();
          if (vo.getWarehouseCodeWar01WAR02()==null || vo.getWarehouseCodeWar01WAR02().equals("")) {
            controlItem.setValue(null);
            controlItemDescr.setValue(null);
            controlUmCode.setValue(null);
            controlQty.setValue(null);
            controlQty.setEnabled(false);
            controlItem.setEnabled(false);
            controlPositionCode.setValue(null);
            controlPositionCode.setEnabled(false);
          }
          else {
            controlItem.setValue(null);
            controlItemDescr.setValue(null);
            controlUmCode.setValue(null);
            controlQty.setValue(null);
            controlQty.setEnabled(false);
            controlItem.setEnabled(true);
            controlPositionCode.setEnabled(true);
            WarehouseVO lookupVO = (WarehouseVO)warController.getLookupVO();
            treeLevelPosDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,lookupVO.getProgressiveHie02WAR01());

            // set root level as default position...
            Response res = ClientUtils.getData("getCompanyRootLevel",new Object[]{lookupVO.getCompanyCodeSys01WAR01(),lookupVO.getProgressiveHie02WAR01()});
            if (!res.isError()) {
              CompanyHierarchyLevelVO posVO = (CompanyHierarchyLevelVO)((VOResponse)res).getVo();
              vo.setProgressiveHie01WAR02(posVO.getProgressiveHIE01());
              vo.setLocationDescriptionSYS10(posVO.getDescriptionSYS10());
            }


          }
        }

        public void beforeLookupAction(ValueObject parentVO) { }

        public void forceValidate() {}

      });

      // item code lookup...
      itemDataLocator.setGridMethodName("loadItems");
      itemDataLocator.setValidationMethodName("validateItemCode");
      itemDataLocator.getLookupFrameParams().put(ApplicationConsts.SHOW_ONLY_MOVABLE_ITEMS,Boolean.TRUE);
      itemDataLocator.getLookupValidationParameters().put(ApplicationConsts.SHOW_ONLY_MOVABLE_ITEMS,Boolean.TRUE);

      controlItem.setLookupController(itemController);
      controlItem.setControllerMethodName("getItemsList");

      itemController.setLookupDataLocator(itemDataLocator);
      itemController.setFrameTitle("items");

      itemController.setCodeSelectionWindow(itemController.TREE_GRID_FRAME);
      treeLevelDataLocator.setServerMethodName("loadCompanyHierarchy");
      itemDataLocator.setTreeDataLocator(treeLevelDataLocator);
      itemDataLocator.setNodeNameAttribute("descriptionSYS10");

      itemController.setLookupValueObjectClassName("org.jallinone.items.java.GridItemVO");
      itemController.addLookup2ParentLink("itemCodeITM01", "itemCodeItm01WAR02");
      itemController.addLookup2ParentLink("descriptionSYS10", "itemDescriptionSYS10");

      itemController.setAllColumnVisible(false);
      itemController.setVisibleColumn("companyCodeSys01ITM01", true);
      itemController.setVisibleColumn("itemCodeITM01", true);
      itemController.setVisibleColumn("descriptionSYS10", true);
      itemController.setPreferredWidthColumn("descriptionSYS10", 200);
      itemController.setFramePreferedSize(new Dimension(650,500));
      itemController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          MovementVO vo = (MovementVO)manualMovForm.getVOModel().getValueObject();
          GridItemVO lookupVO = (GridItemVO)itemController.getLookupVO();
          if (vo.getItemCodeItm01WAR02()==null || vo.getItemCodeItm01WAR02().equals("") ) {
            controlUmCode.setValue(null);
            controlQty.setValue(null);
            controlQty.setEnabled(false);
          }
          else {
            controlUmCode.setValue(lookupVO.getMinSellingQtyUmCodeReg02ITM01());
            controlQty.setValue(null);
            controlQty.setEnabled(true);
            serialNumbersRequired = lookupVO.getSerialNumberRequiredITM01().booleanValue();
            controlQty.setDecimals(lookupVO.getDecimalsREG02().intValue());
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {
          MovementVO vo = (MovementVO)manualMovForm.getVOModel().getValueObject();
          itemDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR02());
          itemDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR02());
          itemDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,controlItemType.getValue());
          itemDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,controlItemType.getValue());

          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01WAR02());
          treeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02,controlItemType.getValue());
        }

        public void forceValidate() {}

      });

      // warehouse position code lookup...
      controlPositionCode.setLookupController(posController);
      posController.setLookupDataLocator(posDataLocator);
      posController.setFrameTitle("warehouse positions");

      posController.setCodeSelectionWindow(posController.TREE_FRAME);
      treeLevelPosDataLocator.setServerMethodName("loadCompanyHierarchy");
      posDataLocator.setTreeDataLocator(treeLevelPosDataLocator);
      posDataLocator.setNodeNameAttribute("descriptionSYS10");

      posController.setLookupValueObjectClassName("org.jallinone.hierarchies.java.CompanyHierarchyLevelVO");
      posController.addLookup2ParentLink("progressiveHIE01", "progressiveHie01WAR02");
      posController.addLookup2ParentLink("descriptionSYS10","locationDescriptionSYS10");
      posController.setFramePreferedSize(new Dimension(400,400));

      // warehouse motive code lookup...
      motiveDataLocator.setGridMethodName("loadWarehouseMotives");
      motiveDataLocator.setValidationMethodName("validateWarehouseMotiveCode");

      controlMotiveCode.setLookupController(motiveController);
      controlMotiveCode.setControllerMethodName("getWarehouseMotivesList");

      motiveController.setLookupDataLocator(motiveDataLocator);
      motiveController.setFrameTitle("warehouse motives");

      motiveController.setLookupValueObjectClassName("org.jallinone.warehouse.tables.motives.java.MotiveVO");
      motiveController.addLookup2ParentLink("warehouseMotiveWAR04", "warehouseMotiveWar04WAR02");
      motiveController.addLookup2ParentLink("descriptionSYS10", "motiveDescriptionSYS10");

      motiveController.setAllColumnVisible(false);
      motiveController.setVisibleColumn("warehouseMotiveWAR04", true);
      motiveController.setVisibleColumn("descriptionSYS10", true);
      motiveController.setPreferredWidthColumn("descriptionSYS10", 250);
      motiveController.setFramePreferedSize(new Dimension(360,500));
      motiveController.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          MovementVO vo = (MovementVO)manualMovForm.getVOModel().getValueObject();
          controlNote.setValue(vo.getMotiveDescriptionSYS10());
        }

        public void beforeLookupAction(ValueObject parentVO) {}

        public void forceValidate() {}
View Full Code Here


      if (this.conn==null) conn = getConn(); else conn = this.conn;
      bean.setConn(conn);

      VariantsMatrixColumnVO colVO = null;
      VariantsMatrixRowVO rowVO = null;
      MovementVO vo = null;
      Response res = null;
      int pos = 0;
      ArrayList sn = new ArrayList();

      for(int i=0;i<cells.length;i++) {
        rowVO = (VariantsMatrixRowVO)matrixVO.getRowDescriptors()[i];


        if (matrixVO.getColumnDescriptors().length==0) {

          if (cells[i][0]!=null) {
            vo = (MovementVO)voTemplate.clone();

            if (!containsVariant(matrixVO,"ITM11_VARIANTS_1")) {
              // e.g. color but not no size...
              vo.setVariantCodeItm11WAR02(ApplicationConsts.JOLLY);
              vo.setVariantTypeItm06WAR02(ApplicationConsts.JOLLY);
            }
            else {
              vo.setVariantCodeItm11WAR02(rowVO.getVariantCodeITM11());
              vo.setVariantTypeItm06WAR02(rowVO.getVariantTypeITM06());
            }
            if (!containsVariant(matrixVO,"ITM12_VARIANTS_2")) {
              vo.setVariantCodeItm12WAR02(ApplicationConsts.JOLLY);
              vo.setVariantTypeItm07WAR02(ApplicationConsts.JOLLY);
            }
            else {
              vo.setVariantCodeItm12WAR02(rowVO.getVariantCodeITM11());
              vo.setVariantTypeItm07WAR02(rowVO.getVariantTypeITM06());
            }
            if (!containsVariant(matrixVO,"ITM13_VARIANTS_3")) {
              vo.setVariantCodeItm13WAR02(ApplicationConsts.JOLLY);
              vo.setVariantTypeItm08WAR02(ApplicationConsts.JOLLY);
            }
            else {
              vo.setVariantCodeItm13WAR02(rowVO.getVariantCodeITM11());
              vo.setVariantTypeItm08WAR02(rowVO.getVariantTypeITM06());
            }
            if (!containsVariant(matrixVO,"ITM14_VARIANTS_4")) {
              vo.setVariantCodeItm14WAR02(ApplicationConsts.JOLLY);
              vo.setVariantTypeItm09WAR02(ApplicationConsts.JOLLY);
            }
            else {
              vo.setVariantCodeItm14WAR02(rowVO.getVariantCodeITM11());
              vo.setVariantTypeItm09WAR02(rowVO.getVariantTypeITM06());
            }
            if (!containsVariant(matrixVO,"ITM15_VARIANTS_5")) {
              vo.setVariantCodeItm15WAR02(ApplicationConsts.JOLLY);
              vo.setVariantTypeItm10WAR02(ApplicationConsts.JOLLY);
            }
            else {
              vo.setVariantCodeItm15WAR02(rowVO.getVariantCodeITM11());
              vo.setVariantTypeItm10WAR02(rowVO.getVariantTypeITM06());
            }


            //PurchaseUtils.updateTotals(vo,currencyDecimals.intValue());
/*
            vo.setVariantCodeItm11WAR02(rowVO.getVariantCodeITM11());
            vo.setVariantTypeItm06WAR02(rowVO.getVariantTypeITM06());

            vo.setVariantCodeItm12WAR02(ApplicationConsts.JOLLY);
            vo.setVariantCodeItm13WAR02(ApplicationConsts.JOLLY);
            vo.setVariantCodeItm14WAR02(ApplicationConsts.JOLLY);
            vo.setVariantCodeItm15WAR02(ApplicationConsts.JOLLY);

            vo.setVariantTypeItm07WAR02(ApplicationConsts.JOLLY);
            vo.setVariantTypeItm08WAR02(ApplicationConsts.JOLLY);
            vo.setVariantTypeItm09WAR02(ApplicationConsts.JOLLY);
            vo.setVariantTypeItm10WAR02(ApplicationConsts.JOLLY);
*/
            try {
        vo.setDeltaQtyWAR02((BigDecimal)cells[i][0]);
      } catch (Exception e) {
        continue;
      }
            sn.clear();
            if (vo.getDeltaQtyWAR02().intValue()>0) {
              sn.addAll(voTemplate.getSerialNumbers().subList(pos,pos+vo.getDeltaQtyWAR02().intValue()));
            }
            vo.setSerialNumbers(sn);
            pos += vo.getDeltaQtyWAR02().intValue();
          }

          WarehouseMovementVO movVO = new WarehouseMovementVO(
              vo.getProgressiveHie01WAR02(),
              vo.getDeltaQtyWAR02(),
              vo.getCompanyCodeSys01WAR02(),
              vo.getWarehouseCodeWar01WAR02(),
              vo.getItemCodeItm01WAR02(),
              vo.getWarehouseMotiveWar04WAR02(),
              vo.getItemTypeWAR04(),
              vo.getNoteWAR02(),
              vo.getSerialNumbers(),

              vo.getVariantCodeItm11WAR02(),
              vo.getVariantCodeItm12WAR02(),
              vo.getVariantCodeItm13WAR02(),
              vo.getVariantCodeItm14WAR02(),
              vo.getVariantCodeItm15WAR02(),
              vo.getVariantTypeItm06WAR02(),
              vo.getVariantTypeItm07WAR02(),
              vo.getVariantTypeItm08WAR02(),
              vo.getVariantTypeItm09WAR02(),
              vo.getVariantTypeItm10WAR02()

          );

          res = bean.addWarehouseMovement(movVO,t1,serverLanguageId,username);
          if (res.isError()) {
            throw new Exception(res.getErrorMessage());
          }

        }
        else
          for(int k=0;k<matrixVO.getColumnDescriptors().length;k++) {

            colVO = (VariantsMatrixColumnVO)matrixVO.getColumnDescriptors()[k];
            if (cells[i][k]!=null) {
              vo = (MovementVO)voTemplate.clone();

              try {
                vo.setDeltaQtyWAR02((BigDecimal)cells[i][k]);
              } catch (Exception e) {
                continue;
              }
              sn.clear();
              if (vo.getDeltaQtyWAR02().intValue()>0) {
                sn.addAll(voTemplate.getSerialNumbers().subList(pos,pos+vo.getDeltaQtyWAR02().intValue()));
              }
              vo.setSerialNumbers(sn);
              pos += vo.getDeltaQtyWAR02().intValue();

              //PurchaseUtils.updateTotals(vo,currencyDecimals.intValue());

              vo.setVariantCodeItm11WAR02(rowVO.getVariantCodeITM11());
              vo.setVariantTypeItm06WAR02(rowVO.getVariantTypeITM06());

              vo.setVariantCodeItm12WAR02(colVO.getVariantCodeITM12()==null?ApplicationConsts.JOLLY:colVO.getVariantCodeITM12());
              vo.setVariantCodeItm13WAR02(colVO.getVariantCodeITM13()==null?ApplicationConsts.JOLLY:colVO.getVariantCodeITM13());
              vo.setVariantCodeItm14WAR02(colVO.getVariantCodeITM14()==null?ApplicationConsts.JOLLY:colVO.getVariantCodeITM14());
              vo.setVariantCodeItm15WAR02(colVO.getVariantCodeITM15()==null?ApplicationConsts.JOLLY:colVO.getVariantCodeITM15());

              vo.setVariantTypeItm07WAR02(colVO.getVariantTypeITM07()==null?ApplicationConsts.JOLLY:colVO.getVariantTypeITM07());
              vo.setVariantTypeItm08WAR02(colVO.getVariantTypeITM08()==null?ApplicationConsts.JOLLY:colVO.getVariantTypeITM08());
              vo.setVariantTypeItm09WAR02(colVO.getVariantTypeITM09()==null?ApplicationConsts.JOLLY:colVO.getVariantTypeITM09());
              vo.setVariantTypeItm10WAR02(colVO.getVariantTypeITM10()==null?ApplicationConsts.JOLLY:colVO.getVariantTypeITM10());

              WarehouseMovementVO movVO = new WarehouseMovementVO(
                  vo.getProgressiveHie01WAR02(),
                  vo.getDeltaQtyWAR02(),
                  vo.getCompanyCodeSys01WAR02(),
                  vo.getWarehouseCodeWar01WAR02(),
                  vo.getItemCodeItm01WAR02(),
                  vo.getWarehouseMotiveWar04WAR02(),
                  vo.getItemTypeWAR04(),
                  vo.getNoteWAR02(),
                  vo.getSerialNumbers(),

                  vo.getVariantCodeItm11WAR02(),
                  vo.getVariantCodeItm12WAR02(),
                  vo.getVariantCodeItm13WAR02(),
                  vo.getVariantCodeItm14WAR02(),
                  vo.getVariantCodeItm15WAR02(),
                  vo.getVariantTypeItm06WAR02(),
                  vo.getVariantTypeItm07WAR02(),
                  vo.getVariantTypeItm08WAR02(),
                  vo.getVariantTypeItm09WAR02(),
                  vo.getVariantTypeItm10WAR02()

              );

              res = bean.addWarehouseMovement(movVO,t1,serverLanguageId,username);
              if (res.isError())
View Full Code Here

TOP

Related Classes of org.jallinone.warehouse.tables.movements.java.MovementVO

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.