Fixed exception, when a part does not have price informations.

This commit is contained in:
Jan Böhmer 2019-08-06 17:15:37 +02:00
parent a916c40aa3
commit 717b257778
2 changed files with 2 additions and 2 deletions

View file

@ -665,7 +665,7 @@ class Part extends AttachmentContainingDBElement
* *
* @throws \Exception if there was an error * @throws \Exception if there was an error
*/ */
public function getAveragePrice(int $quantity = 1, $multiplier = null) : float public function getAveragePrice(int $quantity = 1, $multiplier = null) : ?float
{ {
$prices = $this->getPrices($quantity, $multiplier, true); $prices = $this->getPrices($quantity, $multiplier, true);
$average_price = null; $average_price = null;

View file

@ -79,7 +79,7 @@
</div> </div>
{% endif %} {% endif %}
<div class="tab-pane fade {% if part.comment is empty %} show active{% endif %}" id="attachments" role="tabpanel" aria-labelledby="profile-tab"> <div class="tab-pane fade {% if part.comment is empty %} show active{% endif %}" id="attachments" role="tabpanel" aria-labelledby="profile-tab">
Test {% include "Parts/info/_attachments_info.html.twig" %}
</div> </div>
<div class="tab-pane fade" id="suppliers" role="tabpanel" aria-labelledby="profile-tab"> <div class="tab-pane fade" id="suppliers" role="tabpanel" aria-labelledby="profile-tab">