diff --git a/entity/Offeritem_entity/afterSave.js b/entity/Offeritem_entity/afterSave.js
index 0fc435de6530b8e80d7e205b331ace1191a336ac..2041fcb06ebb03186268f931bc460f18ab937d96 100644
--- a/entity/Offeritem_entity/afterSave.js
+++ b/entity/Offeritem_entity/afterSave.js
@@ -2,6 +2,7 @@ import("system.neon");
 import("system.entities");
 import("system.vars");
 import("Sql_lib");
+import("Offer_lib");
 
 if(vars.get("$local.recordstate") == neon.OPERATINGSTATE_EDIT)
 {
diff --git a/entity/Prod2prod_entity/Prod2prod_entity.aod b/entity/Prod2prod_entity/Prod2prod_entity.aod
index ead47cfc2b7ce1a9f304350248ad64201065a2a0..16f8ef9b8636f70b48a0f164bceb5178dca87067 100644
--- a/entity/Prod2prod_entity/Prod2prod_entity.aod
+++ b/entity/Prod2prod_entity/Prod2prod_entity.aod
@@ -39,6 +39,10 @@
       <consumer>Products</consumer>
       <mandatory v="true" />
       <onValueChange>%aditoprj%/entity/Prod2prod_entity/entityfields/source_id/onValueChange.js</onValueChange>
+      <onValueChangeTypes>
+        <element>MASK</element>
+        <element>PROCESS_SETVALUE</element>
+      </onValueChangeTypes>
     </entityField>
     <entityField>
       <name>TAKEPRICE</name>
diff --git a/entity/Prod2prod_entity/entityfields/source_id/onValueChange.js b/entity/Prod2prod_entity/entityfields/source_id/onValueChange.js
index 6b7340b99f92da214cf9f70f511e441c2d15ec55..c9db8f5da2ee3395ae89925242b80f5860b479c4 100644
--- a/entity/Prod2prod_entity/entityfields/source_id/onValueChange.js
+++ b/entity/Prod2prod_entity/entityfields/source_id/onValueChange.js
@@ -166,17 +166,20 @@ function _calcPrices()
 
     }
 
-    for (i = 0; i < productAndChildProducts[null].length; i++)
+    if(productAndChildProducts[null])
     {
-        var currentProdId = productAndChildProducts[null][i];
-
-        if(Utils.isNotNullOrEmptyString(productPrices[currentProdId]["PP"]))
-        {
-            buyPrice = eMath.addDec(buyPrice, productPrices[currentProdId]["PP"]);
-        }
-        if(Utils.isNotNullOrEmptyString(productPrices[currentProdId]["SP"]))
+        for(i = 0; i < productAndChildProducts[null].length; i++)
         {
-            sellPrice = eMath.addDec(sellPrice, productPrices[currentProdId]["SP"]);
+            var currentProdId = productAndChildProducts[null][i];
+
+            if(Utils.isNotNullOrEmptyString(productPrices[currentProdId]["PP"]))
+            {
+                buyPrice = eMath.addDec(buyPrice, productPrices[currentProdId]["PP"]);
+            }
+            if(Utils.isNotNullOrEmptyString(productPrices[currentProdId]["SP"]))
+            {
+                sellPrice = eMath.addDec(sellPrice, productPrices[currentProdId]["SP"]);
+            }
         }
     }
     buyPrice =(