Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.ShipDetail


      shipDisplay.setInputShipQty("");
      shipDisplay.setOrderItemAttributes(itemDisplay.getOrderItemAttributes());

      Iterator<?> shipDetailIterator = shipHeader.getShipDetails().iterator();
      while (shipDetailIterator.hasNext()) {
        ShipDetail shipDetail = (ShipDetail) shipDetailIterator.next();
        if (itemDisplay.getOrderItemDetailId().equals(shipDetail.getOrderItemDetail().getOrderItemDetailId().toString())) {
          shipDisplay.setInputShipQty(Format.getInt(shipDetail.getItemShipQty()));
        }
      }
     
      shipDetailVector.add(shipDisplay);
    }
View Full Code Here


      shipDisplay.setInputShipQty("0");
      shipDisplay.setOrderItemAttributes(itemDisplay.getOrderItemAttributes());
 
      Iterator<?> shipDetailIterator = shipHeader.getShipDetails().iterator();
      while (shipDetailIterator.hasNext()) {
        ShipDetail shipDetail = (ShipDetail) shipDetailIterator.next();
        if (itemDisplay.getOrderItemDetailId().equals(shipDetail.getOrderItemDetail().getOrderItemDetailId().toString())) {
          shipDisplay.setInputShipQty(Format.getInt(shipDetail.getItemShipQty()));
        }
      }
     
      shipDetailVector.add(shipDisplay);
    }
View Full Code Here

      itemDisplay.setItemCreditQty(Format.getInt(itemCreditQty));

      Iterator<?> shipIterator = orderItemDetail.getShipDetails().iterator();
      int itemShipQty = 0;
      while (shipIterator.hasNext()) {
        ShipDetail shipDetail = (ShipDetail) shipIterator.next();
        ShipHeader sHeader = shipDetail.getShipHeader();
        if (sHeader.getShipHeaderId() == null) {
          continue;
        }
        if (shipHeader != null) {
          if (sHeader.getShipHeaderId().equals(shipHeader.getShipHeaderId())) {
            continue;
          }
        }
        String status = sHeader.getShipStatus();
        if (status.equals(Constants.ORDERSTATUS_CANCELLED) || status.equals(Constants.ORDERSTATUS_VOIDED)) {
          continue;
        }
        itemShipQty += shipDetail.getItemShipQty();
        itemShipTotal += shipDetail.getItemShipQty();
      }
      itemDisplay.setItemShipQty(Format.getInt(itemShipQty));

      itemOrderTotal += orderItemDetail.getItemOrderQty();
      itemDetailAmount += orderItemDetail.getItemDetailAmount();
View Full Code Here

    shipHeader.setRecCreateDatetime(header.getRecCreateDatetime());
    shipHeader.setOrderHeader(header.getOrderHeader());
   
    Iterator<?> iterator = header.getShipDetails().iterator();
    while (iterator.hasNext()) {
      ShipDetail detail = (ShipDetail) iterator.next();
      ShipDetail shipDetail = new ShipDetail();
      shipDetail.setShipHeader(shipHeader);
      shipHeader.getShipDetails().add(shipDetail);
      shipDetail.setShipDetailId(detail.getShipDetailId());
      shipDetail.setSeqNum(detail.getSeqNum());
      shipDetail.setItemShipQty(detail.getItemShipQty());
      shipDetail.setRecUpdateBy(header.getRecUpdateBy());
      shipDetail.setRecUpdateDatetime(header.getRecUpdateDatetime());
      shipDetail.setRecCreateBy(header.getRecCreateBy());
      shipDetail.setRecCreateDatetime(header.getRecCreateDatetime());
      shipDetail.setOrderItemDetail(detail.getOrderItemDetail());
    }   
    return shipHeader;
  }
View Full Code Here

    }
    calculateHeader();
  }
 
  public void setQty(String itemSkuCd, int qty) throws Exception {
    ShipDetail shipDetail = null;
    boolean found = false;
    Iterator<?> iterator = shipHeader.getShipDetails().iterator();
    while (iterator.hasNext()) {
      shipDetail = (ShipDetail) iterator.next();
      if (shipDetail.getOrderItemDetail().getItemSkuCd().equals(itemSkuCd)) {
        found = true;
        break;
      }
    }
    if (!found) {
      shipDetail = new ShipDetail();
      shipDetail.setRecCreateBy(user.getUserId());
      shipDetail.setRecCreateDatetime(new Date());
      iterator = orderHeader.getOrderItemDetails().iterator();
      found = false;
      while (iterator.hasNext()) {
        OrderItemDetail orderItemDetail = (OrderItemDetail) iterator.next();
        if (orderItemDetail.getItemSkuCd().equals(itemSkuCd)) {
          shipDetail.setOrderItemDetail(orderItemDetail);
//          orderItemDetail.getShipDetails().add(shipDetail);
          found = true;
          break;
        }
      }
      if (!found) {
        throw new OrderItemNotFoundException("");
      }
      shipDetail.setShipHeader(shipHeader);
     
      iterator = shipHeader.getShipDetails().iterator();
      int seqNum = 0;
      while (iterator.hasNext()) {
        ShipDetail s = (ShipDetail) iterator.next();
        if (s.getSeqNum() > seqNum) {
          seqNum = s.getSeqNum();
        }
      }
      shipDetail.setSeqNum(seqNum);
      shipHeader.getShipDetails().add(shipDetail);
    }
View Full Code Here

 
  public void shipOrder(HttpServletRequest request) throws Exception {
        EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    Iterator<?> iterator = shipHeader.getShipDetails().iterator();
    while (iterator.hasNext()) {
      ShipDetail shipDetail = (ShipDetail) iterator.next();
      int shipQty = shipDetail.getItemShipQty();
     
      Item item = shipDetail.getOrderItemDetail().getItem();
      if (item != null) {
        item = (Item) em.find(Item.class, item.getItemId());
        em.lock(item, LockModeType.WRITE);
     
        InventoryEngine engine = new InventoryEngine(item);
View Full Code Here

  }
 
  public void voidShip() throws Exception {
    Iterator<?> iterator = shipHeader.getShipDetails().iterator();
    while (iterator.hasNext()) {
      ShipDetail shipDetail = (ShipDetail) iterator.next();
      int shipQty = shipDetail.getItemShipQty();
      InventoryEngine engine = new InventoryEngine(shipDetail.getOrderItemDetail().getItem());
      engine.adjustQty(shipQty);
      engine.adjustBookedQty(shipQty);
    }
    shipHeader.setShipStatus(Constants.ORDERSTATUS_VOIDED);
    shipHeader.setRecUpdateBy(user.getUserId());
View Full Code Here

      shipHeader.setShipHeaderId(masterHeader.getShipHeaderId());
    }
   
    Iterator<?> iterator = masterHeader.getShipDetails().iterator();
    while (iterator.hasNext()) {
      ShipDetail masterDetail = (ShipDetail) iterator.next();
      em.remove(masterDetail);
      iterator.remove();
    }
   
    iterator = shipHeader.getShipDetails().iterator();
    while (iterator.hasNext()) {
      ShipDetail shipDetail = (ShipDetail) iterator.next();
      if (shipDetail.getItemShipQty() <= 0) {
        continue;
      }
      ShipDetail masterDetail = new ShipDetail();
      masterDetail.setShipHeader(masterHeader);
      masterDetail.setSeqNum(shipDetail.getSeqNum());
      masterDetail.setItemShipQty(shipDetail.getItemShipQty());
      masterDetail.setRecUpdateBy(shipDetail.getRecUpdateBy());
      masterDetail.setRecUpdateDatetime(shipDetail.getRecUpdateDatetime());
      masterDetail.setRecCreateBy(shipDetail.getRecCreateBy());
      masterDetail.setRecCreateDatetime(shipDetail.getRecCreateDatetime());
      masterDetail.setOrderItemDetail(shipDetail.getOrderItemDetail());
      em.persist(masterDetail);
      masterHeader.getShipDetails().add(masterDetail);
    }
  }
View Full Code Here

    if (shipDetail.getShipDetailId() == null) {
      return null;
    }
    Iterator<?> iterator = masterHeader.getShipDetails().iterator();
    while (iterator.hasNext()) {
      ShipDetail detail = (ShipDetail) iterator.next();
      if (shipDetail.getShipDetailId().equals(detail.getShipDetailId())) {
        return shipDetail;
      }
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }
 
  public boolean isModified(ShipDetail shipDetail) {
    ShipDetail masterDetail = getMasterDetail(shipDetail);
    if (masterDetail == null) {
      return true;
    }
    if (shipDetail.getRecUpdateDatetime().equals(masterDetail.getRecUpdateDatetime())) {
      return false;
    }
    return true;
  }
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.ShipDetail

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.