From a984e524cb8f930b6fee2cf3abefdffa852226d0 Mon Sep 17 00:00:00 2001
From: Henning Leutz <leutz@pcsg.de>
Date: Mon, 24 Feb 2020 09:38:33 +0100
Subject: [PATCH] fix: quiqqer/shipping#22

---
 src/QUI/ERP/Shipping/Types/ShippingEntry.php | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/QUI/ERP/Shipping/Types/ShippingEntry.php b/src/QUI/ERP/Shipping/Types/ShippingEntry.php
index ce1f6c5..29b32f8 100644
--- a/src/QUI/ERP/Shipping/Types/ShippingEntry.php
+++ b/src/QUI/ERP/Shipping/Types/ShippingEntry.php
@@ -187,8 +187,18 @@ public function getShippingType()
      */
     public function getPriceDisplay()
     {
+        $PriceFactor = $this->toPriceFactor();
+
+        // display is incl vat
+        $vat   = $PriceFactor->getVat();
+        $price = $this->getPrice();
+
+        if ($vat) {
+            $price = $price + ($price * ($vat / 100));
+        }
+
         $Price = new QUI\ERP\Money\Price(
-            $this->getPrice(),
+            $price,
             QUI\ERP\Defaults::getCurrency()
         );
 
@@ -731,6 +741,10 @@ public function toPriceFactor(
         $Locale = null,
         QUI\ERP\Order\AbstractOrder $Order = null
     ) {
+        if ($Order === null) {
+            $Order = $this->Order;
+        }
+
         $PriceFactor = new QUI\ERP\Products\Utils\PriceFactor([
             'title'       => QUI::getLocale()->get('quiqqer/shipping', 'shipping.order.title', [
                 'shipping' => $this->getTitle($Locale)
-- 
GitLab