Allow to directly add build as stock to the associated builds part.

This commit is contained in:
Jan Böhmer 2023-01-22 23:27:45 +01:00
parent 015c71cbd2
commit 2f42eb7cff
7 changed files with 207 additions and 3 deletions

View file

@ -135,13 +135,13 @@ class ProjectBuildHelper
}
/**
* Withdraw the parts from the stock using the given ProjectBuildRequest.
* Withdraw the parts from the stock using the given ProjectBuildRequest and create the build parts entries, if needed.
* The ProjectBuildRequest has to be validated before!!
* You have to flush changes to DB afterwards
* @param ProjectBuildRequest $buildRequest
* @return void
*/
public function doWithdrawForProjectBuildRequest(ProjectBuildRequest $buildRequest): void
public function doBuild(ProjectBuildRequest $buildRequest): void
{
$message = $buildRequest->getComment();
$message .= ' (Project build: '.$buildRequest->getProject()->getName().')';
@ -154,5 +154,9 @@ class ProjectBuildHelper
}
}
}
if ($buildRequest->getAddBuildsToBuildsPart()) {
$this->withdraw_add_helper->add($buildRequest->getBuildsPartLot(), $buildRequest->getNumberOfBuilds(), $message);
}
}
}