Index: /mods/wpsg_mod_rechnungen.class.php
===================================================================
--- /mods/wpsg_mod_rechnungen.class.php	(revision 8155)
+++ /mods/wpsg_mod_rechnungen.class.php	(revision 8156)
@@ -8,5 +8,5 @@
 		var $lizenz = 1;
 		var $id = 1400;		
-		var $version = "9.9.9";
+		var $version = "4.3.8";
 		var $hilfeURL = 'http://wpshopgermany.de/?p=718';
 		var $free = false;
@@ -382,5 +382,5 @@
 					`rnr` DESC
 			";
-			
+
 			$this->shop->view['mod_rechnungen']['arRechnungen'] = $this->db->fetchAssoc($strQuery);
 			
@@ -571,5 +571,5 @@
 						$rn_file_copy = $this->getFilePath($_REQUEST['edit_id']).'copy_'.$rechnung['gnr'].'.pdf';
 						
-					}
+					} 
 					  
 					$strTitle = wpsg_translate(__('Zusendung einer Kopie fÃŒr Rechnungskorrektur #1# an #2#', 'wpsg'), $rechnung['gnr'], $email);
@@ -609,4 +609,15 @@
 						$rn_file_copy = $this->getFilePath($_REQUEST['edit_id']).'copy_'.$rechnung['rnr'].'.pdf';
 						
+					} else {
+
+						$oInvoice = \wpsg\wpsg_invoice::getInstance($rechnung['id']);
+						$rn_file = $oInvoice->getFilePath();
+
+						if (file_exists($rn_file)) {
+							
+							$rn_file_copy = dirname($rn_file).DIRECTORY_SEPARATOR.'copy_'.basename($rn_file);
+							
+						}
+
 					}
 					
@@ -1030,5 +1041,5 @@
 					$discount['amount']
 				);
-
+				
 				$arVoucher = $oCalculationOrder->getVoucher();
 				if ($arVoucher !== null) {
@@ -1256,5 +1267,5 @@
 			}
 			
-			if (!$bOK && !$preview) throw new \Exception(__('Kein Produkt ausgewÃ€hlt!', 'wpsg'));
+			if (!$bOK) throw new \Exception(__('Kein Produkt ausgewÃ€hlt!', 'wpsg'));
 			
 			$this->shop->view['output'] = $bOutput;
@@ -1279,5 +1290,5 @@
 			$this->shop->view['kunde']['land'] = $this->db->fetchRow("SELECT L.* FROM `".WPSG_TBL_LAND."` AS L WHERE L.`id` = '".wpsg_q($this->shop->view['kunde']['land'])."'");
 			$this->shop->view['data']['shipping_land'] = $this->db->fetchRow("SELECT L.* FROM `".WPSG_TBL_LAND."` AS L WHERE L.`id` = '".wpsg_q(wpsg_getStr($this->shop->view['data']['shipping_land']))."'");
-			
+
 			if (wpsg_checkInput($_REQUEST['wpsg_rechnungen_datum'], WPSG_SANITIZE_DATE_EN)) $this->shop->view['rDatum'] = date('Y-m-d', strtotime($_REQUEST['wpsg_rechnungen_datum']));
 			else throw \wpsg\Exception::getSanitizeException();
@@ -1321,7 +1332,5 @@
 			$oCalculation = new \wpsg\wpsg_calculation();			
 			$oCalculationOrder = \wpsg\wpsg_calculation::getOrderCalculation($order_id);
-					
-			$this->shop->view['oCalculationOrder'] = $oCalculationOrder;
-
+						
 			$oCalculation->setTaxMode($oCalculationOrder->getTaxMode());
 			
@@ -1335,5 +1344,5 @@
 					$country['c_'.$country['id']],
 					$country['d_'.$country['id']],					
-					$country['default']
+					$country['default'],
 				);
 				
@@ -1354,6 +1363,6 @@
 
 				}
-
-				$arVoucher = $oCalculationOrder->getVoucher(); 
+				
+				$arVoucher = $oCalculationOrder->getVoucher();
 				if ($arVoucher !== null) {
 					
@@ -1433,7 +1442,7 @@
 
 					$sum['weight_gesamt'] += $p['weight'];
-
+					
 					if ($oCalculationOrder->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_B2B) {
-
+						
 						$p['preis_brutto'] = $p['preis_netto'];
 						$p['mwst_value'] = 0;
@@ -1483,4 +1492,6 @@
 				
 			}
+			
+			//die(wpsg_debug($oCalculation->getCalculationArray()));
 						
 			$this->shop->view['basket'] = [
@@ -2373,6 +2384,6 @@
                     $file = $this->getFilePath($multiRechnung).$rechnung['id'].'.pdf';
                     header('Content-Disposition: attachment; filename="'.$rechnung['rnr'].'.pdf"');
-
-                }
+              
+				}
                 else if (file_exists($this->getFilePath($multiRechnung).$rechnung['rnr'].'.pdf'))
                 {
@@ -2380,6 +2391,6 @@
                     $file = $this->getFilePath($multiRechnung).$rechnung['rnr'].'.pdf';
                     header('Content-Disposition: attachment; filename="'.$rechnung['rnr'].'.pdf"');
-
-                }
+               
+				}
                 else if (file_exists($this->getFilePath($multiRechnung).'R'.$rechnung['id'].'.pdf'))
                 {
