Index: /mods/wpsg_mod_rechnungen.class.php
===================================================================
--- /mods/wpsg_mod_rechnungen.class.php	(revision 8274)
+++ /mods/wpsg_mod_rechnungen.class.php	(revision 8275)
@@ -1707,5 +1707,5 @@
 
 				$this->shop->view['file_path'] = $oInvoice->getFilePath();
-				
+
 			}
 			
@@ -1714,5 +1714,5 @@
 
 			$this->shop->view['oOrder'] = $this->shop->cache->loadOrderObject($order_id);
-						
+
 			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_rechnungen/multi_invoice_pdf.phtml');	
 
@@ -1724,4 +1724,5 @@
 					$oInvoice = \wpsg\wpsg_invoice::getInstance($r_id);				
 					$oInvoice->setMeta('version', '3');
+
 					$FilePath = dirname($oInvoice->getFilePath()); 
 
@@ -1729,11 +1730,25 @@
 					 * Damit alte Rechnungen noch versendet werden
 					 */
-					if (file_exists($FilePath.'/'.$r_id.'.pdf')) { $file = $FilePath.'/'.$r_id.'.pdf'; }
-					else if (file_exists($FilePath.'/'.$rnr.'.pdf')) { $file = $FilePath.'/'.$rnr.'.pdf'; }
-					else if (file_exists($FilePath.'/'.'R'.$r_id.'.pdf')) { $file = $FilePath.'/'.'R'.$r_id.'.pdf'; }
-					else { $file = $FilePath.'/'.'R'.$rnr.'.pdf'; }  
- 
+					if (file_exists($FilePath.'/'.$r_id.'.pdf')) { 
+wpsg_debug('1'); 
+						$file = $FilePath.'/'.$r_id.'.pdf'; }
+					else if (file_exists($FilePath.'/'.$rnr.'.pdf')) { 
+wpsg_debug('2'); 
+						$file = $FilePath.'/'.$rnr.'.pdf'; }
+					else if (file_exists($FilePath.'/'.'R'.$r_id.'.pdf')) { 
+wpsg_debug('3'); 
+						$file = $FilePath.'/'.'R'.$r_id.'.pdf'; }
+					else { 
+wpsg_debug('4'); 
+						$file = $FilePath.'/'.'R'.$rnr.'.pdf'; }  	
+
+
+wpsg_debug($FilePath);
+wpsg_debug($file);
+wpsg_debug($rnr);
+
+
 					$file = $this->copyTemp($file, $rnr);
-					
+
 					$mail_text = $this->shop->render(WPSG_PATH_VIEW."/mods/mod_rechnungen/multi_invoicemail.phtml", false);
 
@@ -1757,5 +1772,10 @@
 					
 					}
-					
+
+
+wpsg_debug($arFiles);
+die();
+			
+
 					$this->shop->sendMail($mail_text, $empfaenger, 'invoicemail', $arFiles, $order_id, false, $mail_html);
 
@@ -1781,5 +1801,5 @@
 												
 			}
-			
+
 			$this->shop->restoreTempLocale();
 
@@ -1881,5 +1901,4 @@
                     $oInvoice = \wpsg\wpsg_invoice::getInstance(intval($g_id));
                     $file = $oInvoice->getFilePath();
-
 					$file = $this->copyTemp($file, $gnr);
 				
@@ -2052,6 +2071,11 @@
 			
 			$path = $this->shop->getTempDir();
-			
+
 			wpsg_copy($file, $path.'/'.$rnr.'.pdf');
+
+
+wpsg_debug('copyTemp');
+die();
+
 
 			return $path.'/'.$rnr.'.pdf';
