/**
  * @return \Generated\Shared\Transfer\OrderTransfer
  */
 protected function getOrderTransferWithRefundedItem()
 {
     $orderTransfer = new OrderTransfer();
     $itemTransfer = new ItemTransfer();
     $itemTransfer->setRefundableAmount(0);
     $itemTransfer->setIdSalesOrderItem(1);
     $orderTransfer->addItem($itemTransfer);
     $itemTransfer = new ItemTransfer();
     $itemTransfer->setRefundableAmount(100);
     $itemTransfer->setIdSalesOrderItem(2);
     $orderTransfer->addItem($itemTransfer);
     $expenseTransfer = new ExpenseTransfer();
     $expenseTransfer->setRefundableAmount(10);
     $orderTransfer->addExpense($expenseTransfer);
     return $orderTransfer;
 }
 /**
  * @param \ArrayObject|\Generated\Shared\Transfer\ProductOptionTransfer[] $itemProductOptions
  * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
  *
  * @return void
  */
 protected function setProductOptionTotals(\ArrayObject $itemProductOptions, ItemTransfer $itemTransfer)
 {
     $totalProductOptionGrossSum = 0;
     $totalProductOptionGrossUnit = 0;
     $totalOptionsRefundableAmount = 0;
     foreach ($itemProductOptions as $productOptionTransfer) {
         $productOptionTransfer->requireUnitGrossPrice()->requireQuantity();
         $productOptionTransfer->setSumGrossPrice($productOptionTransfer->getUnitGrossPrice() * $productOptionTransfer->getQuantity());
         $totalProductOptionGrossSum += $productOptionTransfer->getSumGrossPrice();
         $totalProductOptionGrossUnit += $productOptionTransfer->getUnitGrossPrice();
         $totalOptionsRefundableAmount += $productOptionTransfer->getRefundableAmount();
     }
     $itemTransfer->setUnitGrossPriceWithProductOptions($itemTransfer->getUnitGrossPrice() + $totalProductOptionGrossUnit);
     $itemTransfer->setSumGrossPriceWithProductOptions($itemTransfer->getSumGrossPrice() + $totalProductOptionGrossSum);
     $itemTransfer->setRefundableAmount($itemTransfer->getRefundableAmount() + $totalOptionsRefundableAmount);
 }