Index: /classes/M1.class.php
===================================================================
--- /classes/M1.class.php	(revision 8082)
+++ /classes/M1.class.php	(revision 8083)
@@ -32,5 +32,5 @@
             } else {
 
-                if (is_numeric($value) && itnval($testValue) === intval($value)) return true;
+                if (is_numeric($value) && intval($testValue) === intval($value)) return true;
                 else return false;
 
Index: /mods/wpsg_mod_rechnungen.class.php
===================================================================
--- /mods/wpsg_mod_rechnungen.class.php	(revision 8082)
+++ /mods/wpsg_mod_rechnungen.class.php	(revision 8083)
@@ -1572,6 +1572,5 @@
 				if (@$_REQUEST['wpsg_rechnungen_sendmail'] == "1") {
 					
-					//Mail versenden
-					
+					//Mail versenden				
 					/**
 					 * Damit alte Rechnungen noch versÃ€ndet werden
@@ -1824,5 +1823,5 @@
 
 				}
-				
+
 				$this->shop->view['file_path'] = $oInvoice->getFilePath();
 				
@@ -1841,16 +1840,19 @@
 					
 					//Mail versenden
-					
+					$oInvoice = \wpsg\wpsg_invoice::getInstance($r_id);				
+					$oInvoice->setMeta('version', '3');
+					$FilePath = dirname($oInvoice->getFilePath()); 
+
 					/**
 					 * Damit alte Rechnungen noch versendet werden
 					 */
-					if (file_exists($this->getFilePath($order_id).$r_id.'.pdf')) { $file = $this->getFilePath($order_id).$r_id.'.pdf'; }
-					else if (file_exists($this->getFilePath($order_id).$rnr.'.pdf')) { $file = $this->getFilePath($order_id).$rnr.'.pdf'; }
-					else if (file_exists($this->getFilePath($order_id).'R'.$r_id.'.pdf')) { $file = $this->getFilePath($order_id).'R'.$r_id.'.pdf'; }
-					else { $file = $this->getFilePath($order_id).'R'.$rnr.'.pdf'; }  
+					if (file_exists($FilePath.'/'.$r_id.'.pdf')) { $file = $FilePath.'/'.$r_id.'.pdf'; }
+					else if (file_exists($FilePath.'/'.$rnr.'.pdf')) { $file = $FilePath.'/'.$rnr.'.pdf'; }
+					else if (file_exists($FilePath.'/'.'R'.$r_id.'.pdf')) { $file = $FilePath.'/'.'R'.$r_id.'.pdf'; }
+					else { $file = $FilePath.'/'.'R'.$rnr.'.pdf'; }  
  
 					$file = $this->copyTemp($file, $rnr);
 					
-					$mail_text = $this->shop->render(WPSG_PATH_VIEW."/mods/mod_rechnungen/Multi_invoicemail.phtml", false);
+					$mail_text = $this->shop->render(WPSG_PATH_VIEW."/mods/mod_rechnungen/multi_invoicemail.phtml", false);
 
 					if ($this->shop->get_option('wpsg_htmlmail') === '1') { $mail_html = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_rechnungen/multi_invoicemail_html.phtml', false); }
Index: /views/mods/mod_rechnungen/multi_invoice_pdf.phtml
===================================================================
--- /views/mods/mod_rechnungen/multi_invoice_pdf.phtml	(revision 8082)
+++ /views/mods/mod_rechnungen/multi_invoice_pdf.phtml	(revision 8083)
@@ -136,5 +136,5 @@
 
             // Datum
-            $pdf->Text($rdata_left + 75, $rdata_top, __("Datum", "wpsg"));
+            $pdf->Text($rdata_left + 75, $rdata_top, __("Rechnungsdatum", "wpsg"));
 			$pdf->Text($rdata_left + 75, $rdata_top + 6, $shop->view['rDatum']);
 
@@ -145,4 +145,6 @@
 				$pdf->Text($adress_left, $rdata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg"));
 				
+                $offset += 11.5;
+
 			}
 
@@ -169,9 +171,4 @@
 	}
 
-    // wpsg_debug($this->view['basket']); // DEBUG
-    // wpsg_debug($this->view['kunde']); // DEBUG
-    // wpsg_debug($this->view['data']); // DEBUG
-    // wpsg_debug($this->view['multi_data']['orders']); // DEBUG
-
     $pdf = new wpsg_fpdf();
     $pdf->SetAutoPageBreak(false, 5);
@@ -193,7 +190,12 @@
     $sum_multi_offset = 0;
     $orders = $this->view['multi_data']['orders']; 
-     	
+
 	// noMwSt
-	$bNoTax = false;
+    $head_data = array_values($this->view['multi_data']['order_data'])[0];
+    if ($this->view['kunde']['ustidnr'] != "" && $head_data['oCalculation']->getTaxMode() === '3' && $shop->view['oOrder']->isInnerEu()) {
+        $bNoTax = true;
+    } else {
+	    $bNoTax = false;
+    }
 	
 	$bTaxCol = false;
@@ -225,7 +227,11 @@
         $pdf->SetFont('Arial', '', 9);
 
+        // Bestelltag anzeigen
+        $pdf->Text($rhead_left + 85, $rhead_top + $sum_multi_offset, __("Bestelldatum", "wpsg"));
+        $pdf->Text($rhead_left + 85, $rhead_top + $sum_multi_offset + 6, date("d.m.Y", strtotime($oOrder->cdate)));
+
         // Zahlungsbedingung anzeigen
-        $pdf->Text($rhead_left + 100, $rhead_top + $sum_multi_offset, __("Zahlungsbedingungen", "wpsg"));
-        $pdf->Text($rhead_left + 100, $rhead_top + $sum_multi_offset + 6, $oOrder->getPaymentLabel());
+        $pdf->Text($rhead_left + 115, $rhead_top + $sum_multi_offset, __("Zahlungsbedingungen", "wpsg"));
+        $pdf->Text($rhead_left + 115, $rhead_top + $sum_multi_offset + 6, $oOrder->getPaymentLabel());
          
         // Bestellnummer anzeigen
@@ -285,14 +291,14 @@
             }
             
-            if ($this->get_option('wpsg_rechnungen_pdetailname' == '1')) {
+            if ($this->get_option('wpsg_rechnungen_pdetailname') == '1') {
 
                 $produkt_text = $this->getProductName($product_id, true);
 
             } else {
-
+                
                 $produkt_text = $this->getProductName($product_id, false);
 
             }
-
+            
             $produktBeschreibung = trim(strip_tags($oOrderProduct->getProduct()->getShortDescription()));
             
@@ -323,7 +329,11 @@
                     foreach ($arPV as $pv) {
                         
-                        $produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
-                        $height += 5;
+                        if ($pv['value'] != '') {
+
+                            $produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
+                            $height += 5;
                         
+                        }
+
                     }
                     
@@ -371,5 +381,5 @@
              */
             $pBeschreibungHeight = 0;
-            if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($p['beschreibung'])) != '') {
+            if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($oOrderProduct->getShortDescription())) != '') {
                 
                 $produktBeschreibung = nl2br($produktBeschreibung);
@@ -396,5 +406,5 @@
             if ($this->get_option('wpsg_rechnungen_produktattribute') == '1') {
                 
-                $attributeInfo = $this->callMod('wpsg_mod_produktattribute', 'getProductAttributeByProductId', array($this->getProduktId($p['id'])));
+                $attributeInfo = $this->callMod('wpsg_mod_produktattribute', 'getProductAttributeByProductId', array($this->getProduktId($oOrderProduct->getId())));
                 
                 foreach ($attributeInfo as $pa) {
@@ -409,7 +419,7 @@
              * Variante ?
              */
-            if (preg_match('/pv_(.*)/', $p['productkey'])) {
-                
-                $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey']));
+            if (preg_match('/pv_(.*)/', $oOrderProduct->getProductKey())) {
+                
+                $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($oOrderProduct->getProductKey()));
                 
                 $height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5 + $sum_multi_offset, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width);
@@ -524,5 +534,5 @@
                 if ($bNoTax) {
                     
-                    $mwst = 0;
+                    $mwst = wpsg_ff('0.00', '%');
                     
                 } else { 
@@ -575,5 +585,5 @@
                 if ($bNoTax) {
 					
-                    $mwst = 0;
+                    $mwst = wpsg_ff('0.00', '%');
 					
                 } else {
@@ -680,5 +690,5 @@
                 if ($bNoTax) {
 					
-                    $mwst = 0;
+                    $mwst = wpsg_ff('0.00', '%');
 					
                 } else {                    
@@ -759,10 +769,10 @@
 			
 			$pdf->Text($prod_left, $prod_top + $offset + 10, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
-			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("BRUTTOBETRAG", "wpsg"));
+			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("BRUTTOBETRAG GESAMT", "wpsg"));
 			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
 			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 			$offset += 5;
 			
-			$pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
+			$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. GESAMT", "wpsg"));
 			$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
 			$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -776,19 +786,16 @@
 			$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 			
-			if (sizeof($arCalculation['tax']) >= 1) {
-				
-				foreach ($arCalculation['tax'] as $k => $mw) {
+			// if (sizeof($arCalculation['tax']) >= 1) {
+			// 	foreach ($arCalculation['tax'] as $k => $mw) {
+			// 		if ($k === 0) continue;					
 					
-					if ($k === 0) continue;					
+			// 		$offset += 5;
 					
-					$offset += 5;
+			// 		$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. ", "wpsg").wpsg_ff($mw['tax_value'], '%'));
+			// 		$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
+			// 		$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 					
-					$pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. ", "wpsg").wpsg_ff($mw['tax_value'], '%'));
-					$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
-					$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-					
-				}
-				
-			}
+			// 	}
+			// }
 			
 			if (sizeof($arCalculation['tax']) > 1) {
Index: /views/mods/mod_rechnungen/multi_invoicemail.phtml
===================================================================
--- /views/mods/mod_rechnungen/multi_invoicemail.phtml	(revision 8082)
+++ /views/mods/mod_rechnungen/multi_invoicemail.phtml	(revision 8083)
@@ -0,0 +1,27 @@
+<?php 
+
+	/**
+	 * Template fÃŒr die Mail, die beim Schreiben einer Rechnung optional an den Kunden versendet werden kann
+	 */
+
+    $arPflicht = $this->loadPflichtFeldDaten();
+    $arTitle = explode('|', $arPflicht['anrede_auswahl']);
+    
+    foreach ($this->view['multi_data']['order_data'] as $order_data) { 
+		
+		$oOrder = $order_data['oOrder'];
+		$str['onr'][] = intval($oOrder->getNr()); 
+	
+	}
+
+    //wpsg_debug($this->view);
+
+?><?php echo wpsg_translate(__('Hallo #1# #2# #3#,', 'wpsg'), @$arTitle[$this->view['kunde']['title']], $this->view['kunde']['vname'], $this->view['kunde']['name']); ?>
+ 
+		
+<?php echo __("Sie erhalten hiermit Ihre Sammelrechnung in HÃ¶he von", "wpsg"); ?> <?php echo wpsg_ff($this->view['arCalculationSum']['sum']['topay_brutto'], $this->get_option('wpsg_currency')); ?> <?php echo __("fÃŒr Ihre Bestellungen mit den Bestellnummern:", "wpsg"); ?> <?php  echo implode(',', $str['onr']); ?>.
+<?php $this->callMods('wpsg_mod_rechnungen_mail'); ?>
+ 
+<?php echo __("Mit freundlichen GrÃŒÃen", "wpsg"); ?>
+ 
+<?php echo __($this->get_option('wpsg_shopdata_name'), 'wpsg'); ?> - <?php echo __('Team', 'wpsg'); ?>
Index: /views/mods/mod_rechnungen/multi_invoicemail_html.phtml
===================================================================
--- /views/mods/mod_rechnungen/multi_invoicemail_html.phtml	(revision 8082)
+++ /views/mods/mod_rechnungen/multi_invoicemail_html.phtml	(revision 8083)
@@ -0,0 +1,29 @@
+<?php 
+
+	/**
+	 * Template fÃŒr die Mail, die beim Schreiben einer Rechnung optional an den Kunden versendet werden kann (HTML)
+	 */
+
+	include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
+
+	/* Wichtig, da die Module sonst kein HTML zurÃŒckgeben */
+	$this->htmlMail = true;
+
+	foreach ($this->view['multi_data']['order_data'] as $order_data) { 
+		
+		$oOrder = $order_data['oOrder'];
+		$str['onr'][] = intval($oOrder->getNr()); 
+	
+	}
+
+	//wpsg_debug($this->view);
+
+?><p><?php echo __("Hallo", "wpsg"); ?> <?php echo $this->view['kunde']['vname']; ?> <?php echo $this->view['kunde']['name']; ?>,</p>
+		
+<p><?php echo __("Sie erhalten hiermit die Sammelrechnung in HÃ¶he von", "wpsg"); ?> <?php echo wpsg_ff($this->view['arCalculationSum']['sum']['topay_brutto'], $this->get_option('wpsg_currency')); ?> <?php echo __("fÃŒr Ihre Bestellungen mit den Bestellnummern:", "wpsg"); ?> <?php echo implode(',', $str['onr']); ?>.</p>
+
+<?php $this->callMods('wpsg_mod_rechnungen_mail'); ?>
+ 
+<p><?php echo __("Mit freundlichen GrÃŒÃen", "wpsg"); ?></p>
+ 
+<p><?php echo __($this->get_option('wpsg_shopdata_name'), 'wpsg'); ?> - <?php echo __('Team', 'wpsg'); ?></p>
Index: /views/order/index.phtml
===================================================================
--- /views/order/index.phtml	(revision 8082)
+++ /views/order/index.phtml	(revision 8083)
@@ -482,8 +482,10 @@
 
                     <div style="width: 100%; padding: 1rem; display: grid; row-gap: 0.5rem; column-gap: 0.5rem; grid-template-columns: 25px 1fr 150px; align-items: center; grid-auto-rows: 30px; padding-bottom: 0.5rem;" >
+                        
+                        <?php $oCustomer = wpsg_customer::getInstance(intval($this->view['arFilter']['k_id'])); ?>
 
                         <input type="checkbox" name="wpsg_Multirechnung_sendmail" value="1" id="invoice_sendmail" />
                         <label for="invoice_sendmail"><?php echo __('E-Mail an Kunden senden', 'wpsg'); ?></label>
-                        <input type="email" name="wpsg_Multirechnung_email" value="" />
+                        <input type="email" name="wpsg_Multirechnung_email" value="<?php echo $oCustomer->getEmail();  ?>" />
                     
                         <input type="checkbox" name="wpsg_Multirechnung_faelligkeit" value="1" id="invoice_faelligkeit" />
