Esempio n. 1
0
  public void extractShipmentLevelREF(Loop inLoop) throws OBOEException {
    Segment segment = null;
    try {
      int numberOfSegmentsInVector = inLoop.getCount("REF");
      for (int i = 0; i < numberOfSegmentsInVector; i++) {
        segment = inLoop.getSegment("REF", i);
        String refIdentificatorQualifier =
            getField(
                segment, 1, true, "Missing Reference Identificator Qualifier in segment REF*0");
        if (refIdentificatorQualifier == null) {
          errorMsgs.add("Reference Identificator Qualifier is null");
          setValid(false);
          return;
        }

        ediInp856Vw.setRefIdentQualif(refIdentificatorQualifier);
        String refIdentificator =
            getField(segment, 2, true, "Missing Reference Identificator in segment REF*0");
        if (refIdentificator == null) {
          errorMsgs.add("Reference Identificator is null");
          setValid(false);
          return;
        }
        ediInp856Vw.setRefIdent(refIdentificator);
      }
    } catch (OBOEException oe) {
      return;
    }
  }
Esempio n. 2
0
 public void extractShipByN1(Loop inLoop) throws OBOEException {
   Loop loop = null;
   int numberInVector = inLoop.getCount("N1");
   for (int i = 0; i < numberInVector; i++) {
     loop = inLoop.getLoop("N1", i);
     if (loop == null) return;
     Segment segment = loop.getSegment("N1");
     String qualif = getField(segment, 1, false, null);
     if ("ST".equals(qualif)) {
       String shipToName = getField(segment, 2, false, null);
       ediInp856Vw.setShipToName(shipToName);
       String identQualifier = getField(segment, 3, false, null);
       if ("01".equals(identQualifier)) {
         String shipToCode = getField(segment, 4, false, null);
         ediInp856Vw.setShipToCode(shipToCode);
       }
       extractShipFromN4(loop);
     } else {
       String distName = qualif;
       ediInp856Vw.setDistName(distName);
       String distCodeQualifier = getField(segment, 2, false, null);
       ediInp856Vw.setDistIdentCodeQualif(distCodeQualifier);
       if (!Utility.isSet(distName) && !Utility.isSet(distCodeQualifier)) {
         errorMsgs.add("No distributor info in segment N1");
         setValid(false);
         return;
       }
       if (Utility.isSet(distCodeQualifier)) {
         String distCode = getField(segment, 3, false, null);
         ediInp856Vw.setDistIdentCode(distCode);
         if (!Utility.isSet(distCode) && !Utility.isSet(distName)) {
           errorMsgs.add("No distributor info in segment N1");
           setValid(false);
           return;
         }
       }
     }
   }
 }
Esempio n. 3
0
 public void extractShipmentTD5(Loop inLoop) throws OBOEException {
   Segment segment = null;
   try {
     int numberOfSegmentsInVector = inLoop.getCount("TD5");
     for (int i = 0; i < numberOfSegmentsInVector; i++) {
       segment = inLoop.getSegment("TD5", i);
       if (segment == null) return;
       String carrierCode =
           getField(
               segment,
               2,
               true,
               "Missing Carrier Code"); // may not be right field but not used in integration
       // services
       ediInp856Vw.setCarrierCode(carrierCode);
       String carrierName = getField(segment, 5, false, "Missing Carrier Name");
       ediInp856Vw.setCarrierName(carrierName);
     }
   } catch (Exception exc) {
   }
   return;
 }
Esempio n. 4
0
  public void extractItemIdentificationREF(Loop inLoop) throws OBOEException {
    try {
      int numberOfSegmentsInVector = inLoop.getCount("REF");

      Segment segment = null;

      ArrayList trackingNums = new ArrayList();
      for (int i = 0; i < numberOfSegmentsInVector; i++) {
        segment = inLoop.getSegment("REF", i);
        if (segment == null) return;
        String identQualifier = getField(segment, 1, false, null);
        String identification = getField(segment, 2, false, null);
        if ("2I".equals(identQualifier) || "CN".equals(identQualifier)) {
          trackingNums.add(identification);
        }
      }
      ediInp856ItemVw.setTrackingNumList(trackingNums);
    } catch (Exception e) {
      return;
    }

    return;
  }