From 989fa4385e154b2aaa5de0e7a8ce58cc1a27a7f8 Mon Sep 17 00:00:00 2001
From: Henning Leutz <leutz@pcsg.de>
Date: Sat, 27 Apr 2024 15:58:12 +0200
Subject: [PATCH] refactor: change deprecated order method

---
 composer.json                            | 8 ++++----
 src/QUI/ERP/Coupons/CouponCode.php       | 2 +-
 src/QUI/ERP/Coupons/Products/Handler.php | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/composer.json b/composer.json
index ecfb060..0104e40 100644
--- a/composer.json
+++ b/composer.json
@@ -15,10 +15,10 @@
     "email": "support@pcsg.de"
   },
   "require": {
-    "quiqqer\/quiqqer": "^1.2|^2",
-    "quiqqer\/erp": "3.2",
-    "quiqqer\/discount": "^1.1",
-    "quiqqer/products": "^1.3"
+    "quiqqer\/quiqqer": "^2",
+    "quiqqer\/erp": "^3.2",
+    "quiqqer\/discount": "^2",
+    "quiqqer/products": "^2"
   },
   "autoload": {
     "psr-4": {
diff --git a/src/QUI/ERP/Coupons/CouponCode.php b/src/QUI/ERP/Coupons/CouponCode.php
index f6ac2a4..b6ef5d5 100644
--- a/src/QUI/ERP/Coupons/CouponCode.php
+++ b/src/QUI/ERP/Coupons/CouponCode.php
@@ -747,7 +747,7 @@ public function addToOrder(QUI\ERP\Order\OrderInProcess $Order): void
                 // @todo wenn fest preis (zb 10$), dann eigener produkt typ hinzufügen
 
                 $articles[] = new QUI\ERP\Accounting\Articles\Text([
-                    'id' => '-',
+                    'id' => -1,
                     'articleNo' => $Coupon->getCode(),
                     'title' => $PriceFactor->getTitle(),
                     'description' => '',
diff --git a/src/QUI/ERP/Coupons/Products/Handler.php b/src/QUI/ERP/Coupons/Products/Handler.php
index b59d28f..6ffeafe 100644
--- a/src/QUI/ERP/Coupons/Products/Handler.php
+++ b/src/QUI/ERP/Coupons/Products/Handler.php
@@ -194,7 +194,7 @@ protected static function createCouponCodeFromProduct(
                 'quiqqer/coupons',
                 'ProductCoupon.coupon_title',
                 [
-                    'orderId' => $Order->getPrefixedId(),
+                    'orderId' => $Order->getPrefixedNumber(),
                     'productId' => $Product->getId()
                 ]
             ),
-- 
GitLab