Skip to content

Commit

Permalink
Hp 2250/fix behat test at billing mrdp (#94)
Browse files Browse the repository at this point in the history
* HP-2250/Fix_behat_test_at_billing-mrdp

* HP-2250/Fixed convert unit in progressive price

---------

Co-authored-by: Drahma <[email protected]>
  • Loading branch information
ValeriyShnurovoy and Drahma authored Feb 7, 2025
1 parent 9f1c3f1 commit bf48787
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/price/ProgressivePrice.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public function getThresholds(): ProgressivePriceThresholdList
*/
public function calculateUsage(QuantityInterface $quantity): ?QuantityInterface
{
$usage = $quantity->subtract($this->prepaid);
$usage = $quantity->convert($this->prepaid->getUnit())->subtract($this->prepaid);

if ($usage->isPositive()) {
return $quantity;
return $usage;
}

return Quantity::create($this->prepaid->getUnit()->getName(), 0);
Expand Down

0 comments on commit bf48787

Please sign in to comment.