From fdd15fdae67f28f408ced1292ec8ef12ae3ffa44 Mon Sep 17 00:00:00 2001
From: Benjamin Ulrich <b.ulrich@adito.de>
Date: Mon, 10 Feb 2020 09:14:54 +0100
Subject: [PATCH] 1050799 die ersten beiden Punkte gefixt.

---
 process/OfferOrder_lib/process.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/process/OfferOrder_lib/process.js b/process/OfferOrder_lib/process.js
index b89d167903f..585076d1d7f 100644
--- a/process/OfferOrder_lib/process.js
+++ b/process/OfferOrder_lib/process.js
@@ -256,6 +256,13 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c
                 price = ProductDetails.PriceListToUse.price;
                 vat = ProductDetails.PriceListToUse.vat;
             }
+            if(newSelect("takeprice")
+            .from("prod2prod")  
+            .whereIfSet("PROD2PROD.PROD2PRODID", p2pid)
+            .cell() == 0){
+                price = 0
+            }
+            
             
             var vals =  [newid
                         , self.offerOrderId
@@ -267,7 +274,7 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c
                         , price
                         , vat
                         , P2pObject.quantity
-                        , (P2pObject.optional) ? "1" : "0"
+                        , P2pObject.optional
                         , pos
                         , itemsort]
                     // add aditional details
-- 
GitLab