Index: /controller/wpsg_OrderController.class.php
===================================================================
--- /controller/wpsg_OrderController.class.php	(revision 8071)
+++ /controller/wpsg_OrderController.class.php	(revision 8072)
@@ -1715,5 +1715,9 @@
 						foreach ($arIDs as $k) {
 
-							$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'");
+							$bRechnungExists = $this->db->fetchOne("SELECT COUNT(*) FROM `".WPSG_TBL_RECHNUNGEN."` WHERE `rnr` != '' AND (
+								`o_id` = '".wpsg_q($k)."' OR
+								 FIND_IN_SET('".intval($k)."', `o_ids`)
+							) AND `storno` = '0000-00-00 00:00:00'
+							");
 
 							// E-Mail aus Bestellung
Index: /mods/wpsg_mod_rechnungen.class.php
===================================================================
--- /mods/wpsg_mod_rechnungen.class.php	(revision 8071)
+++ /mods/wpsg_mod_rechnungen.class.php	(revision 8072)
@@ -488,5 +488,5 @@
 				$rechnung = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_RECHNUNGEN."` WHERE `id` = '".wpsg_q($_REQUEST['r_id'])."'");
 				
-				if ($rechnung['id'] != $_REQUEST['r_id'] || $_REQUEST['edit_id'] != $rechnung['o_id']) die(__("Rechnung existiert nicht oder passt nicht zur Bestellung!", "wpsg"));
+				if ($rechnung['id'] != $_REQUEST['r_id'] || ($_REQUEST['edit_id'] != $rechnung['o_id'] && !in_array($_REQUEST['edit_id'], explode(',', $rechnung['o_ids'])))) die(__("Rechnung existiert nicht oder passt nicht zur Bestellung!", "wpsg"));
 				
 				$this->shop->view['order'] = $this->shop->cache->loadOrder($rechnung['o_id']); 
@@ -531,6 +531,5 @@
 						
 					}
-					
-					
+					  
 					$strTitle = wpsg_translate(__('Zusendung einer Kopie fÃŒr Rechnungskorrektur #1# an #2#', 'wpsg'), $rechnung['gnr'], $email);
 					$this->shop->view['gnr'] = $rechnung['gnr'];
@@ -577,4 +576,12 @@
 					
 				}
+				
+				$oInvoice = \wpsg\wpsg_invoice::getInstance(intval($_REQUEST['r_id']));
+				
+				if ($oInvoice->isMultiInvoice()) {
+
+					$rn_file = $oInvoice->getFilePath();
+				
+				} 
 				
 				if (!file_exists($rn_file)) die(__("Die Originalrechnung existiert nicht im Dateisystem.", 'wpsg'));
@@ -1675,4 +1682,5 @@
 			$arCalculationSum = [
 				'tax' => [],
+				'coupon' => [],
 				'sum' => [
 					'netto' => 0,
@@ -1715,9 +1723,11 @@
 						
 					}
-					
+										
 				}
 				
 				$arCalculation = $oCalculation->getCalculationArray();
 				
+				foreach ($arCalculation['coupon'] as $c) $arCalculationSum['coupon'][] = $c;
+								
 				$this->shop->view['multi_data']['order_data'][$o_id] = [
 					'oCalculation' => $oCalculation,
@@ -1795,4 +1805,24 @@
 				$oInvoice = \wpsg\wpsg_invoice::getInstance($r_id);				
 				$oInvoice->setMeta('version', '3');
+				
+				foreach ($order_ids as $o_id) {
+
+					$oOrder = wpsg_order::getInstance($o_id);
+					
+					foreach ($oOrder->getOrderProducts() as $oOrderProduct) {
+						
+						$invoice_data = json_decode($oOrderProduct->getMeta('wpsg_mod_rechnungen_data', false, 'null'), true);
+						if (!is_array($invoice_data)) $invoice_data = [];
+						
+						$invoice_data[] = [						
+							'amount' => $oOrderProduct->getAmount(),
+							'invoice_id' => $oInvoice->getId()
+						];
+						
+						$oOrderProduct->setMeta('wpsg_mod_rechnungen_data', json_encode($invoice_data));
+						
+					}
+
+				}
 				
 				$this->shop->view['file_path'] = $oInvoice->getFilePath();
Index: /views/mods/mod_rechnungen/multi_invoice_pdf.phtml
===================================================================
--- /views/mods/mod_rechnungen/multi_invoice_pdf.phtml	(revision 8071)
+++ /views/mods/mod_rechnungen/multi_invoice_pdf.phtml	(revision 8072)
@@ -613,5 +613,5 @@
 			
 			$pdf->setXY($prod_left + 97, $prod_top + $offset + $sum_multi_offset);
-            $pdf->Cell(15, 8, _('Anteilig'), 1, 0, 'C');
+            $pdf->Cell(15, 8, _('anteilig'), 1, 0, 'C');
 			
 			$pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
@@ -627,4 +627,30 @@
 			
 	    }
+		
+		// Wertgutschein
+		foreach ($arCalculation['coupon'] as $c) {
+			  
+			$pdf->SetFont('Arial', '', 9);
+            $pdf->setXY($prod_left, $prod_top + $offset + $sum_multi_offset);
+            $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
+			
+			$pdf->setXY($prod_left + 10, $prod_top + $offset + $sum_multi_offset);
+            $pdf->Cell( (($bTaxCol)?87:102), 8, _('Wertgutschein').' ('.$c['code'].')', 1, 0, 'L');
+			
+			$pdf->setXY($prod_left + 97, $prod_top + $offset + $sum_multi_offset);
+            $pdf->Cell(15, 8, _('anteilig'), 1, 0, 'C');
+			
+			$pdf->setXY($prod_left + 112, $prod_top + $offset + $sum_multi_offset);
+            $pdf->Cell(15, 8, $c['amount'], 1, 0, 'C');
+			
+			$pdf->setXY($prod_left + 127, $prod_top + $offset + $sum_multi_offset);
+            $pdf->Cell(25, 8, wpsg_ff($c[$taxdisplay.'_single'], $this->get_option('wpsg_currency')), 1, 0, 'R');
+            
+            $pdf->setXY($prod_left + 152, $prod_top + $offset + $sum_multi_offset);
+            $pdf->Cell(25, 8, wpsg_ff($c[$taxdisplay], $this->get_option('wpsg_currency')), 1, 0, 'R');
+			
+			$offset += 8; 
+			
+		}
 		
         // GebÃŒhr
@@ -671,5 +697,5 @@
 
         }
-
+		
         // Bestellbetrag einer einzelnen Bestellung
         if ($bNoTax) {
@@ -677,5 +703,5 @@
             $pdf->Text($prod_left + 115, $prod_top + $offset + $sum_multi_offset + 6, __("Bestellbetrag (NETTO):", "wpsg"));
 			$pdf->setXY($prod_left + 140, $prod_top + $offset + $sum_multi_offset + 1);
-			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['topay_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 			
         } else  {
@@ -683,5 +709,5 @@
             $pdf->Text($prod_left + 115, $prod_top + $offset + $sum_multi_offset + 6, __("Bestellbetrag (BRUTTO):", "wpsg"));
 			$pdf->setXY($prod_left + 140, $prod_top + $offset + $sum_multi_offset + 1);
-			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['topay_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 			
         }
