Example #1
0
 /**
  * @param \Generated\Shared\Transfer\GroupedRefundItemTransfer $groupedRefundItem
  * @param \Generated\Shared\Transfer\RefundItemTransfer $refundItem
  *
  * @return \Generated\Shared\Transfer\GroupedRefundItemTransfer
  */
 protected function aggregateItem(GroupedRefundItemTransfer $groupedRefundItem, RefundItemTransfer $refundItem)
 {
     $groupTaxAmount = $groupedRefundItem->getTaxAmount() + $refundItem->getTaxAmount();
     $groupTotalGrossPrice = $groupedRefundItem->getTotalGrossPrice() + $refundItem->getTotalGrossPrice();
     $groupTotalGrossPriceWithDiscount = $groupedRefundItem->getTotalGrossPriceWithDiscount() + $refundItem->getTotalGrossPriceWithDiscount();
     $groupQuantity = $groupedRefundItem->getQuantity() + 1;
     $groupDiscountAmount = $groupedRefundItem->getDiscountAmount() + $refundItem->getDiscountAmount();
     $groupedRefundItem->setTotalGrossPriceWithDiscount($groupTotalGrossPriceWithDiscount);
     $groupedRefundItem->setTotalGrossPrice($groupTotalGrossPrice);
     $groupedRefundItem->setQuantity($groupQuantity);
     $groupedRefundItem->setTaxAmount($groupTaxAmount);
     $groupedRefundItem->setDiscountAmount($groupDiscountAmount);
     return $groupedRefundItem;
 }