Index: /controller/wpsg_OrderController.class.php
===================================================================
--- /controller/wpsg_OrderController.class.php	(revision 8166)
+++ /controller/wpsg_OrderController.class.php	(revision 8167)
@@ -1103,6 +1103,4 @@
 		    	$oBasket = new wpsg_basket();
 		    	$oBasket->initFromDB($_REQUEST['edit_id']);
-		    	
-		    	//die(wpsg_debug($oBasket->toArray()));
 		    	
 		    	$oBasket->sendOrderSaveMails($_REQUEST['edit_id'], $oBasket->toArray(), true, false, false);
@@ -1527,4 +1525,5 @@
 
 						$rnr_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_RECHNUNGEN."` WHERE `rnr` != '' AND `storno` = '0000-00-00 00:00:00' AND `o_id` = '".wpsg_q($o_id)."' ORDER BY `id` DESC");
+
 						$rnr = $rnr_db['rnr'];
 
@@ -1864,5 +1863,4 @@
 			}
 
-
 			foreach ($this->shop->arStatus as $status_key => $status_label) {
 
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 8166)
+++ /controller/wpsg_ShopController.class.php	(revision 8167)
@@ -1181,5 +1181,5 @@
 					$b = call_user_func_array(array($m, $func_name), $arParam);
 
-					if ($b === -1) break;
+					if ($b === -1) break; 
 					else if ($b === -2) {
 					
Index: /lib/wpsg_calculation.class.php
===================================================================
--- /lib/wpsg_calculation.class.php	(revision 8166)
+++ /lib/wpsg_calculation.class.php	(revision 8167)
@@ -209,9 +209,14 @@
 			
 			foreach ($this->arCalculationRow as $cr_key => $cr) { 
-				
+
+				// wenn Gutschein
 				if ($cr['type'] === 'voucher') {
 
-					$arVoucher[] = $cr;
-					
+					// true wenn Gutschein in %
+					// if ( strpos($cr['set'], '%')  !== false ) wpsg_debug('Proz. Gutschein');
+					// else 
+					
+					$arVoucher[] = $cr; // Inahlt else diese zeile
+
 				}
 
@@ -574,4 +579,7 @@
 							$set_brutto = $brutto_scope / 100 * wpsg_tf($set);
 
+							// wpsg_debug($set_netto); // DEBUG
+							// wpsg_debug($set_brutto); // DEBUG
+
 							if ($this->shop->getBackendTaxview() === WPSG_NETTO) {
 								
@@ -583,4 +591,6 @@
 								
 							}
+
+							// die('cut_calc'); // DEBUG
 							
 						} else {
Index: /model/wpsg_order.class.php
===================================================================
--- /model/wpsg_order.class.php	(revision 8166)
+++ /model/wpsg_order.class.php	(revision 8167)
@@ -245,6 +245,4 @@
 		public function getAmount($brutto_netto = WPSG_BRUTTO)
 		{
-						
-			//wpsg_debug($this->data['price_gesamt_netto'].":".$this->data['price_gesamt_brutto']);
 			
 			if ($brutto_netto == WPSG_BRUTTO)
@@ -287,8 +285,4 @@
 		public function getProductAmount($brutto_netto = WPSG_BRUTTO)
 		{
-				
-			//wpsg_debug($this->getAmount($brutto_netto));
-			//wpsg_debug($this->getShippingAmount($brutto_netto));
-			//wpsg_debug($this->getPaymentAmount($brutto_netto));
 			
 			return $this->getAmount($brutto_netto) - $this->getShippingAmount($brutto_netto) - $this->getPaymentAmount($brutto_netto); 
@@ -1063,5 +1057,5 @@
 		public function delete()
 		{
-			
+
 			// Module aufrufen, damit sie die AbhÃ€ngigkeiten lÃ¶schen kÃ¶nnen
 			$this->shop->callMods('delOrder', array($this->getId()));
@@ -1320,5 +1314,5 @@
 			if ($bJoinProducts === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_PRODUCTS."` AS P ON (OP.`p_id` = P.`id`) ";
 			if ($bJoinCustomer === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_KU."` AS C ON (C.`id` = O.`k_id`) ";
-			if ($bJoinInvoice === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_RECHNUNGEN."` AS I ON (I.`o_id` =  O.`id` AND I.`storno` = '0000-00-00 00:00:00' AND I.`rnr` != '') ";
+			if ($bJoinInvoice === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_RECHNUNGEN."` AS I ON ( ( FIND_IN_SET(O.`id`, I.`o_ids`) AND I.`storno` = '0000-00-00 00:00:00' AND I.`rnr` != '' ) OR ( I.`o_id` =  O.`id` AND I.`storno` = '0000-00-00 00:00:00' AND I.`rnr` != '' ) ) ";
 			if ($bJoinOrderAdress === true) $strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_ADRESS."` AS OA ON (OA.`id` = O.`adress_id`) ";
 			
Index: /mods/wpsg_mod_kundenverwaltung.class.php
===================================================================
--- /mods/wpsg_mod_kundenverwaltung.class.php	(revision 8166)
+++ /mods/wpsg_mod_kundenverwaltung.class.php	(revision 8167)
@@ -93,4 +93,5 @@
 			$this->shop->checkDefault('wpsg_mod_kundenverwaltung_loginZwang', '1');
 			$this->shop->checkDefault('wpsg_page_mod_kundenverwaltung_status', '1');
+			$this->shop->checkDefault('wpsg_mod_kundenverwaltung_mathcaptcha', '1');
 
             $this->db->UpdateQuery(WPSG_TBL_KU, ['last_login' => 'NOW()'], " `last_login` = '0000-00-00 00:00:00' ");
Index: /mods/wpsg_mod_productvars.class.php
===================================================================
--- /mods/wpsg_mod_productvars.class.php	(revision 8166)
+++ /mods/wpsg_mod_productvars.class.php	(revision 8167)
@@ -745,5 +745,4 @@
 			$arPVars = @unserialize($order_data['pvars']);
 			$arPVars = wpsg_getArray($arPVars[$product_index]);
-
 			$arReturn = array();
 
Index: /mods/wpsg_mod_rechnungen.class.php
===================================================================
--- /mods/wpsg_mod_rechnungen.class.php	(revision 8166)
+++ /mods/wpsg_mod_rechnungen.class.php	(revision 8167)
@@ -79,4 +79,5 @@
 
 			$this->shop->checkDefault('wpsg_rechnungen_pdetailname', '1');
+			$this->shop->checkDefault('wpsg_rechnungen_deliverynote', '1');
 		   	
 		} // public function install()
@@ -87,7 +88,7 @@
 			// Rechnungen in der Datenbank lÃ¶schen
 			$this->db->Query("DELETE FROM `".WPSG_TBL_RECHNUNGEN."` WHERE `o_id` = '".wpsg_q($order_id)."'");
-			
+
 			// Rechnungen im Dateisystem lÃ¶schen
-			$path = $this->FilePath($order_id); wpsg_rrmdir($path);
+			$path = $this->getFilePath($order_id); wpsg_rrmdir($path);
 			
 		} // public function delOrder($order_id)
@@ -301,4 +302,5 @@
 			$this->shop->update_option("wpsg_rechnungen_pbeschreibung", $_REQUEST['wpsg_rechnungen_pbeschreibung'], false, false, WPSG_SANITIZE_CHECKBOX);
 			$this->shop->update_option("wpsg_rechnungen_produktattribute", $_REQUEST['wpsg_rechnungen_produktattribute'], false, false, WPSG_SANITIZE_CHECKBOX, ['allowEmpty' => true]);
+			$this->shop->update_option("wpsg_rechnungen_deliverynote", $_REQUEST['wpsg_rechnungen_deliverynote'], false, false, WPSG_SANITIZE_CHECKBOX, ['allowEmpty' => true]);
 			$this->shop->update_option("wpsg_mod_rechnungen_showgutschriftrechnung", $_REQUEST['wpsg_mod_rechnungen_showgutschriftrechnung'], false, false, WPSG_SANITIZE_CHECKBOX);
 			$this->shop->update_option('wpsg_mod_rechnungen_anr', $_REQUEST['wpsg_mod_rechnungen_anr'], false, false, WPSG_SANITIZE_INT);
@@ -471,5 +473,5 @@
 				if (file_exists($this->getFilePath('').'wpsg_rechnungen_bp.jpg')) {
 					
-					wpsg_header::IMG($this->getFilePath('', false).'wpsg_rechnungen_bp.jpg');
+					(new wpsg_header)->IMG($this->getFilePath('', false).'wpsg_rechnungen_bp.jpg');
 					
 				} else if (file_exists($this->getFilePath('').'wpsg_rechnungen_bp.pdf')) {
@@ -485,5 +487,5 @@
 				if (file_exists($this->getFilePath('').'wpsg_rechnungen_logo.jpg')) {
 					
-					wpsg_header::IMG($this->getFilePath('', false).'wpsg_rechnungen_logo.jpg');
+					(new wpsg_header)->IMG($this->getFilePath('', false).'wpsg_rechnungen_logo.jpg');
 					
 				} else throw new \Exception('Kein Logo definiert.');
Index: /views/mods/mod_kundenverwaltung/settings_edit.phtml
===================================================================
--- /views/mods/mod_kundenverwaltung/settings_edit.phtml	(revision 8166)
+++ /views/mods/mod_kundenverwaltung/settings_edit.phtml	(revision 8167)
@@ -71,5 +71,5 @@
 </div>
 
-<?php echo wpsg_drawForm_Checkbox('wpsg_mod_kundenverwaltung_recaptcha_register', __('reCaptcha V2 fÃŒr Registrierung', 'wpsg'), $this->get_option('wpsg_mod_kundenverwaltung_recaptcha_register')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_kundenverwaltung_recaptcha_register', __('reCaptcha V2 fÃŒr Registrierung', 'wpsg'), $this->get_option('wpsg_mod_kundenverwaltung_recaptcha_register'), array('help' => 'wpsg_mod_kundenverwaltung_recaptcha_register')); ?>
 <div id="wpsg_mod_kundenverwaltung_register_recaptcha_layer" style="display:none;">
     
Index: /views/mods/mod_rechnungen/invoice_pdf.phtml
===================================================================
--- /views/mods/mod_rechnungen/invoice_pdf.phtml	(revision 8166)
+++ /views/mods/mod_rechnungen/invoice_pdf.phtml	(revision 8167)
@@ -53,5 +53,5 @@
 			
 			$pdf->AddPage();
-			
+
 			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf")) {
 				
@@ -65,6 +65,5 @@
 				
 			}
-			
-			
+
 			if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg"))
 			{
@@ -128,5 +127,5 @@
 				
 				$pdf->Text($rdata_left + 35, $rdata_top, __("FÃ€llig am", "wpsg"));
-				$pdf->Text($rdata_left + 35, $rdata_top + 6, $shop->view['faelligkeitdatum']);
+				$pdf->Text($rdata_left + 35, $rdata_top + 6, date("d.m.Y", strtotime($shop->view['faelligkeitdatum'])));
 				
 			}
@@ -147,5 +146,5 @@
 			
 			$pdf->Text($rdata_left + 155, $rdata_top, __("Datum", "wpsg"));
-			$pdf->Text($rdata_left + 155, $rdata_top + 6, $shop->view['rDatum']);
+			$pdf->Text($rdata_left + 155, $rdata_top + 6, date("d.m.Y", strtotime($shop->view['rDatum'])));
 			
 			if ($shop->view['oOrder']->isInnerEu())
@@ -183,6 +182,6 @@
 	AddRechnungPage($this, $pdf);
 
-    if ( ( ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_B2B) && ($this->view['oOrder']->isInnerEu()) )
-		|| ( $this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS ) 
+    if ( ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_B2B && $this->view['oOrder']->isInnerEu()) 
+		|| ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) 
 	) {
         $bNoTax = true;
@@ -195,4 +194,19 @@
 	else if (!$bNoTax) $bTaxCol = true;
 
+	
+	if ($bNoTax) {
+
+		$discount_value = $this->view['basket']['arCalculation']['sum']['discount_netto'];
+		$shipping_cost = $this->view['basket']['arCalculation']['sum']['shipping_netto'];
+		$payment_cost = $this->view['basket']['arCalculation']['sum']['payment_netto'];
+
+	} else {
+
+		$discount_value = $this->view['basket']['arCalculation']['sum']['discount_brutto'];
+		$shipping_cost = $this->view['basket']['arCalculation']['sum']['shipping_brutto'];
+		$payment_cost = $this->view['basket']['arCalculation']['sum']['payment_brutto'];
+
+	}
+
 	$summe = 0;
 
@@ -281,10 +295,10 @@
 		$pdf->setXY($prod_left + 10, $prod_top + $offset);
 		
-		// Produktvariablen 
+		// Produktvariablen
 		if ($this->hasMod('wpsg_mod_productvars') && $this->get_option("wpsg_mod_rechnungen_showpv") == "1")
 		{
-			
-			$arPV = $this->callMod('wpsg_mod_productvars', 'getAllProductVarValues', array($this->view['data']['id'], $p['product_index']));
-			
+
+			$arPV = $this->callMod('wpsg_mod_productvars', 'getAllProductVarValues', array($this->view['data']['id'], $p['product_index'] - 1));
+
 			if (wpsg_isSizedArray($arPV))
 			{
@@ -328,5 +342,5 @@
 		 
 		if ($bTaxCol) {
-			
+
 			$pdf->setXY($prod_left + 97, $prod_top + $offset);
 			$pdf->Cell(15, 8, (($bNoTax)?'0.00 %':wpsg_ff($this->view['basket']['arCalculation']['tax'][$p['tax_key']]['tax_value'], '%')), 0, 0, 'C'); // BUG
@@ -359,5 +373,5 @@
 		if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($product->getShortDescription())) != '')
 		{
-			
+
 			$produktBeschreibung = nl2br($produktBeschreibung);
 			preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
@@ -389,4 +403,5 @@
 			{
 				
+				if ($pa['value'] == "") $pa['value'] = "Keine Angabe";
 				$pa_text = $pa['name'].': '.$pa['value'];
 				$height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, $pa_text, 0, 'L', 0, $produkt_text_cell_width);
@@ -409,5 +424,5 @@
 		}
 		
-		if ($this->hasMod('wpsg_mod_deliverynote'))
+		if ($this->hasMod('wpsg_mod_deliverynote') && ($this->get_option('wpsg_rechnungen_deliverynote') == '1'))
 		{
 			
@@ -507,14 +522,4 @@
 		
 	}
-		
-	if ($bNoTax) {
-
-		$shipping_cost = $this->view['basket']['arCalculation']['sum']['shipping_netto'];
-
-	} else {
-
-		$shipping_cost = $this->view['basket']['arCalculation']['sum']['shipping_brutto'];
-
-	}
 
 	// Versandkosten
@@ -568,15 +573,4 @@
 		$offset += 8;	
 		
-	}
-
-			
-	if ($bNoTax) {
-
-		$payment_cost = $this->view['basket']['arCalculation']['sum']['payment_netto'];
-
-	} else {
-
-		$payment_cost = $this->view['basket']['arCalculation']['sum']['payment_brutto'];
-
 	}
 	
@@ -688,5 +682,6 @@
 	}
 	
-	$offset += 10;
+	$offset += 10; // Abstand zwischen Tabelle und Auswertung
+
 	if ( $this->get_option('wpsg_kleinunternehmer') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) )
 	{
@@ -696,6 +691,6 @@
 		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
 		$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'] + $this->view['basket']['arCalculation']['sum']['discount_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-		$offset += 5;
-		
+		if ( !$bNoTax || ($arCalculation['sum']['topay_brutto'] != $arCalculation['sum']['brutto']) ) $offset += 5;
+
 	} else {
 		
@@ -707,4 +702,6 @@
 			$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
 			$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'] + $this->view['basket']['arCalculation']['sum']['discount_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+			//if ( !$bNoTax || ($arCalculation['sum']['topay_brutto'] != $arCalculation['sum']['brutto']) ) 
+			$offset += 5;
 
 			if ( !(($this->view['oOrder']->isInnerEu()) && ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_B2B)) ) {
@@ -717,5 +714,5 @@
 					{
 
-						if ($mw['tax_value'] > 0) {
+						if ( $mw['tax_value'] > 0 && $mw['sum'] > 0 ) {
 
 							$offset += 5;
@@ -742,9 +739,9 @@
 				}
 			
-			} else $offset += 5;
-			
+			} else if ( !($arCalculation['sum']['topay_brutto'] != $arCalculation['sum']['brutto']) ) $offset -= 5; 
+
 		} else {
-			
-			$pdf->Text($prod_left, $prod_top + $offset, __("Der Gesamtbetrag setzt sich wie folgt zusammen:", "wpsg"));
+
+			$pdf->Text($prod_left, $prod_top + $offset, __("Der Gesamtbetrag setzt sich wie folgt zusammen", "wpsg").':');
 			
 			$pdf->Text($prod_left + 80, $prod_top + $offset, __("NETTOBETRAG", "wpsg"));
@@ -756,9 +753,8 @@
 
 				$mw_count = 0;
-
 				foreach ($this->view['basket']['arCalculation']['tax'] as $mw)
 				{
 
-					if ($mw['tax_value'] > 0) {
+					if ( $mw['tax_value'] > 0 && $mw['sum'] > 0) {
 
 						$offset += 5;
@@ -788,14 +784,4 @@
 		
 	}
-
-	if ($bNoTax) {
-
-		$discount_value = $this->view['basket']['arCalculation']['sum']['discount_netto'];
-
-	} else {
-
-		$discount_value = $this->view['basket']['arCalculation']['sum']['discount_brutto'];
-
-	}
 	
 	// Rabatt
@@ -804,5 +790,4 @@
 		
 		$offset += 5;
-		
 		$pdf->Text($prod_left + 80, $prod_top + $offset, __("Rabatt", "wpsg"));
 		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
@@ -813,13 +798,17 @@
 	// Wertgutschein
 	if ( $arCalculation['sum']['topay_brutto'] != $arCalculation['sum']['brutto'] ) {
-		
-		$offset += 5;
-		$pdf->Text($prod_left + 80, $prod_top + $offset, __("SUMME", "wpsg"));
-		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
-		
-		$pdf->setFont('Arial', '', '9');
-		$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-		$pdf->setFont('Arial', '', '9');
-		
+
+		if (!$bNoTax) {
+		
+			$offset += 5;
+			$pdf->Text($prod_left + 80, $prod_top + $offset, __("SUMME", "wpsg"));
+			$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+			
+			$pdf->setFont('Arial', '', '9');
+			$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+			$pdf->setFont('Arial', '', '9');
+		
+		} else if (!($mw_count >= 2)) $offset -= 5;
+
 		foreach ($arCalculation['coupon'] as $c) {
 			
@@ -846,5 +835,5 @@
 	} else {
 	
-		if (!$bNoTax) $offset += 5;
+		$offset += 5;
 		$pdf->setFont('Arial', 'B', '9');
 		$pdf->Text($prod_left + 80, $prod_top + $offset, __("GESAMTSUMME", "wpsg"));
@@ -859,64 +848,65 @@
 	if (($this->get_option('wpsg_kleinunternehmer') == '1') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) )
 	{
-		
-		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset + 5, 5, $this->get_option('wpsg_kleinunternehmer_text'));
-		$offset += 15;
-		
-	}
-	
-	if ($this->hasMod('wpsg_mod_deliverynote'))
+
+		$offset += 3;
+		$pdf->setFont('Arial', '', '8');
+		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, '('.$this->get_option('wpsg_kleinunternehmer_text').')');
+		$offset += 8;
+		
+	}
+
+	$offset += 5;
+	
+	if ($this->hasMod('wpsg_mod_deliverynote') && ($this->get_option('wpsg_rechnungen_deliverynote') == '1'))
 	{
 		
 		$arDN_order = $this->callMod('wpsg_mod_deliverynote', 'loadDeliveryNotesFromOrder', array($this->view['data']['id']));
 		$delivery_date = $this->callMod('wpsg_mod_deliverynote', 'getDeliveryTime', array($this->view['data']['id']));
-		
+
 		// Wenn es ein Gesamtlieferdatum gibt und nur einen Lieferschein, dann unter der Bestellung anzeigen
 		if ($delivery_date !== false && sizeof($arDN_order) == 1)
 		{
 			
-			$offset += 10;
-			
-			$pdf->wpsg_MultiCell($prod_left, $prod_top + $offset, 5, wpsg_translate(__('Lieferung: #1#', 'wpsg'), date('d.m.Y', $delivery_date)));
-			
-			$offset += 5;
-			
-		}
-		
-	}
-	
-	$offset += 5;
+			$pdf->setFont('Arial', 'B', '9');
+			$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, __('Lieferung:', 'wpsg'));
+			$pdf->setFont('Arial', '', '9');
+			$pdf->wpsg_MultiCell($prod_left + 16, $prod_top + $offset, 5, wpsg_translate(__('#1#', 'wpsg'), date('d.m.Y', $delivery_date)));
+			$offset += 8;
+			
+		}
+		
+	}
 	
 	if ($this->view['fussText'] != "")
 	{
 		
-		//$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, utf8_encode($this->view['fussText']));		
+		$pdf->setFont('Arial', '', '9');	
 		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $this->view['fussText']);
-		$pdf->SetFont('Arial', 'B', 9);
-		$offset += 10;
-		
-	}
-	
+		$offset += 8;
+		
+	}
+	
+	$offset += 10;
+
 	$shipping_adress = false;
-	
 	if ($this->hasMod('wpsg_mod_shippingadress') && $this->callMod('wpsg_mod_shippingadress', 'check_different_shippingadress', array('k_id' => $this->view['data']['k_id'], 'o_id' => $this->view['data']['id']))) {
 		
 		$pdf->setFont('Arial', 'B', 9);
 		$pdf->Text($prod_left, $prod_top + $offset, __("Lieferanschrift", "wpsg").":");
-		$offset += 5;
+		$offset += 2;
 		
 		$pdf->setFont('Arial', '', 9);
 		
-		$shipping_adress = "";
-		if ($this->view['data']['shipping_firma'] != "")
-		{
-			$shipping_adress .= $this->view['data']['shipping_firma']."\r\n";
-		}
-		$shipping_adress .= $this->view['data']['shipping_vname'].' '.$this->view['data']['shipping_name']."\r\n";
-		$shipping_adress .= $this->view['data']['shipping_strasse'].' '.$this->view['data']['shipping_nr']."\r\n";
-		// $shipping_adress .= $this->view['data']['shipping_land']['kuerzel'].'-';
-		
-		$shipping_adress .= $this->view['data']['shipping_plz'].' '.$this->view['data']['shipping_ort']."\r\n";
-		$shipping_adress .= $this->view['data']['shipping_land']['name'];
-		
+			$shipping_adress = "";
+			if ($this->view['data']['shipping_firma'] != "")
+			{
+				$shipping_adress .= $this->view['data']['shipping_firma']."\r\n";
+			}
+			$shipping_adress .= $this->view['data']['shipping_vname'].' '.$this->view['data']['shipping_name']."\r\n";
+			$shipping_adress .= $this->view['data']['shipping_strasse'].' '.$this->view['data']['shipping_nr']."\r\n";
+			// $shipping_adress .= $this->view['data']['shipping_land']['kuerzel'].'-';
+			
+			$shipping_adress .= $this->view['data']['shipping_plz'].' '.$this->view['data']['shipping_ort']."\r\n";
+			$shipping_adress .= $this->view['data']['shipping_land']['name'];	
 		
 		$start = $pdf->getY();
@@ -928,43 +918,42 @@
 	}
 	
-	
-	$offset += 5;
-	
 	// Bestellvariablen
 	if ($this->hasMod('wpsg_mod_ordervars') && $this->get_option('wpsg_mod_rechnungen_showov') == '1')
 	{
-		
-		$bvars = @unserialize($this->view['data']['bvars']);
-		if (!is_array($bvars)) $bvars = array();
-		
-		$strBVars = "";
-		foreach ($bvars as $bvars_id => $bvars_value)
-		{
-			
-			$bvars = $this->db->fetchRow("SELECT * FROM `".wpsg_q(WPSG_TBL_ORDERVARS)."` WHERE `id` = '".wpsg_q($bvars_id)."' ORDER BY `pos` ASC, `id` ASC ");
-			
-			if ($bvars['typ'] == "1") // Auswahl
-			{
-				if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
-			}
-			else if ($bvars['typ'] == "2") // Texteingabe
-			{
-				if (trim($bvars_value) == "") $bvars_value = __("Keine Angabe", "wpsg");
-			}
-			else if ($bvars['typ'] == "3") // Checkbox
-			{
-				if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
-			}
-			
-			$bvars_name = $this->callMod('wpsg_mod_ordervars', 'getNameById', array($bvars_id));
-			$strBVars .= "\r\n".$bvars_name.": ".$bvars_value;
-			
-		}
-		
+
 		$pdf->SetFont('Arial', 'B', 9);
-		$pdf->Text($prod_left, $prod_top + $offset, __("Angaben wÃ€hrend der Bestellung", "wpsg").":");
+		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset - 7, 5, __("Angaben wÃ€hrend der Bestellung", "wpsg").":");
+		
 		$pdf->SetFont('Arial', '', 9);
-		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $strBVars);
-		
+
+			$bvars = @unserialize($this->view['data']['bvars']);
+			if (!is_array($bvars)) $bvars = array();
+			
+			$strBVars = "";
+			foreach ($bvars as $bvars_id => $bvars_value)
+			{
+				
+				$bvars = $this->db->fetchRow("SELECT * FROM `".wpsg_q(WPSG_TBL_ORDERVARS)."` WHERE `id` = '".wpsg_q($bvars_id)."' ORDER BY `pos` ASC, `id` ASC ");
+				
+				if ($bvars['typ'] == "1") // Auswahl
+				{
+					if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
+				}
+				else if ($bvars['typ'] == "2") // Texteingabe
+				{
+					if (trim($bvars_value) == "") $bvars_value = __("Keine Angabe", "wpsg");
+				}
+				else if ($bvars['typ'] == "3") // Checkbox
+				{
+					if ($bvars_value <= 0) $bvars_value = __("Keine Angabe", "wpsg");
+				}
+				
+				$bvars_name = $this->callMod('wpsg_mod_ordervars', 'getNameById', array($bvars_id));
+				$strBVars .= "\r\n".$bvars_name.": ".$bvars_value;
+				
+			}
+		
+		$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset - 6, 5, $strBVars);
+
 	}
 	
Index: /views/mods/mod_rechnungen/settings_edit.phtml
===================================================================
--- /views/mods/mod_rechnungen/settings_edit.phtml	(revision 8166)
+++ /views/mods/mod_rechnungen/settings_edit.phtml	(revision 8167)
@@ -197,4 +197,8 @@
 				<?php echo wpsg_drawForm_Checkbox('wpsg_rechnungen_produktattribute', __('Produktattribute auf der Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_rechnungen_produktattribute'), array('help' => 'wpsg_rechnungen_produktattribute')); ?>
 			<?php }?>
+			
+			<?php if ($this->hasMod('wpsg_mod_deliverynote') == '1') {?>
+				<?php echo wpsg_drawForm_Checkbox('wpsg_rechnungen_deliverynote', __('Lieferdatum auf der Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_rechnungen_deliverynote'), array('help' => 'wpsg_rechnungen_deliverynote')); ?>
+			<?php }?>
 
 			<?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_showgutschriftrechnung', __('Rechnungsnummer auf Rechnungskorrektur anzeigen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_showgutschriftrechnung'), array('help' => 'wpsg_mod_rechnungen_showgutschriftrechnung')); ?>
