Package org.jallinone.variants.java

Examples of org.jallinone.variants.java.VariantsMatrixColumnVO


  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];
            if (colVO.getVariantCodeITM12().equals(snVO.getVariantCodeItm12WAR05()) &&
                colVO.getVariantCodeITM13().equals(snVO.getVariantCodeItm13WAR05()) &&
                colVO.getVariantCodeITM14().equals(snVO.getVariantCodeItm14WAR05()) &&
                colVO.getVariantCodeITM15().equals(snVO.getVariantCodeItm15WAR05()) &&
                colVO.getVariantTypeITM07().equals(snVO.getVariantTypeItm07WAR05()) &&
                colVO.getVariantTypeITM08().equals(snVO.getVariantTypeItm08WAR05()) &&
                colVO.getVariantTypeITM09().equals(snVO.getVariantTypeItm09WAR05()) &&
                colVO.getVariantTypeITM10().equals(snVO.getVariantTypeItm10WAR05())) {
              try {
                CustomValueObject.class.getMethod("setAttributeNameN" + j,new Class[] {BigDecimal.class}).invoke(vo, new Object[] {new BigDecimal(1)});
              }
              catch (Throwable ex) {
                ex.printStackTrace();
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];
            if ((colVO.getVariantCodeITM12()==null && barcodeVO.getVariantCodeItm12ITM22().equals(ApplicationConsts.JOLLY) || colVO.getVariantCodeITM12().equals(barcodeVO.getVariantCodeItm12ITM22())) &&
                (colVO.getVariantCodeITM13()==null && barcodeVO.getVariantCodeItm13ITM22().equals(ApplicationConsts.JOLLY) || colVO.getVariantCodeITM13().equals(barcodeVO.getVariantCodeItm13ITM22())) &&
                (colVO.getVariantCodeITM14()==null && barcodeVO.getVariantCodeItm14ITM22().equals(ApplicationConsts.JOLLY) || colVO.getVariantCodeITM14().equals(barcodeVO.getVariantCodeItm14ITM22())) &&
                (colVO.getVariantCodeITM15()==null && barcodeVO.getVariantCodeItm15ITM22().equals(ApplicationConsts.JOLLY) || colVO.getVariantCodeITM15().equals(barcodeVO.getVariantCodeItm15ITM22())) &&
                (colVO.getVariantTypeITM07()==null && barcodeVO.getVariantTypeItm07ITM22().equals(ApplicationConsts.JOLLY) || colVO.getVariantTypeITM07().equals(barcodeVO.getVariantTypeItm07ITM22())) &&
                (colVO.getVariantTypeITM08()==null && barcodeVO.getVariantTypeItm08ITM22().equals(ApplicationConsts.JOLLY) || colVO.getVariantTypeITM08().equals(barcodeVO.getVariantTypeItm08ITM22())) &&
                (colVO.getVariantTypeITM09()==null && barcodeVO.getVariantTypeItm09ITM22().equals(ApplicationConsts.JOLLY) || colVO.getVariantTypeITM09().equals(barcodeVO.getVariantTypeItm09ITM22())) &&
                (colVO.getVariantTypeITM10()==null && barcodeVO.getVariantTypeItm10ITM22().equals(ApplicationConsts.JOLLY) || colVO.getVariantTypeITM10().equals(barcodeVO.getVariantTypeItm10ITM22()))) {
              try {
                CustomValueObject.class.getMethod("setAttributeNameN" + j,new Class[] {BigDecimal.class}).invoke(vo, new Object[] {new BigDecimal(1)});
              }
              catch (Throwable ex) {
                ex.printStackTrace();
View Full Code Here

    Connection conn = null;
    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());

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

TOP

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

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.