Index: /lib/wpsg_calculation.class.php
===================================================================
--- /lib/wpsg_calculation.class.php	(revision 7982)
+++ /lib/wpsg_calculation.class.php	(revision 7985)
@@ -42,5 +42,5 @@
     	private $tax_mode = '2';
 	
-    	private static $functionscache = [];
+    	public static $functionscache = [];
     	
 		const TAXMODE_SMALLBUSINESS = '1';
Index: /mods/wpsg_mod_abo.class.php
===================================================================
--- /mods/wpsg_mod_abo.class.php	(revision 7982)
+++ /mods/wpsg_mod_abo.class.php	(revision 7985)
@@ -537,4 +537,10 @@
 
 			date_default_timezone_set('Europe/Berlin');
+
+			$t_start = microtime(true);
+			
+			// Parallele AusfÃŒhrung verhindern
+			$wpsg_mod_abo_cron_lastrun = intval($this->shop->get_option('wpsg_mod_abo_cron_lastrun'));			
+			if ($wpsg_mod_abo_cron_lastrun > 0 && $wpsg_mod_abo_cron_lastrun > time() - 1 * 60) return;
 			
             //$d1 = date_create('2022-04-20 12:05:00');
@@ -591,4 +597,5 @@
                     } else if ($wpsg_mod_abo_expiremode === self::EXPIRE_AUTO) {
 						
+						//wpsg_debug("1");
                     	$this->autoExtendOrder($a['order_id'], $a['order_product_id']);
 
@@ -635,4 +642,5 @@
                 if ($wpsg_mod_abo_expiremode == self::EXPIRE_AUTO) {
 
+					//wpsg_debug("2");
                     $this->autoExtendOrder($a['order_id'], $a['order_product_id']);
 
@@ -653,4 +661,8 @@
             $this->shop->update_option('wpsg_mod_abo_cron_lastrun', time());
 
+			$t_end = microtime(true) - $t_start;
+			
+			//mail("", "CRON: ".$t_end.'s', '');
+			
 		}
 
@@ -1333,5 +1345,5 @@
          */
 		public function autoExtendOrder($order_id, $order_product_id) {
-
+		
 		    $oOrderProduct = wpsg_order_product::getInstance($order_product_id);
             $product_id = $oOrderProduct->getProductId();
@@ -1350,12 +1362,21 @@
 			"));
 
+			//wpsg_debug('....');
+			//wpsg_debug("VerlÃ€ngere1: ".$order_id.":".$order_product_id);
+			
             if ($order_extend_exist > 0) return;
-
+						
+			//wpsg_debug("VerlÃ€ngere1.5: ".$order_id.":".$order_product_id);
+			
 		    if (!is_numeric($product_id)) throw new \Exception(__('Nicht vorgesehen!', 'wpsg'));
 
             $this->shop->addShipPay();
 
+			//wpsg_debug("VerlÃ€ngere2: ".$order_id.":".$order_product_id);
+			
             $oOrder = wpsg_order::getInstance($order_id);
 
+			//wpsg_debug("VerlÃ€ngere3: ".$order_id.":".$order_product_id.":".$oOrder->getId());
+		
             unset($_SESSION['wpsg']['basket']);
             unset($_SESSION['wpsg']['checkout']);
@@ -1394,11 +1415,21 @@
             $_SESSION['wpsg']['checkout']['land'] = wpsg_getStr($customer_address['land']);
 
+			\wpsg\wpsg_calculation::$functionscache = [];
+			
             $oBasket = new wpsg_basket();
 
             $oBasket->addProduktToSession('abo_'.$order_id.'_'.$order_product_id, 1);
-
+			
+			//wpsg_debug("VerlÃ€ngere4: ".$order_id.":".$order_product_id.":".$oOrder->getId()."=".'abo_'.$order_id.'_'.$order_product_id);
+			
             $oBasket->initFromSession(true); $arBasket = $oBasket->toArray();
             $new_o_id = $oBasket->save(true, false);
 
+			$this->db->UpdateQuery(WPSG_TBL_ORDER, [
+				'type_shipping' => wpsg_q($oOrder->type_shipping)
+			], " `id` = '".wpsg_q($oOrder->getId())."' ");
+			
+			//mail("daniel@maennchen1.de", "CRON TEST: ".'abo_'.$order_id.'_'.$order_product_id.' = '.$new_o_id, "VerlÃ€ngere ".$order_id.":".$order_product_id);
+			
             $arBasket['checkout']['knr'] = $customer_db_data['knr'];
             $arBasket['checkout']['onr'] = $this->db->fetchOne("SELECT `onr` FROM `".WPSG_TBL_ORDER."` WHERE `id` = '".wpsg_q($new_o_id)."' ");
@@ -1411,5 +1442,7 @@
             if ($this->getSetting('wpsg_mod_abo_autoexpire_adminmail', $product_id) === '1') $bAdminMail = true;
 
-            $oOrder->addLogEntry(__('VerlÃ€ngerung erworben', 'wpsg'), 'OrderID: '.$new_o_id);
+			//wpsg_debug("VerlÃ€ngere5: ".$order_id.":".$order_product_id.":".$oOrder->getId());
+			
+            $oOrder->addLogEntry(__('VerlÃ€ngerung erworben', 'wpsg'), 'OrderID: '.$order_id.'/'.$new_o_id);
 
             $oBasket->sendOrderSaveMails($new_o_id, $arBasket, $bCustomerMail, $bAdminMail);
@@ -1516,6 +1549,5 @@
 		 * Gibt die BestellID der Originalbestellung einer VerlÃ€ngerung zurÃŒck
 		 */
-		public function getOriginOrder($order_id)
-		{
+		public function getOriginOrder($order_id) {
 
 			if ($this->isAboOrder($order_id) !== 2) return false;
@@ -1523,9 +1555,7 @@
 			$productkeys = $this->db->fetchAssocField("SELECT `productkey` FROM `".WPSG_TBL_ORDERPRODUCT."` WHERE `o_id` = '".wpsg_q($order_id)."' ");
 
-			foreach ($productkeys as $pk)
-			{
-
-				if (preg_match('/^abo_\d+_\d+$/', $pk))
-				{
+			foreach ($productkeys as $pk) {
+
+				if (preg_match('/^abo_\d+_\d+$/', $pk)) {
 
 					$arAbo = explode('_', $pk);
Index: /views/order/index.phtml
===================================================================
--- /views/order/index.phtml	(revision 7982)
+++ /views/order/index.phtml	(revision 7985)
@@ -308,4 +308,6 @@
                                         $origin_order_data = $this->cache->loadOrder($origin_order_id);
 
+                                        //wpsg_debug($oOrder->id.":".$origin_order_id);
+                                        
                                     ?>
                                     <?php echo wpsg_translate(__('VerlÃ€ngerung zu Bestellung <a href="#1#">#2#</a>', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$origin_order_id, $origin_order_data['onr']); ?>
