summaryrefslogtreecommitdiff
path: root/views/mods
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2022-06-10 06:17:08 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2022-06-10 06:17:08 +0000
commit3d917b6c61c632be1ca15009e8dae1ed21c70328 (patch)
tree9cad0261704d95eb2342c8a46e00bf23839eeccd /views/mods
parent12cc0a8deef2533478df389cc6cf5b4f5fb99ad4 (diff)
- Backup
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8007 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods')
-rwxr-xr-xviews/mods/mod_deliverytime/product_bottom.phtml31
-rw-r--r--views/mods/mod_deliverytime/produkt_addedit_allgemein.phtml31
-rw-r--r--views/mods/mod_rechnungen/accounting_pdf.phtml16
-rwxr-xr-xviews/mods/mod_rechnungen/order_view_orderdata_after.phtml243
-rw-r--r--views/mods/mod_rechnungen/order_view_row.phtml61
5 files changed, 370 insertions, 12 deletions
diff --git a/views/mods/mod_deliverytime/product_bottom.phtml b/views/mods/mod_deliverytime/product_bottom.phtml
new file mode 100755
index 0000000..3687401
--- /dev/null
+++ b/views/mods/mod_deliverytime/product_bottom.phtml
@@ -0,0 +1,31 @@
+<?php
+
+ declare(strict_types=1);
+
+ /**
+ * @author: Daniel Schmitzer (daschmi@daschmi.de)
+ * @date: 08.06.22
+ * @time: 13:43
+ */
+
+ $available_date = $this->view['wpsg_mod_deliverytime']['available_date'];
+ $t_date = strtotime($available_date);
+
+ $nowplusoneday = strtotime('+1 days');
+ $days_between = ceil(($t_date - mktime(0, 0, 0)) / (24 * 60 * 60));
+
+?>
+
+<?php if ($days_between <= 1) { ?>
+
+ <div class="wpsg_mod_deliverytime_product_bottom">
+ <?php echo __('sofort Lieferbar', 'wpsg') ;?>
+ </div>
+
+<?php } else { ?>
+
+ <div class="wpsg_mod_deliverytime_product_bottom">
+ <?php echo wpsg_translate(__('Lieferbar in #1# Tagen', 'wpsg'), $days_between); ?>
+ </div>
+
+<?php } ?>
diff --git a/views/mods/mod_deliverytime/produkt_addedit_allgemein.phtml b/views/mods/mod_deliverytime/produkt_addedit_allgemein.phtml
index 9576850..b25033e 100644
--- a/views/mods/mod_deliverytime/produkt_addedit_allgemein.phtml
+++ b/views/mods/mod_deliverytime/produkt_addedit_allgemein.phtml
@@ -17,6 +17,7 @@
<?php echo wpsg_drawForm_Input('wpsg_mod_deliverytime[wpsg_mod_deliverytime_deliverytime]', __('Lieferzeit', 'wpsg'), wpsg_getStr($this->view['wpsg_mod_deliverytime']['wpsg_mod_deliverytime_deliverytime']), array('unit' => __('Tage', 'wpsg'), 'help' => 'wpsg_mod_deliverytime_input')); ?>
<?php } ?>
</div>
+
<?php if (isset($this->view['wpsg_mod_deliverytime']['wpsg_mod_deliverytime_storeproduct'])) {?>
<?php echo wpsg_drawForm_Select('wpsg_mod_deliverytime[wpsg_mod_deliverytime_storeproduct]', __('Als Offlineprodukt anzeigen', 'wpsg'), array(0 => 'Moduleinstellungen', 1 => 'Offlineprodukt', 2 => 'Onlineprodukt'), $this->view['wpsg_mod_deliverytime']['wpsg_mod_deliverytime_storeproduct'], array('noIndex' => true, 'help' => 'wpsg_mod_deliverytime_store')); ?>
@@ -53,9 +54,35 @@
<?php echo wpsg_drawForm_Input('wpsg_mod_deliverytime[wpsg_mod_deliverytime_holidaytext]', __('Urlaubsgruß', 'wpsg'), $this->view['wpsg_mod_deliverytime']['wpsg_mod_deliverytime_holidaytext'], array('help' => 'wpsg_mod_deliverytime_holidayText')); ?>
</div>
<?php } ?>
-
- <br />
+ <!-- Versanddatum -->
+ <?php echo wpsg_drawForm_Select('wpsg_mod_deliverytime[set_available]', __('Verfügbarkeit definieren', 'wpsg'), [
+ '0' => __('Nein', 'wpsg'),
+ '1' => __('Ja', 'wpsg')
+ ], $this->view['wpsg_mod_deliverytime']['set_available']??'0'); ?>
+
+ <div class="wpsg_mod_deliverytime_set_available wpsg_mod_deliverytime_set_available_1" style="display:none;">
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_deliverytime[available_date]', __('Verfügbar ab', 'wpsg'), $this->view['wpsg_mod_deliverytime']['available_date']??date('Y-m-d'), ['type' => 'date']); ?>
+
+ </div>
+
+ <script>
+
+ let el_set_available = document.getElementById('wpsg_mod_deliverytimeset_available');
+
+ el_set_available.addEventListener('change', (event) => {
+
+ for (let el of document.querySelectorAll('.wpsg_mod_deliverytime_set_available')) el.style.display = 'none';
+ for (let el of document.querySelectorAll('.wpsg_mod_deliverytime_set_available_' + event.target.value)) el.style.display = 'block';
+
+ });
+
+ el_set_available.dispatchEvent(new Event('change'));
+
+ </script>
+
+ <br />
<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_deliverytime"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration der Lieferzeit', 'wpsg'); ?></a>
diff --git a/views/mods/mod_rechnungen/accounting_pdf.phtml b/views/mods/mod_rechnungen/accounting_pdf.phtml
index 9732bc9..ec314b6 100644
--- a/views/mods/mod_rechnungen/accounting_pdf.phtml
+++ b/views/mods/mod_rechnungen/accounting_pdf.phtml
@@ -92,8 +92,8 @@
$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()));
+
+ 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);
@@ -829,7 +829,7 @@
} else {
$offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("SUMME", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("SUMME", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
/* Endbetrag wird fett ausgegeben */
@@ -968,20 +968,16 @@
ob_end_clean();
- if ($this->view['preview'])
- {
+ if ($this->view['preview']) {
$pdf->Output($filename, 'I');
- }
- else
- {
+ } else {
$pdf->Output($this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'])).$filename, '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');
+ $pdf->Output($this->view['filename_out'], 'I');
}
-?> \ No newline at end of file
diff --git a/views/mods/mod_rechnungen/order_view_orderdata_after.phtml b/views/mods/mod_rechnungen/order_view_orderdata_after.phtml
new file mode 100755
index 0000000..0decca8
--- /dev/null
+++ b/views/mods/mod_rechnungen/order_view_orderdata_after.phtml
@@ -0,0 +1,243 @@
+<?php
+
+ declare(strict_types=1);
+
+ /**
+ * @author: Daniel Schmitzer (daschmi@daschmi.de)
+ * @date: 09.06.22
+ * @time: 07:44
+ */
+
+ namespace wpsg;
+
+ /** @var \wpsg_customer $oCustomer */
+ $oCustomer = $this->view['oCustomer']??null;
+
+ /** @var \wpsg_order $oOrder */
+ $oOrder = $this->view['oOrder']??null;
+
+ $wpsg_rechnungen_footer = $this->get_option("wpsg_rechnungen_footer");
+
+ if (!is_array($wpsg_rechnungen_footer)) $wpsg_rechnungen_footer = unserialize($this->get_option("wpsg_rechnungen_footer"));
+ if (!is_array($wpsg_rechnungen_footer)) $wpsg_rechnungen_footer = Array();
+
+ $default = $this->get_option('wpsg_rechnungen_foottext_standard');
+
+?>
+
+
+<div id="wpsg_mod_invoice_tabs">
+
+ <ul class="nav nav-tabs" role="tablist">
+ <li role="presentation" class="tab akttab active" id="tab1"><a href="#tab1" role="tab" data-toggle="tab" class="bg_invoice"><?php echo __('Rechnung erstellen', 'wpsg'); ?></a></li>
+ <li role="presentation" class="tab" id="tab2"><a href="#tab2" role="tab" data-toggle="tab" class="bg_storno"><?php echo __('Gutschrift/Rechnungskorrektur erstellen', 'wpsg'); ?></a></li>
+ </ul>
+
+ <div class="tab-content">
+
+ <div role="tabpanel" class="tabcontent bg_invoice" id="tabcontent1">
+
+ <form method="post" id="invoice_form" target="_blank" action="<?php
+
+ echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_rechnungen&cmd=rechnung&noheader=1&edit_id='.$oOrder->getId();
+
+ ?>" class="grid">
+
+ <?php \wp_nonce_field('wpsg-mod_invoice-order_ajax-rechnung-'.$this->view['data']['id']); ?>
+
+ <!-- Rechnung -->
+
+ <input type="checkbox" name="wpsg_rechnungen_sendmail" value="1" id="invoice_sendmail" checked="checked" />
+ <label for="invoice_sendmail"><?php echo __('E-Mail an Kunden senden', 'wpsg'); ?></label>
+ <input type="email" name="wpsg_rechnungen_email" value="<?php echo $oCustomer->getEMail(); ?>" />
+
+ <input type="checkbox" name="wpsg_rechnungen_faelligkeit" value="1" id="invoice_faelligkeit" checked="checked" />
+ <label for="invoice_faelligkeit"><?php echo __('Fälligkeit anzeigen', 'wpsg'); ?></label>
+ <input type="date" name="wpsg_rechnungen_faelligkeitsdatum" value="<?php echo date('Y-m-d'); ?>" />
+
+ <input type="checkbox" name="wpsg_rechnungen_status" value="1" id="invoice_state" checked="checked" />
+ <label for="invoice_state"><?php echo __('Neuer Status', 'wpsg'); ?></label>
+ <select name="wpsg_rechnungen_status_neu">
+ <?php foreach ($this->arStatus as $status_key => $status_label) { ?>
+ <option value="<?php echo $status_key; ?>"><?php echo $status_label; ?></option>
+ <?php } ?>
+ </select>
+
+ <input type="checkbox" name="wpsg_rechnungen_shippay" value="1" id="invoice_shippay" checked="checked" />
+ <label style="grid-column:2 / span 2;" for="invoice_shippay"><?php
+
+ echo __('Versand-/Zahlungskosten abrechnen', 'wpsg');
+
+ /** @var \wpsg\wpsg_invoice[] $arInvoice */
+ $arInvoice = $this->callMod('wpsg_mod_rechnungen', 'getInvoiceToOrder', [$oOrder->getId()]);
+ $arInvoiceLabel = [];
+
+ foreach ($arInvoice as $oInvoice) {
+
+ if ($oInvoice->getMeta('include_shipping', false, '0')) {
+
+ $arInvoiceLabel[] = $oInvoice->getNr(true);
+
+ }
+
+ }
+
+ if (sizeof($arInvoiceLabel) > 0) {
+
+ echo wpsg_translate(__(' (Enthalten in #1#)', 'wpsg'), implode(', ', $arInvoiceLabel));
+
+ }
+
+ ?></label>
+
+ <input type="checkbox" name="wpsg_rechnungen_url" value="1" id="invoice_url" />
+ <label for="invoice_url" style="grid-column: 2 / span 2;"><?php echo __('URL Benachrichtigung', 'wpsg'); ?></label>
+
+ <span></span>
+ <label for="invoice_date"><?php echo __('Rechnungsdatum', 'wpsg') ;?></label>
+ <input type="date" value="<?php echo date('Y-m-d'); ?>" name="wpsg_rechnungen_datum" id="invoice_date" />
+
+ <span></span>
+ <label for="invoice_foottext_select"><?php echo __('Fußtext', 'wpsg'); ?></label>
+
+ <?php if (sizeof($wpsg_rechnungen_footer) > 0) { ?>
+ <select id="invoice_foottext_select">
+ <?php foreach ($wpsg_rechnungen_footer as $k => $v) { ?>
+ <option value="<?php echo wpsg_hspc($v[1]); ?>" <?php echo ((intval($default) === intval($k))?'selected="selected"':''); ?>><?php echo wpsg_hspc($v[0]); ?></option>
+ <?php } ?>
+ </select>
+ <?php } else { ?>
+ <span></span>
+ <?php } ?>
+
+ <span></span>
+ <input type="text" name="wpsg_rechnungen_fusstext" id="wpsg_rechnungen_fusstext" value="" style="grid-column: 2 / span 2;" />
+
+ <span style="grid-column:1 / span 3;"></span>
+
+ <span style="display:flex; justify-content:flex-end; gap:0.5rem; grid-column:1/span 3;">
+
+ <input class="button" style="" id="invoice_wpsg_rechnungen_preview" name="wpsg_rechnungen_preview" type="submit" value="Vorschau">
+ <input class="button" style="" id="invoice_wpsg_rechnungen_submit" onclick="window.setTimeout(function() { location.href = '<?php
+
+ echo wpsg_admin_url('Order', 'view', ['edit_id' => $oOrder->getId()]);
+
+ ?>'; }, 1000);" name="wpsg_rechnungen_write" type="submit" value="Rechnung schreiben">
+
+ </span>
+
+ <script>
+
+ let el_invoice_foottext_select = document.getElementById('invoice_foottext_select');
+ let el_invoice_form = document.getElementById('invoice_form');
+
+ if (el_invoice_foottext_select) {
+
+ el_invoice_foottext_select.addEventListener('change', (event) => {
+
+ document.getElementById('wpsg_rechnungen_fusstext').value = event.target.value;
+
+ });
+
+ el_invoice_foottext_select.dispatchEvent(new Event('change'));
+
+ };
+
+ let el_invoice_wpsg_rechnungen_preview = document.getElementById('invoice_wpsg_rechnungen_preview');
+ let el_invoice_wpsg_rechnungen_submit = document.getElementById('el_invoice_wpsg_rechnungen_submit');
+
+ </script>
+
+ </form>
+
+ </div>
+
+ <div role="tabpanel" class="tabcontent bg_storno" id="tabcontent2">
+
+ <form method="post" id="storno_form" target="_blank" action="<?php
+
+ echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&noheader=1&action=ajax&mod=wpsg_mod_rechnungen&edit_id='.$oOrder->getId().'&do=storno';
+
+ ?>" class="grid">
+
+ <?php \wp_nonce_field('wpsg-mod_invoice-order_ajax-storno-'.$this->view['data']['id']); ?>
+
+ <input type="checkbox" name="storno_send" id="storno_send" value="1" />
+ <label for="storno_send"><?php echo __('E-Mail an Kunden senden', 'wpsg'); ?></label>
+ <input type="email" name="storno_mail" value="<?php echo $oCustomer->getEMail(); ?>" />
+
+ <input type="checkbox" id="storno_shippay" name="storno_shippay" value="1" id="invoice_shippay" checked="checked" />
+ <label style="grid-column:2 / span 2;" for="storno_shippay"><?php echo __('Versand-/Zahlungskosten stornieren', 'wpsg'); ?></label>
+
+ <input type="checkbox" name="storno_state" value="1" id="storno_state" checked="checked" />
+ <label for="storno_state"><?php echo __('Neuer Status', 'wpsg'); ?></label>
+ <select name="storno_state_new">
+ <?php foreach ($this->arStatus as $status_key => $status_label) { ?>
+ <option value="<?php echo $status_key; ?>"><?php echo $status_label; ?></option>
+ <?php } ?>
+ </select>
+
+ <input type="checkbox" name="storno_fee_set" id="storno_fee_set" value="1" id="storno_fee_set" />
+ <label for="storno_fee_set"><?php echo __('Stornierungsgebühr in % oder EUR', 'wpsg'); ?></label>
+ <input type="text" value="" name="storno_fee_value" />
+
+ <span style="grid-column:1 / span 3;"></span>
+
+ <span style="display:flex; justify-content:flex-end; gap:0.5rem; grid-column:1/span 3;">
+
+ <input class="button" style="" id="invoice_wpsg_storno_preview" name="wpsg_storno_preview" type="submit" value="Vorschau">
+ <input class="button" style="" id="invoice_wpsg_storno_submit" onclick="window.setTimeout(function() { location.href = '<?php
+
+ echo wpsg_admin_url('Order', 'view', ['edit_id' => $oOrder->getId()]);
+
+ ?>'; }, 1000);" name="wpsg_storno_write" type="submit" value="Rechnungskorrektur schreiben">
+
+ </span>
+
+ <script>
+
+ let el_storno_form = document.getElementById('storno_form');
+
+ let el_invoice_wpsg_storno_preview = document.getElementById('invoice_wpsg_storno_preview');
+ let el_invoice_wpsg_storno_submit = document.getElementById('invoice_wpsg_storno_submit');
+
+ </script>
+
+ </form>
+
+ </div>
+
+ </div>
+
+</div>
+
+<style>
+
+ #wpsg_mod_invoice_tabs .grid { width:100%; padding:1rem; display:grid; row-gap:0.5rem; column-gap:0.5rem; grid-template-columns:25px 1fr 300px; align-items:center; grid-auto-rows:30px; padding-bottom:0.5rem; }
+ #wpsg_mod_invoice_tabs .grid input[type="checkbox"] { margin-top:0; }
+ #wpsg_mod_invoice_tabs .grid label { font-weight:normal; margin-bottom:0; }
+
+ .nav-tabs > li.active > a.bg_invoice,
+ .nav-tabs > li.active > a.bg_invoice:focus,
+ label.bg_invoice,
+ .link_invoice.bg_invoice,
+ .tabcontent.bg_invoice { background-color:lightgreen; color:black; }
+
+ .nav-tabs > li.active > a.bg_storno,
+ .nav-tabs > li.active > a.bg_storno:focus,
+ label.bg_storno,
+ .link_invoice.bg_storno,
+ .tabcontent.bg_storno { background-color:lightpink; color:black; }
+
+ .link_invoice { transform:translateX(-5px); padding:2px 5px; font-siz:12px; text-decoration:underline; }
+ label[for="invoice_shippay"] .link_invoice { padding:0; }
+
+</style>
+
+<script>
+
+ jQuery('#wpsg_mod_invoice_tabs').wpsg_tab( {
+
+ } );
+
+</script> \ No newline at end of file
diff --git a/views/mods/mod_rechnungen/order_view_row.phtml b/views/mods/mod_rechnungen/order_view_row.phtml
new file mode 100644
index 0000000..5ab2eab
--- /dev/null
+++ b/views/mods/mod_rechnungen/order_view_row.phtml
@@ -0,0 +1,61 @@
+<?php
+
+ /**
+ * Template für die Produktauswahl innerhalb der Bestellansicht
+ */
+
+ $storno_amount = $this->view['wpsg_mod_rechnungen']['storno_amount'];
+ $invoice_amount = $this->view['wpsg_mod_rechnungen']['invoice_amount'];
+
+ /** @var wpsg_order_product $oOrderProduct */
+ $oOrderProduct = $this->view['wpsg_mod_rechnungen']['oOrderProduct'];
+
+ $p = $this->view['wpsg_mod_rechnungen']['product'];
+ $product_index = $this->view['wpsg_mod_rechnungen']['product']['product_index'];
+
+?>
+<tr class="wpsg_<?php echo (($this->view['wpsg_mod_rechnungen']['i'] == 0)?'odd':'even'); ?>">
+ <td colspan="<?php echo ((sizeof($this->view['arCalculation']['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?'5':'4'); ?>">
+ <div style="display:flex; flex-direction:row; margin-bottom:0px; gap:2rem;">
+
+ <?php if ($invoice_amount > 0) { ?>
+
+ <label style="display:flex; flex-direction:row; padding:5px; margin-left:-5px; gap:0.5rem; font-weight:normal; align-items:center;" class="bg_invoice">
+
+ <input form="invoice_form" type="hidden" name="invoice_products[<?php echo $p['order_product_id']; ?>][set]" value="0" />
+ <input checked="checked" form="invoice_form" type="checkbox" class="wpsg_mod_deliverynote_product" name="invoice_products[<?php echo $p['order_product_id']; ?>][set]" value="1" style="margin:0;" />
+
+ <input form="invoice_form" name="invoice_products[<?php echo $p['order_product_id']; ?>][amount]" type="number" max="<?php echo $invoice_amount; ?>" min="1" value="<?php echo min($invoice_amount, $p['amount']); ?>" style="padding:0; font-size:14px; line-height:22px; min-height:initial; height:22px; width:50px; text-indent:5px; border:1px solid black; margin:0;" />
+
+ <span>&nbsp;<?php echo __('Stück auf Rechnung', 'wpsg'); ?></span>
+
+ </label>
+
+ <?php } ?>
+
+ <?php if ($storno_amount > 0) { ?>
+
+ <label style="display:flex; flex-direction:row; padding:5px; margin-left:-5px; gap:0.5rem; font-weight:normal; align-items:center;" class="bg_storno">
+
+ <input form="storno_form" type="hidden" name="storno_products[<?php echo $p['order_product_id']; ?>][set]" value="0" />
+ <input form="storno_form" checked="checked" type="checkbox" class="wpsg_mod_deliverynote_product" name="storno_products[<?php echo $p['order_product_id']; ?>][set]" value="1" style="margin:0;" />
+
+ <input form="storno_form" name="storno_products[<?php echo $p['order_product_id']; ?>][amount]" type="number" max="<?php echo $storno_amount; ?>" min="1" value="<?php echo min($storno_amount, $p['amount']); ?>" style="padding:0; font-size:14px; line-height:22px; min-height:initial; height:22px; width:50px; text-indent:5px; border:1px solid black; margin:0;" />
+
+ <span>&nbsp;<?php echo __('Stück auf Gutschrift', 'wpsg'); ?></span>
+
+ </label>
+
+ <?php } ?>
+
+ </div>
+ <?php /** @var \wpsg\wpsg_invoice[] $arInvoice */ $arInvoice = $this->callMod('wpsg_mod_rechnungen', 'getInvoiceToOrderProduct', [$oOrderProduct]); ?>
+ <?php if (sizeof($arInvoice) > 0) { ?>
+ <div style="display:flex; gap:0.5rem; justify-content:flex-start; flex-wrap:wrap;">
+ <?php foreach ($arInvoice as $oInvoice) { ?>
+ <?php echo $oInvoice->getNr(true); ?>
+ <?php } ?>
+ </div>
+ <?php } ?>
+ </td>
+</tr> \ No newline at end of file