summaryrefslogtreecommitdiff
path: root/views/mods
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods')
-rw-r--r--views/mods/mod_export/fields.phtml37
-rw-r--r--views/mods/mod_export/profil.phtml26
-rw-r--r--views/mods/mod_kundenverwaltung/checkout_login.phtml18
-rw-r--r--views/mods/mod_kundenverwaltung/edit.phtml2
-rw-r--r--views/mods/mod_kundenverwaltung/login.phtml17
-rw-r--r--views/mods/mod_kundenverwaltung/profil.phtml42
-rw-r--r--views/mods/mod_kundenverwaltung/register.phtml271
-rw-r--r--views/mods/mod_kundenverwaltung/settings_edit.phtml3
-rw-r--r--views/mods/mod_kundenverwaltung/widget.phtml17
-rw-r--r--views/mods/mod_rechnungen/invoice_pdf.phtml530
-rw-r--r--views/mods/mod_rechnungen/multi_invoice_pdf.phtml17
-rw-r--r--views/mods/mod_rechnungen/order_view.phtml10
-rw-r--r--views/mods/mod_rechnungen/settings_edit.phtml6
13 files changed, 579 insertions, 417 deletions
diff --git a/views/mods/mod_export/fields.phtml b/views/mods/mod_export/fields.phtml
index 38fe41e..c731984 100644
--- a/views/mods/mod_export/fields.phtml
+++ b/views/mods/mod_export/fields.phtml
@@ -36,14 +36,11 @@
</td>
<td class="wpsg_mod_export_col_field"><div class="wpsg_editable" id="field_typ_<?php echo $f_id; ?>"><?php
- foreach ($this->view['fields'] as $fieldgroup)
- {
+ foreach ($this->view['fields'] as $fieldgroup) {
- foreach ($fieldgroup['fields'] as $field_key => $field)
- {
+ foreach ($fieldgroup['fields'] as $field_key => $field) {
- if ($field_key == $f['value_key'])
- {
+ if ($field_key == $f['value_key']) {
echo $field;
@@ -74,8 +71,18 @@
</td>
</tr>
- <tr id="userformatrow_<?php echo $f_id; ?>" style="<?php echo (($f['format'] != 700)?'display:none;':''); ?>" class="wpsg_mod_export_row2 wpsg_tablerow wpsg_mod_export_fieldrow_<?php echo $f_id; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
+ <tr id="staticformat_<?php echo $f_id; ?>" style="<?php echo (($f['value_key'] != 'general_static')?'display:none;':''); ?>" class="wpsg_mod_export_row2 wpsg_tablerow wpsg_mod_export_fieldrow_<?php echo $f_id; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
<td class="wpsg_mod_export_col_format_user" colspan="4">
+
+ <?php echo __('Statischer Wert', 'wpsg'); ?>:
+
+ <div class="wpsg_editable" id="field_static_<?php echo $f_id; ?>"><?php echo wpsg_hspc(wpsg_getStr($f['static'])); ?></div>
+
+ </td>
+ <td></td>
+ </tr>
+ <tr id="userformatrow_<?php echo $f_id; ?>" style="<?php echo (($f['format'] != 700)?'display:none;':''); ?>" class="wpsg_mod_export_row2 wpsg_tablerow wpsg_mod_export_fieldrow_<?php echo $f_id; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
+ <td class="wpsg_mod_export_col_format_user" colspan="4">
<?php echo __('Format', 'wpsg'); ?>:
@@ -94,7 +101,13 @@
jQuery('#field_typ_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
'type': 'multiarray',
- 'data': '<?php echo addslashes(json_encode($this->view['fields'], JSON_UNESCAPED_SLASHES)); ?>'
+ 'data': '<?php echo addslashes(json_encode($this->view['fields'], JSON_UNESCAPED_SLASHES)); ?>',
+ 'callback': function(response, newValue) {
+
+ if (newValue === 'general_static') jQuery('#staticformat_<?php echo $f_id; ?>').show();
+ else jQuery('#staticformat_<?php echo $f_id; ?>').hide();
+
+ }
} );
jQuery('#field_format_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
@@ -110,6 +123,8 @@
jQuery('#field_userformat_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', { } );
+ jQuery('#field_static_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', { } );
+
} );
/* ]]> */</script>
@@ -149,3 +164,9 @@
).disableSelection();
/* ]]> */</script>
+
+<style>
+
+ .wpsg_mod_export_col_format { min-width:100px; }
+
+</style> \ No newline at end of file
diff --git a/views/mods/mod_export/profil.phtml b/views/mods/mod_export/profil.phtml
index 5a946c3..4709b9c 100644
--- a/views/mods/mod_export/profil.phtml
+++ b/views/mods/mod_export/profil.phtml
@@ -89,10 +89,13 @@
<?php echo wpsg_drawForm_Text(__('Pfad', 'wpsg'), $this->view['profil']['cron_path'], 'cron_path', array('inlineEdit' => true, 'inlineEdit_url' => $inlineEdit_url)); ?>
<?php echo wpsg_drawForm_Text(__('Letzte Ausführung', 'wpsg'), (($this->view['profil']['cron_lastrun'] == '0000-00-00')?__('Noch nie', 'wpsg'):wpsg_formatTimestamp($this->view['profil']['cron_lastrun'], true)), false, array('noP' => false)); ?>
- <?php echo wpsg_drawForm_Text(__('Cron URL', 'wpsg'), '<a href="'.site_url().'/?wpsg_cron=1">'.site_url().'/?wpsg_cron=1</a>', false, array('noP' => false)); ?>
-
+
+ <fieldset id="wpsg_mod_export_cron_url" style="display:<?php echo (($this->view['profil']['cron_interval'] !== wpsg_mod_export::CRON_ORDER)?'block':'none'); ?>;">
+ <?php echo wpsg_drawForm_Text(__('Cron URL', 'wpsg'), '<a href="'.site_url().'/?wpsg_cron=1">'.site_url().'/?wpsg_cron=1</a>', false, array('noP' => false)); ?>
+ </fieldset>
+
<?php if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_ORDER) { ?>
- <fieldset id="wpsg_mod_export_orderfilter">
+ <fieldset id="wpsg_mod_export_orderfilter" style="display:<?php echo (($this->view['profil']['cron_interval'] !== wpsg_mod_export::CRON_ORDER)?'block':'none'); ?>;">
<legend><div class="col-sm-offset-6"><?php echo __('Bestellfilter', 'wpsg'); ?></div></legend>
@@ -233,9 +236,20 @@
<script type="text/javascript">/* <![CDATA[ */
- function switchCronType(response, newValue)
- {
-
+ function switchCronType(response, newValue) {
+
+ if (parseInt(newValue) === parseInt("<?php echo wpsg_mod_export::CRON_ORDER; ?>")) {
+
+ jQuery('#wpsg_mod_export_cron_url').hide();
+ jQuery('#wpsg_mod_export_orderfilter').hide();
+
+ } else {
+
+ jQuery('#wpsg_mod_export_cron_url').show();
+ jQuery('#wpsg_mod_export_orderfilter').show();
+
+ }
+
if (newValue != "0") jQuery('.cron_interval_1').show();
else jQuery('.cron_interval_1').hide();
diff --git a/views/mods/mod_kundenverwaltung/checkout_login.phtml b/views/mods/mod_kundenverwaltung/checkout_login.phtml
index 855449c..e7ab23a 100644
--- a/views/mods/mod_kundenverwaltung/checkout_login.phtml
+++ b/views/mods/mod_kundenverwaltung/checkout_login.phtml
@@ -11,13 +11,27 @@
<div class="wpsg_checkoutblock">
<label for="wpsg_mod_kundenverwaltung_email"><?php echo __("E-Mail Adresse", "wpsg"); ?>:
</label>
- <input class="wpsg_checkout <?php echo ((in_array("wpsg_mod_kundenverwaltung_email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_mod_kundenverwaltung_email" name="wpsg[mod_kundenverwaltung][email]" value="" />
+ <input
+ class="wpsg_checkout <?php echo ((in_array("wpsg_mod_kundenverwaltung_email", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="text"
+ id="wpsg_mod_kundenverwaltung_email"
+ name="wpsg[mod_kundenverwaltung][email]"
+ value=""
+ autocomplete="off"
+ />
</div>
<div class="wpsg_checkoutblock">
<label for="wpsg_mod_kundenverwaltung_password"><?php echo __("Passwort", "wpsg"); ?>:
</label>
- <input class="wpsg_checkout <?php echo ((in_array("wpsg_mod_kundenverwaltung_password", (array)$this->view['error']))?'wpsg_error':''); ?>" type="password" id="wpsg_mod_kundenverwaltung_password" name="wpsg[mod_kundenverwaltung][password]" value="" />
+ <input
+ class="wpsg_checkout <?php echo ((in_array("wpsg_mod_kundenverwaltung_password", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="password"
+ id="wpsg_mod_kundenverwaltung_password"
+ name="wpsg[mod_kundenverwaltung][password]"
+ value=""
+ autocomplete="off"
+ />
</div>
<br />
diff --git a/views/mods/mod_kundenverwaltung/edit.phtml b/views/mods/mod_kundenverwaltung/edit.phtml
index 1892448..bab185b 100644
--- a/views/mods/mod_kundenverwaltung/edit.phtml
+++ b/views/mods/mod_kundenverwaltung/edit.phtml
@@ -224,7 +224,7 @@
var password = jQuery(this).val();
- if (password.length < 6)
+ if (password.length < 8)
{
jQuery('#wpsg_pwd_length').removeClass('valid').addClass('invalid');
diff --git a/views/mods/mod_kundenverwaltung/login.phtml b/views/mods/mod_kundenverwaltung/login.phtml
index 19258af..1c6c44a 100644
--- a/views/mods/mod_kundenverwaltung/login.phtml
+++ b/views/mods/mod_kundenverwaltung/login.phtml
@@ -18,12 +18,25 @@
<div class="wpsg_block wpsg_checkoutblock">
<label for="wpsg_mod_kundenverwaltung_email"><?php echo __("E-Mail Adresse", "wpsg"); ?>:</label>
- <input class="wpsg_checkout" type="text" id="wpsg_mod_kundenverwaltung_email" name="wpsg[mod_kundenverwaltung][email]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_kundenverwaltung']['email']); ?>" />
+ <input
+ class="wpsg_checkout"
+ type="text"
+ autocomplete="off"
+ id="wpsg_mod_kundenverwaltung_email"
+ name="wpsg[mod_kundenverwaltung][email]"
+ value="<?php echo wpsg_getStr($this->view['wpsg_mod_kundenverwaltung']['email']); ?>" />
</div>
<div class="wpsg_block wpsg_checkoutblock">
<label for="wpsg_mod_kundenverwaltung_password"><?php echo __("Passwort", "wpsg"); ?>:</label>
- <input class="wpsg_checkout" type="password" id="wpsg_mod_kundenverwaltung_password" name="wpsg[mod_kundenverwaltung][password]" value="" />
+ <input
+ class="wpsg_checkout"
+ type="password"
+ id="wpsg_mod_kundenverwaltung_password"
+ name="wpsg[mod_kundenverwaltung][password]"
+ value=""
+ autocomplete="off"
+ />
</div>
<br />
diff --git a/views/mods/mod_kundenverwaltung/profil.phtml b/views/mods/mod_kundenverwaltung/profil.phtml
index 3485d32..d17615e 100644
--- a/views/mods/mod_kundenverwaltung/profil.phtml
+++ b/views/mods/mod_kundenverwaltung/profil.phtml
@@ -1,6 +1,6 @@
<?php
- /**
+ /**
* Seite für das Profil eines Kunden
*/
@@ -50,7 +50,7 @@
var password = jQuery(this).val();
- if (password.length < 6) {
+ if (password.length < 8) {
jQuery('#wpsg_pwd_length').removeClass('valid').addClass('invalid');
@@ -193,7 +193,15 @@
<label for="email" class="wpsg_checkout"><?php echo __("E-Mail Adresse", "wpsg"); ?>
<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email" name="wpsg[profil][email]" value="<?php echo htmlspecialchars($this->view['data']['email']); ?>" />
+ <input
+ class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?>
+ wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="email"
+ id="email"
+ name="wpsg[profil][email]"
+ value="<?php echo htmlspecialchars($this->view['data']['email']); ?>"
+ autocomplete="off"
+ />
</div>
<?php } ?>
@@ -202,7 +210,15 @@
<label for="email" class="wpsg_checkout"><?php echo __("E-Mail Adresse (Wiederholung)", "wpsg"); ?>
<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email2" name="wpsg[profil][email2]" value="<?php echo htmlspecialchars($this->view['data']['email2']); ?>" />
+ <input
+ class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?>
+ wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="email"
+ id="email2"
+ name="wpsg[profil][email2]"
+ value="<?php echo htmlspecialchars($this->view['data']['email2']); ?>"
+ autocomplete="off"
+ />
</div>
<?php } ?>
@@ -324,14 +340,28 @@
<label for="wpsg_mod_kundenverwaltung_pwd1"><?php echo __("Passwort", "wpsg"); ?>
<?php if ($this->get_option('wpsg_mod_kundenverwaltung_showCheckoutRegisterzwang') == '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_checkout <?php echo ((in_array("mod_kundenverwaltung_pwd1", (array)$this->view['error']))?'wpsg_error':''); ?>" type="password" id="wpsg_mod_kundenverwaltung_pw1" name="wpsg[mod_kundenverwaltung][register_pwd1]" value="" /><span id="wpsg_mod_kundenverwaltung_password_result"></span>
+ <input
+ class="wpsg_checkout <?php echo ((in_array("mod_kundenverwaltung_pwd1", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="password"
+ id="wpsg_mod_kundenverwaltung_pw1"
+ name="wpsg[mod_kundenverwaltung][register_pwd1]"
+ value=""
+ autocomplete="off"
+ /><span id="wpsg_mod_kundenverwaltung_password_result"></span>
</div>
<div class="wpsg_checkoutblock">
<label for="wpsg_mod_kundenverwaltung_pwd2"><?php echo __("Passwort wiederholen", "wpsg"); ?>
<?php if ($this->get_option('wpsg_mod_kundenverwaltung_showCheckoutRegisterzwang') == '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_checkout <?php echo ((in_array("mod_kundenverwaltung_pwd2", (array)$this->view['error']))?'wpsg_error':''); ?>" type="password" id="wpsg_mod_kundenverwaltung_pwd2" name="wpsg[mod_kundenverwaltung][register_pwd2]" value="" />
+ <input
+ class="wpsg_checkout <?php echo ((in_array("mod_kundenverwaltung_pwd2", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="password"
+ id="wpsg_mod_kundenverwaltung_pwd2"
+ name="wpsg[mod_kundenverwaltung][register_pwd2]"
+ value=""
+ autocomplete="off"
+ />
</div>
<div id="wpsg_pwd_info">
diff --git a/views/mods/mod_kundenverwaltung/register.phtml b/views/mods/mod_kundenverwaltung/register.phtml
index 1a7ee0c..d2967dd 100644
--- a/views/mods/mod_kundenverwaltung/register.phtml
+++ b/views/mods/mod_kundenverwaltung/register.phtml
@@ -12,50 +12,49 @@
<?php if ($this->get_option('wpsg_form_validation') == '1') { ?>
- if (typeof jQuery.validationEngine == "object")
- {
-
- jQuery("#form-step2").validationEngine('attach', {promptPosition : "centerRight", scroll: false});
-
- jQuery('.wpsg_mod_kundenverwaltung_login').bind('click', function(){
- jQuery("#form-step2").validationEngine('detach');
- });
+ if (typeof jQuery.validationEngine == "object")
+ {
+
+ jQuery("#form-step2").validationEngine('attach', {promptPosition : "centerRight", scroll: false});
+
+ jQuery('.wpsg_mod_kundenverwaltung_login').bind('click', function(){
+ jQuery("#form-step2").validationEngine('detach');
+ });
- }
+ }
<?php } else if ($this->get_option('wpsg_form_validation') == '2') { ?>
- jQuery.validator.addMethod("cRequired", jQuery.validator.methods.required, "<?php echo __('Dieses Feld ist ein Pflichtfeld.', 'wpsg'); ?>");
- jQuery.validator.addClassRules('validate[required]', { cRequired: true } );
- jQuery("#form-step2").validate( {
- ignore: '',
- errorClass: 'wpsg_error',
- onsubmit: false,
- showErrors: function(errorMap, errorList) {
+ jQuery.validator.addMethod("cRequired", jQuery.validator.methods.required, "<?php echo __('Dieses Feld ist ein Pflichtfeld.', 'wpsg'); ?>");
+ jQuery.validator.addClassRules('validate[required]', { cRequired: true } );
+ jQuery("#form-step2").validate( {
+ ignore: '',
+ errorClass: 'wpsg_error',
+ onsubmit: false,
+ showErrors: function(errorMap, errorList) {
- this.defaultShowErrors();
+ this.defaultShowErrors();
- }
- } );
+ }
+ } );
- jQuery('.wpsg_registerButton').bind('click', function() {
+ jQuery('.wpsg_registerButton').bind('click', function() {
- var bReturn = jQuery('#form-step2').validate().form();
- if (jQuery('#form-step2 input.wpsg_error').length > 0) jQuery('#form-step2 input.wpsg_error')[0].focus();
- return bReturn;
-
- } );
+ var bReturn = jQuery('#form-step2').validate().form();
+ if (jQuery('#form-step2 input.wpsg_error').length > 0) jQuery('#form-step2 input.wpsg_error')[0].focus();
+ return bReturn;
+
+ } );
<?php } ?>
-// Visualisierung der Passwortstärke
-
+ // Visualisierung der Passwortstärke
jQuery('input[type=password]').keyup(function(){
var password = jQuery(this).val();
- if (password.length < 6) {
+ if (password.length < 8) {
jQuery('#wpsg_pwd_length').removeClass('valid').addClass('invalid');
@@ -104,11 +103,9 @@
jQuery('#wpsg_pwd_speziell').removeClass('valid').addClass('invalid');
}
-
jQuery('#wpsg_pwd_info').show();
-
jQuery(this).blur(function(){
jQuery('#wpsg_pwd_info').hide();
@@ -116,15 +113,14 @@
});
});
-
-// Validierung Spam
- <?php
- if (isset($_GET["wpsg_spam_email"]) && $_GET["wpsg_spam_email"] != "") {
- echo "<p>Sie haben ein Feld ausgefüllt, das frei bleiben muss.</p>";
- exit;
- }
- ?>
+ // Validierung Spam
+ <?php
+ if (isset($_GET["wpsg_spam_email"]) && $_GET["wpsg_spam_email"] != "") {
+ echo "<p>Sie haben ein Feld ausgefüllt, das frei bleiben muss.</p>";
+ exit;
+ }
+ ?>
});
@@ -144,9 +140,18 @@
<div class="wpsg wpsg_checkout wpsg_register">
- <?php echo $this->writeFrontendMessage(); ?>
+ <style>
+ .placeholder { display: none !important; }
+ .m1_dsgvo_layer { position:relative; width:100%; height:100px; margin-bottom: 30px; }
+ .m1_dsgvo_layer > .placeholder_text { height:100px; font-size: small; position:relative; left:0; top:0; z-index:2; background-color:rgba(0, 0, 0, 0.75); display:flex; justify-content:center; align-items:center; color:#FFFFFF; flex-direction:column; padding:1rem; text-align:center; }
+ .m1_dsgvo_layer > .placeholder_text > button { color: rgba(0, 0, 0, 0.75); margin-top: 1rem;}
+ </style>
<form id="form-step2" method="post" action="<?php echo $this->callMod('wpsg_mod_kundenverwaltung', 'getRegisterURL'); ?>">
+
+ <?php echo $this->writeFrontendMessage(); ?>
+
+ <h2><?php echo __('Registrierung', 'sto'); ?></h2>
<?php if ($this->view['pflicht']['firma'] != '2') { ?>
<div class="wpsg_checkoutblock">
@@ -193,7 +198,13 @@
<label for="email" class="wpsg_register"><?php echo __("E-Mail Adresse", "wpsg"); ?>
<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email" name="wpsg[register][email]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['data']['email'])); ?>" />
+ <input
+ class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="email" id="email"
+ name="wpsg[register][email]"
+ value="<?php echo htmlspecialchars(wpsg_getStr($this->view['data']['email'])); ?>"
+ autocomplete="off"
+ />
</div>
<?php } ?>
@@ -202,7 +213,14 @@
<label for="email2" class="wpsg_register"><?php echo __("E-Mail Adresse (Wiederholung)", "wpsg"); ?>
<?php if ($this->view['pflicht']['email'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>" type="email" id="email2" name="wpsg[register][email2]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['data']['register']['email2'])); ?>" />
+ <input
+ class="wpsg_input_text <?php echo (($this->view['pflicht']['email'] != '1')?'validate[required]':''); ?> wpsg_checkout <?php echo ((in_array("email", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="email"
+ id="email2"
+ name="wpsg[register][email2]"
+ value="<?php echo htmlspecialchars(wpsg_getStr($this->view['data']['register']['email2'])); ?>"
+ autocomplete="off"
+ />
</div>
<?php } ?>
@@ -210,14 +228,28 @@
<label for="pwd1" class="wpsg_register"><?php echo __("Passwort", "wpsg"); ?>
<?php if (wpsg_getStr($this->view['pflicht']['pwd1']) != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="<?php echo ((wpsg_getStr($this->view['pflicht']['pwd1']) != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("mod_kundenverwaltung_pwd1", (array)$this->view['error']))?'wpsg_error':''); ?>" type="password" id="pwd1" name="wpsg[register][register_pwd1]" value="" /><span id="wpsg_checkoutblock_password_result"></span>
+ <input
+ class="<?php echo ((wpsg_getStr($this->view['pflicht']['pwd1']) != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("mod_kundenverwaltung_pwd1", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="password"
+ id="pwd1"
+ name="wpsg[register][register_pwd1]"
+ autocomplete="off"
+ value=""
+ /><span id="wpsg_checkoutblock_password_result"></span>
</div>
<div class="wpsg_checkoutblock">
<label for="pwd2" class="wpsg_register"><?php echo __("Passwort (Wiederholung)", "wpsg"); ?>
<?php if (wpsg_getStr($this->view['pflicht']['pwd2']) != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="<?php echo ((wpsg_getStr($this->view['pflicht']['pwd2']) != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("mod_kundenverwaltung_pwd2", (array)$this->view['error']))?'wpsg_error':''); ?>" type="password" id="pwd2" name="wpsg[register][register_pwd2]" value="" />
+ <input
+ class="<?php echo ((wpsg_getStr($this->view['pflicht']['pwd2']) != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("mod_kundenverwaltung_pwd2", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="password"
+ id="pwd2"
+ name="wpsg[register][register_pwd2]"
+ value=""
+ autocomplete="off"
+ />
</div>
<div id="wpsg_pwd_info">
@@ -285,20 +317,20 @@
<?php } ?>
<?php } ?>
-
+
<?php if ($this->view['pflicht']['plz'] != '2') { ?>
<div class="wpsg_checkoutblock">
<label for="plz" class="wpsg_register"><?php echo __("Postleitzahl", "wpsg"); ?>
- <?php if ($this->view['pflicht']['plz'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
+ <?php if ($this->view['pflicht']['plz'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
- <input class="wpsg_input_text <?php echo (($this->view['pflicht']['plz'] != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("plz", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="plz" name="wpsg[register][plz]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['data']['plz'])); ?>" />
+ <input class="<?php echo (($this->view['pflicht']['plz'] != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("plz", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="plz" name="wpsg[register][plz]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['data']['plz'])); ?>" />
</div>
<?php } ?>
<?php if ($this->view['pflicht']['ort'] != '2') { ?>
<div class="wpsg_checkoutblock">
<label for="ort" class="wpsg_register"><?php echo __("Ort", "wpsg"); ?>
- <?php if ($this->view['pflicht']['ort'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
+ <?php if ($this->view['pflicht']['ort'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
<input class="<?php echo (($this->view['pflicht']['ort'] != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("ort", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="ort" name="wpsg[register][ort]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['data']['ort'])); ?>" />
</div>
@@ -307,7 +339,7 @@
<?php if ($this->view['pflicht']['land'] != '2') { ?>
<div class="wpsg_checkoutblock">
<label for="wpsg_land" class="wpsg_register"><?php echo __("Land", "wpsg"); ?>
- <?php if ($this->view['pflicht']['land'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
+ <?php if ($this->view['pflicht']['land'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
<select name="wpsg[register][land]" class="<?php echo (($this->view['pflicht']['land'] != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("land", (array)$this->view['error']))?'wpsg_error':''); ?>" id="wpsg_land">
<option value="-1"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
@@ -321,7 +353,7 @@
<?php if ($this->view['pflicht']['ustidnr'] != '2') { ?>
<div class="wpsg_checkoutblock">
<label for="wpsg_ustidnr" class="wpsg_register"><?php echo __("UStIdNr.", "wpsg"); ?>
- <?php if ($this->view['pflicht']['ustidnr'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
+ <?php if ($this->view['pflicht']['ustidnr'] != '1') { ?><span class="wpsg_required">*</span><?php } ?>:
</label>
<input class="<?php echo (($this->view['pflicht']['ustidnr'] != '1')?'validate[required]':''); ?> wpsg_register <?php echo ((in_array("ustidnr", (array)$this->view['error']))?'wpsg_error':''); ?>" type="text" id="wpsg_ustidnr" name="wpsg[register][ustidnr]" value="<?php echo htmlspecialchars(wpsg_getStr($this->view['data']['ustidnr'])); ?>" />
</div>
@@ -354,65 +386,79 @@
<?php /* Automatische Einbindung der benutzerdefinierten Kundenfelder ENDE */ ?>
<div class="wpsg_clear"></div>
- <?php if ($this->get_option('wpsg_mod_kundenverwaltung_recaptcha_register') === '1') { ?>
- <div class="wpsg_checkoutblock">
- <label>
- <?php echo __('SPAM Schutz Abfrage'); ?> <span class="wpsg_required">*</span>:
- <div class="g-recaptcha" data-sitekey="<?php echo $this->get_option('wpsg_mod_kundenveraltung_recaptcha_key'); ?>"></div>
- </label>
- </div>
- <div class="wpsg_clear"></div>
- <?php } ?>
-
- <?php if ($this->get_option('wpsg_mod_kundenverwaltung_mathcaptcha') === '1') {
-
- $number1 = rand(0, 9);
- $number2 = rand(0, 10);
- $arOperator = ['+', '-', '*']; $operator = $arOperator[array_rand($arOperator)];
-
- $time = time();
-
- switch ($operator) {
-
- case '+': $captcha_result = $number1 + $number2; break;
- case '-': $captcha_result = $number1 - $number2; break;
- case '*': $captcha_result = $number1 * $number2; break;
-
- default: throw new \Exception();
-
- }
-
- \set_transient('wpsg_mod_kundenverwaltung_mathcaptcha_result', $captcha_result);
-
- ?>
-
- <div class="wpsg_checkoutblock">
- <label for="wpsg_mod_kundenverwaltung_mathcaptcha" class="wpsg_register"><?php echo wpsg_translate(
- __("Ergebnis aus #1# #2# #3#", "wpsg"),
- $number1, $operator, $number2
- ); ?>:
- <span class="wpsg_required">*</span>
- </label>
- <input
- class="validate[required] wpsg_register <?php echo ((in_array("wpsg_mod_kundenverwaltung_mathcaptcha", (array)$this->view['error']))?'wpsg_error':''); ?>"
- type="text" id="wpsg_mod_kundenverwaltung_mathcaptcha" name="wpsg_mod_kundenverwaltung_mathcaptcha"
- placeholder="SPAM Schutz"
- value="" />
- </div>
-
- <?php } ?>
-
+ <?php if ($this->get_option('wpsg_mod_kundenverwaltung_recaptcha_register') === '1') { ?>
+ <div class="wpsg_checkoutblock">
+ <label class="recaptcha_v2_checkout ">
+
+ <?php echo __('SPAM Schutz Abfrage'); ?> <span class="wpsg_required">*</span>:
+
+ <?php if ($this->get_option('wpsg_mod_kundenverwaltung_recaptcha_dsgvo_layer') != '1') { ?>
+ <div class="g-recaptcha" data-sitekey="<?php echo $this->get_option('wpsg_mod_kundenveraltung_recaptcha_key'); ?>"></div>
+ <?php } else { ?>
+ <div class="wpsg_recaptcha placeholder"> <!-- Platzhalter für das Google ReCAPTCHA --> </div>
+ <div class="m1_dsgvo_layer ">
+ <div class="placeholder_text">
+ <strong>Datenschutz ist uns wichtig!</strong>
+ Daher wird das Google ReCAPTCHA erst geladen, wenn sie der Verwendung des Drittanbieters "Google LLC" zustimmen durch den möglicherweise Cookies gesetzt werden.<br />
+ <button class="layer_link wpsg_required">Ich bin damit einverstanden.</button>
+ </div>
+ </div>
+ <?php } ?>
+
+ </label>
+ </div>
+ <div class="wpsg_clear"></div>
+ <?php } ?>
+
+ <?php if ($this->get_option('wpsg_mod_kundenverwaltung_mathcaptcha') === '1') {
+
+ $number1 = rand(0, 9);
+ $number2 = rand(0, 10);
+ $arOperator = ['+', '-', '*']; $operator = $arOperator[array_rand($arOperator)];
+
+ $time = time();
+
+ switch ($operator) {
+
+ case '+': $captcha_result = $number1 + $number2; break;
+ case '-': $captcha_result = $number1 - $number2; break;
+ case '*': $captcha_result = $number1 * $number2; break;
+
+ default: throw new \Exception();
+
+ }
+
+ \set_transient('wpsg_mod_kundenverwaltung_mathcaptcha_result', $captcha_result);
+
+ ?>
+
+ <div class="wpsg_checkoutblock">
+ <label for="wpsg_mod_kundenverwaltung_mathcaptcha" class="wpsg_register"><?php echo wpsg_translate(
+ __("Ergebnis aus #1# #2# #3#", "wpsg"),
+ $number1, $operator, $number2
+ ); ?>:
+ <span class="wpsg_required">*</span>
+ </label>
+ <input
+ class="validate[required] wpsg_register <?php echo ((in_array("wpsg_mod_kundenverwaltung_mathcaptcha", (array)$this->view['error']))?'wpsg_error':''); ?>"
+ type="text" id="wpsg_mod_kundenverwaltung_mathcaptcha" name="wpsg_mod_kundenverwaltung_mathcaptcha"
+ placeholder="SPAM Schutz"
+ value="" />
+ </div>
+
+ <?php } ?>
+
<div class="wpsg_mandatoryfield_hint">
<?php echo wpsg_translate(__('Mit #1# gekennzeichnete Felder sind Pflichtfelder.', 'wpsg'), '<span class="wpsg_required">*</span>'); ?>
</div>
<?php /* versteckte Sicherheitsabfrage als Bot-Schutz START*/ ?>
<span style="display:none">
- <label for="wpsg_spam_email">Das Feld muss frei bleiben:</label>
- <input type="text" name="wpsg_spam_email" id="wpsg_spam_email" title=" dieses Feld muss frei bleiben " />
+ <label for="wpsg_spam_email">Das Feld muss frei bleiben:</label>
+ <input type="text" name="wpsg_spam_email" id="wpsg_spam_email" title=" dieses Feld muss frei bleiben " />
</span>
<?php /* versteckte Sicherheitsabfrage als Bot-Schutz ENDE*/ ?>
-
+
<br />
<input type="submit" class="wpsg_button wpsg_registerButton" value="<?php echo __('Registrieren', 'wpsg'); ?>" name="wpsg_mod_kundenverwaltung_register" />
@@ -421,4 +467,29 @@
<div class="wpsg_clear"></div>
</form>
+
+ <script>
+ // DSGVO Layer Script
+ document.querySelector('.layer_link').addEventListener('click', function() {
+
+ const recaptcha = document.createElement("div");
+ const a = document.createAttribute("data-sitekey");
+ const b = document.createAttribute("style");
+ a.value = "<?php echo $this->get_option('wpsg_mod_kundenveraltung_recaptcha_key'); ?>";
+ b.value = "float: left !important;";
+ recaptcha.classList.add("g-recaptcha");
+ recaptcha.setAttributeNode(a);
+ recaptcha.setAttributeNode(b);
+
+ document.querySelector('.wpsg_recaptcha').appendChild(recaptcha);
+ (function(){var w=window,C='___grecaptcha_cfg',cfg=w[C]=w[C]||{},N='grecaptcha';var gr=w[N]=w[N]||{};gr.ready=gr.ready||function(f){(cfg['fns']=cfg['fns']||[]).push(f);};w['__recaptcha_api']='https://www.google.com/recaptcha/api2/';(cfg['render']=cfg['render']||[]).push('onload');w['__google_recaptcha_client']=true;var d=document,po=d.createElement('script');po.type='text/javascript';po.async=true;po.src='https://www.gstatic.com/recaptcha/releases/vP4jQKq0YJFzU6e21-BGy3GP/recaptcha__de.js';po.crossOrigin='anonymous';po.integrity='sha384-xxpEMChSTl1oMpSrXrILE1mQOlVQNv6OGibce0r0HX1HeHF72bSDheOIehafBC9Y';var e=d.querySelector('script[nonce]'),n=e&&(e['nonce']||e.getAttribute('nonce'));if(n){po.setAttribute('nonce',n);}var s=d.getElementsByTagName('script')[0];s.parentNode.insertBefore(po, s);})();
+
+ document.querySelector('.m1_dsgvo_layer').classList.add('placeholder');
+ document.querySelector('.wpsg_recaptcha').classList.remove('placeholder');
+
+ event.preventDefault();
+
+ });
+ </script>
+
</div> \ No newline at end of file
diff --git a/views/mods/mod_kundenverwaltung/settings_edit.phtml b/views/mods/mod_kundenverwaltung/settings_edit.phtml
index 8bdf87b..fe39220 100644
--- a/views/mods/mod_kundenverwaltung/settings_edit.phtml
+++ b/views/mods/mod_kundenverwaltung/settings_edit.phtml
@@ -70,11 +70,12 @@
</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;">
<?php echo wpsg_drawForm_Input('wpsg_mod_kundenveraltung_recaptcha_key', __('Websiteschlüssel', 'wpsg'), $this->get_option('wpsg_mod_kundenveraltung_recaptcha_key')); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_kundenveraltung_recaptcha_secretkey', __('Geheimer Schlüssel', 'wpsg'), $this->get_option('wpsg_mod_kundenveraltung_recaptcha_secretkey')); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_kundenverwaltung_recaptcha_dsgvo_layer', __('DSGVO Layer für das Recaptcha', 'wpsg'), $this->get_option('wpsg_mod_kundenverwaltung_recaptcha_dsgvo_layer')); ?>
</div>
diff --git a/views/mods/mod_kundenverwaltung/widget.phtml b/views/mods/mod_kundenverwaltung/widget.phtml
index 7408a1b..0894cb5 100644
--- a/views/mods/mod_kundenverwaltung/widget.phtml
+++ b/views/mods/mod_kundenverwaltung/widget.phtml
@@ -31,8 +31,21 @@
<h2 class="widget-title widgettitle"><?php echo __('Login', 'wpsg'); ?></h2>
- <input type="text" value="<?php echo __('E-Mail', 'wpsg'); ?>" id="wpsg_mod_kundenverwaltung_widget_email" name="wpsg[mod_kundenverwaltung][email]" />
- <input type="password" value="<?php echo __('Passwort', 'wpsg'); ?>" id="wpsg_mod_kundenverwaltung_widget_passwort" name="wpsg[mod_kundenverwaltung][password]" />
+ <input
+ type="text"
+ value="<?php echo __('E-Mail', 'wpsg'); ?>"
+ id="wpsg_mod_kundenverwaltung_widget_email"
+ name="wpsg[mod_kundenverwaltung][email]"
+ autocomplete="off"
+ />
+
+ <input
+ type="password"
+ value="<?php echo __('Passwort', 'wpsg'); ?>"
+ id="wpsg_mod_kundenverwaltung_widget_passwort"
+ name="wpsg[mod_kundenverwaltung][password]"
+ autocomplete="off"
+ />
<br /><br />
diff --git a/views/mods/mod_rechnungen/invoice_pdf.phtml b/views/mods/mod_rechnungen/invoice_pdf.phtml
index e7b4811..9409e87 100644
--- a/views/mods/mod_rechnungen/invoice_pdf.phtml
+++ b/views/mods/mod_rechnungen/invoice_pdf.phtml
@@ -36,7 +36,7 @@
else $taxdisplay = 'brutto';
// Damit die Steuer bei der Kleinunternehmerregelung nicht angezeigt wird leer ich den Array sicherheitshalber
- if ($this->get_option('wpsg_kleinunternehmer') == '1')
+ if ( ($this->get_option('wpsg_kleinunternehmer') == '1') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) )
{
unset($this->view['basket']['mwst']);
@@ -52,7 +52,7 @@
global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
$pdf->AddPage();
-
+
if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf")) {
$pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf");
@@ -64,8 +64,7 @@
$pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
}
-
-
+
if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg"))
{
@@ -127,7 +126,7 @@
{
$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'])));
}
@@ -146,7 +145,7 @@
$pdf->Text($rdata_left + 135, $rdata_top + 6, ((trim($shop->view['data']['onr']) != '')?$shop->view['data']['onr']:$shop->view['data']['id']));
$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())
{
@@ -181,26 +180,52 @@
$pdf = new wpsg_fpdf();
$pdf->SetAutoPageBreak(true, 5);
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)
+ ) {
+ $bNoTax = true;
+ } else {
+ $bNoTax = false;
+ }
+
+ $bTaxCol = false;
+ if ($this->get_option('wpsg_showMwstAlways') === '1') $bTaxCol = true;
+ 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;
-
+
$bKopf = false; $pnr = 1; $offset = 0; $count = 0;
- foreach ($this->view['basket']['produkte'] as $p)
+ foreach ($this->view['basket']['arCalculation']['product'] as $p)
{
-
+ $product = wpsg_product::getInstance($p['product_id']);
+
if (!$bKopf)
{
-
+
$pdf->SetFont('Arial', 'B', 9);
$pdf->setXY($prod_left, $prod_top);
$pdf->Cell(10, 8, __("Nr.", "wpsg"), 1, 0, 'C');
$pdf->setXY($prod_left + 10, $prod_top);
- if(is_array($this->view['basket']['mwst'])) {
- $pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, "Name", 1, 0, 'L');
- }
+ $pdf->Cell( (($bTaxCol)?87:102), 8, "Name", 1, 0, 'L');
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
+ if ($bTaxCol)
{
$pdf->setXY($prod_left + 97, $prod_top);
@@ -228,7 +253,7 @@
if ($this->get_option('wpsg_mod_rechnungen_anr') == '1')
{
- $pdf->Cell(10, 8, $p['anr'], 0, 0, 'C');
+ $pdf->Cell(10, 8, $product->getNr(), 0, 0, 'C');
}
else
@@ -240,20 +265,20 @@
if ($this->get_option('wpsg_rechnungen_pdetailname' == '1')) {
- $produkt_text = $this->getProductName($this->getProduktID($p['id']), true);
+ $produkt_text = $this->getProductName($this->getProduktID($p['product_id']), true);
} else {
- $produkt_text = $this->getProductName($this->getProduktID($p['id']), false);
+ $produkt_text = $this->getProductName($this->getProduktID($p['product_id']), false);
}
- $produktBeschreibung = trim(strip_tags($p['beschreibung']));
+ $produktBeschreibung = trim(strip_tags($product->getShortDescription()));
if ($this->isOtherLang())
{
- $trans_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($this->getProduktID($p['id']))."' AND `lang_code` = '".wpsg_q($this->getCurrentLanguageCode())."'");
+ $trans_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `lang_parent` = '".wpsg_q($this->getProduktID($p['product_id']))."' AND `lang_code` = '".wpsg_q($this->getCurrentLanguageCode())."'");
if (is_array($trans_db) && sizeof($trans_db) > 0)
{
@@ -269,12 +294,12 @@
$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))
{
@@ -293,13 +318,13 @@
if ($this->get_option('wpsg_mod_rechnungen_anr') === '2')
{
- $anr = $this->getProductAnr($p['productkey']);
+ $anr = $this->getProductAnr($product->getProductKey());
$produkt_text .= "\r\n".wpsg_translate(__('Artikelnummer: #1#', 'wpsg'), $anr);
}
$produkt_text_cell_width = 102;
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
+ if ($bTaxCol)
{
$produkt_text_cell_width = 87;
}
@@ -315,23 +340,23 @@
//$height += 3 + 5 + $pdf->getY() - $height_y;
//$pdf->Cell((($this->arMwSt == "-1")?102:87), 8, $produkt_text, 0, 0, 'L');
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1') {
-
+ if ($bTaxCol) {
+
$pdf->setXY($prod_left + 97, $prod_top + $offset);
- $pdf->Cell(15, 8, (($this->view['basket']['noMwSt'] == '1')?'0.00 %':wpsg_ff($p['mwst_value'], '%')), 0, 0, 'C');
+ $pdf->Cell(15, 8, (($bNoTax)?'0.00 %':wpsg_ff($this->view['basket']['arCalculation']['tax'][$p['tax_key']]['tax_value'], '%')), 0, 0, 'C'); // BUG
}
$pdf->setXY($prod_left + 112, $prod_top + $offset);
- $pdf->Cell(15, 8, $p['menge'], 0, 0, 'C');
+ $pdf->Cell(15, 8, $p['amount'], 0, 0, 'C');
- if (wpsg_ShopController::get_option('wpsg_preisangaben') == WPSG_NETTO) {
+ if ( ( wpsg_ShopController::get_option('wpsg_preisangaben') == WPSG_NETTO ) || $bNoTax ) {
- $preis = $p['preis_netto'];
+ $preis = $p['netto'];
} else {
- $preis = $p['preis_brutto'];
+ $preis = $p['brutto'];
}
@@ -339,15 +364,15 @@
$pdf->Cell(25, 8, wpsg_ff($preis, $this->get_option('wpsg_currency')), 0, 0, 'R');
$pdf->setXY($prod_left + 152, $prod_top + $offset);
- $pdf->Cell(25, 8, wpsg_ff($preis * $p['menge'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->Cell(25, 8, wpsg_ff($preis * $p['amount'], $this->get_option('wpsg_currency')), 0, 0, 'R');
/**
* Produktbeschreibung anzeigen Ja/Nein
*/
$pBeschreibungHeight = 0;
- if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($p['beschreibung'])) != '')
+ if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($product->getShortDescription())) != '')
{
-
+
$produktBeschreibung = nl2br($produktBeschreibung);
preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
$produktBeschreibung = strip_tags($produktBeschreibung);
@@ -372,11 +397,12 @@
if ($this->get_option('wpsg_rechnungen_produktattribute') == '1')
{
- $attributeInfo = $this->callMod('wpsg_mod_produktattribute', 'getProductAttributeByProductId', array($this->getProduktId($p['id'])));
+ $attributeInfo = $this->callMod('wpsg_mod_produktattribute', 'getProductAttributeByProductId', array($this->getProduktId($p['product_id'])));
foreach ($attributeInfo as $pa)
{
+ 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);
@@ -386,10 +412,10 @@
/**
* Variante ?
*/
- if (preg_match('/pv_(.*)/', $p['productkey']))
+ if (preg_match('/pv_(.*)/', $p['product_key']))
{
- $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey']));
+ $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['product_key']));
$height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width);
@@ -397,7 +423,7 @@
}
- if ($this->hasMod('wpsg_mod_deliverynote'))
+ 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']));
@@ -421,9 +447,9 @@
// Jetzt die Rahmen zeichnen
$pdf->Rect($prod_left, $prod_top + $offset, 10, $height);
- $pdf->Rect($prod_left + 10, $prod_top + $offset, ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), $height);
+ $pdf->Rect($prod_left + 10, $prod_top + $offset, (($bTaxCol)?87:102), $height);
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
+ if ($bTaxCol)
{
$pdf->Rect($prod_left + 97, $prod_top + $offset, 15, $height);
@@ -439,9 +465,15 @@
$pnr ++;
$count ++;
- $summe += $p['price'] * $p['menge'];
+ if ($bNoTax) {
+ $price = $p['netto'];
+ } else {
+ $price = $p['brutto'];
+ }
+
+ $summe += $price * $p['amount'];
- if ($pdf->getY() > 220 || ($count >= $prod_break && sizeof($this->view['basket']['produkte']) > ($pnr - 1)))
+ if ($pdf->getY() > 220 || ($count >= $prod_break && sizeof($this->view['basket']['arCalculation']['product']) > ($pnr - 1)))
{
AddRechnungPage($this, $pdf);
@@ -451,56 +483,18 @@
} // produkte
- // Gutschein
- /*
- if ((isset($this->view['basket']['gs'])) && abs($this->view['basket']['gs_value']) > 0)
- {
-
- $pdf->SetFont('Arial', '', 9);
- $pdf->setXY($prod_left, $prod_top + $offset);
- $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
-
- $pdf->setXY($prod_left + 10, $prod_top + $offset);
- $pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $this->view['basket']['gs']['code']), 1, 0, 'L');
-
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
- {
-
- $mwst = __('anteilig', 'wpsg');
-
- $pdf->setXY($prod_left + 97, $prod_top + $offset);
- $pdf->Cell(15, 8, $mwst, 1, 0, 'C');
-
- }
-
- $pdf->setXY($prod_left + 112, $prod_top + $offset);
- $pdf->Cell(15, 8, '1', 1, 0, 'C');
-
- $gs_value_einzel = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
- $gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
-
- $pdf->setXY($prod_left + 127, $prod_top + $offset);
- $pdf->Cell(25, 8, $gs_value_einzel, 1, 0, 'R');
-
- $pdf->setXY($prod_left + 152, $prod_top + $offset);
- $pdf->Cell(25, 8, $gs_value_gesamt, 1, 0, 'R');
-
- $offset += 8;
-
- }
- */
if (wpsg_isSizedArray($this->view['basket']['arCalculation']['voucher'])) {
foreach ($this->view['basket']['arCalculation']['voucher'] as $v) {
-
+
$pdf->SetFont('Arial', '', 9);
$pdf->setXY($prod_left, $prod_top + $offset);
$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
$pdf->setXY($prod_left + 10, $prod_top + $offset);
- $pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $v['code']), 1, 0, 'L');
+ $pdf->Cell( (($bTaxCol)?87:102), 8, wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $v['code']), 1, 0, 'L');
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
+ if ($bTaxCol)
{
$mwst = __('anteilig', 'wpsg');
@@ -527,9 +521,9 @@
}
}
-
+
// Versandkosten
- if ($this->view['basket']['sum']['preis_shipping'] != '' && $this->view['basket']['sum']['preis_shipping'] != 0)
+ if ( ($shipping_cost != '') && ($shipping_cost != 0) )
{
$pdf->SetFont('Arial', '', 9);
@@ -537,26 +531,24 @@
$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
$pdf->setXY($prod_left + 10, $prod_top + $offset);
- $pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Versandkosten "#1#"', 'wpsg'), $this->view['oOrder']->getShippingLabel()), 1, 0, 'L');
+ $pdf->Cell( (($bTaxCol)?87:102), 8, wpsg_translate(__('Versandkosten "#1#"', 'wpsg'), $this->view['oOrder']->getShippingLabel()), 1, 0, 'L');
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
+ if ($bTaxCol)
{
-
- if ($this->arShipping[$this->view['data']['type_shipping']]['mwst_null'] == '1' && $this->view['basket']['noMwSt'] == '1')
- {
-
- $mwst = 0;
-
- }
- else
+
+ 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 {
-
+
$mwst = wpsg_ff($this->view['basket']['arCalculation']['shipping'][0]['tax'], '%');
$mwst = wpsg_ff($this->view['basket']['arCalculation']['tax'][$this->view['basket']['arCalculation']['shipping'][0]['tax_key']]['tax_value'], '%');
@@ -573,58 +565,17 @@
$pdf->Cell(15, 8, '1', 1, 0, 'C');
$pdf->setXY($prod_left + 127, $prod_top + $offset);
- $pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 1, 0, 'R');
+ $pdf->Cell(25, 8, wpsg_ff($shipping_cost, $this->get_option('wpsg_currency')), 1, 0, 'R');
$pdf->setXY($prod_left + 152, $prod_top + $offset);
- $pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_shipping'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-
- $offset += 8;
-
- // Zusammengesetzte Versandarten darstellen
- /*
- if (wpsg_isSizedArray($this->view['basket']['shipping']['methods'])) {
-
- foreach ($this->view['basket']['shipping']['methods'] as $shipping) {
-
- $pdf->SetFont('Arial', '', 9);
- $pdf->setXY($prod_left, $prod_top + $offset);
- $pdf->Cell(10, 8, '', 1, 0, 'C'); $pnr ++;
-
- $pdf->setXY($prod_left + 10, $prod_top + $offset);
- $pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $this->getShippingName($shipping), 1, 0, 'L');
-
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
- {
-
- if ($this->view['basket']['shipping'][$shipping]['tax_rata'] == 1) { $mwst = __('Anteilig', 'wpsg'); }
- else { $mwst = wpsg_ff($this->view['basket']['shipping'][$shipping]['mwst'], '%'); }
-
- $pdf->setXY($prod_left + 97, $prod_top + $offset);
- $pdf->Cell(15, 8, $mwst, 1, 0, 'C');
-
- }
-
- $pdf->setXY($prod_left + 112, $prod_top + $offset);
- $pdf->Cell(15, 8, '1', 1, 0, 'C');
-
- $pdf->setXY($prod_left + 127, $prod_top + $offset);
- $pdf->Cell(25, 8, wpsg_ff($this->view['basket']['shipping'][$shipping]['preis_shipping_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-
- $pdf->setXY($prod_left + 152, $prod_top + $offset);
- $pdf->Cell(25, 8, wpsg_ff($this->view['basket']['shipping'][$shipping]['preis_shipping_brutto'], $this->get_option('wpsg_currency')), 1, 0, 'R');
-
- $offset += 8;
-
- }
-
- }
- */
+ $pdf->Cell(25, 8, wpsg_ff($shipping_cost, $this->get_option('wpsg_currency')), 1, 0, 'R');
+ $offset += 8;
}
// Zahlungskosten
- if ($this->view['basket']['sum']['preis_payment'] != '' && $this->view['basket']['sum']['preis_payment'] != 0)
+ if ( ($payment_cost != '') && ($payment_cost != 0) )
{
$pdf->SetFont('Arial', '', 9);
@@ -632,31 +583,31 @@
$pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
$pdf->setXY($prod_left + 10, $prod_top + $offset);
- $pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $this->arPayment[$this->view['data']['type_payment']]['name'], 1, 0, 'L');
+ $pdf->Cell( (($bTaxCol)?87:102), 8, $this->arPayment[$this->view['data']['type_payment']]['name'], 1, 0, 'L');
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
+ if ($bTaxCol)
{
- if ($this->arPayment[$this->view['data']['type_payment']]['mwst_null'] == '1' && $this->view['basket']['noMwSt'] == '1')
- {
- $mwst = 0;
- }
- else
+ if ($this->arPayment[$this->view['data']['type_payment']]['mwst_null'] == '1' && $bNoTax)
{
+
+ $mwst = wpsg_ff(0.00, '%');
+
+ } else {
if ($this->view['basket']['arCalculation']['payment'][0]['tax_key'] === '0') {
-
+
$mwst = _('anteilig');
-
+
} else {
-
+
$mwst = wpsg_ff($this->view['basket']['arCalculation']['payment'][0]['tax'], '%');
$mwst = wpsg_ff($this->view['basket']['arCalculation']['tax'][$this->view['basket']['arCalculation']['payment'][0]['tax_key']]['tax_value'], '%');
-
+
}
}
-
+
$pdf->setXY($prod_left + 97, $prod_top + $offset);
$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
@@ -666,10 +617,10 @@
$pdf->Cell(15, 8, '1', 1, 0, 'C');
$pdf->setXY($prod_left + 127, $prod_top + $offset);
- $pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 1, 0, 'R');
+ $pdf->Cell(25, 8, wpsg_ff($payment_cost, $this->get_option('wpsg_currency')), 1, 0, 'R');
$pdf->setXY($prod_left + 152, $prod_top + $offset);
- $pdf->Cell(25, 8, wpsg_ff($this->view['basket']['sum']['preis_payment'], $this->get_option('wpsg_currency')), 1, 0, 'R');
+ $pdf->Cell(25, 8, wpsg_ff($payment_cost, $this->get_option('wpsg_currency')), 1, 0, 'R');
$offset += 8;
@@ -688,21 +639,18 @@
if (strpos($this->view['storno_fee'], '%') !== false) $label .= ' ('.wpsg_ff($this->view['storno_fee'], '%').')';
$pdf->setXY($prod_left + 10, $prod_top + $offset);
- $pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, $label, 1, 0, 'L');
+ $pdf->Cell( (($bTaxCol)?87:102), 8, $label, 1, 0, 'L');
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
+ if ($bTaxCol)
{
- if ($this->view['basket']['noMwSt'] == '1')
+ if ($bNoTax)
{
- $mwst = 0;
+ $mwst = wpsg_ff(0.00, '%');
}
else
{
-
-
$mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
-
}
$pdf->setXY($prod_left + 97, $prod_top + $offset);
@@ -733,65 +681,102 @@
$pdf->Cell(37, 8, $this->view['kunde']['ustidnr'], 0, 0, 'R');
}
- $offset += 10;
- if ($this->get_option('wpsg_kleinunternehmer'))
+ $offset += 10; // Abstand zwischen Tabelle und Auswertung
+
+ if ( $this->get_option('wpsg_kleinunternehmer') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) )
{
$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']['sum']['preis_gesamt_brutto'] + $this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
- $offset += 5;
-
- }
- else
- {
+ $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;
+
+ } else {
- if ($this->view['basket']['noMwSt'] == '1')
+ if ($bNoTax)
{
$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
- $pdf->Text($prod_left + 80, $prod_top + $offset, __("BRUTTOBETRAG", "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']['sum']['preis_gesamt_netto'] + $this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $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)) ) {
+
+ if (sizeof($this->view['basket']['arCalculation']['tax']) >= 1)
+ {
+
+ $mw_count = 0;
+ foreach ($this->view['basket']['arCalculation']['tax'] as $mw)
+ {
+
+ if ( $mw['tax_value'] > 0 && $mw['sum'] > 0 ) {
+
+ $offset += 5;
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['tax_value'], '%'));
+ $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+ $pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+
+ $mw_count++;
+
+ }
+
+ }
+
+ }
+
+ if ($mw_count >= 2)
+ {
+
+ $offset += 5;
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "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']['netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+
+ }
- $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
- $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
- $pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
-
- }
- else
- {
-
- $pdf->Text($prod_left, $prod_top + $offset, __("Der Gesamtbetrag setzt sich wie folgt zusammen", "wpsg"));
+ } 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 + 80, $prod_top + $offset, __("NETTOBETRAG", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
- $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_netto'] + $this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $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');
- if (sizeof($this->view['basket']['mwst']) >= 1)
+ if (sizeof($this->view['basket']['arCalculation']['tax']) >= 1)
{
-
- foreach ($this->view['basket']['mwst'] as $mw)
+
+ $mw_count = 0;
+ foreach ($this->view['basket']['arCalculation']['tax'] as $mw)
{
+
+ if ( $mw['tax_value'] > 0 && $mw['sum'] > 0) {
+
+ $offset += 5;
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['tax_value'], '%'));
+ $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+ $pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
- $offset += 5;
- $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['value'], '%'));
- $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
- $pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-
+ $mw_count++;
+
+ }
+
}
}
- if (sizeof($this->view['basket']['mwst']) > 1)
+ if ($mw_count >= 2)
{
$offset += 5;
$pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
- $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'] - $this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'] - $this->view['basket']['arCalculation']['sum']['netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
}
@@ -800,28 +785,31 @@
}
// Rabatt
- if ($this->view['basket']['sum']['preis_rabatt'] > 0)
+ 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($this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->Cell(37, 8, '-'.wpsg_ff($discount_value, $this->get_option('wpsg_currency')), 0, 0, 'R');
}
-
+
// Wertgutschein
- if ($arCalculation['sum']['topay_brutto'] !== $arCalculation['sum']['brutto']) {
-
- $offset += 5;
- $pdf->Text($prod_left + 80, $prod_top + $offset, __("Bruttobetrag", "wpsg"));
- $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+ if ( $arCalculation['sum']['topay_brutto'] != $arCalculation['sum']['brutto'] ) {
+
+ if (!$bNoTax) {
- $pdf->setFont('Arial', '', '9');
- $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
- $pdf->setFont('Arial', '', '9');
+ $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) {
$offset += 5;
@@ -847,78 +835,79 @@
} else {
$offset += 5;
- $pdf->Text($prod_left + 80, $prod_top + $offset, __("SUMME", "wpsg"));
+ $pdf->setFont('Arial', 'B', '9');
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("GESAMTSUMME", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
/* Endbetrag wird fett ausgegeben */
- $pdf->setFont('Arial', 'B', '9');
- $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['topay_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
$pdf->setFont('Arial', '', '9');
}
- if ($this->get_option('wpsg_kleinunternehmer') == '1')
+ 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;
+
+ $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'))
+ 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;
+ $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;
}
}
- $offset += 5;
-
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();
$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $shipping_adress, 0, 'L', 0, 100);
@@ -928,45 +917,44 @@
}
-
- $offset += 5;
-
// Bestellvariablen
if ($this->hasMod('wpsg_mod_ordervars') && $this->get_option('wpsg_mod_rechnungen_showov') == '1')
{
+
+ $pdf->SetFont('Arial', 'B', 9);
+ $pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset - 7, 5, __("Angaben während der Bestellung", "wpsg").":");
- $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 ");
+ $pdf->SetFont('Arial', '', 9);
+
+ $bvars = @unserialize($this->view['data']['bvars']);
+ if (!is_array($bvars)) $bvars = array();
- if ($bvars['typ'] == "1") // Auswahl
+ $strBVars = "";
+ foreach ($bvars as $bvars_id => $bvars_value)
{
- 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 = $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;
+
}
-
- $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->SetFont('Arial', '', 9);
- $pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $strBVars);
+ $pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset - 6, 5, $strBVars);
+
}
if (!file_exists($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id']))))
diff --git a/views/mods/mod_rechnungen/multi_invoice_pdf.phtml b/views/mods/mod_rechnungen/multi_invoice_pdf.phtml
index d9aaedb..0902fce 100644
--- a/views/mods/mod_rechnungen/multi_invoice_pdf.phtml
+++ b/views/mods/mod_rechnungen/multi_invoice_pdf.phtml
@@ -192,7 +192,7 @@
// noMwSt
$head_data = array_values($this->view['multi_data']['order_data'])[0];
- if ( ($head_data['oCalculation']->getTaxMode() === wpsg_calculation::TAXMODE_B2B) && ($head_data['oOrder']->isInnerEu()) ) {
+ if ( ($head_data['oCalculation']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_B2B) && ($head_data['oOrder']->isInnerEu()) ) {
$bNoTax = true;
} else {
$bNoTax = false;
@@ -380,7 +380,7 @@
* Produktbeschreibung anzeigen Ja/Nein
*/
$pBeschreibungHeight = 0;
- if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($oOrderProduct->getShortDescription())) != '') {
+ if ($this->get_option("wpsg_rechnungen_pbeschreibung") == "1" && trim(strip_tags($oOrderProduct->getProduct()->getShortDescription())) != '') {
$produktBeschreibung = nl2br($produktBeschreibung);
preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
@@ -785,19 +785,6 @@
$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
- // if (sizeof($arCalculation['tax']) >= 1) {
- // foreach ($arCalculation['tax'] as $k => $mw) {
- // if ($k === 0) continue;
-
- // $offset += 5;
-
- // $pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. ", "wpsg").wpsg_ff($mw['tax_value'], '%'));
- // $pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
- // $pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-
- // }
- // }
-
if (sizeof($arCalculation['tax']) > 1) {
$offset += 5;
diff --git a/views/mods/mod_rechnungen/order_view.phtml b/views/mods/mod_rechnungen/order_view.phtml
index 9a900b3..fb4aa27 100644
--- a/views/mods/mod_rechnungen/order_view.phtml
+++ b/views/mods/mod_rechnungen/order_view.phtml
@@ -34,8 +34,14 @@
<a target="_blank" onclick="if (!confirm('<?php echo __('Sind Sie sicher, dass Sie eine Kopie dieser Rechnung/Rechnungskorrektur erneut an den Kunden senden möchten?', 'wpsg'); ?>')) return false;" href="<?php
- echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_rechnungen&noheader=1&action=ajax&edit_id='.$this->view['data']['id'].'&r_id='.$r['id'].'&do=copy', 'wpsg-mod_invoice-order_ajax-copy-'.$this->view['data']['id']);
-
+ if ($r['o_id'] != '0') {
+ // Multirechnung
+ echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_rechnungen&noheader=1&action=ajax&edit_id='.$r['o_ids'][0].'&r_id='.$r['id'].'&do=copy', 'wpsg-mod_invoice-order_ajax-copy-'.$r['o_ids'][0]);
+ } else {
+ // normale Rechnung
+ echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_rechnungen&noheader=1&action=ajax&edit_id='.$this->view['data']['id'].'&r_id='.$r['id'].'&do=copy', 'wpsg-mod_invoice-order_ajax-copy-'.$this->view['data']['id']);
+ }
+
?>"><?php echo ' &nbsp;'.__("Kopie senden", "wpsg"); ?></a>&nbsp;
</div>
diff --git a/views/mods/mod_rechnungen/settings_edit.phtml b/views/mods/mod_rechnungen/settings_edit.phtml
index 10609bf..18c393b 100644
--- a/views/mods/mod_rechnungen/settings_edit.phtml
+++ b/views/mods/mod_rechnungen/settings_edit.phtml
@@ -196,12 +196,16 @@
<?php if ($this->hasMod('wpsg_mod_produktattribute') == '1') {?>
<?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')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_showpv', __('Produktvariablen auf Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_showpv'), array('help' => 'wpsg_mod_rechnungen_showpv')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_showov', __('Bestellvariablen auf Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_showov'), array('help' => 'wpsg_mod_rechnungen_showov')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_hideCountry', __('Land auf Rechnung verbergen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_hideCountry'), array('help' => 'wpsg_mod_rechnungen_hideCountry')); ?>
- <?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_customermail', __('Mail an Bestellbestätigung anhängen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_customermail'), ['help' => 'wpsg_mod_rechnungen_customermail']); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_customermail', __('Rechnung/PDF an Bestellbestätigungsmail anhängen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_customermail'), ['help' => 'wpsg_mod_rechnungen_customermail']); ?>
<?php echo wpsg_drawForm_Input('wpsg_rechnungen_start', __('Startnummer (Rechnungen)', 'wpsg'), $this->get_option('wpsg_rechnungen_start'), array('help' => 'wpsg_rechnungen_start')); ?>
<?php echo wpsg_drawForm_Input('wpsg_gutschrift_start', __('Startnummer (Rechnungskorrektur)', 'wpsg'), $this->get_option('wpsg_gutschrift_start'), array('help' => 'wpsg_gutschrift_start')); ?>
<?php echo wpsg_drawForm_Select('wpsg_mod_rechnungen_gutschrifttax', __('Mehrwertsteuersatz für Bearbeitungsgebühr', 'wpsg'), wpsg_tax_groups(), $this->get_option('wpsg_mod_rechnungen_gutschrifttax'), array('help' => 'wpsg_mod_rechnungen_gutschrifttax')); ?>