Index: /views/mods/mod_rechnungen/invoice_pdf.phtml
===================================================================
--- /views/mods/mod_rechnungen/invoice_pdf.phtml	(revision 8300)
+++ /views/mods/mod_rechnungen/invoice_pdf.phtml	(revision 8301)
@@ -34,7 +34,4 @@
 	
 	$arCalculation = $this->view['basket']['arCalculation'];
-	
-	if ($this->getFrontendTaxView() === WPSG_NETTO) $taxdisplay = 'netto';
-	else $taxdisplay = 'brutto';
 	
 	// Damit die Steuer bei der Kleinunternehmerregelung nicht angezeigt wird leer ich den Array sicherheitshalber
@@ -204,4 +201,6 @@
 		$payment_cost = $this->view['basket']['arCalculation']['sum']['payment_netto'];
 
+		$taxdisplay = 'netto';
+
 	} else {
 
@@ -209,4 +208,6 @@
 		$shipping_cost = $this->view['basket']['arCalculation']['sum']['shipping_brutto'];
 		$payment_cost = $this->view['basket']['arCalculation']['sum']['payment_brutto'];
+
+		$taxdisplay = 'brutto';
 
 	}
@@ -481,5 +482,5 @@
 			$gs_value_einzel = wpsg_ff($v[$taxdisplay.'_single'], $this->get_option('wpsg_currency'));
 			$gs_value_gesamt = wpsg_ff($v[$taxdisplay], $this->get_option('wpsg_currency'));
-			
+
 			$pdf->setXY($prod_left + 127, $prod_top + $offset);
 			$pdf->Cell(25, 8, $gs_value_einzel, 1, 0, 'R');
@@ -508,9 +509,18 @@
 		{
 
-			if ($this->arShipping[$this->view['data']['type_shipping']]['mwst_null'] == '1' && $bNoTax) $mwst = wpsg_ff(0.00, '%');
-			else {
-				
-				if ($this->view['basket']['arCalculation']['shipping'][0]['tax_key'] === '0') $mwst = _('anteilig');
-				else {
+			// if ($this->arShipping[$this->view['data']['type_shipping']]['mwst_null'] == '1' && $bNoTax) 
+			// {
+			if ($bNoTax) 
+			{
+			
+				$mwst = wpsg_ff(0.00, '%');
+
+			} else {
+				
+				if ($this->view['basket']['arCalculation']['shipping'][0]['tax_key'] === '0') {
+				
+					$mwst = _('anteilig');
+
+				} else {
 
 					$mwst = wpsg_ff($this->view['basket']['arCalculation']['shipping'][0]['tax'], '%');
@@ -553,5 +563,7 @@
 		{
 			
-			if ($this->arPayment[$this->view['data']['type_payment']]['mwst_null'] == '1' && $bNoTax)
+			// if ($this->arPayment[$this->view['data']['type_payment']]['mwst_null'] == '1' && $bNoTax)
+			// {
+			if ($bNoTax)
 			{
 
@@ -640,5 +652,18 @@
 	}
 	
-	$offset += 10; // Abstand zwischen Tabelle und Auswertung
+	$offset += 5; // Abstand zwischen Tabelle und Rabatt
+
+	// Rabatt
+	if ($discount_value > 0)
+	{
+
+		$offset += 5;
+		$pdf->Text($prod_left + 80, $prod_top + $offset, __("Rabatt", "wpsg"));
+		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+		$pdf->Cell(37, 8, '-'.wpsg_ff($discount_value, $this->get_option('wpsg_currency')), 0, 0, 'R');
+		
+	}
+
+	$offset += 5; // Abstand zwischen Rabatt und Auswertung
 
 	if ( ($this->get_option('wpsg_kleinunternehmer') == '1') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) )
@@ -648,5 +673,5 @@
 		$pdf->Text($prod_left + 80, $prod_top + $offset, __("Summe", "wpsg"));
 		$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');
+		$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 		if ( !$bNoTax || ($arCalculation['sum']['topay_brutto'] != $arCalculation['sum']['brutto']) ) $offset += 5;
 
@@ -655,10 +680,9 @@
 		if ($bNoTax)
 		{
-			
+
 			$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
 			$pdf->Text($prod_left + 80, $prod_top + $offset, __("Summe", "wpsg"));
 			$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']) ) 
+			$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 			$offset += 5;
 
@@ -705,5 +729,5 @@
 			$pdf->Text($prod_left + 80, $prod_top + $offset, __("NETTOBETRAG", "wpsg"));
 			$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
-			$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['netto'] + $this->view['basket']['arCalculation']['sum']['discount_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+			$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['topay_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
 			
 			if (sizeof($this->view['basket']['arCalculation']['tax']) >= 1)
@@ -740,15 +764,4 @@
 			
 		}
-		
-	}
-	
-	// Rabatt
-	if ($discount_value > 0)
-	{
-
-		$offset += 5;
-		$pdf->Text($prod_left + 80, $prod_top + $offset, __("Rabatt", "wpsg"));
-		$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
-		$pdf->Cell(37, 8, '-'.wpsg_ff($discount_value, $this->get_option('wpsg_currency')), 0, 0, 'R');
 		
 	}
