From 1a1a441d2483d2b4b870d542b9fb2b74504016c9 Mon Sep 17 00:00:00 2001
From: Henning Leutz <leutz@pcsg.de>
Date: Mon, 26 Sep 2022 10:35:44 +0200
Subject: [PATCH] feat: quiqqer/erp#78

---
 ajax/backend/getCouponPrice.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ajax/backend/getCouponPrice.php b/ajax/backend/getCouponPrice.php
index 2204c9a..0c21d5e 100644
--- a/ajax/backend/getCouponPrice.php
+++ b/ajax/backend/getCouponPrice.php
@@ -20,6 +20,14 @@ function ($couponId, $vat) {
         foreach ($discounts as $Discount) {
             $PriceFactor = $Discount->toPriceFactor();
 
+            if ($PriceFactor->getCalculation() === QUI\ERP\Accounting\Calc::CALCULATION_PERCENTAGE) {
+                continue;
+            }
+
+            if ($PriceFactor->getCalculation() === QUI\ERP\Accounting\Calc::CALCULATION_COMPLEMENT) {
+                continue;
+            }
+
             if ($vat !== false) {
                 $PriceFactor->setVat($vat);
             }
-- 
GitLab