summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--views/admin/konfiguration.phtml1
-rw-r--r--views/admin/versandzonen_list.phtml4
-rw-r--r--views/js/dsimagezoom.min.js1
-rw-r--r--views/mods/mod_abo/index.phtml10
-rw-r--r--views/mods/mod_abo/order_view_base.phtml2
-rw-r--r--views/mods/mod_deliverynote/deliverynote_pdf.phtml3
-rwxr-xr-xviews/mods/mod_deliverytime/product_bottom.phtml12
-rw-r--r--views/mods/mod_downloadplus/settings_edit.phtml24
-rw-r--r--views/mods/mod_export/profil.phtml28
-rw-r--r--views/mods/mod_kundenverwaltung/order.phtml28
-rw-r--r--views/mods/mod_productgroups/add.phtml81
-rw-r--r--views/mods/mod_productgroups/index.phtml16
-rw-r--r--views/mods/mod_productgroups/list.phtml5
-rw-r--r--views/mods/mod_productgroups/settings_edit.phtml4
-rw-r--r--views/mods/mod_productgroups/show_2.phtml86
-rw-r--r--views/mods/mod_productvariants/admin_edit.phtml21
-rw-r--r--views/mods/mod_rechnungen/accounting_pdf.phtml602
-rw-r--r--views/mods/mod_rechnungen/invoice_pdf.phtml159
-rw-r--r--views/mods/mod_rechnungen/multi_invoice_pdf.phtml43
-rw-r--r--views/mods/mod_rechnungen/order_view.phtml5
-rwxr-xr-xviews/mods/mod_rechnungen/order_view_orderdata_after.phtml10
-rw-r--r--views/mods/mod_shippingadress/wpsg_order_view_customerdata.phtml18
-rw-r--r--views/order/index.phtml13
-rw-r--r--views/order/product_table.phtml8
-rw-r--r--views/order/view_general.phtml7
-rw-r--r--views/produkt/index.phtml18
-rw-r--r--views/produkttemplates/standard.phtml8
-rw-r--r--views/produkttemplates/standard2.phtml19
-rw-r--r--views/produkttemplates/standard3.phtml521
29 files changed, 1228 insertions, 529 deletions
diff --git a/views/admin/konfiguration.phtml b/views/admin/konfiguration.phtml
index 8d4a527..e769137 100644
--- a/views/admin/konfiguration.phtml
+++ b/views/admin/konfiguration.phtml
@@ -64,6 +64,7 @@
<?php echo wpsg_drawForm_Input('wpsg_produkte_perpage', __('Produkte pro Seite', 'wpsg'), $this->get_option('wpsg_produkte_perpage'), array('help' => 'ProduktePerPage')); ?>
<?php echo wpsg_drawForm_Input('wpsg_order_perpage', __('Bestellungen pro Seite', 'wpsg'), $this->get_option('wpsg_order_perpage'), array('help' => 'Bestellung_pro_Seite')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_showincompleteorder', __('Unvollständige Best. in Bestellverwaltung anzeigen', 'wpsg'), $this->get_option('wpsg_showincompleteorder'), array('help' => 'unvollstaendige_Bestellung')); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_showvalueofgoods', __('Warenwert in Bestellverwaltung anzeigen', 'wpsg'), $this->get_option('wpsg_showvalueofgoods'), array('help' => 'Warenwert_Bestellung')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_emptyorder_clear', wpsg_translate(__('Bestellungen für 0 #1# direkt abschließen', 'wpsg'), $this->get_option('wpsg_currency')), $this->get_option('wpsg_emptyorder_clear'), array('help' => 'Bestellung_0')); ?>
<?php echo wpsg_drawForm_Select('wpsg_afterinsert', __('Nach neuem Produkt im Warenkorb', 'wpsg'), array(
'0' => __('Auf Seite bleiben', 'wpsg'),
diff --git a/views/admin/versandzonen_list.phtml b/views/admin/versandzonen_list.phtml
index b099e3f..55f7ea5 100644
--- a/views/admin/versandzonen_list.phtml
+++ b/views/admin/versandzonen_list.phtml
@@ -13,7 +13,7 @@
foreach ($arShipping as $s_key => $s) {
- if (intval($s['deleted']) !== 1 && intval($s['active']) === 1) {
+ if (intval($s['deleted']??'') !== 1 && intval($s['active']??'') === 1) {
$arShippingPreset[$s_key] = $s['name'];
@@ -51,7 +51,7 @@
<?php echo (($vz['innereu'] == '1')?'checked="checked"':''); ?> type="checkbox" value="1" name="innereu_<?php echo $vz['id']; ?>" id="innereu_<?php echo $vz['id']; ?>" />
</td>
<td class="col_shippingpreset">
- <span id="vz_<?php echo $vz['id']; ?>_shippingpreset"><?php echo $arShippingPreset[$vz['shippingpreset']]; ?></span>
+ <span id="vz_<?php echo $vz['id']; ?>_shippingpreset"><?php echo ($arShippingPreset[($vz['shippingpreset']??'')]??''); ?></span>
<script>
jQuery('#vz_<?php echo $vz['id']; ?>_shippingpreset').wpsg_editable('<?php
diff --git a/views/js/dsimagezoom.min.js b/views/js/dsimagezoom.min.js
new file mode 100644
index 0000000..7748583
--- /dev/null
+++ b/views/js/dsimagezoom.min.js
@@ -0,0 +1 @@
+class DsImageZoom{static destroy(t){void 0===t&&(t=document.getElementsByClassName("ds_image_zoom"));for(const e of t){const t=e.getElementsByTagName("img")[0];e.classList.remove("attached"),e.setAttribute("style",""),t.setAttribute("style","")}}static init(t){void 0===t&&(t=document.getElementsByClassName("ds_image_zoom"));for(const e of t){const t=e.getElementsByTagName("img")[0];t.onload=()=>{const s=t.getBoundingClientRect().width,i=t.getBoundingClientRect().height,a=.5*s;e.setAttribute("data-image-width",s),e.setAttribute("data-image-height",i),e.setAttribute("data-factor",a),e.style.width=s+"px",e.style.height=i+"px",t.style.width=s+"px",t.style.height=i+"px",e.classList.add("attached"),e.addEventListener("mousemove",(o=>{t.style.width=s+a+"px",t.style.height=i+a+"px";const n=(o.x-e.getBoundingClientRect().x)/s,d=(o.y-e.getBoundingClientRect().y)/s;t.style.left=-1*a*n+"px",t.style.top=-1*a*d+"px"})),e.addEventListener("mousein",(t=>{})),e.addEventListener("mouseout",(e=>{t.style.width=s+"px",t.style.height=i+"px",t.style.left="0px",t.style.top="0px"}))},t.setAttribute("src",t.getAttribute("data-src"))}}}
diff --git a/views/mods/mod_abo/index.phtml b/views/mods/mod_abo/index.phtml
index dc03e8f..b726fc0 100644
--- a/views/mods/mod_abo/index.phtml
+++ b/views/mods/mod_abo/index.phtml
@@ -79,9 +79,11 @@
<div class="col-lg-6">
<select name="filter[enddate_y]" class="form-control input-sm">
<option value="-1"><?php echo __("Alle", "wpsg"); ?></option>
- <?php foreach ($this->view['enddate_years'] as $y) { ?>
- <option <?php echo ((wpsg_getStr($this->view['arFilter']['enddate_y']) == $y)?'selected="selected"':''); ?> value="<?php echo $y; ?>"><?php echo $y; ?></option>
- <?php } ?>
+ <?php if(isset($this->view['enddate_years']) && !empty($this->view['enddate_years'])) {
+ foreach ($this->view['enddate_years'] as $y) { ?>
+ <option <?php echo ((wpsg_getStr($this->view['arFilter']['enddate_y']) == $y)?'selected="selected"':''); ?> value="<?php echo $y; ?>"><?php echo $y; ?></option>
+ <?php }
+ } ?>
</select>
</div>
</div>
@@ -127,7 +129,7 @@
<th class="col_customer wpsg_order" data-order="customer"><?php echo __('Kunde', 'wpsg'); ?></th>
<th class="col_payment wpsg_order" data-order="payment"><?php echo __('Bezahlmethode', 'wpsg'); ?></th>
<th class="col_shipping wpsg_order" data-order="shipping"><?php echo __('Versandart', 'wpsg'); ?></th>
- <th class="col_products wpsg_order" data-order="products"><?php echo __('Abonnement', 'wpsg'); ?></th>
+ <th class="col_products wpsg_order" data-order="products"><?php echo __('Abonnement', 'wpsg'); ?></th>
<th class="col_sum wpsg_order" data-order="amount"><?php echo __('Bestellwert', 'wpsg'); ?></th>
<th class="col_time wpsg_order" data-order="expiration"><?php echo __('Laufzeit', 'wpsg'); ?></th>
<th class="col_state"><?php echo __('Status', 'wpsg'); ?></th>
diff --git a/views/mods/mod_abo/order_view_base.phtml b/views/mods/mod_abo/order_view_base.phtml
index b5dc919..3ce1172 100644
--- a/views/mods/mod_abo/order_view_base.phtml
+++ b/views/mods/mod_abo/order_view_base.phtml
@@ -7,7 +7,7 @@
?>
<tr class="wpsg_<?php echo (($this->view['i'] == 0)?'odd':'even'); ?>">
<td ><?php echo __('Abo Verlängerungen', 'wpsg'); ?>:</td>
- <td align="right" colspan="<?php echo ((sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?'4':'3'); ?>">
+ <td align="right" colspan="<?php echo ((sizeof($this->view['basket']['mwst'])??0 > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?'4':'3'); ?>">
<?php if (wpsg_isSizedArray($this->view['wpsg_mod_abo']['rebuy'])) { ?>
<?php foreach ($this->view['wpsg_mod_abo']['rebuy'] as $k => $v) { ?>
<?php echo wpsg_translate(__('Mit Bestellung <a href="#1#">#2#</a> um #3# Tage verlängert.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$v['o_id'], $v['order']['onr'], $v['tage']); ?><br />
diff --git a/views/mods/mod_deliverynote/deliverynote_pdf.phtml b/views/mods/mod_deliverynote/deliverynote_pdf.phtml
index 78505c9..876f0fe 100644
--- a/views/mods/mod_deliverynote/deliverynote_pdf.phtml
+++ b/views/mods/mod_deliverynote/deliverynote_pdf.phtml
@@ -169,6 +169,7 @@
$filename = $this->view['filename'].".pdf";
$bKopf = false; $pnr = 1; $offset = 0; $count = 0;
+
foreach ($this->view['data']['products'] as $p)
{
@@ -232,7 +233,7 @@
/* Wenn Detailname nicht vorhanden, wird der Name auf dem Lieferschein verwendet*/
$produkt_text = $this->getProductName($this->getProduktID($p['p_id']), false);
- $produktBeschreibung = trim(strip_tags($p['beschreibung']));
+ $produktBeschreibung = trim(strip_tags($product_data['beschreibung']));
if ($this->isOtherLang())
{
diff --git a/views/mods/mod_deliverytime/product_bottom.phtml b/views/mods/mod_deliverytime/product_bottom.phtml
index 3687401..3412e52 100755
--- a/views/mods/mod_deliverytime/product_bottom.phtml
+++ b/views/mods/mod_deliverytime/product_bottom.phtml
@@ -18,14 +18,18 @@
<?php if ($days_between <= 1) { ?>
- <div class="wpsg_mod_deliverytime_product_bottom">
- <?php echo __('sofort Lieferbar', 'wpsg') ;?>
+ <div class="wpsg_mod_deliverytime wpsg_mod_deliverytime_product_bottom">
+ <span class="fa fa-calendar-minus-o"></span>
+ <span class="label label_deliverytime_product">Verfügbarkeit: </span>
+ <span class="label_deliverytime"><?php echo __('sofort Verfügbar', 'wpsg') ;?></span>
</div>
<?php } else { ?>
- <div class="wpsg_mod_deliverytime_product_bottom">
- <?php echo wpsg_translate(__('Lieferbar in #1# Tagen', 'wpsg'), $days_between); ?>
+ <div class="wpsg_mod_deliverytime wpsg_mod_deliverytime_product_bottom">
+ <span class="fa fa-calendar-minus-o"></span>
+ <span class="label label_deliverytime_product">Verfügbarkeit: </span>
+ <span class="label_deliverytime"><?php echo wpsg_translate(__('Lieferbar in #1# Tagen', 'wpsg'), $days_between); ?></span>
</div>
<?php } ?>
diff --git a/views/mods/mod_downloadplus/settings_edit.phtml b/views/mods/mod_downloadplus/settings_edit.phtml
index f30f3ff..71b945a 100644
--- a/views/mods/mod_downloadplus/settings_edit.phtml
+++ b/views/mods/mod_downloadplus/settings_edit.phtml
@@ -45,13 +45,16 @@
<?php echo wpsg_drawForm_Input('wpsg_mod_downloadplus_range_bis', __('Anpassung bis Seite', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_range_bis'), array()); ?>
</div>
- <?php echo wpsg_drawForm_Input('wpsg_mod_downloadplus_masterpass', __('Passwort (Um Schutz aufzuheben)', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_masterpass'), array('help' => 'wpsg_mod_downloadplus_masterpass')); ?>
- <?php echo wpsg_drawForm_Input('wpsg_mod_downloadplus_openpass', __('Passwort (Um Dokument öffnen zu können)', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_openpass'), array('help' => 'wpsg_mod_downloadplus_openpass')); ?>
-
- <?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_securitysave', __('Speichern erlauben', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_securitysave'), array('label' => __('Dokumentenberechtigung', 'wpsg'))); ?>
- <?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_securityprint', __('Drucken erlauben', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_securityprint')); ?>
- <?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_securitymod', __('Modifizieren erlauben', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_securitymod')); ?>
- <?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_securitynote', __('Bemerkungen erlauben', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_securitynote')); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_setpwd', __('Passwortschutz aktivieren', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_setpwd'), array('help' => 'wpsg_mod_downloadplus_setpwd')); ?>
+ <div class="wpsg_mod_downloadplus_setpwd_activ" style="display:none;">
+ <?php echo wpsg_drawForm_Input('wpsg_mod_downloadplus_masterpass', __('Passwort (Um Schutz aufzuheben)', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_masterpass'), array('help' => 'wpsg_mod_downloadplus_masterpass')); ?>
+ <?php echo wpsg_drawForm_Input('wpsg_mod_downloadplus_openpass', __('Passwort (Um Dokument öffnen zu können)', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_openpass'), array('help' => 'wpsg_mod_downloadplus_openpass')); ?>
+
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_securitysave', __('Speichern erlauben', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_securitysave'), array('label' => __('Dokumentenberechtigung', 'wpsg'))); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_securityprint', __('Drucken erlauben', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_securityprint')); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_securitymod', __('Modifizieren erlauben', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_securitymod')); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_securitynote', __('Bemerkungen erlauben', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_securitynote')); ?>
+ </div>
<?php echo wpsg_drawForm_TextStart(); ?>
<?php echo wpsg_translate(__('Kann <a href="#1#">hier</a> konfiguriert werden.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf#pdfdownloadcronmail'); ?>
@@ -121,6 +124,13 @@
} ).change();
+ jQuery('#wpsg_mod_downloadplus_setpwd').bind('change', function() {
+
+ if (jQuery(this).is(':checked')) jQuery('.wpsg_mod_downloadplus_setpwd_activ').show();
+ else jQuery('.wpsg_mod_downloadplus_setpwd_activ').hide();
+
+ } ).change();
+
} );
</script> \ No newline at end of file
diff --git a/views/mods/mod_export/profil.phtml b/views/mods/mod_export/profil.phtml
index 4709b9c..9284f71 100644
--- a/views/mods/mod_export/profil.phtml
+++ b/views/mods/mod_export/profil.phtml
@@ -93,7 +93,27 @@
<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 echo wpsg_drawForm_Checkbox('wp_cron', __('Stündlich mit Wordpress Cron ausführen', 'wpsg'), ($this->view['profil']['wp_cron']??'0') === '1'); ?>
+
+ <script>
+
+ document.getElementById('wp_cron').addEventListener('change', (event) => {
+
+ jQuery.ajax({
+ url: '<?php echo $inlineEdit_url; ?>',
+ data: {
+ name: 'wp_cron',
+ value: ((event.target.checked === true)?'1':'0')
+ }
+ })
+
+ // console.log('<?php echo $inlineEdit_url; ?>');
+
+ });
+
+ </script>
+
<?php if ($this->view['profil']['export_type'] === wpsg_mod_export::TYPE_ORDER) { ?>
<fieldset id="wpsg_mod_export_orderfilter" style="display:<?php echo (($this->view['profil']['cron_interval'] !== wpsg_mod_export::CRON_ORDER)?'block':'none'); ?>;">
@@ -108,7 +128,7 @@
<?php echo wpsg_drawForm_Text(__('Bestellstatus', 'wpsg'), $arOrderStatus[wpsg_getStr($this->view['profil']['orderfilter']['status'], '-1')], 'orderfilter_status', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_source' => $arOrderStatus)); ?>
<?php $arMonth = array('-1' => __('Alle', 'wpsg')); ?>
- <?php for ($i = 1; $i <= 12; $i ++) { $arMonth[str_pad($i, 2, '0', STR_PAD_LEFT)] = strftime("%B", mktime(0, 0, 0, $i, 1, 2000)); } ?>
+ <?php for ($i = 1; $i <= 12; $i ++) { $arMonth[str_pad($i, 2, '0', STR_PAD_LEFT)] = wpsg_strftime("%B", mktime(0, 0, 0, $i, 1, 2000)); } ?>
<?php $arYearCdate = array('-1' => __('Alle', 'wpsg')); ?>
<?php foreach ($this->view['cdate_years'] as $y) { $arYearCdate[$y] = $y; } ?>
@@ -202,7 +222,9 @@
<?php if ($this->hasMod('wpsg_mod_produktartikel')) { $temp = $this->callMod('wpsg_mod_produktartikel', 'getProductcategorySelect', array()); ?>
<?php $arProductCategorySelect = array(); foreach ($temp as $k => $v) $arProductCategorySelect[$v['term_id']] = $v['label']; ?>
- <?php echo wpsg_drawForm_Text(__('Produktkategorie', 'wpsg'), $arProductCategorySelect[wpsg_getStr($this->view['profil']['orderfilter']['productcategory_ids'], '-1')], 'orderfilter_productcategory_ids', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_source' => $arProductCategorySelect)); ?>
+ <?php $productCategoryIds = wpsg_getStr($this->view['profil']['orderfilter']['productcategory_ids'], '-1'); ?>
+ <?php $selectedCategory = $arProductCategorySelect['-1'] ?? ''; ?>
+ <?php echo wpsg_drawForm_Text(__('Produktkategorie', 'wpsg'), $arProductCategorySelect[$productCategoryIds], 'orderfilter_productcategory_ids', array('inlineEdit' => true, 'inlineEdit_type' => 'select', 'inlineEdit_url' => $inlineEdit_url, 'inlineEdit_source' => $arProductCategorySelect)); ?>
<?php } ?>
</form>
diff --git a/views/mods/mod_kundenverwaltung/order.phtml b/views/mods/mod_kundenverwaltung/order.phtml
index 5b3bc9a..d47b4d2 100644
--- a/views/mods/mod_kundenverwaltung/order.phtml
+++ b/views/mods/mod_kundenverwaltung/order.phtml
@@ -22,14 +22,26 @@
<div class="wpsg_inner wpsg_order_<?php echo $order['id']; ?>">
<strong><?php echo __('Bestellstatus', 'wpsg'); ?>:</strong>&nbsp;
<?php echo $this->arStatus[$order['status']]; ?>
- <?php if ($this->hasMod('wpsg_mod_rechnungen')) { ?>
-
- <?php if ($r = $this->callMod('wpsg_mod_rechnungen', 'getOrderInvoice', array($order['id']))) { ?>
- <a href="<?php echo $this->callMod('wpsg_mod_rechnungen', 'getFrontendLink', array($r['id'])); ?>"><?php echo wpsg_translate(__('Rechnung #1#', 'wpsg'), $r['rnr']); ?></a>
- <?php } else if ($r = $this->callMod('wpsg_mod_rechnungen', 'getOrderCredit', array($order['id']))) { ?>
- <a href="<?php echo $this->callMod('wpsg_mod_rechnungen', 'getFrontendLink', array($r['id'])); ?>"><?php echo wpsg_translate(__('Rechnungskorrektur #1#', 'wpsg'), $r['gnr']); ?></a>
- <?php } ?>
-
+ <?php if ($this->hasMod('wpsg_mod_rechnungen')) {
+
+ $arInvoice = \wpsg\wpsg_invoice::findByOrderId(intval($order['id']));
+
+ ?>
+
+ <?php foreach ($arInvoice as $oInvoice) { ?>
+
+ <?php if ($oInvoice->isInvoice()) { ?>
+
+ <a href="<?php echo $this->callMod('wpsg_mod_rechnungen', 'getFrontendLink', [$oInvoice->getId()]); ?>"><?php echo wpsg_translate(__('Rechnung #1#', 'wpsg'), $oInvoice->getNr()); ?></a>
+
+ <?php } else if ($oInvoice->isStorno()) { ?>
+
+ <a href="<?php echo $this->callMod('wpsg_mod_rechnungen', 'getFrontendLink', [$oInvoice->getId()]); ?>"><?php echo wpsg_translate(__('Rechnungskorrektur #1#', 'wpsg'), $oInvoice->getNr()); ?></a>
+
+ <?php } ?>
+
+ <?php } ?>
+
<?php } ?>
<br />
<strong><?php echo __('Rechnungsbetrag', 'wpsg'); ?>:</strong> <?php echo wpsg_ff($order['price_gesamt'], $this->get_option('wpsg_currency')); ?><br />
diff --git a/views/mods/mod_productgroups/add.phtml b/views/mods/mod_productgroups/add.phtml
index 6de468e..22983b0 100644
--- a/views/mods/mod_productgroups/add.phtml
+++ b/views/mods/mod_productgroups/add.phtml
@@ -4,6 +4,15 @@
* Template für das Anlegen/Bearbeiten einer Produktgruppe
*/
+ /** @var wpsg_productgroup|null $oProductgroup */
+ $oProductgroup = null;
+
+ if (intval($_REQUEST['edit_id']??0) > 0) {
+
+ $oProductgroup = wpsg_productgroup::getInstance(intval($_REQUEST['edit_id']));
+
+ }
+
?>
<div class="wpsg_productgroups" id="wpsg-bs">
@@ -61,6 +70,78 @@
<?php echo wpsg_drawForm_Select('template_file', __('Template', 'wpsg'), $this->view['templates'], $this->view['data']['template_file']); ?>
<?php echo wpsg_drawForm_Select('infopage', __('Info Seite', 'wpsg'), $this->view['pages'], $this->view['data']['infopage']); ?>
+ <div class="form-group form-group-sm ">
+ <label class="col-sm-6 control-label"><?php echo __('Produktgruppenbild', 'wpsg'); ?></label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap">
+ <div id="imageBox"><?php
+
+ if ($oProductgroup !== null) {
+
+ if ($oProductgroup->getImage() > 0) {
+
+ echo wp_get_attachment_image($oProductgroup->getImage(), 'full', false, [
+ 'style' => 'max-width:100%; height:auto; margin-bottom:8px;'
+ ]);
+
+ }
+
+ }
+
+ ?></div>
+
+ <input value="Mediathek" class="button" type="button" style="text-align:center;" size="10" id="btnAddImgLink" />
+ <input type="hidden" name="image" value="<?php echo (($oProductgroup !== null)?$oProductgroup->getImage():0); ?>" id="image_input" />
+
+ <script>
+
+ let wpframe = undefined;
+ let imageBox = document.getElementById('imageBox');
+ let elImageInput = document.getElementById('image_input');
+
+ document.getElementById('btnAddImgLink').addEventListener('click', (event) => {
+
+ event.preventDefault();
+
+ if (wpframe !== undefined) { wpframe.open(); return; }
+
+ wpframe = wp.media.frames.file_frame = wp.media({
+ title: "<?php echo __('Auswählen oder Hochladen von Medien', 'wpsg'); ?>",
+ button: { text: "<?php echo __('Medien benutzen', 'wpsg'); ?>" },
+ multiple: false
+ });
+
+ wpframe.on('select', () => {
+
+ let attachments = wpframe.state().get('selection').map((attachment) => {
+
+ attachment.toJSON();
+
+ return attachment;
+
+ });
+
+ for (let i = 0; i < attachments.length; ++i) {
+
+ let attachment = attachments[i];
+
+ imageBox.innerHTML = '<img src="' + attachment.attributes.url + '" alt="" style="max-width:100%; margin-bottom:8px;"/>';
+ elImageInput.value = attachment.attributes.id;
+
+ }
+
+ });
+
+ wpframe.open();
+
+ });
+
+ </script>
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
</div>
diff --git a/views/mods/mod_productgroups/index.phtml b/views/mods/mod_productgroups/index.phtml
index 66599a8..18b19d1 100644
--- a/views/mods/mod_productgroups/index.phtml
+++ b/views/mods/mod_productgroups/index.phtml
@@ -80,16 +80,28 @@
<table class="table wpsg-table-order table-bordered table-hover table-striped wpsg-table-customer">
<thead>
<tr>
+ <th class="wpsg_pic_col"></th>
<th class="wpsg_order col_name" data-order="nr"><?php echo __("Name", 'wpsg'); ?></th>
<th class="wpsg_order col_template" data-order="template"><?php echo __("Template", 'wpsg'); ?></th>
<th class="wpsg_order col_products" data-order="products"><?php echo __("Produkte", 'wpsg'); ?></th>
</tr>
</thead>
<tbody>
- <?php foreach ($this->view['arData'] as $pg) { ?>
+ <?php foreach ($this->view['arData'] as /** @var wpsg_productgroup */ $pg) { ?>
<tr>
+ <td class="wpsg_pic_col">
+ <?php if ($pg->getImage() > 0) { ?>
+
+ <?php echo \wp_get_attachment_image($pg->getImage(), [75, 75]); ?>
+
+ <?php } ?>
+ </td>
<td class="col_name">
- <strong><a title="<?php echo __("Diese Produktgruppe bearbeiten", "wpsg"); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Productgroups&wpsg_mod_action=edit&edit_id=<?php echo $pg->id; ?>" class="row-title"><?php echo $pg->name; ?></a></strong>
+ <strong><a title="<?php echo __("Diese Produktgruppe bearbeiten", "wpsg"); ?>" href="<?php
+
+ echo wpsg_admin_url('Productgroups', '', ['wpsg_mod_action' => 'edit', 'edit_id' => $pg->id]);
+
+ ?>" class="row-title"><?php echo $pg->name; ?></a></strong>
<div class="row-actions">
<span class="edit"><a title="<?php echo __("Diese Produktgruppe bearbeiten", "wpsg"); ?>" href="<?php
diff --git a/views/mods/mod_productgroups/list.phtml b/views/mods/mod_productgroups/list.phtml
index 07df917..440af68 100644
--- a/views/mods/mod_productgroups/list.phtml
+++ b/views/mods/mod_productgroups/list.phtml
@@ -22,9 +22,10 @@
<div class="wpsg_pgruppen_list_produkte">
<?php for ($i = 0; $i < $showP && $i < sizeof($g['produkte']); $i ++) { ?>
- <?
+ <?php
- $lagerbestand = $this->callMod('wpsg_mod_stock', 'getBestand', [$g['produkte'][$i]['id']]);
+ if ($this->hasMod('wpsg_mod_stock')) $lagerbestand = $this->callMod('wpsg_mod_stock', 'getBestand', [$g['produkte'][$i]['id']]);
+ else $lagerbestand = 1;
?>
diff --git a/views/mods/mod_productgroups/settings_edit.phtml b/views/mods/mod_productgroups/settings_edit.phtml
index 6546985..2d00f6c 100644
--- a/views/mods/mod_productgroups/settings_edit.phtml
+++ b/views/mods/mod_productgroups/settings_edit.phtml
@@ -6,6 +6,10 @@
?>
<?php echo wpsg_drawForm_Select('wpsg_productgroups_page', __('Produktgruppenübersichtsseite', 'wpsg'), $this->view['pages'], $this->get_option('wpsg_productgroups_page'), array('help' => 'wpsg_mod_productgroups_page')); ?>
+<?php echo wpsg_drawForm_Select('wpsg_productgroups_page_layout', __('Layout der Übersichtsseite', 'wpsg'), [
+ '0' => 'Layout 1 (show.phtml)',
+ '1' => 'Layout 2 (show_2.phml)'
+], $this->get_option('wpsg_productgroups_page_layout'), ['help' => 'wpsg_productgroups_page_layout']); ?>
<?php echo wpsg_drawForm_Select('wpsg_productgroups_order', __('Sortierung innerhalb der Gruppe', 'wpsg'), array(
'id' => __('Nach ID', 'wpsg'),
'alphabetisch' => __('Alphabetisch', 'wpsg'),
diff --git a/views/mods/mod_productgroups/show_2.phtml b/views/mods/mod_productgroups/show_2.phtml
new file mode 100644
index 0000000..2f8eaef
--- /dev/null
+++ b/views/mods/mod_productgroups/show_2.phtml
@@ -0,0 +1,86 @@
+<?php
+
+ /** Template für die Anzeige von Produktgruppen Layout 2 */
+
+ namespace wpsg;
+
+ $page_url = \get_permalink(\get_the_ID());
+ $page_url .= ((strpos($page_url, '?') === false)?'?':'&');
+
+ if (isset($_REQUEST['show'])) {
+
+ $oProductgroup = \wpsg_productgroup::getInstance(intval($_REQUEST['show']));
+ $arProducts = $oProductgroup->findProducts();
+ $view = 'products';
+
+ } else {
+
+ $arProductgroups = \wpsg_productgroup::find();
+ $view = 'productgroups';
+
+ }
+
+?>
+
+<div class="wpsg_mod_productgroup_layout2_wrap">
+ <?php if ($view === 'products') { ?>
+
+ <div class="wpsg_mod_productgroup_layout2 products">
+
+ <?php foreach ($arProducts as $oProduct) { ?>
+
+ <?php echo $this->renderProdukt($oProduct->getId(), $oProductgroup->getTemplate()); ?>
+
+ <?php } ?>
+
+ <br />
+
+ <a href="<?php echo $page_url; ?>"><?php echo __('Zurück zur Übersicht', 'wpsg'); ?></a>
+
+ </div>
+
+ <?php } else if ($view === 'productgroups') { ?>
+
+ <div class="wpsg_mod_productgroup_layout2 productgroups">
+
+ <?php foreach ($arProductgroups as $k => $oProductgroup) { ?>
+
+ <a href="<?php
+
+ if (intval($oProductgroup->__get('infopage')) > 0) echo \get_permalink(intval($oProductgroup->__get('infopage')));
+ else echo $page_url.'show='.$oProductgroup->getId();
+
+ ?>" class="productgroup">
+
+ <div class="title"><?php echo $oProductgroup->getLabel(); ?></div>
+
+ <?php echo \wp_get_attachment_image($oProductgroup->getImage(), [462, 462], false, [
+ 'class' => 'bg'
+ ]); ?>
+
+ </a>
+
+ <?php } ?>
+
+ </div>
+
+ <style>
+
+ .wpsg_mod_productgroup_layout2.productgroups { all:revert; width:100%; display:grid; grid-template-columns:repeat(2, 1fr); grid-template-rows:repeat(10, 1fr); grid-column-gap:1rem; grid-row-gap:1rem; }
+ .wpsg_mod_productgroup_layout2.productgroups > .productgroup { grid-column:span 2; padding-top:100%; text-decoration:none; position:relative; overflow:hidden; transition:all 0.3s ease; overflow:hidden width:100%; }
+ .wpsg_mod_productgroup_layout2.productgroups > .productgroup .bg { position:absolute; left:0; top:0; object-position:50% 50%; background-color:#DEDEDE; width:100%; height:100%; object-fit:cover; z-index:1; }
+ .wpsg_mod_productgroup_layout2.productgroups > .productgroup .title { z-index:2; border-radius:2px; transition:all 0.3s ease; position:absolute; left:1rem; top:1rem; background-color:#000000; color:#FFFFFF; padding:0 0.5rem; }
+ .wpsg_mod_productgroup_layout2.productgroups > .productgroup:hover .title { background-color:#FFFFFF; color:#000000; }
+
+ @media screen and (min-width:768px) {
+
+ .wpsg_mod_productgroup_layout2.productgroups > .productgroup { padding-top:initial; grid-column:initial; }
+ .wpsg_mod_productgroup_layout2.productgroups > .productgroup:nth-child(6n + 1),
+ .wpsg_mod_productgroup_layout2.productgroups > .productgroup:nth-child(6n + 5) { grid-row:span 2; padding-top:100%; }
+
+ }
+
+ </style>
+
+ <?php } ?>
+</div>
diff --git a/views/mods/mod_productvariants/admin_edit.phtml b/views/mods/mod_productvariants/admin_edit.phtml
index 57d4f47..ebfc9a6 100644
--- a/views/mods/mod_productvariants/admin_edit.phtml
+++ b/views/mods/mod_productvariants/admin_edit.phtml
@@ -303,7 +303,7 @@
});
</script>
-
+
<?php if (intval($this->view['product_id']) <= 0) { ?>
<span style="padding-left:15px;">
<span style="display:inline-block; margin-right:5px;"><?php echo __('Für alle Downloadplus Produkte:', 'wpsg'); ?></span>
@@ -316,6 +316,25 @@
</div>
<?php } ?>
+ <?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+ <div style="margin-top:0.25rem;">
+ <span>EAN:
+ <span title="<?php echo __('EAN der Produktvariation', 'wpsg'); ?>" class="wpsg_editable" id="productvariation_ean_<?php echo $vari['id']; ?>"><?php echo $vari['ean']??''; ?></span>
+ </span>
+ <script>
+
+ jQuery('#productvariation_ean_<?php echo $vari['id']; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+ submitdata: {
+ field: 'ean',
+ product_id: <?php echo $this->view['product_id']; ?>,
+ field_id: '<?php echo $vari['id']; ?>'
+ }
+ });
+
+ </script>
+ </div>
+ <?php } ?>
+
<script>
function wpsg_mod_downloadplus_setProducts(vari_id, active) {
diff --git a/views/mods/mod_rechnungen/accounting_pdf.phtml b/views/mods/mod_rechnungen/accounting_pdf.phtml
index ec314b6..60930cc 100644
--- a/views/mods/mod_rechnungen/accounting_pdf.phtml
+++ b/views/mods/mod_rechnungen/accounting_pdf.phtml
@@ -9,7 +9,10 @@
require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
-
+
+ /** @var wpsg\wpsg_invoice|null $oInvoice */
+ $oInvoice = $this->view['oInvoice'];
+
// Positionierung der Absenderadresszeile
$absender_left = 25;
$absender_top = 50;
@@ -33,14 +36,9 @@
if ($this->getFrontendTaxView() === WPSG_NETTO) $taxdisplay = 'netto';
else $taxdisplay = 'brutto';
-
+
// Damit die Steuer bei der Kleinunternehmerregelung nicht angezeigt wird leer ich den Array sicherheitshalber
- if ($this->get_option('wpsg_kleinunternehmer') == '1')
- {
-
- unset($this->view['basket']['mwst']);
-
- }
+ if ( ($this->get_option('wpsg_kleinunternehmer') == '1') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) ) unset($this->view['basket']['mwst']);
if (!function_exists('AddRechnungPage'))
{
@@ -52,31 +50,31 @@
$pdf->AddPage();
- if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf"))
+ if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.pdf"))
{
- $pagecount = $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf");
+ $pagecount = $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.pdf");
$tplidx = $pdf->importPage(1, '/MediaBox');
$pdf->useTemplate($tplidx, 0, 0, 210);
}
- if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg"))
+ if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.jpg"))
{
- $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
+ $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
}
- if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg"))
+ if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg"))
{
- list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg");
+ list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg");
//wpsg_debug($width.":".$height);
$wPix = (25.4 * $width) / 96;
$hPix = (25.4 * $height) / 96;
- $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg", 210 - $wPix, 0, $wPix, $hPix);
+ $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg", 210 - $wPix, 0, $wPix, $hPix);
}
@@ -106,7 +104,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'])));
}
@@ -125,7 +123,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())
{
@@ -163,16 +161,41 @@
}
}
- //wpsg_debug($this->view); die();
+
$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)
{
@@ -182,9 +205,9 @@
$pdf->Cell(10, 8, __("Nr.", "wpsg"), 1, 0, 'C');
$pdf->setXY($prod_left + 10, $prod_top);
- $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);
@@ -209,31 +232,18 @@
$pdf->SetFont('Arial', '', 9);
$pdf->setXY($prod_left, $prod_top + $offset);
- if ($this->get_option('wpsg_mod_rechnungen_anr') == '1')
- {
-
- $pdf->Cell(10, 8, $p['anr'], 0, 0, 'C');
-
- }
- else
- {
-
- $pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
-
- }
+ if ($this->get_option('wpsg_mod_rechnungen_anr') == '1') $pdf->Cell(10, 8, $product->getNr(), 0, 0, 'C');
+ else $pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
- /* Wenn Detailname vorhanden, wird der Detailname auf Rechnung verwendet */
- $produkt_text = $this->getProductName($this->getProduktID($p['id']), true);
+ if ($this->get_option('wpsg_rechnungen_pdetailname') == '1') $produkt_text = $this->getProductName($this->getProduktID($p['product_id']), true);
+ else $produkt_text = $this->getProductName($this->getProduktID($p['product_id']), false);
- /* Falls Detailname vorhanden, wird jetzt der Produktname verwendet */
- /* $produkt_text = $this->getProductName($this->getProduktID($p['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)
{
@@ -273,16 +283,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')
- {
- $produkt_text_cell_width = 87;
- }
+ if ($bTaxCol) $produkt_text_cell_width = 87;
$produkt_text_width = $pdf->GetStringWidth($produkt_text);
//$produkt_text_cell_width = (($this->arMwSt == "-1")?87:102);
@@ -295,39 +302,30 @@
//$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');
}
$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)
- {
- $preis = $p['preis_netto'];
-
- //TODO
- }
- else
- {
- $preis = $p['preis_brutto'];
- }
+ if ( ( wpsg_ShopController::get_option('wpsg_preisangaben') == WPSG_NETTO ) || $bNoTax ) $preis_single = $p['netto_calculated_single'];
+ else $preis_single = $p['brutto_calculated_single'];
$pdf->setXY($prod_left + 127, $prod_top + $offset);
- $pdf->Cell(25, 8, wpsg_ff($preis, $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->Cell(25, 8, wpsg_ff($preis_single, $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_single * $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);
@@ -353,12 +351,13 @@
*/
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);
@@ -368,10 +367,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);
@@ -379,7 +378,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']));
@@ -403,14 +402,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);
-
- if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
- {
+ $pdf->Rect($prod_left + 10, $prod_top + $offset, (($bTaxCol)?87:102), $height);
- $pdf->Rect($prod_left + 97, $prod_top + $offset, 15, $height);
-
- }
+ if ($bTaxCol) $pdf->Rect($prod_left + 97, $prod_top + $offset, 15, $height);
$pdf->Rect($prod_left + 112, $prod_top + $offset, 15, $height);
$pdf->Rect($prod_left + 127, $prod_top + $offset, 25, $height);
@@ -421,9 +415,12 @@
$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);
@@ -433,44 +430,6 @@
} // produkte
- // Gutschein
- /*
- if ((isset($this->view['basket']['gs'])) && ($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) {
@@ -480,9 +439,9 @@
$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');
@@ -511,7 +470,7 @@
}
// 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);
@@ -519,25 +478,16 @@
$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')
- {
+ if ($this->arShipping[$this->view['data']['type_shipping']]['mwst_null'] == '1' && $bNoTax) $mwst = wpsg_ff(0.00, '%');
+ else {
- $mwst = 0;
-
- }
- else
- {
-
- if ($this->view['basket']['arCalculation']['shipping'][0]['tax_key'] === '0') {
-
- $mwst = _('anteilig');
-
- } 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'], '%');
@@ -555,58 +505,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');
+ $pdf->Cell(25, 8, wpsg_ff($shipping_cost, $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;
-
- }
-
- }
- */
-
-
}
// 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);
@@ -614,17 +523,17 @@
$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') {
@@ -648,10 +557,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;
@@ -670,22 +579,13 @@
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')
- {
- $mwst = 0;
- }
- else
- {
-
-
- $mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
-
- }
+ if ($bNoTax) $mwst = wpsg_ff(0.00, '%');
+ else $mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
$pdf->setXY($prod_left + 97, $prod_top + $offset);
$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
@@ -715,95 +615,135 @@
$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') == '1') || ($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->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;
-
- $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');
+
+ 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++;
+
+ }
+
+ }
- }
- 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->get_option('wpsg_currency')), 0, 0, 'R');
-
- if (sizeof($this->view['basket']['mwst']) >= 1)
- {
+ }
- foreach ($this->view['basket']['mwst'] as $mw)
+ if ($mw_count >= 2)
{
$offset += 5;
- $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['value'], '%'));
+ $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($mw['sum'], $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');
}
+
+ } 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']['arCalculation']['sum']['netto'] + $this->view['basket']['arCalculation']['sum']['discount_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+
+ 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 (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');
+
}
-
- }
+
+ }
}
// 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;
@@ -818,7 +758,7 @@
$offset += 5;
$pdf->setFont('Arial', 'B', '9');
- $pdf->Text($prod_left + 80, $prod_top + $offset, __("SUMME", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("ZU ZAHLEN", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
/* Endbetrag wird fett ausgegeben */
@@ -827,84 +767,81 @@
$pdf->setFont('Arial', '', '9');
} 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');
-
- /* Endbetrag wird normal ausgegeben */
- //$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
-
+
}
- 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;
}
- $shipping_adress = false;
+ $offset += 10;
- 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'])))
- {
-
+ $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;
-
- $pdf->setFont('Arial', '', 9);
+ $offset += 2;
- $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']."\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'];
+ $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'];
$start = $pdf->getY();
$pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset, 5, $shipping_adress, 0, 'L', 0, 100);
@@ -913,55 +850,47 @@
$shipping_adress = true;
}
-
-
- $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
- {
- 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
+ $strBVars = "";
+ foreach ($bvars as $bvars_id => $bvars_value)
{
- 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);
-
- }
-
- if (!file_exists($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id']))))
- {
-
- mkdir($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])), 0777, true);
+ $pdf->wpsg_MultiCell($prod_left - 1, $prod_top + $offset - 6, 5, $strBVars);
+
}
-
+
$this->callMods('wpsg_mod_rechnungen_pdf', array(&$pdf, &$this->view['data']['id'], &$this->view['preview'], &$this->view['invoice']));
$filename = $this->view['filename'].".pdf";
@@ -974,10 +903,11 @@
} else {
- $pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])).$filename, 'F');
+ $pdf->Output($oInvoice->getFilePath(), 'F');
// Hier wird der Dateiname an FPD übergeben. Er soll sich aus der Rechnungsnummer ergeben, auch wenn das Dokument über die ID gespeichert ist.
$pdf->Output($this->view['filename_out'], 'I');
}
-
+
+?> \ No newline at end of file
diff --git a/views/mods/mod_rechnungen/invoice_pdf.phtml b/views/mods/mod_rechnungen/invoice_pdf.phtml
index fad5443..d11e6d6 100644
--- a/views/mods/mod_rechnungen/invoice_pdf.phtml
+++ b/views/mods/mod_rechnungen/invoice_pdf.phtml
@@ -6,11 +6,13 @@
require_once WPSG_PATH_LIB.'FPDF_1.81/fpdf.php';
require_once WPSG_PATH_LIB.'FPDI_2.2.0/autoload.php';
-
require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top;
-
+
+ /** @var \wpsg\wpsg_invoice|null $oInvoice */
+ $oInvoice = $this->view['oInvoice']??null;
+
// Positionierung der Absenderadresszeile
$absender_left = 25;
$absender_top = 50;
@@ -36,12 +38,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') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) )
- {
-
- unset($this->view['basket']['mwst']);
-
- }
+ if ( ($this->get_option('wpsg_kleinunternehmer') == '1') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) ) unset($this->view['basket']['mwst']);
if (!function_exists('AddRechnungPage'))
{
@@ -53,22 +50,22 @@
$pdf->AddPage();
- if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf")) {
+ if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.pdf")) {
- $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf");
+ $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.pdf");
$tplidx = $pdf->importPage(1, '/MediaBox');
$pdf->useTemplate($tplidx, 0, 0, 210);
- } else if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg")) {
+ } else if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.jpg")) {
- $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
+ $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
}
- if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg"))
+ if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg"))
{
- list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg");
+ list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg");
// Umrechnung von Inch zu Pixel
$wPix = (25.4 * (int)$width) / 96;
@@ -95,25 +92,25 @@
if(isset($logo_pos) && $logo_pos === "right") { $abscissa = $rightPos; }
$pdf->SetAlpha($alpha);
- $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg", $abscissa, $ordinate, $wPix, $hPix);
+ $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg", $abscissa, $ordinate, $wPix, $hPix);
$pdf->SetAlpha(1);
}
// Absenderadresszeile (Wird in der Konfiguration hinterlegt)
$pdf->SetFont('Arial', '', 6);
- $pdf->Text($absender_left, $absender_top, $shop->replaceUniversalPlatzhalter(__($shop->get_option("wpsg_rechnungen_adresszeile"), 'wpsg'), $shop->view['data']['id']));
+ $pdf->Text($absender_left, $absender_top, $shop->replaceUniversalPlatzhalter(__($shop->get_option("wpsg_rechnungen_adresszeile"), 'wpsg'), $shop->view['data']['id']??0));
if (wpsg_getStr($shop->view['kunde']['kuerzel']) != "") $shop->view['kunde']['kuerzel'] = $shop->view['kunde']['kuerzel'].'-';
// Adresse des Kunden
$pdf->SetFont('Arial', '', 12);
- $pdf->Text($adress_left, $adress_top, $shop->view['kunde']['firma']);
- $pdf->Text($adress_left, $adress_top + 5, $shop->view['kunde']['vname'].' '.$shop->view['kunde']['name']);
- $pdf->Text($adress_left, $adress_top + 10, $shop->view['kunde']['strasse'].' '.wpsg_getStr($shop->view['kunde']['nr']));
- $pdf->Text($adress_left, $adress_top + 15, $shop->view['kunde']['plz'].' '.$shop->view['kunde']['ort']);
- if ($shop->get_option("wpsg_mod_rechnungen_hideCountry") == '0')
- $pdf->Text($adress_left, $adress_top + 20, strtoupper($shop->view['oOrder']->getInvoiceCountryName()));
+ $pdf->Text($adress_left, $adress_top, $shop->view['kunde']['firma']??'');
+ $pdf->Text($adress_left, $adress_top + 5, ($shop->view['kunde']['vname']??'').' '.($shop->view['kunde']['name']??''));
+ $pdf->Text($adress_left, $adress_top + 10, ($shop->view['kunde']['strasse']??'').' '.($shop->view['kunde']['nr']??''));
+ $pdf->Text($adress_left, $adress_top + 15, ($shop->view['kunde']['plz']??'').' '.($shop->view['kunde']['ort']??''));
+
+ if ($shop->get_option("wpsg_mod_rechnungen_hideCountry") == '0') $pdf->Text($adress_left, $adress_top + 20, strtoupper($shop->view['oOrder']->getInvoiceCountryName()));
// Rechnungsdaten
$pdf->SetFont('Arial', 'B', 16);
@@ -181,13 +178,19 @@
$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;
- }
+ if ($this->get_option('wpsg_deliverycountrytax') === '1') {
+ $value = false;
+ $kl = $this->view['kunde']['land'];
+ if ( ($kl['mwst_a']) && ($kl['mwst_b']) && ($kl['mwst_c']) && ($kl['mwst_d']) == 0.0000 ) $value = true;
+ $deliverycountrytax = $value;
+ }
+
+ if (
+ ( ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_B2B) && ( $this->view['oOrder']->isInnerEu() || $deliverycountrytax ) )
+ ||
+ ( $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;
@@ -250,28 +253,11 @@
$pdf->SetFont('Arial', '', 9);
$pdf->setXY($prod_left, $prod_top + $offset);
- if ($this->get_option('wpsg_mod_rechnungen_anr') == '1')
- {
-
- $pdf->Cell(10, 8, $product->getNr(), 0, 0, 'C');
-
- }
- else
- {
-
- $pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
-
- }
+ if ($this->get_option('wpsg_mod_rechnungen_anr') == '1') $pdf->Cell(10, 8, $product->getNr(), 0, 0, 'C');
+ else $pdf->Cell(10, 8, $pnr.".", 0, 0, 'C');
- if ($this->get_option('wpsg_rechnungen_pdetailname') == '1') {
-
- $produkt_text = $this->getProductName($this->getProduktID($p['product_id']), true);
-
- } else {
-
- $produkt_text = $this->getProductName($this->getProduktID($p['product_id']), false);
-
- }
+ if ($this->get_option('wpsg_rechnungen_pdetailname') == '1') $produkt_text = $this->getProductName($this->getProduktID($p['product_id']), true);
+ else $produkt_text = $this->getProductName($this->getProduktID($p['product_id']), false);
$produktBeschreibung = trim(strip_tags($product->getShortDescription()));
@@ -324,10 +310,7 @@
}
$produkt_text_cell_width = 102;
- if ($bTaxCol)
- {
- $produkt_text_cell_width = 87;
- }
+ if ($bTaxCol) $produkt_text_cell_width = 87;
$produkt_text_width = $pdf->GetStringWidth($produkt_text);
//$produkt_text_cell_width = (($this->arMwSt == "-1")?87:102);
@@ -343,22 +326,15 @@
if ($bTaxCol) {
$pdf->setXY($prod_left + 97, $prod_top + $offset);
- $pdf->Cell(15, 8, (($bNoTax)?'0.00 %':wpsg_ff($this->view['basket']['arCalculation']['tax'][$p['tax_key']]['tax_value'], '%')), 0, 0, 'C'); // BUG
+ $pdf->Cell(15, 8, (($bNoTax)?'0.00 %':wpsg_ff($this->view['basket']['arCalculation']['tax'][$p['tax_key']]['tax_value'], '%')), 0, 0, 'C');
}
$pdf->setXY($prod_left + 112, $prod_top + $offset);
$pdf->Cell(15, 8, $p['amount'], 0, 0, 'C');
- if ( ( wpsg_ShopController::get_option('wpsg_preisangaben') == WPSG_NETTO ) || $bNoTax ) {
-
- $preis_single = $p['netto_calculated_single'];
-
- } else {
-
- $preis_single = $p['brutto_calculated_single'];
-
- }
+ if ( ( wpsg_ShopController::get_option('wpsg_preisangaben') == WPSG_NETTO ) || $bNoTax ) $preis_single = $p['netto_calculated_single'];
+ else $preis_single = $p['brutto_calculated_single'];
$pdf->setXY($prod_left + 127, $prod_top + $offset);
$pdf->Cell(25, 8, wpsg_ff($preis_single, $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -449,12 +425,7 @@
$pdf->Rect($prod_left + 10, $prod_top + $offset, (($bTaxCol)?87:102), $height);
- if ($bTaxCol)
- {
-
- $pdf->Rect($prod_left + 97, $prod_top + $offset, 15, $height);
-
- }
+ if ($bTaxCol) $pdf->Rect($prod_left + 97, $prod_top + $offset, 15, $height);
$pdf->Rect($prod_left + 112, $prod_top + $offset, 15, $height);
$pdf->Rect($prod_left + 127, $prod_top + $offset, 25, $height);
@@ -465,11 +436,8 @@
$pnr ++;
$count ++;
- if ($bNoTax) {
- $price = $p['netto'];
- } else {
- $price = $p['brutto'];
- }
+ if ($bNoTax) $price = $p['netto'];
+ else $price = $p['brutto'];
$summe += $price * $p['amount'];
@@ -536,18 +504,11 @@
if ($bTaxCol)
{
- if ($this->arShipping[$this->view['data']['type_shipping']]['mwst_null'] == '1' && $bNoTax)
- {
-
- $mwst = wpsg_ff(0.00, '%');
-
- } 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 {
+ 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'], '%');
@@ -644,14 +605,8 @@
if ($bTaxCol)
{
- if ($bNoTax)
- {
- $mwst = wpsg_ff(0.00, '%');
- }
- else
- {
- $mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
- }
+ if ($bNoTax) $mwst = wpsg_ff(0.00, '%');
+ else $mwst = wpsg_ff($this->view['storno_fee_tax_value'], '%');
$pdf->setXY($prod_left + 97, $prod_top + $offset);
$pdf->Cell(15, 8, $mwst, 1, 0, 'C');
@@ -683,7 +638,7 @@
$offset += 10; // Abstand zwischen Tabelle und Auswertung
- if ( $this->get_option('wpsg_kleinunternehmer') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) )
+ if ( ($this->get_option('wpsg_kleinunternehmer') == '1') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) )
{
$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
@@ -704,7 +659,7 @@
//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 ( !(($this->view['oOrder']->isInnerEu() || $deliverycountrytax) && ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_B2B)) ) {
if (sizeof($this->view['basket']['arCalculation']['tax']) >= 1)
{
@@ -838,7 +793,7 @@
$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->Cell(37, 8, wpsg_ff($arCalculation['sum']['topay_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
$pdf->setFont('Arial', '', '9');
@@ -957,13 +912,6 @@
}
- if (!file_exists($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id']))))
- {
-
- mkdir($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])), 0777, true);
-
- }
-
$this->callMods('wpsg_mod_rechnungen_pdf', array(&$pdf, &$this->view['data']['id'], &$this->view['preview'], &$this->view['invoice']));
$filename = $this->view['filename'].".pdf";
@@ -976,11 +924,10 @@
} else {
- $pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])).$filename, 'F');
+ $pdf->Output($oInvoice->getFilePath(), 'F');
// Hier wird der Dateiname an FPD übergeben. Er soll sich aus der Rechnungsnummer ergeben, auch wenn das Dokument über die ID gespeichert ist.
if ($this->view['output'] === true) $pdf->Output($this->view['filename_out'], 'I');
}
-?> \ No newline at end of file
diff --git a/views/mods/mod_rechnungen/multi_invoice_pdf.phtml b/views/mods/mod_rechnungen/multi_invoice_pdf.phtml
index 0902fce..fcad732 100644
--- a/views/mods/mod_rechnungen/multi_invoice_pdf.phtml
+++ b/views/mods/mod_rechnungen/multi_invoice_pdf.phtml
@@ -9,7 +9,7 @@
require_once WPSG_PATH_LIB.'wpsg_fpdf.class.php';
- global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top, $rhead_left, $rhead_top, $sum_multi_offset, $pdf;
+ global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top, $rhead_left, $rhead_top, $sum_multi_offset, $pdf, $data;
// Positionierung der Absenderadresszeile
$absender_left = 25;
@@ -33,11 +33,17 @@
// Anzahl an Produkten pro Seite
$prod_break = $this->get_option('wpsg_rechnungen_pdfperpage');
-
- $arCalculation = $this->view['basket']['arCalculation'];
+
+ /*
+ $arCalculation = $this->view['basket']['arCalculation'];
$data = $this->view['multi_data']['orders'][0]['data'];
$sum = $this->view['multi_data']['orders'][0]['sum'];
-
+ */
+
+ $arCalculation = array_values($this->view['multi_data']['order_data'])[0]['arCalculation'];
+ $data = $this->view['data'];
+ $sum = $arCalculation['sum'];
+
if ($this->getFrontendTaxView() === WPSG_NETTO) $taxdisplay = 'netto';
else $taxdisplay = 'brutto';
@@ -45,28 +51,28 @@
function AddRechnungPage($shop, $pdf) {
- global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top, $offset, $sum_multi_offset;
+ global $absender_left, $absender_top, $adress_left, $adress_top, $rdata_left, $rdata_top, $offset, $sum_multi_offset, $data;
$pdf->AddPage();
$sum_multi_offset = 0;
- if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf")) {
+ if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.pdf")) {
- $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.pdf");
+ $pdf->setSourceFile($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.pdf");
$tplidx = $pdf->importPage(1, '/MediaBox');
$pdf->useTemplate($tplidx, 0, 0, 210);
- } else if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg")) {
+ } else if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.jpg")) {
- $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
+ $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_bp.jpg", 0, 0, 210, 297, 'jpg');
}
- if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg"))
+ if (file_exists($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg"))
{
- list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg");
+ list($width, $height, $type, $attr) = getimagesize($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg");
// Umrechnung von Inch zu Pixel
$wPix = (25.4 * (int)$width) / 96;
@@ -93,12 +99,12 @@
if(isset($logo_pos) && $logo_pos === "right") { $abscissa = $rightPos; }
$pdf->SetAlpha($alpha);
- $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getFilePath', array(''))."wpsg_rechnungen_logo.jpg", $abscissa, $ordinate, $wPix, $hPix);
+ $pdf->image($shop->callMod('wpsg_mod_rechnungen', 'getPaperPath', array())."wpsg_rechnungen_logo.jpg", $abscissa, $ordinate, $wPix, $hPix);
$pdf->SetAlpha(1);
}
-
- // Absenderadresszeile (Wird in der Konfiguration hinterlegt)
+
+ // Absenderadresszeile (Wird in der Konfiguration hinterlegt)
$pdf->SetFont('Arial', '', 6);
$pdf->Text($absender_left, $absender_top, $shop->replaceUniversalPlatzhalter(__($shop->get_option("wpsg_rechnungen_adresszeile"), 'wpsg'), $data['id']));
@@ -188,7 +194,7 @@
$rhead_count = 1;
$sum_multi_offset = 0;
- $orders = $this->view['multi_data']['orders'];
+ // $orders = $this->view['multi_data']['orders'];
// noMwSt
$head_data = array_values($this->view['multi_data']['order_data'])[0];
@@ -237,8 +243,6 @@
// Bestellnummer anzeigen
$pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset, __("Best. Nr.", "wpsg"));
$pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset + 6, $oOrder->getNr());
-
- $summe = 0;
$bKopf = false; $pnr = 1; $offset = 0; $count = 0;
@@ -468,9 +472,7 @@
$pnr ++;
$count ++;
-
- $summe += $p['price'] * $p['menge'];
-
+
if ($pdf->getY() > 220 || ($count >= $prod_break && sizeof($oOrder->getOrderProducts()) > ($pnr - 1))) {
AddRechnungPage($this, $pdf);
@@ -897,7 +899,6 @@
if ($this->view['preview']) {
- //$pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array('multi')).$filename, 'F');
$pdf->Output();
exit;
diff --git a/views/mods/mod_rechnungen/order_view.phtml b/views/mods/mod_rechnungen/order_view.phtml
index fb4aa27..ce5e2ae 100644
--- a/views/mods/mod_rechnungen/order_view.phtml
+++ b/views/mods/mod_rechnungen/order_view.phtml
@@ -34,9 +34,10 @@
<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
- if ($r['o_id'] != '0') {
+ 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]);
+ $r_o_ids = array_map('intval', explode(',', $r['o_ids']));
+ 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']);
diff --git a/views/mods/mod_rechnungen/order_view_orderdata_after.phtml b/views/mods/mod_rechnungen/order_view_orderdata_after.phtml
index 24cf97c..1ba5e00 100755
--- a/views/mods/mod_rechnungen/order_view_orderdata_after.phtml
+++ b/views/mods/mod_rechnungen/order_view_orderdata_after.phtml
@@ -202,12 +202,12 @@
}
if (ok) {
-
+
if (event.target.getAttribute("id") === 'invoice_wpsg_rechnungen_submit') {
- window.setTimeout(function() { location.href = '<?php
-
- echo wpsg_admin_url('Order', 'view', ['edit_id' => $oOrder->getId()]);
+ window.setTimeout(function() { location.href = '<?php
+
+ echo wpsg_admin_url('Order', 'view', ['edit_id' => $oOrder->getId()], [], true);
?>'; }, 1000);
@@ -337,7 +337,7 @@
window.setTimeout(function() { location.href = '<?php
- echo wpsg_admin_url('Order', 'view', ['edit_id' => $oOrder->getId()]);
+ echo wpsg_admin_url('Order', 'view', ['edit_id' => $oOrder->getId()], [], true);
?>'; }, 1000);
diff --git a/views/mods/mod_shippingadress/wpsg_order_view_customerdata.phtml b/views/mods/mod_shippingadress/wpsg_order_view_customerdata.phtml
index 0fe4a1d..e00dbb5 100644
--- a/views/mods/mod_shippingadress/wpsg_order_view_customerdata.phtml
+++ b/views/mods/mod_shippingadress/wpsg_order_view_customerdata.phtml
@@ -44,21 +44,21 @@
<div class="modal-body">
<div id="shipping_dialog_content">
- <?php echo wpsg_drawForm_Input('dialog_shipping_firma', __('Firma', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_firma']); ?>
- <?php echo wpsg_drawForm_Select('dialog_shipping_title', __('Anrede', 'wpsg'), $this->view['arTitles'], $this->view['wpsg_mod_shippingadress']['shipping_title'], array('noIndex' => true)); ?>
- <?php echo wpsg_drawForm_Input('dialog_shipping_vname', __('Vorname', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_vname']); ?>
- <?php echo wpsg_drawForm_Input('dialog_shipping_name', __('Name', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_name']); ?>
- <?php echo wpsg_drawForm_Input('dialog_shipping_strasse', __('Straße', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_strasse']); ?>
+ <?php echo wpsg_drawForm_Input('dialog_shipping_firma', __('Firma', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_firma']??''); ?>
+ <?php echo wpsg_drawForm_Select('dialog_shipping_title', __('Anrede', 'wpsg'), $this->view['arTitles'], $this->view['wpsg_mod_shippingadress']['shipping_title']??'', array('noIndex' => true)); ?>
+ <?php echo wpsg_drawForm_Input('dialog_shipping_vname', __('Vorname', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_vname']??''); ?>
+ <?php echo wpsg_drawForm_Input('dialog_shipping_name', __('Name', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_name']??''); ?>
+ <?php echo wpsg_drawForm_Input('dialog_shipping_strasse', __('Straße', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_strasse']??''); ?>
<?php if (wpsg_getStr($this->view['pflicht']['wpsg_showNr']) === '1') { ?>
- <?php echo wpsg_drawForm_Input('dialog_shipping_nr', __('Hausnummer', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_nr']); ?>
+ <?php echo wpsg_drawForm_Input('dialog_shipping_nr', __('Hausnummer', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_nr']??''); ?>
<?php } ?>
- <?php echo wpsg_drawForm_Input('dialog_shipping_plz', __('Postleitzahl', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_plz']); ?>
- <?php echo wpsg_drawForm_Input('dialog_shipping_ort', __('Ort', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_ort']); ?>
- <?php echo wpsg_drawForm_Select('dialog_shipping_land', __('Land', 'wpsg'), $this->view['arCountry'], $this->view['wpsg_mod_shippingadress']['shipping_land']); ?>
+ <?php echo wpsg_drawForm_Input('dialog_shipping_plz', __('Postleitzahl', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_plz']??''); ?>
+ <?php echo wpsg_drawForm_Input('dialog_shipping_ort', __('Ort', 'wpsg'), $this->view['wpsg_mod_shippingadress']['shipping_ort']??''); ?>
+ <?php echo wpsg_drawForm_Select('dialog_shipping_land', __('Land', 'wpsg'), $this->view['arCountry'], $this->view['wpsg_mod_shippingadress']['shipping_land']??''); ?>
<br />
diff --git a/views/order/index.phtml b/views/order/index.phtml
index cd83cfb..0cbc80b 100644
--- a/views/order/index.phtml
+++ b/views/order/index.phtml
@@ -248,6 +248,7 @@
<th class="col_payment wpsg_order" data-order="payment"><?php echo __('Bezahlmethode', 'wpsg'); ?></th>
<th class="col_shipping wpsg_order" data-order="shipping"><?php echo __('Versandart', 'wpsg'); ?></th>
<th class="col_products wpsg_order" data-order="products"><?php echo __('Produkte', 'wpsg'); ?></th>
+ <?php if ($this->get_option('wpsg_showvalueofgoods')) { ?><th class="col_productsum wpsg_order" data-order="productsum"><?php echo __('Warenwert', 'wpsg'); ?></th><?php } ?>
<th class="col_sum wpsg_order" data-order="amount"><?php echo __('Bestellwert', 'wpsg'); ?></th>
<th class="col_state wpsg_order" data-order="state"><?php echo __('Status', 'wpsg'); ?></th>
</tr>
@@ -408,6 +409,18 @@
<?php } ?>
</td>
+ <?php if ($this->get_option('wpsg_showvalueofgoods')) { ?>
+ <td class="col_productsum">
+
+ <?php $oOrderProducts = $oOrder->getOrderProducts(); ?>
+ <?php foreach ($oOrderProducts as $oOrderProduct) { ?>
+ <?php $product_sum += $oOrderProduct->getPriceSum($this->getBackendTaxview()); ?>
+ <?php } ?>
+ <?php echo wpsg_ff($product_sum, $this->get_option('wpsg_currency')); ?>
+ <?php $product_sum = 0; ?>
+
+ </td>
+ <?php } ?>
<td class="col_sum">
<?php echo wpsg_ff($oOrder->getAmount(), $this->get_option('wpsg_currency')); ?>
</td>
diff --git a/views/order/product_table.phtml b/views/order/product_table.phtml
index 3d6cee5..39ef05d 100644
--- a/views/order/product_table.phtml
+++ b/views/order/product_table.phtml
@@ -177,7 +177,9 @@
<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Versandart ändern', 'wpsg'); ?>" onclick="return WPSG_BE_Pay_Ship.changeShippingPayment();"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
<?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
- <td><?php echo $arTaxShort[$arCalculation['shipping'][0]['tax_key']]; ?></td>
+
+ <td><?php echo (($arCalculation['shipping'][0]['brutto'] === $arCalculation['shipping'][0]['netto'])?wpsg_ff(0, '%'):$arTaxShort[$arCalculation['shipping'][0]['tax_key']]); ?></td>
+
<?php } ?>
<td class="wpsg_cell_shipping_value wpsg_cell_gesamtpreis" colspan="2">
<span id="wpsg_cell_shipping_value"><?php echo wpsg_ff($price_shipping); ?> </span>
@@ -203,7 +205,9 @@
<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Zahlungsart ändern', 'wpsg'); ?>" onclick="return WPSG_BE_Pay_Ship.changeShippingPayment();"><span class="glyphicon glyphicon-pencil"></span></a>
</td>
<?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
- <td><?php echo $arTaxShort[$arCalculation['payment'][0]['tax_key']]; ?></td>
+
+ <td><?php echo (($arCalculation['payment'][0]['brutto'] === $arCalculation['payment'][0]['netto'])?wpsg_ff(0, '%'):$arTaxShort[$arCalculation['payment'][0]['tax_key']]); ?></td>
+
<?php } ?>
<td class="wpsg_cell_payment_value wpsg_cell_gesamtpreis" colspan="2">
<span id="wpsg_cell_payment_value"><?php echo wpsg_ff($price_payment); ?> </span>
diff --git a/views/order/view_general.phtml b/views/order/view_general.phtml
index 28d3018..c2a1bd7 100644
--- a/views/order/view_general.phtml
+++ b/views/order/view_general.phtml
@@ -34,8 +34,11 @@
<?php echo wpsg_drawForm_Select('status', __('Neuer Status', 'wpsg'), $this->arStatus, $this->view['data']['status']); ?>
<?php echo wpsg_drawForm_Checkbox('sendMail', __('Kunden informieren', 'wpsg'), 0); ?>
- <?php if ($this->hasMod('wpsg_mod_rechnungen')) { $db_invoice = $this->callMod('wpsg_mod_rechnungen', 'getOrderInvoice', [$this->view['oOrder']->id]); ?>
- <?php if (wpsg_isSizedInt($db_invoice['id'])) { ?>
+ <?php if ($this->hasMod('wpsg_mod_rechnungen')) {
+
+ $arInvoice = \wpsg\wpsg_invoice::findByOrderId($this->view['oOrder']->id);
+
+ if (sizeof($arInvoice) > 0) { ?>
<script>
jQuery('#sendMail').on('click', function() {
diff --git a/views/produkt/index.phtml b/views/produkt/index.phtml
index 573d50a..9a11630 100644
--- a/views/produkt/index.phtml
+++ b/views/produkt/index.phtml
@@ -312,17 +312,21 @@
$post_terms = \get_the_terms($post_id, $this->get_option('wpsg_mod_produktartikel_pathkey_cat'));
$arTermDisplay = [];
+
+ if (is_array($post_terms)) {
- foreach ($post_terms as $term) {
-
- if (!in_array($term->slug, $arTermExclude)) {
-
- if ($wpsg_mod_produktartikel_cat_first_level && $term->parent !== 0) continue;
+ foreach ($post_terms as $term) {
- $arTermDisplay[] = $term->name;
+ if (!in_array($term->slug, $arTermExclude)) {
+
+ if ($wpsg_mod_produktartikel_cat_first_level && $term->parent !== 0) continue;
+
+ $arTermDisplay[] = $term->name;
+
+ }
}
-
+
}
asort($arTermDisplay);
diff --git a/views/produkttemplates/standard.phtml b/views/produkttemplates/standard.phtml
index cdd5931..4dc17a4 100644
--- a/views/produkttemplates/standard.phtml
+++ b/views/produkttemplates/standard.phtml
@@ -37,6 +37,7 @@
<meta itemprop="name" content="<?php echo wpsg_hspc($this->getProductName($this->view['data']['id'])); ?>" />
<meta itemprop="sku" content="<?php echo wpsg_hspc($oProduct->getProductNr()); ?>" />
+ <meta itemprop="gtin13" content="<?php echo wpsg_hspc($oProduct->getEAN()); ?>" />
<meta itemprop="detailname" content="<?php echo wpsg_hspc($this->view['data']['detailname']); ?>" />
<?php /* Block für die Produktbilder START */ ?>
@@ -117,8 +118,10 @@
<?php } else { /* Kleinunternehmerregelung aktiviert ENDE */ ?>
<div class="wpsg_produkt_preishinweis">
+
+ <?php $fs = explode(',', $this->view['data']['allowedshipping']); ?>
<?php if ($this->getFrontendTaxview() == WPSG_NETTO) { /* Frontend = NETTO Preise */ ?>
- <?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1') { /* Versandkostenfrei aktiv */?>
+ <?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1' && (array_search('500', $fs) || array_search('', $fs))) { /* Versandkostenfrei aktiv */?>
<?php if ($this->get_option('wpsg_mod_freeshipping_minvalue') > 0) { ?>
<?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und <a href="#3#">ab #2# € versandkostenfrei</a>)', 'wpsg'),
@@ -134,7 +137,7 @@
<?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>
<?php }?>
<?php } else { /* Frontend = BRUTTO Preise */ ?>
- <?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1') { /* Versandkostenfrei aktiv */ ?>
+ <?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1' && (array_search('500', $fs) || array_search('', $fs))) { /* Versandkostenfrei aktiv */ ?>
<?php if ($this->get_option('wpsg_mod_freeshipping_minvalue') > 0) { ?>
<?php echo wpsg_translate(__('(inkl. #1#% MwSt. und <a href="#3#">ab #2# € versandkostenfrei</a>)', 'wpsg'),
@@ -150,6 +153,7 @@
<?php echo wpsg_translate(__('(inkl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>
<?php }?>
<?php } ?>
+
</div>
<?php } ?>
diff --git a/views/produkttemplates/standard2.phtml b/views/produkttemplates/standard2.phtml
index 3318460..5658288 100644
--- a/views/produkttemplates/standard2.phtml
+++ b/views/produkttemplates/standard2.phtml
@@ -12,6 +12,14 @@
$oProduct = $this->view['oProduct'];
+ $var_info = [];
+
+ if ($this->callMod('wpsg_mod_productvariants', 'isVariantsProductKey', [$oProduct->getProductKey()])) {
+
+ $var_info = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', [$oProduct->getProductKey()]);
+
+ }
+
?>
<div class="wpsg_produkt_wrapper wpsg_produkt_wrapper2">
@@ -22,8 +30,10 @@
<div class="wpsg_produkt wpsg_product_name">
<?php if (!$this->titleDisplayed) { ?>
- <h1 itemprop="name" class="wpsg_producttitle"><?php echo $this->getProductName($this->view['data']['id']); ?></h1>
- <h2 itemprop="detailname" class="wpsg_productdetailtitle"><?php echo $this->view['data']['detailname']; ?></h2>
+ <h1 class="wpsg_producttitle"><?php echo $this->getProductName($this->view['data']['id']); ?></h1>
+ <?php if ($this->getProductName($this->view['data']['id']) !== $this->view['data']['detailname']) { ?>
+ <h2 class="wpsg_productdetailtitle"><?php echo $this->view['data']['detailname']; ?></h2>
+ <?php } ?>
<?php } ?>
<?php $this->callMods('product_top_afterheadline', array(&$this->view['data']['id'], $this->getTemplateIndex())); ?>
@@ -34,6 +44,11 @@
<div itemscope itemtype="http://schema.org/Product" class="wpsg_produkt wpsg_produkt_<?php echo $this->view['data']['id']; ?>">
+ <meta itemprop="url" content="<?php echo $oProduct->getProductURL().'?test'; ?>" />
+ <meta itemprop="name" content="<?php echo wpsg_hspc($this->getProductName($this->view['data']['id'])); ?>" />
+ <meta itemprop="detailname" content="<?php echo wpsg_hspc($this->getProductName($this->view['data']['id']).' / '.rtrim(($var_info['key']??''), ' /')); ?>" />
+ <meta itemprop="sku" content="<?php echo wpsg_hspc($oProduct->getEAN()); ?>" />
+
<?php /* Block für die Produktbilder START */ ?>
<?php
diff --git a/views/produkttemplates/standard3.phtml b/views/produkttemplates/standard3.phtml
new file mode 100644
index 0000000..285d51e
--- /dev/null
+++ b/views/produkttemplates/standard3.phtml
@@ -0,0 +1,521 @@
+<?php
+
+ /*
+ * Template für das Produkt im Frontend Layout 3
+ */
+
+ /** @var wpsg_product $oProduct */
+ $oProduct = $this->view['oProduct'];
+
+ $arAttachmentIDsAll = $this->imagehandler->getAttachmentIDs($this->view['data']['product_id']);
+
+?>
+
+<div class="wpsg_produkt_wrapper layout3">
+
+ <input type="hidden" name="wpsg_post_id" value="<?php echo get_the_ID(); ?>" />
+ <input type="hidden" name="titleDisplayed" value="<?php echo $this->titleDisplayed; ?>" />
+ <input type="hidden" name="wpsg[template]" value="standard3.phtml" />
+
+ <div class="col_wrap">
+ <div class="col image">
+ <div class="thumbnails">
+
+ <?php foreach ($arAttachmentIDsAll as $k => $image_id) { ?>
+
+ <?php echo \wp_get_attachment_image($image_id, 'small', false, [
+ 'data-index' => $k
+ ]); ?>
+
+ <?php } ?>
+
+ </div>
+ <div class="view">
+ <?php foreach ($arAttachmentIDsAll as $k => $image_id) { ?>
+ <a class="thickbox" id="<?php echo $this->getTemplateIndex(); ?>_<?php echo $k; ?>" rel="gallery-<?php echo $this->getTemplateIndex(); ?>" href="<?php echo \wp_get_attachment_image_src($image_id, 'full')[0]; ?>"></a>
+ <?php } ?>
+ <div class="wpsg_product_slider">
+
+ <?php foreach ($arAttachmentIDsAll as $k => $image_id) { ?>
+
+ <div>
+ <div class="ds_image_zoom" data-image-index="<?php echo $k; ?>"
+ onclick="document.getElementById('<?php echo $this->getTemplateIndex(); ?>_<?php echo $k; ?>').click();"
+ >
+ <?php echo \wp_get_attachment_image($image_id, 'full', false, [
+ 'data-index' => $k,
+ 'data-src' => \wp_get_attachment_image_src($image_id, 'full')[0]
+ ]); ?>
+ </div>
+ </div>
+
+ <?php } ?>
+
+ </div>
+ </div>
+ </div>
+ <div>
+
+ <?php if (!$this->titleDisplayed) { ?>
+ <h1 itemprop="name" class="wpsg_producttitle"><?php echo $this->getProductName($this->view['data']['id']); ?></h1>
+ <h2 itemprop="detailname" class="wpsg_productdetailtitle"><?php echo $this->view['data']['detailname']; ?></h2>
+ <?php } ?>
+
+ <?php $this->callMods('product_top_afterheadline', array(&$this->view['data']['id'], $this->getTemplateIndex())); ?>
+
+ <?php $this->callMods('product_top', array(&$this->view['data']['id'], $this->getTemplateIndex())); ?>
+
+ <div itemscope itemtype="http://schema.org/Product" class="wpsg_produkt wpsg_produkt_<?php echo $this->view['data']['id']; ?>">
+
+ <?php if ($this->get_option('wpsg_showArticelnumber') == '1') { ?>
+ <div class="wpsg_artikelnummer">
+ <?php echo __('Artikelnummer', 'wpsg'); ?>: <span class="wpsg_anr"><?php echo wpsg_hspc($this->view['data']['anr']); ?></span><br />
+ <?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_ean'))) {?>
+ <?php echo __('EAN','wpsg');?>:<span class="wpsg_ean"><?php echo wpsg_hspc($this->view['data']['ean']); ?></span><br />
+ <?php } ?>
+ <?php if (wpsg_isSizedInt($this->get_option('wpsg_mod_produktartikel_gtin'))) {?>
+ <?php echo __('GTIN','wpsg');?>:<span class="wpsg_gtin"><?php echo wpsg_hspc($this->view['data']['gtin']); ?></span><br />
+ <?php }?>
+ </div>
+ <?php } ?>
+
+ <?php /* Abfrage Preisanzeige nur für eingeloggte User aktiv und User eingeloggt START*/ ?>
+ <?php if ($this->view['oProduct']->canDisplayPrice()) { ?>
+
+ <div itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="wpsg_produkt_preis">
+
+ <meta itemprop="priceCurrency" content="<?php echo $this->get_option('wpsg_currency'); ?>" />
+
+ <?php echo __('Stückpreis:', 'wpsg'); ?>
+
+ <?php $oldPrice = $this->view['oProduct']->getOldPrice(); ?>
+
+ <?php if ($oldPrice !== false && $oldPrice != $this->view['oProduct']->getPrice($this->view['data']['product_key'])) { ?>
+ <span class="wpsg_mod_productview_price wpsg_mod_productview_current"><?php echo wpsg_ff($this->view['oProduct']->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span>
+ <span class="wpsg_mod_productview_oldprice"><?php echo wpsg_ff($oldPrice, $this->get_option('wpsg_currency')); ?></span>
+ <?php } else { ?>
+ <span class="wpsg_mod_productview_price"><?php echo wpsg_ff($this->view['oProduct']->getPrice($this->view['data']['product_key']), $this->get_option('wpsg_currency')); ?></span>
+ <?php } ?>
+
+ </div>
+
+ <?php if ($this->get_option('wpsg_kleinunternehmer')) { /* Kleinunternehmerregelung aktiviert START */ ?>
+
+ <div class="wpsg_produkt_preishinweis">
+ <?php echo wpsg_translate(__('#2# zzgl. #1#', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>', '<a href="#kkhint" title="'.wpsg_hspc($this->get_option('wpsg_kleinunternehmer_text')).'">Endpreis</a>'); ?>
+ </div>
+
+ <?php } else { /* Kleinunternehmerregelung aktiviert ENDE */ ?>
+
+ <div class="wpsg_produkt_preishinweis">
+ <?php if ($this->getFrontendTaxview() == WPSG_NETTO) { /* Frontend = NETTO Preise */ ?>
+ <?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1') { /* Versandkostenfrei aktiv */?>
+
+ <?php if ($this->get_option('wpsg_mod_freeshipping_minvalue') > 0) { ?>
+ <?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und <a href="#3#">ab #2# € versandkostenfrei</a>)', 'wpsg'),
+ wpsg_ff($this->view['data']['mwst_value']),
+ wpsg_ff($this->get_option('wpsg_mod_freeshipping_minvalue')),
+ $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)
+ ); ?>
+ <?php } else { ?>
+ <?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und versandkostenfrei)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value'])); ?>
+ <?php } ?>
+
+ <?php } else { ?>
+ <?php echo wpsg_translate(__('(zzgl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>
+ <?php }?>
+ <?php } else { /* Frontend = BRUTTO Preise */ ?>
+ <?php if ($this->hasMod('wpsg_mod_freeshipping') && $this->get_option('wpsg_mod_freeshipping_aktiv') == '1') { /* Versandkostenfrei aktiv */ ?>
+
+ <?php if ($this->get_option('wpsg_mod_freeshipping_minvalue') > 0) { ?>
+ <?php echo wpsg_translate(__('(inkl. #1#% MwSt. und <a href="#3#">ab #2# € versandkostenfrei</a>)', 'wpsg'),
+ wpsg_ff($this->view['data']['mwst_value']),
+ wpsg_ff($this->get_option('wpsg_mod_freeshipping_minvalue')),
+ $this->getUrl(wpsg_ShopController::URL_VERSANDKOSTEN)
+ ); ?>
+ <?php } else { ?>
+ <?php echo wpsg_translate(__('(inkl. #1#% MwSt. und versandkostenfrei)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value'])); ?>
+ <?php } ?>
+
+ <?php } else { ?>
+ <?php echo wpsg_translate(__('(inkl. #1#% MwSt. und zzgl. #2#)', 'wpsg'), wpsg_ff($this->view['data']['mwst_value']), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'">'.__('Versandkosten', 'wpsg').'</a>'); ?>
+ <?php }?>
+ <?php } ?>
+ </div>
+
+ <?php } ?>
+
+ <?php } else {?>
+
+ <?php echo wpsg_translate(__('Die Produktpreise werden nur eingeloggten Benutzern angezeigt. Loggen Sie sich <a href="'.$this->getURL(wpsg_ShopController::URL_PROFIL).'">hier</a> bitte ein, um zu bestellen.')); ?>
+
+ <?php }?>
+ <?php /* Abfrage Preisanzeige nur für eingeloggte User aktiv und User eingeloggt ENDE */ ?>
+
+ <div class="wpsg_clear"></div>
+
+ <div itemprop="description" class="wpsg_produkt_shortdescription">
+
+ <span><?php echo $this->view['data']['shortdesc']; ?></span>
+
+ </div>
+
+ <?php /* Lagerbestand START*/?>
+ <?php if ($this->hasMod('wpsg_mod_stock') && $this->get_option('wpsg_mod_stock_showProduct') == '1') { ?>
+
+ <div class="wpsg_mod_produktindex_stock">
+
+ <?php if (($this->view['data']['stock']) > '0') {?>
+
+ <label><?php echo __('Lagerbestand', 'wpsg'); ?></label>
+ <?php echo wpsg_translate(__('#1# Artikel auf Lager','wpsg'), $this->view['data']['stock']); ?>
+
+ <?php } else { ?>
+
+ <label><?php echo wpsg_translate(__('', 'wpsg')); ?></label>
+
+ <?php } ?>
+
+ </div>
+ <?php } ?>
+ <?php /* Lagerbestand ENDE*/?>
+
+ <?php /* Füllmengenanzeige START */ ?>
+ <?php echo $this->callMod('wpsg_mod_fuellmenge', 'renderPriceInfo', [$oProduct->getPrice($this->view['data']['product_key']), $this->view['data']['fmenge'], $oProduct->getId()]); ?>
+ <?php /* Füllmengenanzeige ENDE */ ?>
+
+ <?php /* Gewichtsanzeige START */ ?>
+ <?php if ($this->hasMod('wpsg_mod_weight') && $this->get_option('wpsg_mod_weight_showProduct') === '1') { ?>
+ <div class="wpsg_mod_weight_produkt">
+
+ <?php if (($this->view['data']['weight']) > '0') { ?>
+ <span class="label label_weight"><?php echo wpsg_translate(__('Gewicht:', 'wpsg')); ?></span>
+ <?php echo wpsg_translate(__('#1# #2#', 'wpsg'), '<span class="wpsg_weight" id="weight_'.$this->view['data']['id'].'">'.wpsg_ff($this->view['data']['weight']).'</span>', $this->get_option('wpsg_mod_weight_unit')); ?>
+ <?php } else { ?>
+ <label><?php wpsg_translate(__('', 'wpsg'))?></label>
+ <?php } ?>
+ </div>
+ <?php } ?>
+ <?php /* Gewichtsanzeige ENDE */ ?>
+
+ <?php /* Lieferzeit Anzeige START */ ?>
+ <?php if ($this->hasMod('wpsg_mod_deliverytime') && $this->get_option('wpsg_mod_deliverytime_show_product') == '1') { ?>
+
+ <?php /* Produkt nur im Store, nicht im Onlineshop vorhanden */ ?>
+ <?php if ($this->callMod('wpsg_mod_deliverytime', 'isStoreProduct', array($this->view['data']['product_key']))) { ?>
+
+ <div class="wpsg_product_only_store"><?php echo __($this->callMod('wpsg_mod_deliverytime', 'displayStoreText', array($this->view['data']['product_key']))); ?></div>
+
+ <?php $stl = 0; $stl = $this->callMod('wpsg_mod_deliverytime', 'displayStoreLink', array($this->view['data']['product_key'])) ?>
+ <?php if (wpsg_isSizedInt($stl)) { ?>
+
+ &nbsp;<a href="<?php echo get_permalink($stl); ?>"><?php echo __('So erreichen Sie uns.'); ?></a>
+
+ <?php } ?>
+
+ <?php } else { ?>
+
+ <?php $strDelayNote = $this->callMod('wpsg_mod_deliverytime', 'displayDelayTime', array($this->view['data']['product_key'])); ?>
+ <?php if (wpsg_isSizedString($strDelayNote)) { ?>
+
+ <div class="wpsg_mod_deliverytime_offline">
+
+ <div class="wpsg_mod_deliverytime_delay"><?php echo wpsg_hspc($strDelayNote); ?></div>
+
+ </div>
+
+ <?php } else { ?>
+
+ <div class="wpsg_mod_deliverytime">
+ <span class="label label_deliverytime"><?php echo wpsg_translate(__('Lieferzeit:', 'wpsg')); ?></span>
+ <?php echo $this->callMod('wpsg_mod_deliverytime', 'displayDeliveryTime', array($this->view['data']['product_key'])); ?>
+ </div>
+
+ <?php } ?>
+
+ <?php } ?>
+
+ <?php } ?>
+ <?php /* Lieferzeit Anzeige ENDE */ ?>
+
+ <?php /* Produktkurzbeschreibung START */ ?>
+ <div class="wpsg_product_informationarea">
+
+ <?php if (strlen(trim($this->view['data']['beschreibung'])) > 0) { ?>
+ <div class="wpsg_product_information_short">
+ <div class="wpsg_produkt_additional_information">
+ <div itemprop="description" class="wpsg_produkt_shortdescription">
+ <span><?php echo $this->view['data']['beschreibung']; ?></span>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ </div>
+ <?php /* Produktkurzbeschreibung ENDE */ ?>
+
+ <?php /* Varianten START */ ?>
+ <div class="wpsg_produkt_varianten">
+ <?php echo $this->callMod('wpsg_mod_productvariants', 'renderTemplate', array($this->view['data']['product_key'])); ?>
+ </div>
+ <?php /* Varianten ENDE */ ?>
+
+ <?php $this->callMods('product_bottom', array(&$this->view['data']['product_key'], $this->getTemplateIndex())); ?>
+
+
+ <div class="wpsg_product_buttonarea">
+ <div class="wpsg_product_buttons_add_basket">
+ <?php if ($this->view['oProduct']->canOrder()) { ?>
+ <div class="wpsg_produkt_add_basket_wrapper">
+
+ <label class="wpsg_amount_label" for="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>"><?php echo __('Anzahl', 'wpsg'); ?></label>
+
+ <input type="text" value="<?php echo ((wpsg_isSizedInt($this->view['data']['menge']))?$this->view['data']['menge']:'1'); ?>" name="wpsg[menge]" class="wpsg_menge" id="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>" <?php echo (($this->view['data']['basket_multiple'] == 4)?' readonly="readonly" ':''); ?> />
+
+ <?php /* Urlaubsmodus aktiv */ ?>
+ <?php if ($this->hasMod('wpsg_mod_deliverytime') && ($this->get_option('wpsg_mod_deliverytime_holiday') == '1')) { ?>
+
+ <?php if ($this->callMod('wpsg_mod_deliverytime', 'holiday', array($this->view['data']['product_key']))) { ?>
+
+ <div class="wpsg_product_deliverytime_holiday" style="height:50px; padding:10px; width:50%; float:right; border:1px solid #ff0000;">
+
+ <?php echo __($this->callMod('wpsg_mod_deliverytime', 'displayHolidaytext', array($this->view['data']['product_key']))); ?>
+
+ </div>
+
+ <?php } ?>
+
+ <?php } else {?>
+
+ <input class="wpsg_button wpsg_add_basket wpsg_add_basket_<?php echo $this->getTemplateIndex(); ?>" type="submit" value="<?php echo __('In den Warenkorb', 'wpsg'); ?>" name="wpsg[submit]" />
+
+ <?php } ?>
+
+ <?php if (in_array($this->get_option('wpsg_afterinsert'), array('2', '3'))) { ?>
+ <script type="text/javascript">
+
+ jQuery(document).ready(function() {
+
+ jQuery('.wpsg_add_basket_<?php echo $this->getTemplateIndex(); ?>').bind('click', function() {
+
+ wpsg_blockProductTemplate(<?php echo $this->getTemplateIndex(); ?>);
+
+ jQuery.ajax( {
+ url: '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET); ?>',
+ data:
+ {
+ 'wpsg_form_data': jQuery('#wpsg_produktform_<?php echo $this->getTemplateIndex(); ?>').serialize(),
+ 'wpsg[ajax]': '1',
+ 'wpsg[submit]': '1'
+ },
+ success: function(data)
+ {
+
+ wpsg_refreshBasketWidget();
+
+ <?php if ($this->get_option('wpsg_afterinsert') == '2') { ?>
+ tb_show('<?php echo __('Ihr Warenkorb', 'wpsg'); ?>', '<?php echo $this->getURL(wpsg_ShopController::URL_BASKET_AJAX); ?>&height=500');
+ <?php } else { ?>
+
+ wpsg_unblockProductTemplate(<?php echo $this->getTemplateIndex(); ?>);
+ jQuery('body').append(data);
+
+ <?php } ?>
+
+ }
+ } );
+
+ return false;
+
+ } );
+
+ } );
+
+ </script>
+ <?php } ?>
+
+ </div>
+ <?php } ?>
+ </div>
+ </div>
+
+ <div class="wpsg_clear"></div>
+
+ <?php if ($this->hasMod('wpsg_mod_request') && $this->callMod('wpsg_mod_request', 'isRequestProduct', array($this->view['data']['id']))) { ?>
+ <label class="wpsg_amount_label" for="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>"><?php echo __('Anzahl', 'wpsg'); ?></label>
+ <input type="text" value="<?php echo ((wpsg_isSizedInt($this->view['data']['menge']))?$this->view['data']['menge']:'1'); ?>" name="wpsg[menge]" class="wpsg_menge" id="wpsg_menge_<?php echo $this->getTemplateIndex(); ?>" <?php echo (($this->view['data']['basket_multiple'] == 4)?' readonly="readonly" ':''); ?> />
+
+ <input class="wpsg_button wpsg_add_requestlist" id="wpsg_add_requestlist_<?php echo $this->getTemplateIndex(); ?>" type="submit" value="<?php echo __('Auf die Anfrageliste', 'wpsg'); ?>" name="wpsg[submit_request]" />
+ <?php } ?>
+
+ <?php /* Produktlangbeschreibung START */ ?>
+ <div class="wpsg_product_informationarea">
+
+ <?php if (strlen(trim($this->view['data']['longdescription'])) > 0) { ?>
+ <div class="wpsg_product_information_large">
+ <div class="wpsg_produkt_additional_information">
+ <div itemprop="description" class="wpsg_produkt_longdescription">
+ <span><?php echo $this->view['data']['longdescription']; ?></span>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ </div>
+ <?php /* Produktlangbeschreibung ENDE */ ?>
+
+ <?php /* zusätzliche Informationen START */ ?>
+ <div class="wpsg_product_informationarea">
+
+ <?php if (strlen(trim($this->view['data']['moreinfos'])) > 0) { ?>
+ <div class="wpsg_product_information_large">
+ <div class="wpsg_produkt_additional_information">
+ <div itemprop="description" class="wpsg_produkt_moreinfos">
+ <span><?php echo $this->view['data']['moreinfos']; ?></span>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ </div>
+ <?php /* zusätzliche Informationen ENDE */ ?>
+
+ <?php /* zusätzliche Lieferumfang START */ ?>
+ <div class="wpsg_product_informationarea">
+
+ <?php if (strlen(trim($this->view['data']['moreinfos2'])) > 0) { ?>
+ <div class="wpsg_product_information_large">
+ <div class="wpsg_produkt_additional_information">
+ <div itemprop="description" class="wpsg_produkt_moreinfos2">
+ <span><?php echo $this->view['data']['moreinfos2']; ?></span>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
+
+ </div>
+ <?php /* zusätzliche Lieferumfang ENDE */ ?>
+
+ <div class="wpsg_clear"></div>
+
+ <?php /* Social Media Integration */ ?>
+ <div class="wpsg_product_social_media">
+ <?php if (is_plugin_active('plugin-directory/shariff.php')) {?>
+ <?php echo do_shortcode('[shariff]')?>
+ <?php } ?>
+ </div>
+
+ </div>
+
+ </div>
+ </div>
+
+ <?php if ($this->getTemplateIndex() === 1) { ?>
+
+ <link rel="stylesheet" href="<?php echo $this->getRessourceURL('css/tiny-slider.-2.9.4.min.css'); ?>">
+
+ <style>
+
+ .wpsg_produkt_wrapper.layout3 .col_wrap { display:flex; width:100%; justify-content:stretch; gap:1rem; flex-wrap:wrap; }
+ .wpsg_produkt_wrapper.layout3 .col_wrap > * { flex-grow:1; flex-shrink:0; width:100%; }
+ .wpsg_produkt_wrapper.layout3 .col_wrap > .col.image { display:flex; justify-content:stretch; gap:0.5rem; }
+ .wpsg_produkt_wrapper.layout3 .col_wrap > .col.image .thumbnails { width:20%; flex-shrink:0; }
+ .wpsg_produkt_wrapper.layout3 .col_wrap > .col.image .thumbnails img { aspect-ratio: 1 / 1; object-fit:cover; object-position:50% 50%; }
+ .wpsg_produkt_wrapper img { max-width:100%; height:auto; }
+
+ .ds_image_zoom.attached { position:relative; overflow:hidden; cursor:-webkit-zoom-in; cursor:zoom-in; }
+ .ds_image_zoom.attached img { all:initial; position:absolute; left:0; top:0; /* transition:width 0.3s, height 0.3s, left 0.3s, top 0.3s; */ }
+
+ @media screen and (min-width:993px) {
+
+ .wpsg_produkt_wrapper.layout3 .col_wrap { flex-wrap:nowrap; }
+ .wpsg_produkt_wrapper.layout3 .col_wrap > * { width:0; }
+
+ }
+
+ </style>
+
+ <?php } ?>
+
+ <?php if ($this->getTemplateIndex() === 1 && ($_REQUEST['action']??'') !== 'wpsg_productvariants_switch') { ?>
+
+ <script src="<?php echo $this->getRessourceURL('js/tiny-slider-2.9.2.min.js'); ?>"></script>
+ <script src="<?php echo $this->getRessourceURL('js/dsimagezoom.min.js'); ?>"></script>
+
+ <?php } ?>
+
+ <script>
+
+ if (!wpsg_standard3_slider) { var wpsg_standard3_slider = {}; }
+
+ if (!wpsg_standard3_load) {
+
+ function wpsg_standard3_load(templateIndex) {
+
+ if (wpsg_standard3_slider[templateIndex]) {
+
+ wpsg_standard3_slider[templateIndex] = wpsg_standard3_slider[templateIndex].rebuild();
+
+ } else {
+
+ wpsg_standard3_slider[templateIndex] = tns({
+ container: '#wpsg_produktform_' + templateIndex + ' .wpsg_product_slider',
+ items: 1,
+ slideBy: 1,
+ controls: false,
+ autoplayButton: false,
+ nav: false,
+ arrowKeys: false,
+ autoplayButtonOutput: false,
+ autoplay: false,
+ autoHeight: true,
+ onInit: () => {
+
+ }
+ });
+
+ }
+
+ wpsg_standard3_slider[templateIndex].events.on('transitionEnd', (event) => {
+
+ DsImageZoom.init(document.querySelectorAll('#wpsg_produktform_' + templateIndex + ' .tns-slide-active .ds_image_zoom'));
+
+ });
+
+ wpsg_standard3_slider[templateIndex].events.on('transitionStart', (event) => {
+
+ DsImageZoom.destroy(document.querySelectorAll('#wpsg_produktform_' + templateIndex + ' .tns-item .ds_image_zoom'));
+
+ });
+
+ for (const el_tn of document.querySelectorAll('#wpsg_produktform_' + templateIndex + ' .wpsg_produkt_wrapper.layout3 .thumbnails img')) {
+
+ el_tn.addEventListener('click', (event) => {
+
+ wpsg_standard3_slider[templateIndex].goTo(el_tn.getAttribute('data-index'));
+
+ });
+
+ }
+
+ wpsg_standard3_slider[templateIndex].goTo(0);
+
+ };
+
+ };
+
+ window.addEventListener('load', () => { wpsg_standard3_load(<?php echo $this->getTemplateIndex(); ?>); });
+
+ <?php if (($_REQUEST['action']??'') === 'wpsg_productvariants_switch') { ?>
+
+ window.setTimeout(() => {
+
+ wpsg_standard3_load(<?php echo $this->getTemplateIndex(); ?>);
+
+ }, 100);
+
+ <?php } ?>
+
+ </script>
+
+</div> \ No newline at end of file