From 717b2577786e35ad985866cbdb269cc25182347f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Tue, 6 Aug 2019 17:15:37 +0200 Subject: [PATCH] Fixed exception, when a part does not have price informations. --- src/Entity/Part.php | 2 +- templates/Parts/info/show_part_info.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Entity/Part.php b/src/Entity/Part.php index a420722c..16be2d6c 100644 --- a/src/Entity/Part.php +++ b/src/Entity/Part.php @@ -665,7 +665,7 @@ class Part extends AttachmentContainingDBElement * * @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); $average_price = null; diff --git a/templates/Parts/info/show_part_info.html.twig b/templates/Parts/info/show_part_info.html.twig index 913b2d11..5fd18d89 100644 --- a/templates/Parts/info/show_part_info.html.twig +++ b/templates/Parts/info/show_part_info.html.twig @@ -79,7 +79,7 @@ {% endif %}
- Test + {% include "Parts/info/_attachments_info.html.twig" %}