Index: /mods/wpsg_mod_rechnungen.class.php
===================================================================
--- /mods/wpsg_mod_rechnungen.class.php	(revision 8060)
+++ /mods/wpsg_mod_rechnungen.class.php	(revision 8061)
@@ -969,4 +969,55 @@
 						
 			$oCalculation = new \wpsg\wpsg_calculation();
+			$oCalculationOrder = \wpsg\wpsg_calculation::getOrderCalculation($order_id);
+			
+			if (intval($_REQUEST['wpsg_rechnungen_discount_voucher_coupon']??0) > 0) {
+				
+				$discount = $oCalculationOrder->getDiscount();
+				if ($discount !== null) $oCalculation->addDiscount(
+					$discount['set'], 
+					$discount['bruttonetto'], 
+					$discount['tax_key'], 
+					$discount['amount']
+				);
+				
+				$arVoucher = $oCalculationOrder->getVoucher();
+				if ($arVoucher !== null) {
+					
+					foreach ($arVoucher as $v) {
+						
+						$oCalculation->addVoucher(
+							$v['set'],
+							$v['bruttonetto'],
+							$v['tax_key'],
+							$v['amount'],
+							$v['data']['code']??false,
+							$v['code']['id']??0,
+							$v['code']['order_voucher_id']??0
+						);
+						
+					}
+					
+				}
+				
+				$arCoupon = $oCalculationOrder->getCoupon();
+				if ($arCoupon !== null) {
+					
+					foreach ($arCoupon as $c) {
+						
+						$oCalculation->addCoupon(
+							$c['set'],
+							$c['bruttonetto'],
+							$c['tax_key'],
+							$c['amount'],
+							$c['data']['code']??false,
+							$c['code']['id']??0,
+							$c['code']['order_voucher_id']??0
+						);
+						
+					}
+					
+				}
+
+			}
 			
 			$oOrder = wpsg_order::getInstance($order_id);
@@ -1075,4 +1126,18 @@
 			];
 			
+			// Die Templates brauchen es leider noch etwas anders
+			foreach ($this->shop->view['basket']['arCalculation']['tax'] as $tax_key => $tax) {
+				
+				if ($tax_key !== 0) {
+					
+					$this->shop->view['basket']['mwst'][] = [
+						'value' => $tax['tax_value'],
+						'sum' => $tax['sum']
+					];
+					
+				}
+				
+			} 
+			
 			if ($storno_fee !== '') {
 				
@@ -1199,52 +1264,55 @@
 			}
 			
-			$oCalculation = new \wpsg\wpsg_calculation();
-			
+			$oCalculation = new \wpsg\wpsg_calculation();			
 			$oCalculationOrder = \wpsg\wpsg_calculation::getOrderCalculation($order_id);
 			
-			$discount = $oCalculationOrder->getDiscount();
-			if ($discount !== null) $oCalculation->addDiscount(
-				$discount['set'], 
-				$discount['bruttonetto'], 
-				$discount['tax_key'], 
-				$discount['amount']
-			);
-			
-			$arVoucher = $oCalculationOrder->getVoucher();
-			if ($arVoucher !== null) {
-				
-				foreach ($arVoucher as $v) {
-					
-					$oCalculation->addVoucher(
-						$v['set'],
-						$v['bruttonetto'],
-						$v['tax_key'],
-						$v['amount'],
-						$v['data']['code']??false,
-						$v['code']['id']??0,
-						$v['code']['order_voucher_id']??0
-					);
-					
-				}
-				
-			}
-			
-			$arCoupon = $oCalculationOrder->getCoupon();
-			if ($arCoupon !== null) {
-				
-				foreach ($arCoupon as $c) {
-					
-					$oCalculation->addCoupon(
-						$c['set'],
-						$c['bruttonetto'],
-						$c['tax_key'],
-						$c['amount'],
-						$c['data']['code']??false,
-						$c['code']['id']??0,
-						$c['code']['order_voucher_id']??0
-					);
-					
-				}
-				
+			if (intval($_REQUEST['wpsg_rechnungen_discount_voucher_coupon']??0) > 0) {
+				
+				$discount = $oCalculationOrder->getDiscount();
+				if ($discount !== null) $oCalculation->addDiscount(
+					$discount['set'], 
+					$discount['bruttonetto'], 
+					$discount['tax_key'], 
+					$discount['amount']
+				);
+				
+				$arVoucher = $oCalculationOrder->getVoucher();
+				if ($arVoucher !== null) {
+					
+					foreach ($arVoucher as $v) {
+						
+						$oCalculation->addVoucher(
+							$v['set'],
+							$v['bruttonetto'],
+							$v['tax_key'],
+							$v['amount'],
+							$v['data']['code']??false,
+							$v['code']['id']??0,
+							$v['code']['order_voucher_id']??0
+						);
+						
+					}
+					
+				}
+				
+				$arCoupon = $oCalculationOrder->getCoupon();
+				if ($arCoupon !== null) {
+					
+					foreach ($arCoupon as $c) {
+						
+						$oCalculation->addCoupon(
+							$c['set'],
+							$c['bruttonetto'],
+							$c['tax_key'],
+							$c['amount'],
+							$c['data']['code']??false,
+							$c['code']['id']??0,
+							$c['code']['order_voucher_id']??0
+						);
+						
+					}
+					
+				}
+
 			}
 			
@@ -1347,5 +1415,5 @@
 				}
 				
-			} 
+			} 			
 			
 			if ($this->shop->view['basket']['arCalculation']['sum']['discount_netto'] < 0) {
@@ -1357,8 +1425,5 @@
 				
 			}
-			
-			//wpsg_Debug($this->shop->view['basket']['arCalculation']);
-			// if ($this->view['basket']['sum']['preis_rabatt']
-			 
+				
 			if (($_REQUEST['wpsg_rechnungen_shippay']??'0') === '1') {
 				
Index: /views/mods/mod_rechnungen/order_view_orderdata_after.phtml
===================================================================
--- /views/mods/mod_rechnungen/order_view_orderdata_after.phtml	(revision 8060)
+++ /views/mods/mod_rechnungen/order_view_orderdata_after.phtml	(revision 8061)
@@ -129,4 +129,7 @@
                     ?></label>
                     
+                    <input type="checkbox" name="wpsg_rechnungen_discount_voucher_coupon" value="1" id="wpsg_rechnungen_discount_voucher_coupon" />
+                    <label style="grid-column:2 / span 2;" for="wpsg_rechnungen_discount_voucher_coupon"><?php echo __('Rabatt, Gutschein, Wertgutschein abrechnen wenn vorhanden', 'wpsg'); ?></label>
+                    
                     <input type="checkbox" name="wpsg_rechnungen_url" value="1" id="invoice_url" />
                     <label  for="invoice_url" style="grid-column: 2 / span 2;"><?php echo __('URL Benachrichtigung', 'wpsg'); ?></label>
@@ -288,4 +291,7 @@
                     </select>
                     
+                    <input type="checkbox" name="wpsg_rechnungen_discount_voucher_coupon" value="1" id="wpsg_rechnungen_storno_discount_voucher_coupon" />
+                    <label style="grid-column:2 / span 2;" for="wpsg_rechnungen_storno_discount_voucher_coupon"><?php echo __('Rabatt, Gutschein, Wertgutschein abrechnen wenn vorhanden', 'wpsg'); ?></label>
+                    
                     <input type="checkbox" name="storno_fee_set" id="storno_fee_set" value="1" id="storno_fee_set" />
                     <label for="storno_fee_set"><?php echo __('StornierungsgebÃŒhr in % oder EUR', 'wpsg'); ?></label>
