protected function _loadItem($itemResult, $itemEntity, $return)
 {
     // Cast decimals to float
     $itemEntity->balance = $itemEntity->balance ? (double) $itemEntity->balance : null;
     $itemEntity->calculatedBalance = $itemEntity->calculatedBalance ? (double) $itemEntity->calculatedBalance : null;
     $itemEntity->remainingBalance = $itemEntity->remainingBalance ? (double) $itemEntity->remainingBalance : null;
     $itemEntity->accepted = null !== $itemEntity->accepted ? (bool) $itemEntity->accepted : null;
     $itemEntity->listPrice = (double) $itemEntity->listPrice;
     $itemEntity->actualPrice = (double) $itemEntity->actualPrice;
     $itemEntity->net = (double) $itemEntity->net;
     $itemEntity->discount = (double) $itemEntity->discount;
     $itemEntity->tax = (double) $itemEntity->tax;
     $itemEntity->taxRate = (double) $itemEntity->taxRate;
     $itemEntity->productTaxRate = (double) $itemEntity->productTaxRate;
     $itemEntity->gross = (double) $itemEntity->gross;
     $itemEntity->rrp = (double) $itemEntity->rrp;
     // Only load the order and refunds if one is attached to the return
     if ($itemEntity->orderID) {
         $itemEntity->order = $this->_orderLoader->getByID($itemEntity->orderID);
         // Grab the item from the order for easy access
         if ($itemEntity->orderItemID) {
             $itemEntity->orderItem = $itemEntity->order->items[$itemEntity->orderItemID];
             $itemEntity->unit = $itemEntity->orderItem->getUnit();
         }
         $itemEntity->note = $this->_orderLoader->getEntityLoader('notes')->getByID($itemEntity->noteID, $itemEntity->order);
         // $itemEntity->document = $this->_orderLoader->getEntityLoader('documents')->getByID($itemResult->documentID, $itemEntity->order);
     }
     if ($itemEntity->exchangeItemID) {
         $itemEntity->exchangeItem = $this->_orderLoader->getEntityLoader('items')->getByID($itemEntity->exchangeItemID, $itemEntity->order ?: null);
     }
     if (!$itemEntity->unit) {
         $itemEntity->unit = $this->_unitLoader->getByID($itemEntity->unitID);
     }
     $itemEntity->reason = $this->_reasons->get($itemResult->reason);
     $itemEntity->status = $this->_statuses->get($itemResult->status_code);
     if ($itemResult->returned_stock_location and $this->_stockLocations->exists($itemResult->returned_stock_location)) {
         $itemEntity->returnedStockLocation = $this->_stockLocations->get($itemResult->returned_stock_location);
     }
     $itemEntity->returnedStock = (bool) $itemEntity->returnedStock;
     $itemEntity = $this->_loadDocument($itemEntity, $return);
     return $itemEntity;
 }
 private function _setDefaultStatus()
 {
     $this->_defaultStatus = $this->_statuses->get(Statuses::AWAITING_RETURN);
 }