Index: /mods/wpsg_mod_prepayment.class.php
===================================================================
--- /mods/wpsg_mod_prepayment.class.php	(revision 8340)
+++ /mods/wpsg_mod_prepayment.class.php	(revision 8341)
@@ -204,4 +204,5 @@
 
 				$ret = []; // return array
+				$kundendaten = $data['checkout']; 
 
 				// EPC - QR-Code
@@ -227,6 +228,10 @@
 					$tmpfname = @tempnam("/tmp", "phpgirocode");
 					$qrCode = array(
-						'title' => 'QR-Code - EPC',
-						'hash' => $phpGiroCode->generate(PhpGirocode::OUTPUT_BASE64, $tmpfname)
+						'title' => 'Girocode',
+						'hash' => $phpGiroCode->generate(PhpGirocode::OUTPUT_BASE64, $tmpfname),
+						'referenceNumber' => $referenceNumber??'',
+						'additionalInformation' => $subject,
+						'customerdata' => $kundendaten, 
+						'invoiceAmount' => $betrag
 					);		
 					$ret[] = $qrCode;		
@@ -236,5 +241,4 @@
 				// SWISS - QR-Code
 				$fname3 = WPSG_PATH_UPLOADS.'wpsg_swissqrbill/'.$order_id.'.png';
-				$kundendaten = $data['checkout']; 
 				$oCountryB = wpsg_country::getInstance($this->shop->get_option('wpsg_shopdata_country'));
 				$oCountryC = wpsg_country::getInstance($kundendaten['land']); 
@@ -304,6 +308,10 @@
 
 					$qrCode = array(
-						'title' => 'QR-Code - Schweiz',
+						'title' => 'QR-Rechnung',
 						'hash' => $this->generateBase64QrCode($qrBill),
+						'referenceNumber' => $referenceNumber,
+						'additionalInformation' => $subject,
+						'customerdata' => $kundendaten, 
+						'invoiceAmount' => $betrag
 					);
 					$ret[] = $qrCode; 
@@ -312,14 +320,16 @@
 
 			} else if ($target == wpsg_mod_prepayment::QRCODE_EPC) {
+
+				$kundendaten = $data['checkout']; 
 
 				$fname1 = WPSG_PATH_UPLOADS.'wpsg_girocode/'.$order_id.'.png';
 							
-				$phpGiroCode = new PhpGirocode(); 
-				$phpGiroCode->setBIC(wpsg_getStr($this->shop->get_option('wpsg_shopdata_bank_bic'))); 
-				$phpGiroCode->setIBAN(wpsg_getStr($this->shop->get_option('wpsg_shopdata_bank_iban'))); 
-				$phpGiroCode->setReciver(wpsg_getStr($this->shop->get_option('wpsg_shopdata_bank_owner'))); 
-				$phpGiroCode->setAmount($betrag); 
-				$phpGiroCode->setText($subject); 
-				$phpGiroCode->setSize($size);
+					$phpGiroCode = new PhpGirocode(); 
+					$phpGiroCode->setBIC(wpsg_getStr($this->shop->get_option('wpsg_shopdata_bank_bic'))); 
+					$phpGiroCode->setIBAN(wpsg_getStr($this->shop->get_option('wpsg_shopdata_bank_iban'))); 
+					$phpGiroCode->setReciver(wpsg_getStr($this->shop->get_option('wpsg_shopdata_bank_owner'))); 
+					$phpGiroCode->setAmount($betrag); 
+					$phpGiroCode->setText($subject); 
+					$phpGiroCode->setSize($size);
 				
 				if ($out == PhpGirocode::OUTPUT_BROWSER) $phpGiroCode->generate(PhpGirocode::OUTPUT_BROWSER, $fname1);
@@ -333,11 +343,13 @@
 
 					$tmpfname = @tempnam("/tmp", "phpgirocode");	
-					// $qrCode = array(
-					// 	'title' => 'QR-Code - EPC',
-					// 	'hash' => $phpGiroCode->generate(PhpGirocode::OUTPUT_BASE64, $tmpfname)
-					// );		
-					// $ret[] = $qrCode;	
-
-					$ret = $phpGiroCode->generate(PhpGirocode::OUTPUT_BASE64, $tmpfname);	
+					$qrCode = array(
+						'title' => 'Girocode',
+						'hash' => $phpGiroCode->generate(PhpGirocode::OUTPUT_BASE64, $tmpfname),
+						'referenceNumber' => $referenceNumber??'',
+						'additionalInformation' => $subject,
+						'customerdata' => $kundendaten, 
+						'invoiceAmount' => $betrag
+					);		
+					$ret = $qrCode;		
 
 				} else $ret = $phpGiroCode->generate(PhpGirocode::OUTPUT_TEST, false);
@@ -345,8 +357,12 @@
 			} else if ($target == wpsg_mod_prepayment::QRCODE_SWISS) {
 
+				$kundendaten = $data['checkout']; 
+
 				$fname3 = WPSG_PATH_UPLOADS.'wpsg_swissqrbill/'.$order_id.'.png';
-				$kundendaten = $data['checkout']; 
 				$oCountryB = wpsg_country::getInstance($this->shop->get_option('wpsg_shopdata_country'));
 				$oCountryC = wpsg_country::getInstance($kundendaten['land']); 
+
+				$besrId = '';
+				if (!empty($this->shop->get_option('wpsg_shopdata_bank_besr'))) $besrId = $this->shop->get_option('wpsg_shopdata_bank_besr'); // should be empty if bank = "Postfinance", see also tooltip
 
 					$qrBill = QrBill\QrBill::create();
@@ -381,5 +397,5 @@
 					);
 					$referenceNumber = QrBill\Reference\QrPaymentReferenceGenerator::generate(
-						$this->shop->get_option('wpsg_shopdata_bank_besr')??'null', 
+						$besrId, 
 						$kundendaten['onr']
 					);
@@ -410,11 +426,16 @@
 				} else if ($out == PhpGirocode::OUTPUT_BASE64) {
 
-					// $qrCode = array(
-					// 	'title' => 'QR-Code - Schweiz',
-					// 	'hash' => $this->generateBase64QrCode($qrBill),
-					// );
-					// $ret = $qrCode; 
-
-					$ret = $this->generateBase64QrCode($qrBill);
+					// wpsg_debug($qrBill->getViolations());
+
+					$qrCode = array(
+						'title' => 'QR-Rechnung',
+						'hash' => $this->generateBase64QrCode($qrBill),
+						'referenceNumber' => $referenceNumber,
+						'additionalInformation' => $subject,
+						'customerdata' => $kundendaten, 
+						'invoiceAmount' => $betrag
+					);		
+				
+					$ret = $qrCode;
 
 				}
Index: /views/mods/mod_prepayment/mail_html.phtml
===================================================================
--- /views/mods/mod_prepayment/mail_html.phtml	(revision 8340)
+++ /views/mods/mod_prepayment/mail_html.phtml	(revision 8341)
@@ -31,3 +31,3 @@
 		<td style="text-align:right;"><?php echo wpsg_translate(__('#1#', 'wpsg'), $this->view['mod_prepayment']['subject']); ?></td>
 	</tr>
- </table>
+</table>
Index: /views/mods/mod_prepayment/order_done.phtml
===================================================================
--- /views/mods/mod_prepayment/order_done.phtml	(revision 8340)
+++ /views/mods/mod_prepayment/order_done.phtml	(revision 8341)
@@ -8,4 +8,5 @@
     
 ?>
+
 <?php echo wpsg_translate(__('Sie haben die Zahlungsart "Vorkasse" gewÃ€hlt. Ãberweisen Sie daher den Rechnungsbetrag von #1# auf folgendes Konto:', 'wpsg'), wpsg_ff($this->view['basket']['arCalculation']['sum']['topay_brutto'], $this->get_option('wpsg_currency'))); ?>
 <br /><br />
@@ -16,10 +17,7 @@
 <br /><br />
 <?php echo wpsg_translate(__('Bitte als Betreff angeben: "#1#"', 'wpsg'), $this->view['wpsg_mod_prepayment']['subject']); ?>
+<br /><br />
 
 <?php if ( isset($this->view['wpsg_mod_prepayment']['subject']) && ($this->get_option('wpsg_mod_prepayment_qrcode') == true) ) { ?>
-
-	<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'; ?>
@@ -27,5 +25,5 @@
 	<?php if ($this->get_option('wpsg_mod_prepayment_qrcode_country') == '0') { ?>
 		
-		<!-- QR-CODE fÃŒr EPC und SWISS -->
+		<!-- Girocode und QR-Rechnung -->
 
 		<?php 
@@ -33,41 +31,145 @@
 			$img = array();
 			$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'], 10, PhpGirocode::OUTPUT_BASE64, $this->get_option('wpsg_mod_prepayment_qrcode_country'), $this->view['basket']));
+		
+		?>
 
-			echo '<div style="display: flex; justify-content: center; flex; gap: 20px;">';
-			foreach ($img as $i) {
+		<div style="display: flex; justify-content: center; flex-direction: column; gap: 20px;">
+			<?php foreach ($img as $i) { ?>
+				<div class="wpsg_mod_prepayment_info" style="display: flex; gap: 20px; border: 1px solid #000; padding: 20px;">
+					<div class="wpsg_mod_prepayment_info_left" style="display: flex; flex-direction: column;">
+						<h4 style="margin: 0;"><?php echo wpsg_translate(__($i['title'], $wpsg)); ?></h4>
+						<br />
+						<?php echo '<img style="width: 240px; height:240px;" src="data:image/png;base64,'.$i['hash'].'" />'; ?>
+						<br>
+						<div style="display: flex; gap: 25%;">
+							<div style="display: flex; flex-direction: column;">
+								<h4 style="margin: 0;"><?php echo wpsg_translate(__('WÃ€hrung', $wpsg)); ?></h4>
+								<?php echo $this->get_option('wpsg_currency'); ?>
+							</div>
+							<div style="display: flex; flex-direction: column;">
+								<h4 style="margin: 0;"><?php echo wpsg_translate(__('Betrag', $wpsg)); ?></h4>
+								<?php echo sprintf("%.2f", $i['invoiceAmount']); ?>
+							</div>
+						</div>
+					</div>
+					<div class="wpsg_mod_prepayment_info_right" style="display: flex; flex-direction: column;">
+						<h4 style="margin: 0;"><?php echo wpsg_translate(__('Konto / Zahlbar an', $wpsg)); ?></h4>
+						<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_mod_prepayment_iban')); ?><br />
+						<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_mod_prepayment_kinhaber')); ?><br />
+						<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_shopdata_street')); ?><br />
+						<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_shopdata_zip')).' '.$this->replaceUniversalPlatzhalter($this->get_option('wpsg_shopdata_city')); ?><br />
+						<?php if (!empty($i['referenceNumber'])) { ?>
+							<h4 style="margin: 0;"><?php echo wpsg_translate(__('Referenz', $wpsg)); ?></h4>
+							<?php echo $i['referenceNumber']; ?><br />
+						<?php } ?>
+						<h4 style="margin: 0;"><?php echo wpsg_translate(__('ZusÃ€tzliche Informationen', $wpsg)); ?></h4>
+						<?php echo $i['additionalInformation']; ?><br /> 
+						<h4 style="margin: 0;"><?php echo wpsg_translate(__('Zahlbar durch', $wpsg)); ?></h4>
+						<?php echo $i['customerdata']['vname'].' '.$i['customerdata']['name']; ?><br />
+						<?php echo $i['customerdata']['strasse'].' '.$i['customerdata']['nr']; ?><br />
+						<?php echo $i['customerdata']['plz'].' '.$i['customerdata']['ort']; ?><br />
+					</div>
+				</div>
+			<?php } ?>
+		</div>
 
-				echo '<div>';
-					echo '<h4 style="margin-bottom: -15px; font-weight: bold;">'.$i['title'].':'.'<h4>';
-					echo '<div class="order_done_qrcode"><img style="width: 240px; height:240px; border: solid 1px; padding: 25px;" src="data:image/png;base64,'.$i['hash'].'" /></div>';
-				echo '</div>';
 
-			}
-			echo '</div>'
+	<?php } else if ($this->get_option('wpsg_mod_prepayment_qrcode_country') == '1') { ?>
+
+		<!-- Girocode (EPC) -->
+
+		<p>
+			<?php echo __('Wenn Ihre Banking-App Girocode unterstÃŒtzt, kÃ¶nnen Sie diesen QRCode scannen.', 'wpsg'); ?>
+		</p>
+
+		<?php 
+		
+			$img = array();
+			$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'], 10, PhpGirocode::OUTPUT_BASE64, $this->get_option('wpsg_mod_prepayment_qrcode_country'), $this->view['basket']));
 
 		?>
 
-	<?php } else if ($this->get_option('wpsg_mod_prepayment_qrcode_country') == '1') { ?>
-
-		<!-- QR-CODE fÃŒr EPC -->
-
-		<?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'], 10, PhpGirocode::OUTPUT_BASE64, $this->get_option('wpsg_mod_prepayment_qrcode_country')));
-		
-			echo '<img style="width: 320px; height:320px;" src="data:image/png;base64,'.$img.'" />';
-			
-		?>
+		<div class="wpsg_mod_prepayment_girocode" style="display: flex; gap: 20px; border: 1px solid #000; padding: 20px;">
+			<div class="wpsg_mod_prepayment_girocode_left" style="display: flex; flex-direction: column;">
+				<h4 style="margin: 0;"><?php echo wpsg_translate(__($img['title'], $wpsg)); ?></h4>
+				<br />
+				<?php echo '<img style="width: 240px; height:240px;" src="data:image/png;base64,'.$img['hash'].'" />'; ?>
+				<br>
+				<div style="display: flex; gap: 25%;">
+					<div style="display: flex; flex-direction: column;">
+						<h4 style="margin: 0;"><?php echo wpsg_translate(__('WÃ€hrung', $wpsg)); ?></h4>
+						<?php echo $this->get_option('wpsg_currency'); ?>
+					</div>
+					<div style="display: flex; flex-direction: column;">
+						<h4 style="margin: 0;"><?php echo wpsg_translate(__('Betrag', $wpsg)); ?></h4>
+						<?php echo sprintf("%.2f", $img['invoiceAmount']); ?>
+					</div>
+				</div>
+			</div>
+			<div class="wpsg_mod_prepayment_girocode_right" style="display: flex; flex-direction: column;">
+				<h4 style="margin: 0;"><?php echo wpsg_translate(__('Konto / Zahlbar an', $wpsg)); ?></h4>
+				<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_mod_prepayment_iban')); ?><br />
+				<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_mod_prepayment_kinhaber')); ?><br />
+				<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_shopdata_street')); ?><br />
+				<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_shopdata_zip')).' '.$this->replaceUniversalPlatzhalter($this->get_option('wpsg_shopdata_city')); ?><br />
+				<?php if (!empty($img['referenceNumber'])) { ?>
+					<h4 style="margin: 0;"><?php echo wpsg_translate(__('Referenz', $wpsg)); ?></h4>
+					<?php echo $img['referenceNumber']; ?><br />
+				<?php } ?>
+				<h4 style="margin: 0;"><?php echo wpsg_translate(__('ZusÃ€tzliche Informationen', $wpsg)); ?></h4>
+				<?php echo $img['additionalInformation']; ?><br /> 
+				<h4 style="margin: 0;"><?php echo wpsg_translate(__('Zahlbar durch', $wpsg)); ?></h4>
+				<?php echo $img['customerdata']['vname'].' '.$img['customerdata']['name']; ?><br />
+				<?php echo $img['customerdata']['strasse'].' '.$img['customerdata']['nr']; ?><br />
+				<?php echo $img['customerdata']['plz'].' '.$img['customerdata']['ort']; ?><br />
+			</div>
+		</div>
 
 	<?php } else if ($this->get_option('wpsg_mod_prepayment_qrcode_country') == '2') { ?>
 
-		<!-- QR-CODE fÃŒr SWISS -->
+		<!-- QR-Rechnung (SWISS) -->
 
 		<?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'], 10, PhpGirocode::OUTPUT_BASE64, $this->get_option('wpsg_mod_prepayment_qrcode_country'), $this->view['basket']));
+			$img = array();
+			$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'], 10, PhpGirocode::OUTPUT_BASE64, $this->get_option('wpsg_mod_prepayment_qrcode_country'), $this->view['basket'])); 
 		
-			echo '<img style="width: 320px; height:320px;" src="data:image/png;base64,'.$img.'" />';
-			
 		?>
+		
+		<div class="wpsg_mod_prepayment_qrrechnung" style="display: flex; gap: 20px; border: 1px solid #000; padding: 20px;">
+			<div class="wpsg_mod_prepayment_qrrechnung_left" style="display: flex; flex-direction: column;">
+				<h4 style="margin: 0;"><?php echo wpsg_translate(__($img['title'], $wpsg)); ?></h4>
+				<br />
+				<?php echo '<img style="width: 240px; height:240px;" src="data:image/png;base64,'.$img['hash'].'" />'; ?>
+				<br>
+				<div style="display: flex; gap: 25%;">
+					<div style="display: flex; flex-direction: column;">
+						<h4 style="margin: 0;"><?php echo wpsg_translate(__('WÃ€hrung', $wpsg)); ?></h4>
+						<?php echo $this->get_option('wpsg_currency'); ?>
+					</div>
+					<div style="display: flex; flex-direction: column;">
+						<h4 style="margin: 0;"><?php echo wpsg_translate(__('Betrag', $wpsg)); ?></h4>
+						<?php echo sprintf("%.2f", $img['invoiceAmount']); ?>
+					</div>
+				</div>
+			</div>
+			<div class="wpsg_mod_prepayment_qrrechnung_right" style="display: flex; flex-direction: column;">
+				<h4 style="margin: 0;"><?php echo wpsg_translate(__('Konto / Zahlbar an', $wpsg)); ?></h4>
+				<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_mod_prepayment_iban')); ?><br />
+				<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_mod_prepayment_kinhaber')); ?><br />
+				<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_shopdata_street')); ?><br />
+				<?php echo $this->replaceUniversalPlatzhalter($this->get_option('wpsg_shopdata_zip')).' '.$this->replaceUniversalPlatzhalter($this->get_option('wpsg_shopdata_city')); ?><br />
+				<?php if (!empty($img['referenceNumber'])) { ?>
+					<h4 style="margin: 0;"><?php echo wpsg_translate(__('Referenz', $wpsg)); ?></h4>
+					<?php echo $img['referenceNumber']; ?><br />
+				<?php } ?>
+				<h4 style="margin: 0;"><?php echo wpsg_translate(__('ZusÃ€tzliche Informationen', $wpsg)); ?></h4>
+				<?php echo $img['additionalInformation']; ?><br /> 
+				<h4 style="margin: 0;"><?php echo wpsg_translate(__('Zahlbar durch', $wpsg)); ?></h4>
+				<?php echo $img['customerdata']['vname'].' '.$img['customerdata']['name']; ?><br />
+				<?php echo $img['customerdata']['strasse'].' '.$img['customerdata']['nr']; ?><br />
+				<?php echo $img['customerdata']['plz'].' '.$img['customerdata']['ort']; ?><br />
+			</div>
+		</div>
 
 	<?php } ?>
