/**
  * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrderItem[] $salesOrderItems
  *
  * @return bool
  */
 protected function shouldItemRefunded(ItemTransfer $itemTransfer, array $salesOrderItems)
 {
     foreach ($salesOrderItems as $salesOrderItem) {
         if ($salesOrderItem->getIdSalesOrderItem() === $itemTransfer->getIdSalesOrderItem()) {
             return true;
         }
     }
     return false;
 }
 /**
  * @param \Generated\Shared\Transfer\ItemTransfer $orderItem
  *
  * @return \Generated\Shared\Transfer\RefundItemTransfer
  */
 protected function createRefundItem(ItemTransfer $orderItem)
 {
     $refundItem = new RefundItemTransfer();
     $refundItem->setFkSalesOrderItem($orderItem->getIdSalesOrderItem());
     $refundItem->setQuantity($orderItem->getQuantity());
     $refundItem->setGrossPrice($orderItem->getUnitGrossPrice());
     $refundItem->setDiscountAmount($orderItem->getSumTotalDiscountAmount());
     $refundItem->setName($orderItem->getName());
     $refundItem->setGroupKey($orderItem->getGroupKey());
     $refundItem->setTaxRate($orderItem->getTaxRate());
     $refundItem->setTaxAmount($orderItem->getSumTaxAmount());
     return $refundItem;
 }
Example #3
0
 /**
  * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer
  *
  * @return \Orm\Zed\Sales\Persistence\SpySalesOrderItem
  */
 protected function getSalesOrderItemEntity(ItemTransfer $itemTransfer)
 {
     $salesOrderItemEntity = $this->salesQueryContainer->querySalesOrderItem()->findOneByIdSalesOrderItem($itemTransfer->getIdSalesOrderItem());
     return $salesOrderItemEntity;
 }