Index: /changelog
===================================================================
--- /changelog	(revision 7931)
+++ /changelog	(revision 7932)
@@ -466,4 +466,8 @@
 
 #4.3.4
+- Feature: Bankeinzugsdaten lassen sich im Backend bei bestehenden Bestellungen Ã€ndern
+- Feature: Kundenkontakt aus der Bestellverwaltung fÃŒr mehrere Bestellungen mÃ¶glich. (Templates mÃŒsse in user_views ev. aktualisiert werden)
+- Feature: Suche nach Zahlungsart in Bestellverwaltung mÃ¶glich
+- Feature: Bei Statuswechsel ÃŒber die BestellÃŒbersicht kÃ¶nnen die Kunden jetzt optional darÃŒber informiert werden
 - Bugfix: PasswortzurÃŒcksetzen funktioniert jetzt auch, wenn paralell ein gelÃ¶schter Kunde mit gleicher E-Mail existiert
 - Bugfix: Produktartikel Neu Aufbauen beachtet den "Entwurfs - Status"
Index: /classes/M1.class.php
===================================================================
--- /classes/M1.class.php	(revision 7931)
+++ /classes/M1.class.php	(revision 7932)
@@ -38,4 +38,4 @@
 
         }
-
+        
     }
Index: /controller/wpsg_OrderController.class.php
===================================================================
--- /controller/wpsg_OrderController.class.php	(revision 7931)
+++ /controller/wpsg_OrderController.class.php	(revision 7932)
@@ -1493,11 +1493,9 @@
                 require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
 
-				if (sizeof($IDs) > 0)
-				{
+				if (sizeof($IDs) > 0) {
 
 					$pdf = new wpsg_fpdf();
 
-					foreach ($IDs as $o_id)
-					{
+					foreach ($IDs as $o_id) {
 
 						$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");
@@ -1549,9 +1547,7 @@
 				if ($_REQUEST['wpsg_action'] == '-1') $this->addBackendError(__('Bitte eine Aktion wÃ€hlen!', 'wpsg'));
 				else if (!isset($_REQUEST['wpsg_multido']) || !is_array($_REQUEST['wpsg_multido'])) $this->addBackendError(__('Bitte mindestens eine Bestellung auswÃ€hlen!', 'wpsg'));
-				else
-				{
-
-					if ($_REQUEST['wpsg_action'] == 'multiDelete')
-					{
+				else {
+
+					if ($_REQUEST['wpsg_action'] == 'multiDelete') {
 
 						$arOrderID = $this->db->fetchAssocField("SELECT `id` FROM `".WPSG_TBL_ORDER."` WHERE `id` IN (".wpsg_q(implode(',', array_keys($_REQUEST['wpsg_multido']))).") ");
@@ -1562,7 +1558,5 @@
 						$this->shop->addBackendError(wpsg_translate(__('#1# Bestellung(en) gelÃ¶scht.', 'wpsg'), sizeof($arOrder)));
 
-					}
-					else if ($_REQUEST['wpsg_action'] == 'writeRechnung')
-					{
+					} else if ($_REQUEST['wpsg_action'] == 'writeRechnung') {
 
 						$nWriteRechnung = 0;
@@ -1657,13 +1651,10 @@
 						}
 
-					}
-					else if (is_numeric($_REQUEST['wpsg_action']))
-					{
+					} else if (is_numeric($_REQUEST['wpsg_action'])) {
 
 						// Status setzen
-						foreach ($_REQUEST['wpsg_multido'] as $k => $v)
-						{
-
-							$this->shop->setOrderStatus($k, $_REQUEST['wpsg_action'], false, false, true);
+						foreach ($_REQUEST['wpsg_multido'] as $k => $v) {
+
+							$this->shop->setOrderStatus($k, $_REQUEST['wpsg_action'], intval($_REQUEST['inform']??'0') === 1, false, true);
 
 						}
@@ -1704,5 +1695,6 @@
                 if (wpsg_checkInput($_REQUEST['filter']['cdate_m'], WPSG_SANITIZE_INT, ['allowEmpty' => true])) $_REQUEST['filter']['cdate_m'] = sanitize_text_field($_REQUEST['filter']['cdate_m']);
                 if (wpsg_checkInput($_REQUEST['filter']['cdate_y'], WPSG_SANITIZE_INT, ['allowEmpty' => true])) $_REQUEST['filter']['cdate_y'] = sanitize_text_field($_REQUEST['filter']['cdate_y']);
-
+                if (wpsg_checkInput($_REQUEST['filter']['payment_key'], WPSG_SANITIZE_INT, ['allowEmpty' => true])) $_REQUEST['filter']['payment_key'] = sanitize_text_field($_REQUEST['filter']['payment_key']);
+                
                 if ($this->shop->hasMod('wpsg_mod_rechnungen')) {
 
@@ -1723,5 +1715,5 @@
 
 			// Filter gesetzt?
-			foreach (Array('s', 'k_id', 'cdate_m', 'cdate_y', 'invoicedate_m', 'invoicedate_y') as $field) {
+			foreach (Array('s', 'k_id', 'cdate_m', 'cdate_y', 'invoicedate_m', 'invoicedate_y', 'payment_key') as $field) {
 
 				if (wpsg_isSizedString($this->shop->view['arFilter'][$field]) && $this->shop->view['arFilter'][$field] != '-1') { $this->shop->view['hasFilter'] = true; break; }
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 7931)
+++ /controller/wpsg_ShopController.class.php	(revision 7932)
@@ -3545,16 +3545,15 @@
 		 * Ersetzt in dem String $value die Platzhalter und gibt den neuen String zurÃŒck
 		 */
-		public function replaceUniversalPlatzhalter($value, $order_id = false, $kunden_id = false, $rechnung_id = false, $product_id = false, $arCustomReplace = array(), $product_index = false)
-		{
+		public function replaceUniversalPlatzhalter($value, $order_id = false, $kunden_id = false, $rechnung_id = false, $product_id = false, $arCustomReplace = array(), $product_index = false) {
 
 			$arReplace = array();
 
-			if ($order_id !== false)
-			{
+			$arReplace['/%shopdata_name%/i'] = $this->get_option('wpsg_shopdata_name');
+			
+			if ($order_id !== false) {
 				
 				$order_data = $this->cache->loadOrder($order_id);
 
-				if (!wpsg_isSizedInt($kunden_id))
-				{
+				if (!wpsg_isSizedInt($kunden_id)) {
 
 					$kunden_id = $order_data['k_id'];
@@ -3562,31 +3561,29 @@
 				}
 
-				foreach ((array)$order_data as $k => $v)
-				{
-
-					if ($k == 'cdate')
-					{
+				foreach ((array)$order_data as $k => $v) {
+
+					if ($k == 'cdate') {
 
 						$arReplace['/%order_'.$k.'%/i'] = wpsg_fromDate($v);
 
+					} else {
+
+						$arReplace['/%order_'.$k.'%/i'] = $v;
+
 					}
-					else
-					{
-
-						$arReplace['/%order_'.$k.'%/i'] = $v;
-
-					}
-
-				}
-
-			}
-
-			if (wpsg_isSizedInt($kunden_id))
-			{
+
+				}
+								
+				$arReplace['/%order_topay_brutto_formated%/i'] = wpsg_ff($order_data['topay_brutto'], $this->get_option('wpsg_currency'));
+				$arReplace['/%order_cdate_format_de%/i'] = date("d.m.Y | H:i", strtotime($order_data['cdate']));
+				$arReplace['/%order_done_url%/i'] = $this->getDoneURL($order_id);
+
+			}
+
+			if (wpsg_isSizedInt($kunden_id)) {
 
 				$kunden_data = $this->cache->loadKunden($kunden_id);
 
-				foreach ((array)$kunden_data as $k => $v)
-				{
+				foreach ((array)$kunden_data as $k => $v) {
 
 					$arReplace['/%kunde_'.$k.'%/i'] = $v;
@@ -3598,9 +3595,7 @@
 				$arPflicht = $this->get_option('wpsg_admin_pflicht');
 
-				if (wpsg_isSizedArray($arPflicht['custom']))
-				{
-
-					foreach ($arPflicht['custom'] as $index => $kv)
-					{
+				if (wpsg_isSizedArray($arPflicht['custom'])) {
+
+					foreach ($arPflicht['custom'] as $index => $kv) {
 
 						$arReplace['/%kv_'.$index.'%/i'] = $this->getCustomFieldFromDB($kunden_id, $index);
@@ -4809,5 +4804,11 @@
 				
 		} // public function checkPaymentAvailable()
-
+		
+		public function getPaymentArray(): array {
+			
+			return $this->arPayment;
+			
+		}
+		
 		/**
 		* Gibt den Namen der Zahlungsart zurÃŒck (Eingebaut fÃŒr CrefoPay)
Index: /lib/helper_functions.inc.php
===================================================================
--- /lib/helper_functions.inc.php	(revision 7931)
+++ /lib/helper_functions.inc.php	(revision 7932)
@@ -349,6 +349,5 @@
 	}
 	
-	function wpsg_drawForm_Button($field_name, $field_label, $conf)
-	{
+	function wpsg_drawForm_Button($field_name, $field_label, ?array $conf = []) {
 		
 		if (wpsg_isSizedString($conf['id'])) $field_id = $conf['id'];
@@ -368,10 +367,10 @@
 				
 		$strReturn = '
-			<div class="wpsg_form_field">
+			<div class="wpsg_form_field" '.((isset($conf['wrap_id']))?'id="'.$conf['wrap_id'].'"':'').'">
 				<div class="wpsg_form_left">
 					<label for="'.$field_id.'">'.$field_label.'</label>
 				</div>
 				<div class="wpsg_form_right">
-					<input type="button" class="button '.$button_class.'" onclick="'.$button_onclick.'" value="'.$button_text.'" name="'.$field_name.'" />
+					<input '.((isset($conf['field_id']))?'id="'.$conf['field_id'].'"':'').' type="button" class="button '.$button_class.'" onclick="'.$button_onclick.'" value="'.$button_text.'" name="'.$field_name.'" />
 				</div>
 				<div class="wpsg_clear"></div>
@@ -487,6 +486,5 @@
 	}
 	
-	function wpsg_drawForm_Input($field_name, $field_label, $field_value, $conf = array())
-	{
+	function wpsg_drawForm_Input($field_name, $field_label, $field_value, ?array $conf = []): string {
 				
 		$TC = new wpsg_SystemController();
@@ -730,6 +728,5 @@
 	}
 	
-	function wpsg_drawForm_Select($field_name, $field_label, $field_values, $field_value, $conf = array())
-	{
+	function wpsg_drawForm_Select($field_name, $field_label, $field_values, $field_value, $conf = array()) {
 		
 		$TC = new wpsg_SystemController();
@@ -746,6 +743,5 @@
 		$TC->view['atts_select'] = '';
 
-		if (wpsg_isSizedString($conf['onchange']))
-		{
+		if (wpsg_isSizedString($conf['onchange'])) {
 
 			$TC->view['atts_select'] .= ' onchange="'.$conf['onchange'].'" ';
@@ -753,6 +749,5 @@
 		}
 
-		if (wpsg_isSizedInt($conf['multiple']))
-		{
+		if (wpsg_isSizedInt($conf['multiple'])) {
 		
 			$TC->view['field_name'] .= '[]';
Index: /model/wpsg_order.class.php
===================================================================
--- /model/wpsg_order.class.php	(revision 7931)
+++ /model/wpsg_order.class.php	(revision 7932)
@@ -1095,6 +1095,5 @@
 		 * @param array $arFilter
 		 */
-		public static function find($arFilter = array(), $load = true)
-		{
+		public static function find($arFilter = array(), $load = true) {
 			
 			list($strQuerySELECT, $strQueryWHERE, $strQueryJOIN, $strQueryHAVING, $strQueryORDER) = self::getQueryParts($arFilter);
@@ -1168,4 +1167,6 @@
 				
 			}
+			
+			if (wpsg_isSizedString($arFilter['payment_key'])) $strQueryWHERE .= " AND O.`payment_key` = '".wpsg_q($arFilter['payment_key'])."' ";
 
 			if (wpsg_isSizedString($arFilter['s'])) {
Index: /mods/wpsg_mod_autodebit.class.php
===================================================================
--- /mods/wpsg_mod_autodebit.class.php	(revision 7931)
+++ /mods/wpsg_mod_autodebit.class.php	(revision 7932)
@@ -42,6 +42,5 @@
 		} // public function __construct()
 		
-		public function install()
-		{
+		public function install() {
 			 
 			require_once(WPSG_PATH_WP.'/wp-admin/includes/upgrade.php');
@@ -119,9 +118,34 @@
 		} // public function settings_save()
 		
-		public function be_ajax()
-		{
-		
-			if ($_REQUEST['wpsg_mod_autodebit_bicibanconverter'] == '1')
-			{
+		public function be_ajax() {
+		
+			if (wpsg_isSizedString($_REQUEST['do'], 'inlinedit')) {
+				
+				$order_id = intval($_REQUEST['order_id']);
+				
+				if ($order_id <= 0) throw new \Exception(__('Bestell ID nicht gesetzt.', 'wpsg'));
+				
+				switch ($_REQUEST['field']) {
+					
+					case 'name': $col = 'mod_autodebit_name'; break;
+					case 'owner': $col = 'mod_autodebit_inhaber'; break;
+					case 'bic': $col = 'mod_autodebit_bic'; break;
+					case 'iban': $col = 'mod_autodebit_iban'; break;
+					case 'blz': $col = 'mod_autodebit_blz'; break;
+					case 'knr': $col = 'mod_autodebit_knr'; break;
+					
+					default: throw new \Exception(__('Aufruf nicht definiert.', 'wpsg'));
+					
+				}
+				
+				$value = \sanitize_text_field($_REQUEST['value']);
+				
+				$this->db->UpdateQuery(WPSG_TBL_ORDER, [
+					$col => wpsg_q($value)
+				], " `id` = '".wpsg_q($order_id)."' ");
+				
+				echo $value; exit;
+				
+			} else if ($_REQUEST['wpsg_mod_autodebit_bicibanconverter'] == '1') {
 		
 				$arOrder_bankeinzug = $this->db->fetchAssoc("
@@ -139,6 +163,5 @@
 				");
 				
-				foreach ($arOrder_bankeinzug as $order)
-				{
+				foreach ($arOrder_bankeinzug as $order) {
 										
 					$custom_data = @unserialize($order['custom_data']);
@@ -151,6 +174,5 @@
 					$iban = $this->make_iban($blz, $knr, $order['land_kuerzel']);
 					
-					if ($this->test_iban($iban))
-					{
+					if ($this->test_iban($iban)) {
 						
 						$custom_data['checkout']['mod_autodebit_iban'] = $iban;
@@ -162,4 +184,5 @@
 					
 				}
+				
 				die("1");
 		
Index: /mods/wpsg_mod_kundenkontakt.class.php
===================================================================
--- /mods/wpsg_mod_kundenkontakt.class.php	(revision 7931)
+++ /mods/wpsg_mod_kundenkontakt.class.php	(revision 7932)
@@ -1,6 +1,5 @@
 <?php 
 
-	class wpsg_mod_kundenkontakt extends wpsg_mod_basic 
-	{
+	class wpsg_mod_kundenkontakt extends wpsg_mod_basic {
 		
 		var $lizenz = 1;
@@ -87,27 +86,7 @@
 		 * zeigt das Formular zum Senden in der Bestellverwaltung
 		 */
-		public function order_view($order_id, &$arSidebarArray)
-		{
-			
-			$path = $this->shop->getRessourcePath('mods/mod_kundenkontakt/templates/');
-
-			$this->shop->view['arTemplates'] = array();
-			
-			$arrFiles = scandir($path);
-			
-			foreach ($arrFiles as $file)
-			{
-				
-				if (is_file($path.$file) && preg_match('/(.*)\.phtml/', $file) && !preg_match('/(.*)_html\.phtml/', $file))
-				{
-					
-					$template_name = str_replace('.phtml', '', $file);
-					
-					$this->shop->view['arTemplates'][$file]['filename'] = $file;
-					$this->shop->view['arTemplates'][$file]['name'] = ucfirst($template_name);
-					
-				}
-				
-			}
+		public function order_view($order_id, &$arSidebarArray) {
+			 			
+			$this->shop->view['arTemplates'] = $this->getTemplates();
 			
 			$oOrder = wpsg_order::getInstance($order_id);
@@ -126,6 +105,5 @@
 		} // public function order_view_content($order_id)
 		
-		public function order_ajax()
-		{
+		public function order_ajax() {
 			
 			$_REQUEST['do'] = wpsg_getStr($_REQUEST['do']);
@@ -199,5 +177,5 @@
 			
 		}
-		
+				
 		public function admin_emailconf()
 		{
@@ -225,4 +203,14 @@
 		/* Modulfunktionen */
 		 
+		public function order_index_bottom() {
+			 
+			if (sizeof($this->shop->view['arData']??[]) <= 0) return;
+			
+			$this->shop->view['arTemplates'] = $this->getTemplates();
+			
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_kundenkontakt/order_index_bottom.phtml');
+			
+		}
+		
 		private function isValidPhoneNumber($phone) {
 			
@@ -294,17 +282,11 @@
 		 * ermÃ¶glicht die Auswahl eines Templates zum Versenden als Kundenkontakt
 		 */
-		private function switchTemplate()
-		{
-			
-			if ($_REQUEST['template_file'] != '-1')
-			{
+		private function switchTemplate() {
+			
+			if ($_REQUEST['template_file'] != '-1') {
 				 
 				$path = $this->shop->getRessourcePath('mods/mod_kundenkontakt/templates/');
 				
-				$basket = new wpsg_basket();
-				$basket->initFromDB(wpsg_q($_REQUEST['edit_id']));
-
-				if ($this->shop->get_option('wpsg_htmlMail') === '1')
-				{
+				if ($this->shop->get_option('wpsg_htmlMail') === '1') {
 					
 					$this->shop->htmlMail = true;
@@ -312,10 +294,20 @@
 				}
 				
-				$this->shop->view['basket'] = $basket->toArray();
-				$this->shop->view['order'] = $this->shop->cache->loadOrder($_REQUEST['edit_id']);
-				$this->shop->view['kunde'] = $this->shop->cache->loadKunden($this->shop->view['order']['k_id']);
-				
-				$order_data = $this->shop->cache->loadOrder($_REQUEST['edit_id']);
-				if (trim($order_data['language']) != '') $this->shop->setTempLocale($order_data['language']);
+				$order_id = intval($_REQUEST['edit_id']??0);
+				
+				if ($order_id > 0) {
+										
+					$basket = new wpsg_basket();
+					$basket->initFromDB($order_id);
+					
+					$this->shop->view['oOrder'] = wpsg_order::getInstance($order_id);
+					$this->shop->view['basket'] = $basket->toArray();
+					$this->shop->view['order'] = $this->shop->cache->loadOrder($order_id);
+					$this->shop->view['kunde'] = $this->shop->cache->loadKunden($this->shop->view['order']['k_id']);
+					
+					$order_data = $this->shop->cache->loadOrder($_REQUEST['edit_id']);
+					if (trim($order_data['language']) != '') $this->shop->setTempLocale($order_data['language']);
+				
+				}
 				
 				$this->shop->view['datum'] = time();
@@ -327,13 +319,11 @@
             	global $template_name, $template_betreff;
 				
-				$template = $path.wpsg_q($_REQUEST['template_file']);
-				
-				if ($this->shop->get_option('wpsg_htmlmail') === '1')
-				{
+				$template = $path.basename($_REQUEST['template_file']);
+				
+				if ($this->shop->get_option('wpsg_htmlmail') === '1') {
 					
 					$template_html = preg_replace('/\.phtml$/i', '_html.phtml', $template);
 					
-					if (file_exists($template_html)) 
-					{
+					if (file_exists($template_html)) {
 						
 						$template = $template_html;
@@ -344,11 +334,17 @@
 								
 				$content = $this->shop->render($template, false);				
-				$content = $this->shop->replaceUniversalPlatzhalter($content, $_REQUEST['edit_id']);
-				$template_betreff = $this->shop->replaceUniversalPlatzhalter($template_betreff, $_REQUEST['edit_id']);
+				
+				if ($order_id > 0) {
+				
+					$content = $this->shop->replaceUniversalPlatzhalter($content, $order_id);
+				
+					$template_betreff = $this->shop->replaceUniversalPlatzhalter($template_betreff, $order_id);
+
+				}
 				 				
 				$this->shop->restoreTempLocale();
 								
 				$arData = array(
-					'subject' => wpsg_sinput("text_field", $template_betreff),
+					'subject' => $template_betreff,
 					'content' => $content						
 				);
@@ -356,5 +352,7 @@
 				header('Content-Type: application/json');
 				
-				die(json_encode($arData));
+				echo json_encode($arData);
+				
+				exit;
 				
 			}
@@ -366,34 +364,95 @@
 		 * Enter description here ...
 		 */
-		private function send()
-		{ 
-			
-			$mail_text = $this->shop->replaceUniversalPlatzhalter($_REQUEST['text'], $_REQUEST['edit_id']);
-			$to = $_REQUEST['empfaenger'];
-			$subject = $this->shop->replaceUniversalPlatzhalter($_REQUEST['subject'], $_REQUEST['edit_id']);
-			
-			// HTML Mail
-			if ($this->shop->get_option('wpsg_htmlmail') == '1')
-			{
-				
-				$mail_html = $this->shop->replaceUniversalPlatzhalter($_REQUEST['text'], $_REQUEST['edit_id']);
-				$mail_text = strip_tags($mail_html);
-				
-			} else $mail_html = false;
+		private function send() {
+
+			$arOrderID = $_REQUEST['arOrderID']??[$_REQUEST['edit_id']];
+
+			foreach ($arOrderID as $order_id) {
+				
+				$order_id = intval($order_id); 
+				$oOrder = wpsg_order::getInstance($order_id);
+				
+				$basket = new wpsg_basket();
+				$basket->initFromDB($order_id);
+				
+				$this->shop->view['oOrder'] = wpsg_order::getInstance($order_id);
+				$this->shop->view['basket'] = $basket->toArray();
+				$this->shop->view['order'] = $this->shop->cache->loadOrder($order_id);
+				$this->shop->view['kunde'] = $this->shop->cache->loadKunden($this->shop->view['order']['k_id']);
+				
+				if (trim($this->shop->view['order']['language']) != '') $this->shop->setTempLocale($this->shop->view['order']['language']);
+				else $this->shop->restoreTempLocale();
+								
+				$mail_text = $this->shop->replaceUniversalPlatzhalter($_REQUEST['text'], $order_id);
+				$to = $oOrder->getCustomer()->getEMail();
+				$subject = $this->shop->replaceUniversalPlatzhalter($_REQUEST['subject'], $order_id);
+				
+				// HTML Mail
+				if ($this->shop->get_option('wpsg_htmlmail') == '1') {
+					
+					$mail_html = $this->shop->replaceUniversalPlatzhalter($_REQUEST['text'], $order_id);
+					$mail_text = strip_tags($mail_html);
+					
+				} else $mail_html = false;
+				  
+				$this->shop->sendMail($mail_text, $to, 'customercontact', array(), $order_id, false, $mail_html, $subject);
+				
+				if (!isset($_REQUEST['arOrderID'])) {
+				
+					$this->shop->addBackendMessage(__('Eine Nachricht ÃŒber den Kundenkontakt wurde versendet.', 'wpsg'));
+
+				}
+				
+				$this->db->ImportQuery(WPSG_TBL_OL, array(
+					'cdate' => 'NOW()',
+					'o_id' => wpsg_q($order_id),
+					'title' => wpsg_q(wpsg_translate(__('Kundenkontakt "#1#"', 'wpsg'), $subject)),
+					'mailtext' => wpsg_q($mail_text)					
+				));
+
+			}
 			 
-			$this->shop->sendMail($mail_text, $to, 'customercontact', array(), $_REQUEST['edit_id'], false, $mail_html, $subject);
-			
-			$this->shop->addBackendMessage(__('Eine Nachricht ÃŒber den Kundenkontakt wurde versendet.', 'wpsg'));
-			
-			$this->db->ImportQuery(WPSG_TBL_OL, array(
-				'cdate' => 'NOW()',
-				'o_id' => wpsg_q($_REQUEST['edit_id']),
-				'title' => wpsg_q(wpsg_translate(__('Kundenkontakt "#1#"', 'wpsg'), $subject)),
-				'mailtext' => wpsg_q($mail_text)					
-			));
-			 			
-			die('1');
-			
-		}
-	
+			if (isset($_REQUEST['arOrderID'])) {
+				
+				echo wpsg_translate(__('Es wurden #1# Kunden informiert.', 'wpsg'), sizeof($_REQUEST['arOrderID']));
+
+			} else {
+			
+				echo '1';
+
+			}
+			
+			exit;
+
+		}
+
+		/**
+		 * Gibt die verfÃŒgbaren Templates als Array zurÃŒck
+		 * @return array
+		 */
+		private function getTemplates(): array {
+			
+			$path = $this->shop->getRessourcePath('mods/mod_kundenkontakt/templates/');
+			
+			$arTemplates = array();
+			
+			$arrFiles = scandir($path);
+			
+			foreach ($arrFiles as $file) {
+				
+				if (is_file($path.$file) && preg_match('/(.*)\.phtml/', $file) && !preg_match('/(.*)_html\.phtml/', $file)) {
+					
+					$template_name = str_replace('.phtml', '', $file);
+					
+					$arTemplates[$file]['filename'] = $file;
+					$arTemplates[$file]['name'] = ucfirst($template_name);
+					
+				}
+				
+			}
+			
+			return $arTemplates;
+			
+		}
+		
 	} // class wpsg_mod_kundenkontakt extends wpsg_mod_basic 
Index: /mods/wpsg_mod_paypalapi.class.php
===================================================================
--- /mods/wpsg_mod_paypalapi.class.php	(revision 7931)
+++ /mods/wpsg_mod_paypalapi.class.php	(revision 7932)
@@ -1893,5 +1893,5 @@
 
                     $subTotal += $d['brutto'];
-
+  
                     $discounts += abs($d['brutto']);
 
Index: /views/admin/form/input.phtml
===================================================================
--- /views/admin/form/input.phtml	(revision 7931)
+++ /views/admin/form/input.phtml	(revision 7932)
@@ -1,3 +1,3 @@
-<div class="form-group form-group-sm <?php echo ((wpsg_isSizedString($this->view['field_config']['help']))?'has-feedback':''); ?>">
+<div class="form-group form-group-sm <?php echo ((wpsg_isSizedString($this->view['field_config']['help']))?'has-feedback':''); ?>" <?php echo ((isset($this->view['field_config']['wrap_id']))?'id="'.$this->view['field_config']['wrap_id'].'" ':''); ?>>
 
 	<label class="col-sm-6 control-label" for="<?php echo $this->view['field_id']; ?>"><?php echo $this->view['field_label']; ?></label>
Index: /views/admin/form/select.phtml
===================================================================
--- /views/admin/form/select.phtml	(revision 7931)
+++ /views/admin/form/select.phtml	(revision 7932)
@@ -1,3 +1,3 @@
-<div class="form-group form-group-sm form-select <?php echo ((wpsg_isSizedString($this->view['field_config']['help']) || wpsg_isSizedString($this->view['field_config']['icon']))?'has-feedback':''); ?>">
+<div class="form-group form-group-sm form-select <?php echo ((wpsg_isSizedString($this->view['field_config']['help']) || wpsg_isSizedString($this->view['field_config']['icon']))?'has-feedback':''); ?>" <?php echo ((isset($this->view['field_config']['wrap_id']))?'id="'.$this->view['field_config']['wrap_id'].'" ':''); ?>>
 
 	<label class="col-sm-6 control-label" for="<?php echo $this->view['field_id']; ?>"><?php echo $this->view['field_label']; ?></label>
Index: /views/admin/form/textarea.phtml
===================================================================
--- /views/admin/form/textarea.phtml	(revision 7931)
+++ /views/admin/form/textarea.phtml	(revision 7932)
@@ -1,3 +1,3 @@
-<div class="form-group form-group-sm form-textarea <?php echo ((wpsg_isSizedString($this->view['field_config']['help']))?'has-feedback':''); ?>">
+<div class="form-group form-group-sm form-textarea <?php echo ((wpsg_isSizedString($this->view['field_config']['help']))?'has-feedback':''); ?>" <?php echo ((isset($this->view['field_config']['wrap_id']))?'id="'.$this->view['field_config']['wrap_id'].'" ':''); ?>>
 	
 	<?php if (wpsg_isSizedString($this->view['field_config']['fullLabel'])) { ?>
Index: /views/css/admin.css
===================================================================
--- /views/css/admin.css	(revision 7931)
+++ /views/css/admin.css	(revision 7932)
@@ -80,4 +80,9 @@
 #wpsg-bs .combodate select.second { width:50px !important; }
 #wpsg-bs .editable-popup .control-group { width:500px !important; }
+#wpsg-bs .inline-block { display:inline-block; }
+#wpsg-bs .mr-2 { margin-right:0.5rem; }
+#wpsg-bs .mr-4 { margin-right:1rem; }
+#wpsg-bs .mt-0 { margin-top:0; }
+#wpsg-bs .font-normal { font-weight:normal; }
 
 .wp-admin #wpsg-bs select { max-width:100%; padding-right:0; line-height:initial; }
Index: /views/mods/mod_autodebit/order_view_afterpayment.phtml
===================================================================
--- /views/mods/mod_autodebit/order_view_afterpayment.phtml	(revision 7931)
+++ /views/mods/mod_autodebit/order_view_afterpayment.phtml	(revision 7932)
@@ -6,18 +6,104 @@
 
 ?>
+    
 <br />
-<?php echo wpsg_drawForm_Text(__('Name der Bank', 'wpsg'), $this->view['wpsg_mod_autodebit']['name']); ?>
+    
+<?php echo wpsg_drawForm_Text(__('Name der Bank', 'wpsg'), $this->view['wpsg_mod_autodebit']['name'], 'wpsg_mod_autodebit_name'); ?>
 
 <?php if ($this->get_option('wpsg_mod_autodebit_iban') == '1') { ?>
-<?php echo wpsg_drawForm_Text(__('BIC der Bank', 'wpsg'), $this->view['wpsg_mod_autodebit']['bic']); ?>
+
+    <?php echo wpsg_drawForm_Text(__('BIC der Bank', 'wpsg'), $this->view['wpsg_mod_autodebit']['bic'], 'wpsg_mod_autodebit_bic'); ?>
+    
 <?php } else { ?>
-<?php echo wpsg_drawForm_Text(__('BLZ der Bank', 'wpsg'), $this->view['wpsg_mod_autodebit']['blz']); ?>
+    
+    <?php echo wpsg_drawForm_Text(__('BLZ der Bank', 'wpsg'), $this->view['wpsg_mod_autodebit']['blz'], 'wpsg_mod_autodebit_blz'); ?>
+    
 <?php } ?>
 
-<?php echo wpsg_drawForm_Text(__('Inhaber', 'wpsg'), $this->view['wpsg_mod_autodebit']['inhaber']); ?>
+<?php echo wpsg_drawForm_Text(__('Inhaber', 'wpsg'), $this->view['wpsg_mod_autodebit']['inhaber'], 'wpsg_mod_autodebit_owner'); ?>
 
 <?php if ($this->get_option('wpsg_mod_autodebit_iban') == '1') { ?>
-<?php echo wpsg_drawForm_Text(__('IBAN Nr.', 'wpsg'), $this->view['wpsg_mod_autodebit']['iban']); ?>
+
+    <?php echo wpsg_drawForm_Text(__('IBAN Nr.', 'wpsg'), $this->view['wpsg_mod_autodebit']['iban'], 'wpsg_mod_autodebit_iban'); ?>
+    
 <?php } else { ?>
-<?php echo wpsg_drawForm_Text(__('Kontonummer', 'wpsg'), $this->view['wpsg_mod_autodebit']['knr']); ?>
+    
+    <?php echo wpsg_drawForm_Text(__('Kontonummer', 'wpsg'), $this->view['wpsg_mod_autodebit']['knr'], 'wpsg_mod_autodebit_knr'); ?>
+    
 <?php } ?>
+
+<script>
+    
+    jQuery('#wpsg_mod_autodebit_name').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_autodebit&do=inlinedit&noheader=1', {
+        submitdata: {
+        	order_id: <?php echo intval($_REQUEST['edit_id']); ?>,
+            field: 'name'
+        },
+        submit: '<?php echo __('Speichern', 'wpsg'); ?>',
+        placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+        indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+        tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
+    });
+    
+    jQuery('#wpsg_mod_autodebit_owner').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_autodebit&do=inlinedit&noheader=1', {
+        submitdata: {
+        	order_id: <?php echo intval($_REQUEST['edit_id']); ?>,
+            field: 'owner'
+        },
+        submit: '<?php echo __('Speichern', 'wpsg'); ?>',
+        placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+        indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+        tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
+    });
+    
+    <?php if ($this->get_option('wpsg_mod_autodebit_iban') == '1') { ?>
+    
+        jQuery('#wpsg_mod_autodebit_bic').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_autodebit&do=inlinedit&noheader=1', {
+            submitdata: {
+            	order_id: <?php echo intval($_REQUEST['edit_id']); ?>,
+                field: 'bic'
+            },
+            submit: '<?php echo __('Speichern', 'wpsg'); ?>',
+            placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+            indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+            tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
+        });
+        
+        jQuery('#wpsg_mod_autodebit_iban').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_autodebit&do=inlinedit&noheader=1', {
+            submitdata: {
+            	order_id: <?php echo intval($_REQUEST['edit_id']); ?>,
+                field: 'iban'
+            },
+            submit: '<?php echo __('Speichern', 'wpsg'); ?>',
+            placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+            indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+            tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
+        });
+    
+    <?php } else { ?>
+    
+        jQuery('#wpsg_mod_autodebit_blz').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_autodebit&do=inlinedit&noheader=1', {
+            submitdata: {
+            	order_id: <?php echo intval($_REQUEST['edit_id']); ?>,
+                field: 'blz'
+            },
+            submit: '<?php echo __('Speichern', 'wpsg'); ?>',
+            placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+            indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+            tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
+        });
+        
+        jQuery('#wpsg_mod_autodebit_knr').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_autodebit&do=inlinedit&noheader=1', {
+            submitdata: {
+            	order_id: <?php echo intval($_REQUEST['edit_id']); ?>,
+                field: 'knr'
+            },
+            submit: '<?php echo __('Speichern', 'wpsg'); ?>',
+            placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+            indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+            tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
+        });
+    
+    <?php } ?>
+    
+</script>
Index: /views/mods/mod_kundenkontakt/order_index_bottom.phtml
===================================================================
--- /views/mods/mod_kundenkontakt/order_index_bottom.phtml	(revision 7932)
+++ /views/mods/mod_kundenkontakt/order_index_bottom.phtml	(revision 7932)
@@ -0,0 +1,142 @@
+<?php
+
+	declare(strict_types=1);
+
+	/**
+	 * User: Daschmi (daschmi@daschmi.de)
+	 * Date: 03.08.2021
+	 * Time: 07:17
+	 */
+
+	namespace wpsg;
+	
+	$arTemplateSelect = ['0' => __('Bitte auswÃ€hlen', 'wpsg')];
+	
+	foreach ($this->view['arTemplates'] as $t) $arTemplateSelect[$t['filename']] = $t['name'];
+	
+?>
+
+<fieldset id="wpsg_mod_kundenkontakt_layer" style="display:none;">
+    <legend><?php echo __('Kundenkontakt', 'wpsg'); ?></legend>
+    <div>
+        
+        <?php echo wpsg_drawForm_Select('wpsg_mod_kundenkontakt_template', __('Template', 'wpsg'), $arTemplateSelect, '0'); ?>
+        <?php echo wpsg_drawForm_Input('wpsg_mod_kundenkontakt_subject', __('Betreff', 'wpsg'), '', ['wrap_id' => 'wpsg_mod_kundenkontakt_subject_wrap']); ?>
+        <?php echo wpsg_drawForm_Textarea('wpsg_mod_kundenkontakt_text', __('Text', 'wpsg'), '', ['wrap_id' => 'wpsg_mod_kundenkontakt_text_wrap']); ?>
+              
+        <?php echo wpsg_drawForm_Button(__('Kunden informieren', 'wpsg'), '', ['wrap_id' => 'wpsg_mod_kundenkontakt_submit_wrap', 'field_id' => 'wpsg_mod_kundenkontakt_submit']); ?>
+        
+    </div>
+</fieldset>
+
+<script>
+            
+    let el_wpsg_mod_kundenkontakt_layer = document.getElementById('wpsg_mod_kundenkontakt_layer');
+    
+    let el_wpsg_mod_kundenkontakt_subject = document.getElementById('wpsg_mod_kundenkontakt_subject');
+    let el_wpsg_mod_kundenkontakt_subject_wrap = document.getElementById('wpsg_mod_kundenkontakt_subject_wrap');
+    
+    let el_wpsg_mod_kundenkontakt_text = document.getElementById('wpsg_mod_kundenkontakt_text');
+    let el_wpsg_mod_kundenkontakt_text_wrap = document.getElementById('wpsg_mod_kundenkontakt_text_wrap');
+    
+    let el_wpsg_mod_kundenkontakt_submit = document.getElementById('wpsg_mod_kundenkontakt_submit');
+    let el_wpsg_mod_kundenkontakt_submit_wrap = document.getElementById('wpsg_mod_kundenkontakt_submit_wrap');
+    
+    let el_doaction = document.getElementById('doaction');
+    
+    document.getElementById('wpsg_mod_kundenkontakt_template').addEventListener('change', (event) => {
+            
+    	if (event.target.value !== '0') {
+                		
+            jQuery.ajax({ 
+                url: "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_kundenkontakt&noheader=1&do=kk_switchTemplate",
+                dataType: 'json',
+                data: {					
+                    template_file: event.target.value
+                },
+                success: function(data) {
+            
+                	el_wpsg_mod_kundenkontakt_subject_wrap.style.display = 'block';
+    		        el_wpsg_mod_kundenkontakt_text_wrap.style.display = 'block';  
+    		        el_wpsg_mod_kundenkontakt_submit_wrap.style.display = 'block';  
+                	
+                    el_wpsg_mod_kundenkontakt_subject.value = data.subject;
+                    el_wpsg_mod_kundenkontakt_text.value = data.content;
+                    
+                }
+            });
+
+	    } else {
+    		    		
+    		el_wpsg_mod_kundenkontakt_subject_wrap.style.display = 'none';
+    		el_wpsg_mod_kundenkontakt_text_wrap.style.display = 'none';
+    		el_wpsg_mod_kundenkontakt_submit_wrap.style.display = 'none';
+    		    		
+        }
+        
+    });
+    
+    el_wpsg_mod_kundenkontakt_submit.addEventListener('click', (event) => {
+    	
+    	event.preventDefault();
+    	
+    	let arOrderID = [];
+    	
+    	for (let el of document.querySelectorAll('.col_set_checkbox')) {
+    		
+    		if (el.checked) arOrderID.push(el.getAttribute('data-order_id'));
+    		
+        }
+    	    	
+    	if (arOrderID.length <= 0) {
+    		
+    		alert('<?php echo __('Bitte mindestens eine Bestellung auswÃ€hlen.', 'wpsg'); ?>');
+    		return;
+        }    	
+    	
+    	el_wpsg_mod_kundenkontakt_submit.setAttribute("disabled", "disabled");
+    	
+    	jQuery.ajax({ 
+            url: "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_kundenkontakt&noheader=1&do=kk_sendMail",
+            data: {					
+                arOrderID: arOrderID,
+                text: el_wpsg_mod_kundenkontakt_text.value,
+                el_wpsg_mod_kundenkontakt_subject: el_wpsg_mod_kundenkontakt_subject.value
+            },
+            success: function(data) {
+        
+            	el_wpsg_mod_kundenkontakt_submit.removeAttribute("disabled");
+            	
+            	alert(data);
+            	
+            }
+        });
+    	
+    });
+    
+    document.getElementById('wpsg_action').addEventListener('change', (event) => {
+        
+        if (event.target.value === 'customercontact') {
+            
+        	el_doaction.style.display = 'none';
+            el_wpsg_mod_kundenkontakt_layer.style.display = 'block';
+            
+        } else {
+        
+        	el_doaction.style.display = 'inline-block';
+        	el_wpsg_mod_kundenkontakt_layer.style.display = 'none';
+        	
+        }
+        
+    });
+    
+</script>
+
+<style>
+    
+    #wpsg_mod_kundenkontakt_text { height:300px; }
+    #wpsg_mod_kundenkontakt_subject_wrap { display:none; }
+    #wpsg_mod_kundenkontakt_text_wrap { display:none; }
+    #wpsg_mod_kundenkontakt_submit_wrap { display:none; }
+    
+</style>
Index: /views/mods/mod_kundenkontakt/order_view.phtml
===================================================================
--- /views/mods/mod_kundenkontakt/order_view.phtml	(revision 7931)
+++ /views/mods/mod_kundenkontakt/order_view.phtml	(revision 7932)
@@ -161,5 +161,5 @@
 				<?php } else { ?>			
 				<label><?php echo __("Text", "wpsg"); ?>:<br /></label>
-				<textarea id="kk_text" class="wpsg_kundenkontakt_textarea"></textarea>
+				<textarea id="kk_text" class="wpsg_kundenkontakt_textarea" style="font-family:monospace;"></textarea>
 				<div class="wpsg_clear"></div>
 				<?php } ?>
Index: /views/mods/mod_kundenkontakt/templates/zahlungsaufforderung.phtml
===================================================================
--- /views/mods/mod_kundenkontakt/templates/zahlungsaufforderung.phtml	(revision 7931)
+++ /views/mods/mod_kundenkontakt/templates/zahlungsaufforderung.phtml	(revision 7932)
@@ -2,5 +2,5 @@
 	
 	global $template_name, $template_betreff, $absender_name, $absender_email;
-
+		
 	/**
 	 * Betreff des Templates
@@ -9,16 +9,7 @@
 	$template_betreff = __('wpShopGermany: Zahlungsaufforderung', 'wpsg');
 		
-	/*
-	 * $this->view['basket'] enthÃ€lt Angaben ÃŒber den Warenlorb
-	 * $this->view['kunde'] EnthÃ€lt den Kundendatensatz aus der Datenbank
-	 * $this->view['order'] EnthÃ€lt den Bestelldatensatz aus der Datenbank
-	 * $this->view['datum'] EnthÃ€lt das aktuelle Datum (Timestemp)
-	 */
-	$arPflicht = $this->loadPflichtFeldDaten();
-	$arTitle = explode('|', $arPflicht['anrede_auswahl']);
-	
-?><?php echo wpsg_translate(__('Hallo #1# #2# #3#,', 'wpsg'), @$arTitle[$this->view['basket']['checkout']['title']], $this->view['basket']['checkout']['vname'], $this->view['basket']['checkout']['name']); ?>
+?><?php echo __('Hallo %kunde_anrede% %kunde_vname% %kunde_name%,', 'wpsg'); ?> 
  
-<?php echo __('Sie sind Ihren Zahlungsverpflichtungen nicht nachgekommen. Bitte begleichen Sie umgehend den Rechnungsbetrag von', 'wpsg') ?> <?php echo wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')); ?>
+<?php echo __('Sie sind Ihren Zahlungsverpflichtungen nicht nachgekommen. Bitte begleichen Sie umgehend den Rechnungsbetrag von %order_topay_brutto_formated%.', 'wpsg') ?> 
  
 <?php echo __('Bestelldaten', 'wpsg'); ?>: 
@@ -26,5 +17,5 @@
 
 <?php echo __('Nutzen Sie bitte folgenden Link um den Zahlvorgang abschlieÃen zu kÃ¶nnen', 'wpsg'); ?>:
-<?php echo $this->getDoneURL($this->view['order']['id']); ?> 
+%order_done_url% 
 
 <?php echo __('Mit freundlichen GrÃŒÃen', 'wpsg') ?>
Index: /views/mods/mod_kundenkontakt/templates/zahlungsaufforderung_html.phtml
===================================================================
--- /views/mods/mod_kundenkontakt/templates/zahlungsaufforderung_html.phtml	(revision 7931)
+++ /views/mods/mod_kundenkontakt/templates/zahlungsaufforderung_html.phtml	(revision 7932)
@@ -10,15 +10,8 @@
 
 	$template_betreff = __('wpShopGermany: Zahlungsaufforderung', 'wpsg');
-		
-	/*
-	 * $this->view['basket'] enthÃ€lt Angaben ÃŒber den Warenlorb
-	 * $this->view['kunde'] EnthÃ€lt den Kundendatensatz aus der Datenbank
-	 * $this->view['order'] EnthÃ€lt den Bestelldatensatz aus der Datenbank
-	 * $this->view['datum'] EnthÃ€lt das aktuelle Datum (Timestemp)
-	 */
-
-?><p><?php echo __("Hallo", "wpsg"); ?> <?php echo $this->view['kunde']['vname']; ?> <?php echo $this->view['kunde']['name']; ?>,</p>
  
-<p><?php echo __('Sie sind Ihren Zahlungsverpflichtungen nicht nachgekommen. Bitte begleichen Sie umgehend den Rechnungsbetrag von', 'wpsg') ?> <?php echo wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')); ?>.</p>
+?><p><?php echo __('Hallo %kunde_anrede% %kunde_vname% %kunde_name%,', 'wpsg'); ?>,</p>
+ 
+<p><?php echo __('Sie sind Ihren Zahlungsverpflichtungen nicht nachgekommen. Bitte begleichen Sie umgehend den Rechnungsbetrag von %order_topay_brutto_formated%.', 'wpsg') ?></p>
 
 <h2><?php echo __('Bestelldaten', 'wpsg'); ?></h2>
@@ -30,5 +23,5 @@
 <p>
 	<?php echo __('Nutzen Sie bitte folgenden Link um den Zahlvorgang abschlieÃen zu kÃ¶nnen', 'wpsg'); ?>:
-	<a href="<?php echo $this->getDoneURL($this->view['order']['id']); ?>"><?php echo __('Bestellabschlussseite', 'wpsg'); ?></a>
+	<a href="%order_done_url%"><?php echo __('Bestellabschlussseite', 'wpsg'); ?></a>
 </p>
 
Index: /views/mods/mod_kundenkontakt/templates/zahlungserinnerung.phtml
===================================================================
--- /views/mods/mod_kundenkontakt/templates/zahlungserinnerung.phtml	(revision 7931)
+++ /views/mods/mod_kundenkontakt/templates/zahlungserinnerung.phtml	(revision 7932)
@@ -8,19 +8,8 @@
 
 	$template_betreff = __('wpShopGermany: Zahlungserinnerung', 'wpsg');
-	 	
-	/*
-	 * $this->view['basket'] enthÃ€lt Angaben ÃŒber den Warenlorb
-	 * $this->view['kunde'] EnthÃ€lt den Kundendatensatz aus der Datenbank
-	 * $this->view['order'] EnthÃ€lt den Bestelldatensatz aus der Datenbank
-	 * $this->view['datum'] EnthÃ€lt das aktuelle Datum (Timestemp)
-	 */
-	
-	$arPflicht = $this->loadPflichtFeldDaten();
-	$arTitle = explode('|', $arPflicht['anrede_auswahl']);
-	
-	
-?><?php echo wpsg_translate(__('Hallo #1# #2# #3#,', 'wpsg'), @$arTitle[$this->view['basket']['checkout']['title']], $this->view['basket']['checkout']['vname'], $this->view['basket']['checkout']['name']); ?>
+	 	 
+?><?php echo __('Hallo %kunde_anrede% %kunde_vname% %kunde_name%,', 'wpsg'); ?> 
  
-<?php echo __('Sie haben am', 'wpsg') ?> <?php echo date("d.m.Y | H:i", strtotime($this->view['order']['cdate'])); ?> <?php echo __('eine Bestellung ÃŒber', 'wpsg') ?> <?php echo wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')); ?> <?php echo __('aufgegeben. Leider ist bis heute kein Zahlungsausgleich erfolgt. Gab es Probleme mit der Zahlung? Gerne helfen wir Ihnen weiter! Oder dÃŒrfen wir die Bestellung fÃŒr Sie stornieren?', 'wpsg') ?>
+<?php echo __('Sie haben am', 'wpsg') ?> %order_cdate_format_de% <?php echo __('eine Bestellung ÃŒber %order_topay_brutto_formated% aufgegeben. Leider ist bis heute kein Zahlungsausgleich erfolgt. Gab es Probleme mit der Zahlung? Gerne helfen wir Ihnen weiter! Oder dÃŒrfen wir die Bestellung fÃŒr Sie stornieren?', 'wpsg') ?> 
  
 <?php echo __('Bestelldaten', 'wpsg'); ?>: 
@@ -28,5 +17,5 @@
 
 <?php echo __('Nutzen Sie bitte folgenden Link um den Zahlvorgang abschlieÃen zu kÃ¶nnen', 'wpsg'); ?>:
-<?php echo $this->getDoneUrl($this->view['order']['id']); ?>
+%order_done_url%
 
 <?php echo __('Mit freundlichen GrÃŒÃen', 'wpsg') ?>
Index: /views/mods/mod_kundenkontakt/templates/zahlungserinnerung_html.phtml
===================================================================
--- /views/mods/mod_kundenkontakt/templates/zahlungserinnerung_html.phtml	(revision 7931)
+++ /views/mods/mod_kundenkontakt/templates/zahlungserinnerung_html.phtml	(revision 7932)
@@ -9,15 +9,8 @@
 	 */
 	$template_betreff = __('wpShopGermany: Zahlungserinnerung', 'wpsg');
-	 	
-	/*
-	 * $this->view['basket'] enthÃ€lt Angaben ÃŒber den Warenlorb
-	 * $this->view['kunde'] EnthÃ€lt den Kundendatensatz aus der Datenbank
-	 * $this->view['order'] EnthÃ€lt den Bestelldatensatz aus der Datenbank
-	 * $this->view['datum'] EnthÃ€lt das aktuelle Datum (Timestemp)
-	 */
+	  
+?><p><?php echo __('Hallo %kunde_anrede% %kunde_vname% %kunde_name%,', 'wpsg'); ?></p>
  
-?><p><?php echo __("Hallo", "wpsg"); ?> <?php echo $this->view['kunde']['vname']; ?> <?php echo $this->view['kunde']['name']; ?>,</p>
- 
-<p><?php echo __('Sie haben am', 'wpsg') ?> <?php echo date("d.m.Y | H:i", strtotime($this->view['data']['cdate'])); ?> <?php echo __('eine Bestellung ÃŒber', 'wpsg') ?> <?php echo wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')); ?> <?php echo __('aufgegeben. Leider ist bis heute kein Zahlungsausgleich erfolgt. Gab es Probleme mit der Zahlung? Gerne helfen wir Ihnen weiter! Oder dÃŒrfen wir die Bestellung fÃŒr Sie stornieren?', 'wpsg') ?></p>
+<p><?php echo __('Sie haben am', 'wpsg') ?> %order_cdate_format_de% <?php echo __('eine Bestellung ÃŒber %order_topay_brutto_formated% aufgegeben. Leider ist bis heute kein Zahlungsausgleich erfolgt. Gab es Probleme mit der Zahlung? Gerne helfen wir Ihnen weiter! Oder dÃŒrfen wir die Bestellung fÃŒr Sie stornieren?', 'wpsg') ?></p>
 
 <h2><?php echo __('Bestelldaten', 'wpsg'); ?></h2>
@@ -29,5 +22,5 @@
 <p>
 	<?php echo __('Nutzen Sie bitte folgenden Link um den Zahlvorgang abschlieÃen zu kÃ¶nnen', 'wpsg'); ?>:
-	<a href="<?php echo $this->getDoneURL($this->view['order']['id']); ?>"><?php echo __('Bestellabschlussseite', 'wpsg'); ?></a>
+	<a href=""%order_done_url%"><?php echo __('Bestellabschlussseite', 'wpsg'); ?></a>
 </p>
 
Index: /views/order/index.phtml
===================================================================
--- /views/order/index.phtml	(revision 7931)
+++ /views/order/index.phtml	(revision 7932)
@@ -5,4 +5,12 @@
 	 */
 
+	$arPaymentKeySelect = [];
+	
+	foreach ($this->getPaymentArray() as $payment_key => $payment) {
+	    
+	    $arPaymentKeySelect[$payment_key] = $payment['name'];
+	    
+    }
+	
 ?>
 
@@ -47,4 +55,5 @@
 						<?php echo wpsg_drawForm_Input('filter[s]', __('Suchfeld', 'wpsg'), wpsg_getStr($this->view['arFilter']['s'])); ?>
                         <?php echo wpsg_drawForm_Input('filter[k_id]', __('Kunde (ID)', 'wpsg'), wpsg_getStr($this->view['arFilter']['k_id'])); ?>
+                        <?php echo wpsg_drawForm_Select('filter[payment_key]', __('Zahlungsart', 'wpsg'), $arPaymentKeySelect, wpsg_getStr($this->view['arFilter']['payment_key'])); ?>
 						<?php echo wpsg_drawForm_Select('filter[status]', __('Bestellstatus', 'wpsg'), wpsg_array_merge(array('-1' => __('Alle', 'wpsg')), $this->arStatus), @$this->view['arFilter']['status']); ?>
 						
@@ -247,5 +256,5 @@
                         <td class="col_checkbox">
 
-                            <input class="col_set_checkbox" name="wpsg_multido[<?php echo $oOrder->id; ?>]" type="checkbox" />
+                            <input class="col_set_checkbox" data-order_id="<?php echo $oOrder->id; ?>" name="wpsg_multido[<?php echo $oOrder->id; ?>]" type="checkbox" />
 
                         </td>
@@ -418,8 +427,37 @@
                     <option value="showRechnung"><?php echo __('Rechnung ansehen', 'wpsg'); ?></option>
                     <?php } ?>
+                    <?php if ($this->hasMod('wpsg_mod_kundenkontakt')) { ?>
+                    <option value="customercontact"><?php echo __('Kunden informieren', 'wpsg') ;?></option>
+                    <?php } ?>
                 </select>
 
                 <input onclick="if (jQuery('#wpsg_action').val() == 'multiDelete') { if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return false; }" type="submit" value="<?php echo __('AusfÃŒhren', 'wpsg'); ?>" class="button-secondary action" id="doaction" name="wpsg_order_doaction" />
 
+                <div id="customer_inform" style="display:none;">
+                    <label class="mr-4 font-normal">
+                        <input class="mt-0 mr-2" type="checkbox" name="inform" value="1" />&nbsp;<?php echo __('Kunden informieren', 'wpsg'); ?>
+                    </label>
+                </div>
+                
+                <script>
+                    
+                    let el_customer_inform = document.getElementById('customer_inform');
+                    
+                    document.getElementById('wpsg_action').addEventListener('change', (event) => {
+                    	
+                    	if (parseInt(event.target.value) >= 0) {
+                    		
+                    		el_customer_inform.style.display = 'inline-block';
+                    		
+                        } else {
+                    		
+                    		el_customer_inform.style.display = 'none';
+                    		
+                        }
+                    	
+                    });
+                    
+                </script>
+                
             </div>
 
@@ -442,6 +480,8 @@
 		</form>
 	</div>
-
-<script type="text/javascript">/* <![CDATA[ */
+    
+    <?php if ($this->hasMod('wpsg_mod_kundenkontakt')) { $this->callMod('wpsg_mod_kundenkontakt', 'order_index_bottom'); } ?>
+
+<script>
 
     <?php if (wpsg_isSizedString($this->view['arFilter']['order']) && wpsg_isSizedString($this->view['arFilter']['ascdesc'])) { ?>
@@ -519,4 +559,12 @@
 
     } );
-
-/* <![CDATA[ */</script>
+	
+	<?php if ($this->hasMod('wpsg_mod_kundenkontakt')) { ?>
+	document.getElementById('wpsg_action').addEventListener('click', (event) => {
+		
+		console.log('OK');
+		
+    });
+	<?php } ?>
+
+</script>
