Package org.jallinone.variants.java

Examples of org.jallinone.variants.java.VariantsMatrixRowVO


      totals.setConn(conn); // use same transaction...
      serialNumBean.setConn(conn); // use same transaction...
      bean.setConn(conn);

      VariantsMatrixColumnVO colVO = null;
      VariantsMatrixRowVO rowVO = null;
      DetailSaleDocRowVO vo = null;
      Response res = null;
      for(int i=0;i<cells.length;i++) {
        rowVO = (VariantsMatrixRowVO)matrixVO.getRowDescriptors()[i];
View Full Code Here


      // convert the records list in matrix format...
      ArrayList matrixRows = new ArrayList();
      SupplierVariantsPriceVO vo = null;
      CustomValueObject customVO = null;
      VariantsMatrixRowVO rowVO = null;
      VariantsMatrixColumnVO colVO = null;
      HashMap indexes = new HashMap();
      int cols = matrixVO.getColumnDescriptors().length==0?1:matrixVO.getColumnDescriptors().length;
      for(int i=0;i<matrixVO.getRowDescriptors().length;i++) {
        rowVO = (VariantsMatrixRowVO)matrixVO.getRowDescriptors()[i];

        customVO = new CustomValueObject();
        customVO.setAttributeNameS0(rowVO.getRowDescription());
        matrixRows.add(customVO);
        indexes.put(
          VariantsMatrixUtils.getVariantType(matrixVO,rowVO)+" "+VariantsMatrixUtils.getVariantCode(matrixVO,rowVO),
          customVO
        );
View Full Code Here

      // insert into PUR05...
      SupplierVariantsPriceVO vo = null;
      Response res = null;
      Object[] row = null;
      VariantsMatrixColumnVO colVO = null;
      VariantsMatrixRowVO rowVO = null;
      BigDecimal price = null;
      for(int i=0;i<variantsPrice.getCells().length;i++) {
        row = variantsPrice.getCells()[i];
        rowVO = (VariantsMatrixRowVO)variantsPrice.getMatrixVO().getRowDescriptors()[i];
View Full Code Here

      // convert the records list in matrix format...
      ArrayList matrixRows = new ArrayList();
      VariantsPriceVO vo = null;
      CustomValueObject customVO = null;
      VariantsMatrixRowVO rowVO = null;
      VariantsMatrixColumnVO colVO = null;
      HashMap indexes = new HashMap();
      for(int i=0;i<matrixVO.getRowDescriptors().length;i++) {
        rowVO = (VariantsMatrixRowVO)matrixVO.getRowDescriptors()[i];

        customVO = new CustomValueObject();
        customVO.setAttributeNameS0(rowVO.getRowDescription());
        matrixRows.add(customVO);
        indexes.put(
          VariantsMatrixUtils.getVariantType(matrixVO,rowVO)+" "+VariantsMatrixUtils.getVariantCode(matrixVO,rowVO),
          customVO
        );
View Full Code Here

      // insert into SAL11...
      VariantsPriceVO vo = null;
      Response res = null;
      Object[] row = null;
      VariantsMatrixColumnVO colVO = null;
      VariantsMatrixRowVO rowVO = null;
      BigDecimal price = null;
      for(int i=0;i<variantsPrice.getCells().length;i++) {
        row = variantsPrice.getCells()[i];
        rowVO = (VariantsMatrixRowVO)variantsPrice.getMatrixVO().getRowDescriptors()[i];
View Full Code Here

          for(int k=0;k<vos.size();k++) {
            variantVO = (ItemVariantVO)vos.get(k);
            if (!Boolean.TRUE.equals(variantVO.getSelected()))
                continue;

            VariantsMatrixRowVO rowVO = new VariantsMatrixRowVO();
            setVariantDescription(variantVO,rowVO,sameVarType);
            setVariantTypeAndCode(variantVO,rowVO);
            rows.add(rowVO);
          }
        }
View Full Code Here

                                   ArrayList currentSortedVersusColumns,
                                   Class valueObjectType, Map otherGridParams) {
            VariantsMatrixVO matrixVO = (VariantsMatrixVO)otherGridParams.get(ApplicationConsts.VARIANTS_MATRIX_VO);
            ArrayList rows = new ArrayList();
            CustomValueObject vo = null;
            VariantsMatrixRowVO rowVO = null;
            for(int i=0;i<matrixVO.getRowDescriptors().length;i++) {
              rowVO = (VariantsMatrixRowVO)matrixVO.getRowDescriptors()[i];

              vo = new CustomValueObject();
              vo.setAttributeNameS0(rowVO.getRowDescription());
              rows.add(vo);
            }
            return new VOListResponse(rows,false,rows.size());
          }

        });

      grid.setValueObjectClassName("org.openswing.swing.customvo.java.CustomValueObject");
      grid.getOtherGridParams().put(ApplicationConsts.VARIANTS_MATRIX_VO,vo);
      grid.setReorderingAllowed(false);
      grid.setVisibleStatusPanel(false);
//      if (vo.getManagedVariants().length>1)
//        grid.setHeaderHeight(grid.getHeaderHeight()*(vo.getManagedVariants().length-1));

      // create grid columns...
      ButtonColumn var1Col = new ButtonColumn();
      var1Col.setColumnName("attributeNameS0");
      var1Col.setEnableInReadOnlyMode(true);
      var1Col.setShowAttributeValue(true);
      var1Col.setHeaderColumnName(" ");
      var1Col.setColumnSelectable(false);
      grid.getColumnContainer().add(var1Col,null);

      VariantsMatrixColumnVO colVO = null;
      DecimalColumn col = null;
      for(int i=0;i<vo.getColumnDescriptors().length;i++) {
        colVO = (VariantsMatrixColumnVO)vo.getColumnDescriptors()[i];
        col = new DecimalColumn();
        col.setColumnSelectable(false);
        col.setEditableOnEdit(true);
        col.setHeaderColumnName(colVO.getColumnDescription());
        col.setColumnName("attributeNameN"+i);
        col.setColumnRequired(false);
        col.setDecimals(vo.getDecimals());
        col.setMinWidth(50);

        col.setPreferredWidth(20+this.getFontMetrics(this.getFont()).stringWidth(col.getHeaderColumnName()));

        grid.getColumnContainer().add(col,null);
      }
      if (vo.getColumnDescriptors().length==0) {
        col = new DecimalColumn();
        col.setColumnSelectable(false);
        col.setEditableOnEdit(true);
        col.setHeaderColumnName(" ");
        col.setColumnName("attributeNameN0");
        col.setDecimals(vo.getDecimals());
        //col.setPreferredWidth(110*(vo.getManagedVariants().length-1));

        col.setPreferredWidth(50);

        grid.getColumnContainer().add(col,null);
      }

      grid.addFocusListener(new FocusAdapter() {
        public void focusLost(FocusEvent e) {
          if (!onValidating)
            grid.getTable().getGrid().stopCellEditing();
        }
      });


      buttonsPanel.removeAll();
      final VariantNameVO varVO = (VariantNameVO)getVariantsMatrixVO().getManagedVariants()[0];
      buttonsPanel.setLayout(new FlowLayout(FlowLayout.LEFT,5,5));
      if (showButtons && vo.getManagedVariants().length>1) {
        // create a buttons panel used to copy the same qty for all cells matching the same variant value...
        for(int i=0;i<vo.getManagedVariants().length;i++) {
          GenericButton btn = new GenericButton(new ImageIcon(ClientUtils.getImage("copy.gif")));
          final VariantNameVO vnVO = (VariantNameVO)vo.getManagedVariants()[i];
          btn.setButtonBehavior(Consts.BUTTON_IMAGE_AND_TEXT);
          btn.setHorizontalTextPosition(SwingConstants.LEADING);
          btn.setVerticalTextPosition(SwingConstants.CENTER);
          btn.setText(vnVO.getDescriptionSYS10());
          btn.setToolTipText(ClientSettings.getInstance().getResources().getResource("set the same value when matching the same")+" "+vnVO.getDescriptionSYS10());
          btn.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
             if (!onValidating)
               grid.getTable().getGrid().stopCellEditing();
            try {
               int row = grid.getSelectedRow();
               int col = grid.getTable().getGrid().getSelectedColumn();
               if (row!=-1 && col!=-1 && grid.getTable().getGrid().getValueAt(row,col)!=null) {
                 BigDecimal qty = (BigDecimal)grid.getTable().getGrid().getValueAt(row,col);
                 VariantsMatrixRowVO currentRowVO = (VariantsMatrixRowVO)getVariantsMatrixVO().getRowDescriptors()[row];
                 VariantsMatrixColumnVO currentColVO = (VariantsMatrixColumnVO)getVariantsMatrixVO().getColumnDescriptors()[col-1];
                 String rowtype = null,rowcode = null;
                 String coltype = null,colcode = null;
                 String rowtypename = null,rowcodename = null;
                 String coltypename = null,colcodename = null;


                 if (getVariantsMatrixVO().getColumnDescriptors().length==0 ||
                     varVO.getTableName().equals(vnVO.getTableName())) {
                   rowtype = VariantsMatrixUtils.getVariantType(getVariantsMatrixVO(),currentRowVO);
                   rowcode = VariantsMatrixUtils.getVariantCode(getVariantsMatrixVO(),currentRowVO);

                   if (varVO.getTableName().equals("ITM11_VARIANTS_1")) {
                     rowtypename = "getVariantTypeITM06";
                     rowcodename = "getVariantCodeITM11";
                   }
                   else if (varVO.getTableName().equals("ITM12_VARIANTS_2")) {
                     rowtypename = "getVariantTypeITM07";
                     rowcodename = "getVariantCodeITM12";
                   }
                   else if (varVO.getTableName().equals("ITM13_VARIANTS_3")) {
                     rowtypename = "getVariantTypeITM08";
                     rowcodename = "getVariantCodeITM13";
                   }
                   else if (varVO.getTableName().equals("ITM14_VARIANTS_4")) {
                     rowtypename = "getVariantTypeITM09";
                     rowcodename = "getVariantCodeITM14";
                   }
                   else if (varVO.getTableName().equals("ITM15_VARIANTS_5")) {
                     rowtypename = "getVariantTypeITM10";
                     rowcodename = "getVariantCodeITM15";
                   }

                 }
                 else {
                   if (vnVO.getTableName().equals("ITM11_VARIANTS_1")) {
                     rowtype = currentRowVO.getVariantTypeITM06();
                     rowcode = currentRowVO.getVariantCodeITM11();
                     rowtypename = "getVariantTypeITM06";
                     rowcodename = "getVariantCodeITM11";
                   }
                   else if (vnVO.getTableName().equals("ITM12_VARIANTS_2")) {
                     coltype = currentColVO.getVariantTypeITM07();
                     colcode = currentColVO.getVariantCodeITM12();
                     coltypename = "getVariantTypeITM07";
                     colcodename = "getVariantCodeITM12";
                   }
                   else if (vnVO.getTableName().equals("ITM13_VARIANTS_3")) {
                     coltype = currentColVO.getVariantTypeITM08();
                     colcode = currentColVO.getVariantCodeITM13();
                     coltypename = "getVariantTypeITM08";
                     colcodename = "getVariantCodeITM13";
                   }
                   else if (vnVO.getTableName().equals("ITM14_VARIANTS_4")) {
                     coltype = currentColVO.getVariantTypeITM09();
                     colcode = currentColVO.getVariantCodeITM14();
                     coltypename = "getVariantTypeITM09";
                     colcodename = "getVariantCodeITM14";
                   }
                   else if (vnVO.getTableName().equals("ITM15_VARIANTS_5")) {
                     coltype = currentColVO.getVariantTypeITM10();
                     colcode = currentColVO.getVariantCodeITM15();
                     coltypename = "getVariantTypeITM10";
                     colcodename = "getVariantCodeITM15";
                   }
                 }


                 VariantsMatrixRowVO rowVO = null;
                 VariantsMatrixColumnVO colVO = null;
                 for(int r=0;r<grid.getVOListTableModel().getRowCount();r++) {
                   rowVO = (VariantsMatrixRowVO)getVariantsMatrixVO().getRowDescriptors()[r];
                   for (int c = 0;c < getVariantsMatrixVO().getColumnDescriptors().length;c++)
                     if (! (r == row && c + 1 == col)) {
                       colVO = (VariantsMatrixColumnVO) getVariantsMatrixVO().getColumnDescriptors()[c];
                      try {
                        if (rowtype!=null && rowcode!=null) {
                          if (rowtype.equals(rowVO.getClass().getMethod(rowtypename,new Class[0]).invoke(rowVO,new Object[0])) &&
                              rowcode.equals(rowVO.getClass().getMethod(rowcodename,new Class[0]).invoke(rowVO,new Object[0])))
                            grid.getVOListTableModel().setValueAt(qty, r, c + 1);
                        }
                        else if (coltype!=null && colcode!=null) {
                          if (coltype.equals(colVO.getClass().getMethod(coltypename,new Class[0]).invoke(colVO,new Object[0])) &&
                              colcode.equals(colVO.getClass().getMethod(colcodename,new Class[0]).invoke(colVO,new Object[0])))
View Full Code Here

  private void updateMatrixWithSN() {
    if (!onValidating)
      grid.getTable().getGrid().stopCellEditing();

    VariantsMatrixRowVO rowVO = null;
    VariantsMatrixColumnVO colVO = null;
    CustomValueObject vo = null;
    int cols = getVariantsMatrixVO().getColumnDescriptors().length==0?1:getVariantsMatrixVO().getColumnDescriptors().length;
    for(int i=0;i<grid.getVOListTableModel().getRowCount();i++) {
      rowVO = (VariantsMatrixRowVO)getVariantsMatrixVO().getRowDescriptors()[i];
      vo = (CustomValueObject)grid.getVOListTableModel().getObjectForRow(i);
      if (rowVO.getVariantTypeITM06().equals(snVO.getVariantTypeItm06WAR05()) &&
          rowVO.getVariantCodeITM11().equals(snVO.getVariantCodeItm11WAR05())) {
        if (getVariantsMatrixVO().getColumnDescriptors().length==0)
          vo.setAttributeNameN0(new BigDecimal(1));
        else
          for(int j=0;j<cols;j++) {
            colVO = (VariantsMatrixColumnVO)getVariantsMatrixVO().getColumnDescriptors()[j];
View Full Code Here

  private void updateMatrixWithBarcode() {
    if (!onValidating)
      grid.getTable().getGrid().stopCellEditing();

    VariantsMatrixRowVO rowVO = null;
    VariantsMatrixColumnVO colVO = null;
    CustomValueObject vo = null;
    int cols = getVariantsMatrixVO().getColumnDescriptors().length==0?1:getVariantsMatrixVO().getColumnDescriptors().length;
    for(int i=0;i<grid.getVOListTableModel().getRowCount();i++) {
      rowVO = (VariantsMatrixRowVO)getVariantsMatrixVO().getRowDescriptors()[i];
      vo = (CustomValueObject)grid.getVOListTableModel().getObjectForRow(i);
      if (rowVO.getVariantTypeITM06().equals(barcodeVO.getVariantTypeItm06ITM22()) &&
          rowVO.getVariantCodeITM11().equals(barcodeVO.getVariantCodeItm11ITM22())) {
        if (getVariantsMatrixVO().getColumnDescriptors().length==0)
          vo.setAttributeNameN0(new BigDecimal(1));
        else
          for(int j=0;j<cols;j++) {
            colVO = (VariantsMatrixColumnVO)getVariantsMatrixVO().getColumnDescriptors()[j];
View Full Code Here

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

TOP

Related Classes of org.jallinone.variants.java.VariantsMatrixRowVO

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.