Consider the prices of built instances of subprojects (#1459)

* Consider the prices of built instances of subprojects

* Add test

* fix test

* fix test

* fix test...

* fix test again
This commit is contained in:
d-buchmann 2026-07-27 22:33:29 +02:00 committed by GitHub
parent 0169c2d1fa
commit 8c52407c99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 1 deletions

View file

@ -242,7 +242,11 @@ final readonly class ProjectBuildHelper
* taking bulk pricing into account for N builds.
*/
private function getBomEntryUnitPrice(ProjectBOMEntry $entry, int $number_of_builds, ?Currency $currency): ?BigDecimal
{
{
if ($entry->getPart() && $entry->getPart()->getBuiltProject() instanceof Project){
return $this->calculateTotalBuildPrice($entry->getPart()->getBuiltProject(), 1, $entry->getPriceCurrency());
}
if ($entry->getPart() instanceof Part) {
$total_qty = $entry->getQuantity() * $number_of_builds;
$min_order = $this->pricedetailHelper->getMinOrderAmount($entry->getPart());