Index: /lib/wpsg_basket.class.php
===================================================================
--- /lib/wpsg_basket.class.php	(revision 7334)
+++ /lib/wpsg_basket.class.php	(revision 7335)
@@ -842,5 +842,7 @@
 				if ($finish_order === true) {
 					
-					foreach ($oCalculation->getCalculationArray['product'] as $p) {
+					foreach ($oCalculation->getCalculationArray()['product'] as $p) {
+						
+						
 						
 						$produkt_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($p['product_id'])."'");
Index: /lib/wpsg_calculation.class.php
===================================================================
--- /lib/wpsg_calculation.class.php	(revision 7334)
+++ /lib/wpsg_calculation.class.php	(revision 7335)
@@ -717,5 +717,5 @@
 				if (!wpsg_isSizedInt($p['order_product_id']) && $p['product_index'] !== false) {
 					
-					$p['order_product_id'] = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_ORDERPRODUCT."` WHERE `o_id` = '".wpsg_q($id)."' AND `p_id` = '".wpsg_q($p['product_id'])."' AND `productkey` = '".wpsg_q($p['productkey'])."' AND `product_index` = '".wpsg_q($p['product_index'])."' ");
+					$p['order_product_id'] = $this->db->fetchOne("SELECT `id` FROM `".WPSG_TBL_ORDERPRODUCT."` WHERE `o_id` = '".wpsg_q($id)."' AND `p_id` = '".wpsg_q($p['product_id'])."' AND `productkey` = '".wpsg_q($p['product_key'])."' AND `product_index` = '".wpsg_q($p['product_index'])."' ");
 					
 				}
Index: /mods/wpsg_mod_prepayment.class.php
===================================================================
--- /mods/wpsg_mod_prepayment.class.php	(revision 7334)
+++ /mods/wpsg_mod_prepayment.class.php	(revision 7335)
@@ -236,6 +236,5 @@
 		 * QRCode fÃŒr eMail erzeugen
 		 */
-		public function genQRCode($betrag, $subject, $size, $out)
-		{
+		public function genQRCode($order_id, $subject, $betrag, $size, $out) {
 			
 			require_once WPSG_PATH_LIB.'phpqrcode/qrlib.php';
@@ -244,6 +243,6 @@
             if (!file_exists(WPSG_PATH_UPLOADS.'wpsg_girocode/')) mkdir(WPSG_PATH_UPLOADS.'wpsg_girocode/', 0755, true);
             
-			$fname1 = WPSG_PATH_UPLOADS.'wpsg_girocode/'.$subject.'.png';
-			$fname2 = WPSG_URL_UPLOADS.'wpsg_girocode/'.$subject.'.png';
+			$fname1 = WPSG_PATH_UPLOADS.'wpsg_girocode/'.$order_id.'.png';
+						
 			$phpGiroCode = new PhpGirocode();
 			$phpGiroCode->setBIC(wpsg_getStr($this->shop->get_option('wpsg_shopdata_bank_bic')));
@@ -255,20 +254,26 @@
 			
 			if ($out == PhpGirocode::OUTPUT_BROWSER) {
+				
 				$phpGiroCode->generate(PhpGirocode::OUTPUT_BROWSER, $fname1);
 			
 			} else if ($out == PhpGirocode::OUTPUT_FILE) {
+			
 				$phpGiroCode->generate(PhpGirocode::OUTPUT_FILE, $fname1);
+				
+				$fname2 = WPSG_URL_WP.'?wpsg_action=wpsg_getGiroCode&order_id='.$order_id;
+				
 				$ret = '<img src="'.$fname2.'" />';
 
 			} else if ($out == PhpGirocode::OUTPUT_BASE64) {
 				
-				//error_reporting(E_ALL & ~E_NOTICE);
-				$tmpfname = @tempnam("/tmp", "phpgirocode");
+				$tmpfname = @tempnam("/tmp", "phpgirocode");				
 				
 				$ret = $phpGiroCode->generate(PhpGirocode::OUTPUT_BASE64, $tmpfname);
-				//$ret = base64_encode(file_get_contents($tmpfname));
+				
 				
 			} else {
+				
 				$ret = $phpGiroCode->generate(PhpGirocode::OUTPUT_TEST, false);
+				
 			}
 			
@@ -277,4 +282,15 @@
 		} // private function genQRCode($betrag, $subject, $size, $out)
 		
+		public function template_redirect() {
+			
+			if (wpsg_isSizedString($_REQUEST['wpsg_action'], 'wpsg_getGiroCode')) {
+				
+				header("Content-Type: image/png");
+				
+				readfile(WPSG_PATH_UPLOADS.'wpsg_girocode/'.intval($_REQUEST['order_id']).'.png');
+				
+			}
+			
+		}
 		
 	} // class wpsg_mod_prepayment extends wpsg_mod_basic
Index: /views/mailtemplates/html/customer.phtml
===================================================================
--- /views/mailtemplates/html/customer.phtml	(revision 7334)
+++ /views/mailtemplates/html/customer.phtml	(revision 7335)
@@ -167,11 +167,17 @@
 
 <?php
+	
 	require_once WPSG_PATH_LIB.'phpgirocode.class.php';
-	if (isset($this->view['mod_prepayment']['subject'])) { 
+	
+	if (isset($this->view['mod_prepayment']['subject'])) {
+			
 		if (in_array('kundenmail.phtml', $this->arTemplateStack)) {
-			echo $this->callMod('wpsg_mod_prepayment', 'genQRCode', array($this->view['basket']['sum']['preis_gesamt_brutto'],
-				$this->view['mod_prepayment']['subject'], 3, PhpGirocode::OUTPUT_FILE));
+		
+			echo $this->callMod('wpsg_mod_prepayment', 'genQRCode', array($this->view['o_id'], $this->view['mod_prepayment']['subject'], $this->view['basket']['sum']['preis_gesamt_brutto'], 3, PhpGirocode::OUTPUT_FILE));
+
 		}
+		
 	}
+	
 ?>
 		
Index: /views/mods/mod_prepayment/mail.phtml
===================================================================
--- /views/mods/mod_prepayment/mail.phtml	(revision 7334)
+++ /views/mods/mod_prepayment/mail.phtml	(revision 7335)
@@ -13,3 +13,3 @@
 <?php echo wpsg_pad_right(__('Bank', 'wpsg').':', 35); ?><?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_mod_prepayment_bank')); ?>  
 <?php echo wpsg_pad_right(__('BIC-/SWIFT-Code', 'wpsg').':', 35); ?><?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_mod_prepayment_swift')); ?> 
-<?php echo wpsg_translate(__('Betreff: #1#', 'wpsg'), $this->view['mod_prepayment']['subject']); ?>   
+<?php echo wpsg_pad_right(__('Betreff: #1#', 'wpsg'), 35); ?><?php echo $this->view['mod_prepayment']['subject']; ?>   
Index: /views/mods/mod_prepayment/order_done.phtml
===================================================================
--- /views/mods/mod_prepayment/order_done.phtml	(revision 7334)
+++ /views/mods/mod_prepayment/order_done.phtml	(revision 7335)
@@ -18,15 +18,18 @@
 
 <?php if (isset($this->view['wpsg_mod_prepayment']['subject'])) { ?>
-	<p><?php echo __('Wenn Ihre Banking-App Girocode unterstÃŒtzt, kÃ¶nnen Sie diesen QRCode scannen.', 'wpsg'); ?></p>
+	
+	<p>
+		<?php echo __('Wenn Ihre Banking-App Girocode unterstÃŒtzt, kÃ¶nnen Sie diesen QRCode scannen.', 'wpsg'); ?>
+	</p>
+	
 	<?php 
+	
 		require_once WPSG_PATH_LIB.'phpgirocode.class.php';
+	
+		$img = $this->callMod('wpsg_mod_prepayment', 'genQRCode', array($this->view['o_id'], $this->view['wpsg_mod_prepayment']['subject'], $this->view['basket']['sum']['preis_gesamt_brutto'], 8, PhpGirocode::OUTPUT_BASE64));
+	
+		echo '<img src="data:image/png;base64,'.$img.'" />';
 		
-		$img = $this->callMod('wpsg_mod_prepayment', 'genQRCode', array($this->view['basket']['sum']['preis_gesamt_brutto'],
-			$this->view['wpsg_mod_prepayment']['subject'], 8, PhpGirocode::OUTPUT_BASE64));
 	?>
-	<img src="data:image/gif;base64,<?php echo $img; ?>" alt="" />
-		
-  	<pre style="display:none;"><?php 	echo $this->callMod('wpsg_mod_prepayment', 'genQRCode', array($this->view['basket']['sum']['preis_gesamt_brutto'],
-  			$this->view['wpsg_mod_prepayment']['subject'], 8, PhpGirocode::OUTPUT_TEST));
-	?></pre>
+	
 <?php } ?>
