We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c6a77c commit 6c3b060Copy full SHA for 6c3b060
src/price/ProgressivePrice.php
@@ -49,10 +49,10 @@ public function getThresholds(): ProgressivePriceThresholdList
49
*/
50
public function calculateUsage(QuantityInterface $quantity): ?QuantityInterface
51
{
52
- $usage = $quantity->convert($this->prepaid->getUnit())->subtract($this->prepaid);
+ $usage = $quantity->subtract($this->prepaid);
53
54
if ($usage->isPositive()) {
55
- return $usage;
+ return $quantity->convert($this->prepaid->getUnit());
56
}
57
58
return Quantity::create($this->prepaid->getUnit()->getName(), 0);
0 commit comments