private function getServiceItemForMageItem(\Magento\Sales\Api\Data\OrderItemInterface $item, $stockId = null)
    {
        $result = new \Praxigento\Pv\Service\Sale\Data\Item();
        $prodId = $item->getProductId();
        $itemId = $item->getItemId();
        /* qty of the product can be changed in invoice but we use ordered only */
        $qty = $item->getQtyOrdered();
        /* create data item for service */
        $result->setItemId($itemId);
        $result->setProductId($prodId);
        $result->setQuantity($qty);
        $result->setStockId($stockId);
        return $result;
    }
private function getServiceItemForMageItem(\Magento\Sales\Api\Data\OrderItemInterface $item, $stockId = null)
    {
        $result = new \Praxigento\Pv\Service\Sale\Data\Item();
        $prodId = $item->getProductId();
        $itemId = $item->getItemId();
        /* qty of the product can be changed in invoice but we use ordered only */
        $qty = $item->getQtyOrdered();
        /* create data item for service */
        $result->setItemId($itemId);
        $result->setProductId($prodId);
        $result->setQuantity($qty);
        $result->setStockId($stockId);
        return $result;
    }
private function getServiceItemForMageItem ( \ Magento \ Sales \ Api \ Data \ OrderItemInterface $ item , $ stockId = null ) { $ result = new \ Praxigento \ Pv \ Service \ Sale \ Data \ Item ( ) ; $ prodId = $ item -> getProductId ( ) ; $ itemId = $ item -> getItemId ( ) ; /* qty of the product can be changed in invoice but we use ordered only */ $ qty = $ item -> getQtyOrdered ( ) ; /* create data item for service */ $ result -> setItemId ( $ itemId ) ; $ result -> setProductId ( $ prodId ) ; $ result -> setQuantity ( $ qty ) ; $ result -> setStockId ( $ stockId ) ; return $ result ; }
Convert Magento SaleOrderItem to service item.

@param \Magento\Sales\Api\Data\OrderItemInterface $item
@param int $stockId
@return \Praxigento\Pv\Service\Sale\Data\Item
@throws \Exception
Convert Magento SaleOrderItem to service item .