Index: /mods/wpsg_mod_rechnungen.class.php
===================================================================
--- /mods/wpsg_mod_rechnungen.class.php	(revision 8531)
+++ /mods/wpsg_mod_rechnungen.class.php	(revision 8532)
@@ -300,4 +300,36 @@
 				$this->order_ajax();
 
+			}
+			else if (($_REQUEST['do']??'') === 'rebuildInvoice') {
+				
+				$arInvoiceID = $this->db->fetchAssocField("SELECT `id` FROM `".WPSG_TBL_RECHNUNGEN."`");
+				$nCorrect = 0;
+				
+				foreach ($arInvoiceID as $invoice_id) {
+					
+					$oInvoice = \wpsg\wpsg_invoice::getInstance(intval($invoice_id));
+					$invoice_path = $oInvoice->getFilePath(true);
+										
+					if (!file_exists($invoice_path)) {
+						
+						$this->writeRechnung(
+							intval($oInvoice->getOrder()->getId()),
+							false,
+							false,
+							$oInvoice
+						);
+						
+						if (file_exists($invoice_path)) $nCorrect ++;
+						else $this->shop->addBackendError(wpsg_translate(__('Rechnung #1# konnte nicht erneuert werden.', 'wpsg'), $oInvoice->getNr().' (ID:'.$oInvoice->getId().')'));
+						
+					}
+					
+				}
+				
+				if ($nCorrect > 0) $this->shop->addBackendMessage(wpsg_translate(__('#1# Rechnungen wurden erfolgreich erneuert.', 'wpsg'), $nCorrect));
+				else $this->shop->addBackendError(wpsg_translate(__('Es wurden keine Rechnungen erneuert.', 'wpsg')));
+				
+				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_rechnungen'); exit;
+				
 			}
 			
@@ -2216,26 +2248,10 @@
 			
 			if (!file_exists($file_path)) {
-				
-				// Versuch Neu-Generierung
-				
-				$this->shop->view['rebuild'] = false;
-				$this->writeRechnung(
-					intval($oInvoice->getOrder()->getId()),
-					false,
-					true,
-					$oInvoice
+			
+				throw new \Exception(
+					wpsg_translate(
+						__('Rechnung #1# existiert nicht im Dateisystem.', 'wpsg'), $oInvoice->getNr()
+					)
 				);
-				
-				// $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_rechnungen/invoice_pdf.phtml');
-				
-				if (!file_exists($file_path)) {
-				
-					throw new \Exception(
-						wpsg_translate(
-							__('Rechnung #1# existiert nicht im Dateisystem und konnte nicht erneuert werden.', 'wpsg'), $oInvoice->getNr()
-						)
-					);
-				
-				}
 				
 			}
Index: /views/mods/mod_rechnungen/settings_edit.phtml
===================================================================
--- /views/mods/mod_rechnungen/settings_edit.phtml	(revision 8531)
+++ /views/mods/mod_rechnungen/settings_edit.phtml	(revision 8532)
@@ -286,4 +286,8 @@
 			<?php echo wpsg_drawForm_TextEnd(__('MÃ¶gliche Platzhalter fÃŒr Rechnungen und Rechnungskorrektur', 'wpsg'), array('noP' => true)); ?>
 
+			<?php echo wpsg_drawForm_TextStart(); ?>
+			<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_rechnungen&do=rebuildInvoice&noheader=1" class="button primary" onclick="return confirm('Sind Sie sich sicher? Dies ist eine Admin Funktion und sollte nur mit bedacht ausgefÃŒhrt werden. Vorher Backup machen!')">Fehlende Rechnungen mit Rechnunsdaten nachbauen.</a>
+			<?php echo wpsg_drawForm_TextEnd('Funktionen'); ?>
+			
 		</div>
 	</div>
