Index: /controller/wpsg_OrderController.class.php
===================================================================
--- /controller/wpsg_OrderController.class.php	(revision 8267)
+++ /controller/wpsg_OrderController.class.php	(revision 8268)
@@ -1635,31 +1635,32 @@
 						// Sortieren nach CDDATE
 						$arIDs_write = $this->db->fetchAssocField("SELECT `id` FROM `".WPSG_TBL_ORDER."` WHERE `id` IN (".wpsg_q(implode(',', array_keys($_REQUEST['wpsg_multido']))).") ORDER BY `cdate` ASC");
-
+			
 						// Rechnung fÃŒr mehrere Bestellungen schreiben
-						foreach ($arIDs_write as $k)
-						{
-
-							// Damit alle Produkte der Bestellung ausgewÃ€hlt werden
-							if(!isset($_REQUEST['invoice_products'])) {
-
-								$db_invoice_products = $this->db->fetchAssoc("
-									SELECT
-										*
-									FROM
-										`".WPSG_TBL_ORDERPRODUCT."` 
-									WHERE
-										`o_id` = '".wpsg_q($k)."'
-								");
-				
-								foreach ($db_invoice_products as $p) {
-									$v[$p['id']] = [
-											'set' => '1',
-											'amount' => $p['menge']
-										];
-								}
-				
-								$_REQUEST['invoice_products'] = $v;
-
+						for ($i = 0; $i < count($arIDs_write); $i++) {
+
+							$k = $arIDs_write[$i];
+							
+							$invoice_products = array();
+
+							// If the invoice products array has not been set yet, retrieve the products for the current order and add them to the array
+							$db_invoice_products = $this->db->fetchAssoc("
+								SELECT
+									*
+								FROM
+									`".WPSG_TBL_ORDERPRODUCT."` 
+								WHERE
+									`o_id` = '".wpsg_q($k)."'
+							");
+
+							foreach ($db_invoice_products as $p) {
+
+								$invoice_products[$p['id']] = [
+									'set' => '1',
+									'amount' => $p['menge']
+								];
 							}
+
+							// Set the invoice products array in the request
+							$_REQUEST['invoice_products'] = $invoice_products;
 
 							$bRechnungExists = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_RECHNUNGEN."` WHERE `rnr` != '' AND `o_id` = '".wpsg_q($k)."' AND `storno` = '0000-00-00 00:00:00'");
@@ -1701,5 +1702,5 @@
                             $this->addBackendMessage(
 								'nohspc_'.wpsg_translate(__('#1# Rechnungen geschrieben', 'wpsg'), $nWriteRechnung)
-								.' <a href="'.WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&noheader=1&wpsg_action=showRechnung&ids='.implode('_', $arIDs).'" target="_new">'.__('Download', 'wpsg').'</a>'
+								//.' <a href="'.WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&noheader=1&wpsg_action=showRechnung&ids='.implode('_', $arIDs).'" target="_new">'.__('Download', 'wpsg').'</a>'
 							);
 
