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) {