summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2024-11-18 07:36:36 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2024-11-18 07:36:36 +0000
commit2f9649c605bfafb9c205115a110fceb3068ab751 (patch)
treeeb80b01335a5f67a3cccc60de710ccc0220d2d9f
parent479bd8b375aa031f2dc0a3750b1dd6c938ccfb6a (diff)
- Feature: eInvoice Rechnungsempfänger unabhängig von E-Mail des Kunden
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8456 0d5edaf7-2b12-4e95-93f4-047927463d4b
-rw-r--r--views/admin/kundendaten_tab1.phtml1
-rw-r--r--views/css/frontend.css3
-rw-r--r--views/mailtemplates/adminmail.phtml10
-rw-r--r--views/mailtemplates/html/customer.phtml19
-rw-r--r--views/mailtemplates/kundenmail.phtml17
-rw-r--r--views/mods/mod_kundenverwaltung/edit.phtml11
-rwxr-xr-xviews/mods/mod_rechnungen/order_view_orderdata_after.phtml18
-rw-r--r--views/order/view_customerdata.phtml11
-rw-r--r--views/warenkorb/checkout.phtml32
-rw-r--r--views/warenkorb/overview.phtml7
10 files changed, 113 insertions, 16 deletions
diff --git a/views/admin/kundendaten_tab1.phtml b/views/admin/kundendaten_tab1.phtml
index 6dacb67..9a6d791 100644
--- a/views/admin/kundendaten_tab1.phtml
+++ b/views/admin/kundendaten_tab1.phtml
@@ -20,6 +20,7 @@
<?php echo wpsg_drawForm_Select('pflicht[geb]', __('Geburtsdatum', 'wpsg'), $arSelect, $this->view['pflicht']['geb'])?>
<?php echo wpsg_drawForm_Select('pflicht[email]', __('E-Mail Adresse', 'wpsg'), $arSelect, $this->view['pflicht']['email'])?>
<?php echo wpsg_drawForm_Checkbox('pflicht[emailconfirm]', __('E-Mail Adresse (Wiederholung)', 'wpsg'), $this->view['pflicht']['emailconfirm']); ?>
+<?php echo wpsg_drawForm_Checkbox('pflicht[eInvoice]', __('E-Mail Adresse für eRechnung abfragen (optional)', 'wpsg'), $this->view['pflicht']['eInvoice']??0); ?>
<?php echo wpsg_drawForm_Select('pflicht[tel]', __('Telefon', 'wpsg'), $arSelect, $this->view['pflicht']['tel'])?>
<?php echo wpsg_drawForm_Select('pflicht[fax]', __('Fax', 'wpsg'), $arSelect, $this->view['pflicht']['fax'])?>
<?php echo wpsg_drawForm_Select('pflicht[strasse]', __('Straße', 'wpsg'), $arSelect, $this->view['pflicht']['strasse'])?>
diff --git a/views/css/frontend.css b/views/css/frontend.css
index 70da2f2..47d1870 100644
--- a/views/css/frontend.css
+++ b/views/css/frontend.css
@@ -152,6 +152,9 @@ input.wpsg_error { border-color:red !important; }
.wpsg_overview .wpsg_overview_productimage { display:inline; padding-right:0.2rem; vertical-align:baseline; }
.wpsg_overview .wpsg_cell_weight_value { text-align:right; }
.wpsg_overview .wpsg_cell_deliverytime_value { text-align:right; }
+.wpsg_overview {
+ .einvoice_input { margin-bottom:2rem; }
+}
.wpsg_overview .wpsg_table_wrap {}
.wpsg_overview .wpsg_table_wrap .overview_product_row { display:flex; align-items:baseline; border-bottom:1px solid #EAEAEA; padding-bottom:1em; margin-bottom:1em; }
diff --git a/views/mailtemplates/adminmail.phtml b/views/mailtemplates/adminmail.phtml
index b284ed2..6b029ca 100644
--- a/views/mailtemplates/adminmail.phtml
+++ b/views/mailtemplates/adminmail.phtml
@@ -6,7 +6,7 @@
$this->htmlMail = false;
-
+ $oCustomer = wpsg_customer::getInstance(intval($this->view['basket']['checkout']['k_id']));
?><?php echo __('Hallo Administrator,', 'wpsg'); ?>
@@ -27,7 +27,10 @@
<?php echo wpsg_pad_right(__('Land', 'wpsg').':', 35); ?><?php echo $this->db->fetchOne("SELECT `name` FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($this->view['basket']['checkout']['land'])."' "); ?>
<?php echo wpsg_pad_right(__('Telefon', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['tel']; ?>
<?php echo wpsg_pad_right(__('Fax', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['fax']; ?>
-<?php echo wpsg_pad_right(__('E-Mail Adresse', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['email']; ?>
+<?php echo wpsg_pad_right(__('E-Mail Adresse', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['email']; ?>
+<?php $email_einvoice = $oCustomer->getEMailEInvoice(); if ($email_einvoice !== null) { ?>
+<?php echo wpsg_pad_right(__('E-Mail (eRechnung)', 'wpsg').':', 35); ?><?php echo $email_einvoice; ?>
+<?php } ?>
<?php echo __('Lieferadresse:', 'wpsg'); ?>
@@ -54,6 +57,9 @@
<?php echo wpsg_pad_right(__('Telefon', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['tel']; ?>
<?php echo wpsg_pad_right(__('Fax', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['fax']; ?>
<?php echo wpsg_pad_right(__('E-Mail Adresse', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['email']; ?>
+<?php $email_einvoice = $oCustomer->getEMailEInvoice(); if ($email_einvoice !== null) { ?>
+<?php echo wpsg_pad_right(__('E-Mail (eRechnung)', 'wpsg').':', 35); ?><?php echo $email_einvoice; ?>
+<?php } ?>
<?php } ?>
diff --git a/views/mailtemplates/html/customer.phtml b/views/mailtemplates/html/customer.phtml
index 4441268..dd1ffbb 100644
--- a/views/mailtemplates/html/customer.phtml
+++ b/views/mailtemplates/html/customer.phtml
@@ -1,3 +1,8 @@
+<?php
+
+ $oCustomer = wpsg_customer::getInstance(intval($this->view['basket']['checkout']['k_id']));
+
+?>
<?php if ($this->hasMod('wpsg_mod_shippingadress') && $this->callMod('wpsg_mod_shippingadress', 'check_different_shippingadress', array('k_id' => $this->view['basket']['checkout']['k_id'], 'o_id' => $this->view['o_id']))) { ?>
<h2><?php echo __('Rechnungsadresse:', 'wpsg'); ?></h2>
@@ -40,7 +45,13 @@
<tr>
<td style="padding:2px; line-height:100%; vertical-align:middle;" class="col0"><?php echo __('E-Mail Adresse', 'wpsg'); ?>:</td>
<td style="padding:2px; line-height:100%; vertical-align:middle;" class="col1"><a href="mailto:<?php echo wpsg_hspc($this->view['basket']['checkout']['email']); ?>"><?php echo wpsg_hspc($this->view['basket']['checkout']['email']); ?></a></td>
- </tr>
+ </tr>
+ <?php $email_einvoice = $oCustomer->getEMailEInvoice(); if ($email_einvoice !== null) { ?>
+ <tr>
+ <td style="padding:2px; line-height:100%; vertical-align:middle;" class="col0"><?php echo __('E-Mail (eRechnung)', 'wpsg'); ?>:</td>
+ <td style="padding:2px; line-height:100%; vertical-align:middle;" class="col1"><a href="mailto:<?php echo htmlspecialchars($email_einvoice); ?>"><?php echo htmlspecialchars($email_einvoice); ?></a></td>
+ </tr>
+ <?php } ?>
</table>
<h2><?php echo __('Lieferadresse', 'wpsg'); ?>:</h2>
@@ -110,6 +121,12 @@
<td style="padding:2px; line-height:100%; vertical-align:middle;" class="col0"><?php echo __('E-Mail Adresse', 'wpsg'); ?>:</td>
<td style="padding:2px; line-height:100%; vertical-align:middle;" class="col1"><a href="mailto:<?php echo wpsg_hspc($this->view['basket']['checkout']['email']); ?>"><?php echo wpsg_hspc($this->view['basket']['checkout']['email']); ?></a></td>
</tr>
+ <?php $email_einvoice = $oCustomer->getEMailEInvoice(); if ($email_einvoice !== null) { ?>
+ <tr>
+ <td style="padding:2px; line-height:100%; vertical-align:middle;" class="col0"><?php echo __('E-Mail (eRechnung)', 'wpsg'); ?>:</td>
+ <td style="padding:2px; line-height:100%; vertical-align:middle;" class="col1"><a href="mailto:<?php echo htmlspecialchars($email_einvoice); ?>"><?php echo htmlspecialchars($email_einvoice); ?></a></td>
+ </tr>
+ <?php } ?>
</table>
<?php } ?>
diff --git a/views/mailtemplates/kundenmail.phtml b/views/mailtemplates/kundenmail.phtml
index 3e61d4a..634dddd 100644
--- a/views/mailtemplates/kundenmail.phtml
+++ b/views/mailtemplates/kundenmail.phtml
@@ -8,9 +8,9 @@
$arPflicht = $this->loadPflichtFeldDaten();
$arTitle = explode('|', $arPflicht['anrede_auswahl']);
-
- //wpsg_debug($this->view);
-
+
+ $oCustomer = wpsg_customer::getInstance(intval($this->view['basket']['checkout']['k_id']));
+
?><?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 __('vielen Dank für Ihre Bestellung.', 'wpsg'); ?>
@@ -30,8 +30,10 @@
<?php echo wpsg_pad_right(__('Ort', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['plz']; ?> <?php echo $this->view['basket']['checkout']['ort']; ?>
<?php echo wpsg_pad_right(__('Telefon', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['tel']; ?>
<?php echo wpsg_pad_right(__('Fax', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['fax']; ?>
-<?php echo wpsg_pad_right(__('E-Mail Adresse', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['email']; ?>
-
+<?php echo wpsg_pad_right(__('E-Mail Adresse', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['email']; ?>
+<?php $email_einvoice = $oCustomer->getEMailEInvoice(); if ($email_einvoice !== null) { ?>
+<?php echo wpsg_pad_right(__('E-Mail (eRechnung)', 'wpsg').':', 35); ?><?php echo $email_einvoice; ?>
+<?php } ?>
<?php echo __('Lieferadresse:', 'wpsg'); ?>
<?php echo wpsg_pad_right(__('Firma', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['shipping_firma']; ?>
@@ -56,7 +58,10 @@
<?php echo wpsg_pad_right(__('Land', 'wpsg').':', 35); ?><?php echo $this->db->fetchOne("SELECT `name` FROM `".WPSG_TBL_LAND."` WHERE `id` = '".wpsg_q($this->view['basket']['checkout']['land'])."' "); ?>
<?php echo wpsg_pad_right(__('Telefon', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['tel']; ?>
<?php echo wpsg_pad_right(__('Fax', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['fax']; ?>
-<?php echo wpsg_pad_right(__('E-Mail Adresse', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['email']; ?>
+<?php echo wpsg_pad_right(__('E-Mail Adresse', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['email']; ?>
+<?php $email_einvoice = $oCustomer->getEMailEInvoice(); if ($email_einvoice !== null) { ?>
+<?php echo wpsg_pad_right(__('E-Mail (eRechnung)', 'wpsg').':', 35); ?><?php echo $email_einvoice; ?>
+<?php } ?>
<?php } ?>
diff --git a/views/mods/mod_kundenverwaltung/edit.phtml b/views/mods/mod_kundenverwaltung/edit.phtml
index bab185b..86fdde0 100644
--- a/views/mods/mod_kundenverwaltung/edit.phtml
+++ b/views/mods/mod_kundenverwaltung/edit.phtml
@@ -3,7 +3,9 @@
/**
* Template für die Bearbeitung eines Kunden im Backend
*/
-
+
+ $oCustomer = wpsg_customer::getInstance(intval($_REQUEST['edit_id']??0));
+
?>
<div class="wpsg_customer" id="wpsg-bs">
@@ -57,11 +59,16 @@
<?php echo wpsg_drawForm_Input('vname', __('Vorname', 'wpsg'), @$this->view['data']['vname']); ?>
<?php } ?>
<?php if ($this->view['pflicht']['geb'] != '2') { ?>
- <?php echo wpsg_drawForm_Input('geb', __('Geburtsdatum', 'wpsg'), wpsg_formatTimestamp(strtotime(@$this->view['data']['geb']), true), array('autocomplete' => false, 'datepicker' => true, 'hint' => __('Format: TT.MM.JJJJ', 'wpsg'))); ?>
+ <?php echo wpsg_drawForm_Input('geb', __('Geburtsdatum', 'wpsg'), wpsg_formatTimestamp(strtotime($this->view['data']['geb']??''), true), array('autocomplete' => false, 'datepicker' => true, 'hint' => __('Format: TT.MM.JJJJ', 'wpsg'))); ?>
<?php } ?>
<?php if ($this->view['pflicht']['email'] != '2') { ?>
<?php echo wpsg_drawForm_Input('email', __('E-Mail', 'wpsg'), @$this->view['data']['email']); ?>
<?php } ?>
+
+ <?php if ($oCustomer->getEMailEInvoice() !== null) { ?>
+ <?php echo wpsg_drawForm_Input('email_einvoice', __('E-Mail für eRechnung', 'wpsg'), $oCustomer->getEMailEInvoice()); ?>
+ <?php } ?>
+
<?php if ($this->view['pflicht']['firma'] != '2') { ?>
<?php echo wpsg_drawForm_Input('firma', __('Firma', 'wpsg'), @$this->view['data']['firma']); ?>
<?php } ?>
diff --git a/views/mods/mod_rechnungen/order_view_orderdata_after.phtml b/views/mods/mod_rechnungen/order_view_orderdata_after.phtml
index bbefb5e..55ec2a0 100755
--- a/views/mods/mod_rechnungen/order_view_orderdata_after.phtml
+++ b/views/mods/mod_rechnungen/order_view_orderdata_after.phtml
@@ -97,7 +97,14 @@
<input type="checkbox" name="wpsg_rechnungen_sendmail" value="1" id="invoice_sendmail" checked="checked" />
<label for="invoice_sendmail"><?php echo __('E-Mail an Kunden senden', 'wpsg'); ?></label>
- <input type="email" name="wpsg_rechnungen_email" value="<?php echo $oCustomer->getEMail(); ?>" />
+ <input type="email" name="wpsg_rechnungen_email" value="<?php
+
+ $mail = $oCustomer->getEMailEInvoice();
+ if ($mail === null) $mail = $oCustomer->getEMail();
+
+ echo $mail;
+
+ ?>" />
<input type="checkbox" name="wpsg_rechnungen_faelligkeit" value="1" id="invoice_faelligkeit" checked="checked" />
<label for="invoice_faelligkeit"><?php echo __('Fälligkeit anzeigen', 'wpsg'); ?></label>
@@ -271,7 +278,14 @@
<input type="checkbox" name="storno_send" id="storno_send" value="1" />
<label for="storno_send"><?php echo __('E-Mail an Kunden senden', 'wpsg'); ?></label>
- <input type="email" name="storno_mail" value="<?php echo $oCustomer->getEMail(); ?>" />
+ <input type="email" name="storno_mail" value="<?php
+
+ $mail = $oCustomer->getEMailEInvoice();
+ if ($mail === null) $mail = $oCustomer->getEMail();
+
+ echo $mail;
+
+ ?>" />
<input type="checkbox" id="storno_shippay" name="storno_shippay" value="1" id="invoice_shippay" <?php
diff --git a/views/order/view_customerdata.phtml b/views/order/view_customerdata.phtml
index c76ec1a..3393da1 100644
--- a/views/order/view_customerdata.phtml
+++ b/views/order/view_customerdata.phtml
@@ -55,6 +55,9 @@
'">'.$this->view['data']['email'].'</a>'); ?>
<?php } ?>
<?php } ?>
+
+ <?php echo wpsg_drawForm_Input('email_einvoice', __('E-Mail für eInvoice', 'wpsg'), $this->view['data']['email_einvoice']); ?>
+
<br />
<?php if ($this->view['pflicht']['strasse'] != '2') { ?>
@@ -143,7 +146,7 @@
</a>
<?php echo wpsg_drawForm_TextEnd(__('Anschrift', 'wpsg')); ?>
-
+
<?php if ($this->view['pflicht']['geb'] != '2') { ?>
<?php if (strtotime($this->view['data']['geb']) > 0) { ?>
<?php echo wpsg_drawForm_Text(__('Geburtsdatum', 'wpsg'), wpsg_fromDate($this->view['data']['geb']), array('text' => true)); ?>
@@ -172,6 +175,12 @@
<?php } ?>
<?php echo wpsg_drawForm_TextEnd(__('E-Mail', 'wpsg')); ?>
+ <?php $email_einvoice = $Customer->getEMailEInvoice(); if ($email_einvoice !== null) { ?>
+ <?php echo wpsg_drawForm_TextStart(); ?>
+ <a href="mailto:<?php echo htmlspecialchars($email_einvoice); ?>"><?php echo htmlspecialchars($email_einvoice); ?></a>
+ <?php echo wpsg_drawForm_TextEnd(__('E-Mail für eRechnungen', 'wpsg')); ?>
+ <?php } ?>
+
<script>
function wpsg_saveInvoiceAdress()
diff --git a/views/warenkorb/checkout.phtml b/views/warenkorb/checkout.phtml
index 6605b54..9a038cb 100644
--- a/views/warenkorb/checkout.phtml
+++ b/views/warenkorb/checkout.phtml
@@ -144,7 +144,14 @@
<label for="vname" class="wpsg_checkout"><?php echo __("Vorname:", "wpsg"); ?>
<?php if ($this->view['pflicht']['vname'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
</label>
- <input class="<?php echo (($this->view['pflicht']['vname'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("vname", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="vname" name="wpsg[checkout][vname]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['vname'])); ?>" />
+ <input
+ class="<?php echo (($this->view['pflicht']['vname'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("vname", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="text"
+ id="vname"
+ autocomplete="vname"
+ name="wpsg[checkout][vname]"
+ value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['vname'])); ?>"
+ />
</div>
<?php } ?>
@@ -153,7 +160,14 @@
<label for="name" class="wpsg_checkout"><?php echo __("Name:", "wpsg"); ?>
<?php if ($this->view['pflicht']['name'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>
</label>
- <input class="<?php echo (($this->view['pflicht']['name'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("name", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="name" name="wpsg[checkout][name]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['name'])); ?>" />
+ <input
+ class="<?php echo (($this->view['pflicht']['name'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("name", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="text"
+ id="name"
+ autocomplete="name"
+ name="wpsg[checkout][name]"
+ value="<?php echo htmlspecialchars(wpsg_getStr($this->view['basket']['checkout']['name'])); ?>"
+ />
</div>
<?php } ?>
@@ -191,6 +205,20 @@
<?php } ?>
<?php } ?>
+ <?php if (intval($this->view['pflicht']['eInvoice']??0) === 1) { ?>
+ <div class="wpsg_checkoutblock" id="wpsg_email_einvoice">
+ <label for="wpsg_email_einvoice_input" class="wpsg_checkout"><?php echo __("E-Mail (für eRechnung, optional)", "wpsg"); ?></label>
+ <input
+ class="wpsg_input_text wpsg_checkout <?php echo ((in_array("email_einvoice", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="email"
+ id="wpsg_email_einvoice_input"
+ name="wpsg[checkout][email_einvoice]"
+ value="<?php echo htmlspecialchars($this->view['basket']['checkout']['email_einvoice']??''); ?>"
+ autocomplete="off"
+ />
+ </div>
+ <?php } ?>
+
<?php if ($this->view['pflicht']['geb'] != '2') { ?>
<div class="wpsg_checkoutblock" id="wpsg_geburtsdatum">
<label for="geb" class="wpsg_checkout"><?php echo __('Geburtsdatum (Format: TT.MM.JJJJ):',"wpsg"); ?>
diff --git a/views/warenkorb/overview.phtml b/views/warenkorb/overview.phtml
index d481d45..0703012 100644
--- a/views/warenkorb/overview.phtml
+++ b/views/warenkorb/overview.phtml
@@ -166,6 +166,13 @@
<?php if (wpsg_isSizedString($this->view['basket']['checkout']['ustidnr'])) { ?>
<?php echo __('UStIdNr.', 'wpsg'); ?>: <?php echo wpsg_hspc($this->view['basket']['checkout']['ustidnr']); ?><br /><br />
<?php } ?>
+
+ <?php if (trim($this->view['basket']['checkout']['email_einvoice']??'') !== '') { ?>
+ <div class="einvoice_input">
+ <span><?php echo __('E-Mail für eRechnung:', 'wpsg'); ?></span>
+ <span><?php echo $this->view['basket']['checkout']['email_einvoice']; ?></span>
+ </div>
+ <?php } ?>
<div class="subtitle">
<?php echo __('Bestellte Produkte', 'wpsg'); ?>&nbsp;