mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-28 04:01:42 +00:00
Upgraded brick/math to latest version
This commit is contained in:
parent
506d5f8173
commit
527c42c227
11 changed files with 58 additions and 56 deletions
|
|
@ -190,7 +190,7 @@ final readonly class ProjectBuildHelper
|
|||
continue;
|
||||
}
|
||||
$has_price = true;
|
||||
$total = $total->plus($unit_price->multipliedBy($entry->getQuantity())->multipliedBy($number_of_builds));
|
||||
$total = $total->plus($unit_price->multipliedBy(BigDecimal::fromFloatShortest($entry->getQuantity()))->multipliedBy($number_of_builds));
|
||||
}
|
||||
|
||||
return $has_price ? $total : null;
|
||||
|
|
@ -206,7 +206,7 @@ final readonly class ProjectBuildHelper
|
|||
if ($total === null) {
|
||||
return null;
|
||||
}
|
||||
return $total->dividedBy($number_of_builds, 10, RoundingMode::HALF_UP);
|
||||
return $total->dividedBy($number_of_builds, 10, RoundingMode::HalfUp);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -215,7 +215,7 @@ final readonly class ProjectBuildHelper
|
|||
public function roundedTotalBuildPrice(Project $project, int $number_of_builds = 1, ?Currency $currency = null): ?BigDecimal
|
||||
{
|
||||
return $this->calculateTotalBuildPrice($project, $number_of_builds, $currency)
|
||||
?->toScale(2, RoundingMode::UP);
|
||||
?->toScale(2, RoundingMode::Up);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -224,7 +224,7 @@ final readonly class ProjectBuildHelper
|
|||
public function roundedUnitBuildPrice(Project $project, int $number_of_builds = 1, ?Currency $currency = null): ?BigDecimal
|
||||
{
|
||||
return $this->calculateUnitBuildPrice($project, $number_of_builds, $currency)
|
||||
?->toScale(2, RoundingMode::UP);
|
||||
?->toScale(2, RoundingMode::Up);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue