Esempio n. 1
0
 /**
  * @param \Generated\Shared\Transfer\RefundItemTransfer $itemTransfer
  *
  * @return void
  */
 public function aggregate(RefundItemTransfer $itemTransfer)
 {
     if (!$itemTransfer->getTaxRate()) {
         return;
     }
     $this->taxBridge->resetAccruedTaxCalculatorRoundingErrorDelta();
     $itemTransfer->requireGrossPrice()->requireTotalGrossPrice();
     $taxAmount = $this->taxBridge->getTaxAmountFromGrossPrice($itemTransfer->getTotalGrossPrice(), $itemTransfer->getTaxRate());
     $itemTransfer->setTaxAmount($taxAmount);
     $taxAmountWithDiscount = $this->taxBridge->getTaxAmountFromGrossPrice($itemTransfer->getTotalGrossPriceWithDiscount(), $itemTransfer->getTaxRate());
     $itemTransfer->setTaxAmountWithDiscount($taxAmountWithDiscount);
 }
Esempio n. 2
0
 /**
  * @param \Generated\Shared\Transfer\RefundItemTransfer $refundItem
  *
  * @return \Generated\Shared\Transfer\GroupedRefundItemTransfer
  */
 protected function createNewItem(RefundItemTransfer $refundItem)
 {
     $groupedRefundItem = new GroupedRefundItemTransfer();
     $groupedRefundItem->setName($refundItem->getName());
     $groupedRefundItem->setTotalGrossPriceWithDiscount($refundItem->getTotalGrossPriceWithDiscount());
     $groupedRefundItem->setTotalGrossPrice($refundItem->getTotalGrossPrice());
     $groupedRefundItem->setGrossPrice($refundItem->getGrossPrice());
     $groupedRefundItem->setQuantity(1);
     $groupedRefundItem->setTaxRate($refundItem->getTaxRate());
     $groupedRefundItem->setTaxAmount($refundItem->getTaxAmount());
     $groupedRefundItem->setDiscountAmount($refundItem->getDiscountAmount());
     return $groupedRefundItem;
 }