mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-29 04:31:50 +00:00
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:
parent
0169c2d1fa
commit
8c52407c99
2 changed files with 32 additions and 1 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue