RowBaseCalculator.php 788 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Tax\Model\Calculation;
  7. class RowBaseCalculator extends AbstractAggregateCalculator
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. protected function roundAmount(
  13. $amount,
  14. $rate = null,
  15. $direction = null,
  16. $type = self::KEY_REGULAR_DELTA_ROUNDING,
  17. $round = true,
  18. $item = null
  19. ) {
  20. if ($item->getAssociatedItemCode()) {
  21. // Use delta rounding of the product's instead of the weee's
  22. $type = $type . $item->getAssociatedItemCode();
  23. } else {
  24. $type = $type . $item->getCode();
  25. }
  26. return $this->deltaRound($amount, $rate, $direction, $type, $round);
  27. }
  28. }