|
9 | 9 |
|
10 | 10 | class UnitBaseCalculator extends AbstractCalculator
|
11 | 11 | {
|
12 |
| - /** |
13 |
| - * {@inheritdoc} |
14 |
| - */ |
15 |
| - protected function roundAmount( |
16 |
| - $amount, |
17 |
| - $rate = null, |
18 |
| - $direction = null, |
19 |
| - $type = self::KEY_REGULAR_DELTA_ROUNDING, |
20 |
| - $round = true, |
21 |
| - $item = null |
22 |
| - ) { |
23 |
| - if ($item->getAssociatedItemCode()) { |
24 |
| - // Use delta rounding of the product's instead of the weee's |
25 |
| - $type = $type . $item->getAssociatedItemCode(); |
26 |
| - } else { |
27 |
| - $type = $type . $item->getCode(); |
28 |
| - } |
29 |
| - |
30 |
| - return $this->deltaRound($amount, $rate, $direction, $type, $round); |
31 |
| - } |
32 |
| - |
33 | 12 | /**
|
34 | 13 | * {@inheritdoc}
|
35 | 14 | */
|
@@ -103,6 +82,35 @@ protected function calculateWithTaxInPrice(QuoteDetailsItemInterface $item, $qua
|
103 | 82 | ->setAppliedTaxes($appliedTaxes);
|
104 | 83 | }
|
105 | 84 |
|
| 85 | + /** |
| 86 | + * Round amount. |
| 87 | + * |
| 88 | + * @param float $amount |
| 89 | + * @param null|string $rate |
| 90 | + * @param null|bool $direction |
| 91 | + * @param string $type |
| 92 | + * @param bool $round |
| 93 | + * @param QuoteDetailsItemInterface $item |
| 94 | + * @return float |
| 95 | + */ |
| 96 | + protected function roundAmount( |
| 97 | + float $amount, |
| 98 | + string $rate = null, |
| 99 | + bool $direction = null, |
| 100 | + string $type = self::KEY_REGULAR_DELTA_ROUNDING, |
| 101 | + bool $round = true, |
| 102 | + QuoteDetailsItemInterface $item = null |
| 103 | + ) { |
| 104 | + if ($item->getAssociatedItemCode()) { |
| 105 | + // Use delta rounding of the product's instead of the weee's |
| 106 | + $type = $type . $item->getAssociatedItemCode(); |
| 107 | + } else { |
| 108 | + $type = $type . $item->getCode(); |
| 109 | + } |
| 110 | + |
| 111 | + return $this->deltaRound($amount, $rate, $direction, $type, $round); |
| 112 | + } |
| 113 | + |
106 | 114 | /**
|
107 | 115 | * {@inheritdoc}
|
108 | 116 | */
|
|
0 commit comments