Package com.swinarta.sunflower.server.model

Examples of com.swinarta.sunflower.server.model.DisplayPurchasingOrderDetail


      }
      if(purchasingOrderDetail.getProduct().getProductMeasurement() != null && !purchasingOrderDetail.getProduct().getProductMeasurement().isEmpty()){
        productMeasurement = purchasingOrderDetail.getProduct().getProductMeasurement().iterator().next();
      }
           
      DisplayPurchasingOrderDetail det = mapper.map(purchasingOrderDetail, DisplayPurchasingOrderDetail.class);
     
      if(stock != null){
        det.getProduct().setStock(mapper.map(stock, DisplayStock.class));
      }
     
      if(productMeasurement != null){
        det.getProduct().setProductMeasurement(mapper.map(productMeasurement, DisplayProductMeasurement.class));
      }

      if(purchasingOrderDetail.getPurchasingOrder().getStatus().equals(Status.COMPLETED)){
        det.setCostPrice(purchasingOrderDetail.getCostPriceOnCompleted());
      }else{
        det.setCostPrice(purchasingOrderDetail.getProduct().getBuying().getCostPrice());
      }
     
      resultList.add(det);
    }
   
View Full Code Here


      pod.setPurchasingOrder(po);
      pod.setQty(qty);
     
      PurchasingOrderDetail podResp = coreManager.save(PurchasingOrderDetail.class, pod);
      podResp = coreManager.getPurchasingOrderDetail(pod.getId());
      DisplayPurchasingOrderDetail det =  mapper.map(podResp, DisplayPurchasingOrderDetail.class);
      det.setCostPrice(podResp.getProduct().getBuying().getCostPrice());
     
      Stock stock = null;
      ProductMeasurement productMeasurement = null;     
      if(podResp.getProduct().getStock() != null && !podResp.getProduct().getStock().isEmpty()){
        stock = podResp.getProduct().getStock().iterator().next();
      }
      if(podResp.getProduct().getProductMeasurement() != null && !podResp.getProduct().getProductMeasurement().isEmpty()){
        productMeasurement = podResp.getProduct().getProductMeasurement().iterator().next();
      }
      if(stock != null){
        det.getProduct().setStock(mapper.map(stock, DisplayStock.class));
      }
     
      if(productMeasurement != null){
        det.getProduct().setProductMeasurement(mapper.map(productMeasurement, DisplayProductMeasurement.class));
      }     
     
      resp = det;     
     
    }catch (Exception e) {
View Full Code Here

      pod.setQty(qty);
     
      try {
        PurchasingOrderDetail podResp = coreManager.save(PurchasingOrderDetail.class, pod);
        podResp = coreManager.getPurchasingOrderDetail(pod.getId());
        DisplayPurchasingOrderDetail det =  mapper.map(podResp, DisplayPurchasingOrderDetail.class);
        det.setCostPrice(podResp.getProduct().getBuying().getCostPrice());

        Stock stock = null;
        ProductMeasurement productMeasurement = null;     
        if(podResp.getProduct().getStock() != null && !podResp.getProduct().getStock().isEmpty()){
          stock = podResp.getProduct().getStock().iterator().next();
        }
        if(podResp.getProduct().getProductMeasurement() != null && !podResp.getProduct().getProductMeasurement().isEmpty()){
          productMeasurement = podResp.getProduct().getProductMeasurement().iterator().next();
        }
        if(stock != null){
          det.getProduct().setStock(mapper.map(stock, DisplayStock.class));
        }
       
        if(productMeasurement != null){
          det.getProduct().setProductMeasurement(mapper.map(productMeasurement, DisplayProductMeasurement.class));
        }     
       
        resp = det;
       
      } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.swinarta.sunflower.server.model.DisplayPurchasingOrderDetail

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.