summaryrefslogtreecommitdiff
path: root/views/order
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2019-07-20 15:17:02 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2019-07-20 15:17:02 +0000
commite486bed6ea2a13e97cfc78a03f30c0999d92eb26 (patch)
treed9b55496c54f44aac74bde286760074157c815cd /views/order
parent275b7e8464767913a08a5acc4d0148954bb9738d (diff)
- Backup Wertgutscheine
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7486 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/order')
-rw-r--r--views/order/backendEdit/addVoucher.phtml28
-rw-r--r--views/order/product_table.phtml81
-rw-r--r--views/order/view_orderdata.phtml8
3 files changed, 103 insertions, 14 deletions
diff --git a/views/order/backendEdit/addVoucher.phtml b/views/order/backendEdit/addVoucher.phtml
index 7b90086..88d8e2b 100644
--- a/views/order/backendEdit/addVoucher.phtml
+++ b/views/order/backendEdit/addVoucher.phtml
@@ -15,25 +15,45 @@
else $strBN = 'BRUTTO';
$arCalculation = $oCalculation->getCalculationArray();
+ $voucher = [
+ 'code' => '',
+ 'id' => 0,
+ 'set' => 0,
+ 'type' => 'voucher'
+ ];
- $strVal = ((isset($arCalculation['voucher'][0]['set']))?$arCalculation['voucher'][0]['set']:0);
+ // Voucher suchen
+ foreach (array_merge($arCalculation['voucher'], $arCalculation['coupon']) as $v) {
+
+ if ($v['order_voucher_id'] == $_REQUEST['order_voucher_id']) {
+
+ $voucher = $v;
+
+ }
+
+ }
+
+ $strVal = ((isset($voucher['set']))?$voucher['set']:0);
if (strpos($strVal, '%') !== false) $strVal = wpsg_ff(wpsg_tf($strVal), '%');
else $strVal = wpsg_ff(wpsg_tf($strVal), $this->get_option('wpsg_currency'));
-
+
?>
<form id="wpsg_be_voucher_form">
+ <input type="hidden" name="order_voucher_id" value="<?php echo wpsg_getInt($_REQUEST['order_voucher_id']); ?>" />
+
<div class="autocomplete_wrap">
<?php echo wpsg_drawForm_Input('be_voucher_search', __('Gutscheinsuche', 'wpsg'), ''); ?>
</div>
<br />
- <?php echo wpsg_drawForm_Input('be_voucher_code', __('Code (Optional)', 'wpsg'), @$arCalculation['voucher'][0]['code']); ?>
- <?php echo wpsg_drawForm_Input('be_voucher_id', __('Guschein ID (Optional)', 'wpsg'), @$arCalculation['voucher'][0]['id']); ?>
+ <?php echo wpsg_drawForm_Input('be_voucher_code', __('Code (Optional)', 'wpsg'), @$voucher['code']); ?>
+ <?php echo wpsg_drawForm_Input('be_voucher_id', __('Guschein ID', 'wpsg'), @$voucher['id']); ?>
<?php echo wpsg_drawForm_Input('be_voucher_amount', wpsg_translate(__('Gutscheinwert in #1# (#2#) oder % ', 'wpsg'), $this->get_option('wpsg_currency'), $strBN), $strVal); ?>
+ <?php echo wpsg_drawForm_Checkbox('be_voucher_coupon', __('Wertgutschein'), (($voucher['type'] === 'coupon')?'1':'0')); ?>
</form>
diff --git a/views/order/product_table.phtml b/views/order/product_table.phtml
index 1f5d037..244ee56 100644
--- a/views/order/product_table.phtml
+++ b/views/order/product_table.phtml
@@ -98,8 +98,8 @@
<?php echo __('(zzgl. MwSt.)', 'wpsg'); ?>
<?php } ?>
- <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Gutschein bearbeiten', 'wpsg'); ?>" onclick="return WPSG_BE_Voucher.editVoucher();"><span class="glyphicon glyphicon-pencil"></span></a>
- <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Gutschein löschen', 'wpsg'); ?>" onclick="return WPSG_BE_Voucher.removeVoucher();"><span class="glyphicon glyphicon-trash"></span></a>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Gutschein bearbeiten', 'wpsg'); ?>" onclick="return WPSG_BE_Voucher.editVoucher(<?php echo $v['order_voucher_id']; ?>);"><span class="glyphicon glyphicon-pencil"></span></a>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Gutschein löschen', 'wpsg'); ?>" onclick="return WPSG_BE_Voucher.removeVoucher(<?php echo $v['order_voucher_id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
</div>
<div>
Code: <?php echo $v['code']; ?>
@@ -109,7 +109,7 @@
<td class="wpsg_cell_preis">
<?php if (strpos($v['set'], '%') === false) { ?>
- <?php echo wpsg_ff($arCalculation['sum']['voucher_'.$display], $this->get_option('wpsg_currency')); ?>
+ <?php echo wpsg_ff($v[$display], $this->get_option('wpsg_currency')); ?>
<?php } else { ?>
<?php echo wpsg_ff($v['set'], '%'); ?>
<?php } ?>
@@ -121,11 +121,11 @@
<td>1</td>
<td class="wpsg_cell_mwst_value wpsg_cell_gesamtpreis"><?php
- echo wpsg_ff($arCalculation['sum']['voucher_'.$display]); ?> <?php echo $this->get_option('wpsg_currency');
+ echo wpsg_ff($v[$display]); ?> <?php echo $this->get_option('wpsg_currency');
- if (strpos($arCalculation['voucher'][0]['set'], '%') !== false) {
+ if (strpos($v['set'], '%') !== false) {
- echo '<span class="procent_payship">('.wpsg_ff(wpsg_tf($arCalculation['voucher'][0]['set']), '%').')</span>';
+ echo '<span class="procent_payship">('.wpsg_ff(wpsg_tf($v['set']), '%').')</span>';
}
@@ -314,6 +314,75 @@
<?php } } ?>
<?php } ?>
+
+ <?php // Wertgutscheine ?>
+ <?php if (wpsg_isSizedArray($arCalculation['coupon'])) { ?>
+
+ <?php foreach ($arCalculation['coupon'] as $c) { ?>
+
+ <tr class="wpsg_row_discount wpsg_row_small">
+ <td colspan="" class="wpsg_cell_mwst_label">
+
+ <div>
+ <?php echo __('Wertgutschein', 'wpsg'); ?>
+
+ <?php if ($this->getBackendTaxView() === WPSG_BRUTTO) { ?>
+ <?php echo __('(inkl. MwSt.)', 'wpsg'); ?>
+ <?php } else { ?>
+ <?php echo __('(zzgl. MwSt.)', 'wpsg'); ?>
+ <?php } ?>
+
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Wertgtschein bearbeiten', 'wpsg'); ?>" onclick="return WPSG_BE_Voucher.editVoucher(<?php echo $c['order_voucher_id']; ?>);"><span class="glyphicon glyphicon-pencil"></span></a>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Wertgutschein löschen', 'wpsg'); ?>" onclick="return WPSG_BE_Voucher.removeVoucher(<?php echo $c['order_voucher_id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
+ </div>
+ <div>
+ Code: <?php echo $c['code']; ?>
+ </div>
+
+ </td>
+ <td class="wpsg_cell_preis">
+
+ <?php if (strpos($c['set'], '%') === false) { ?>
+ <?php echo wpsg_ff($c[$display], $this->get_option('wpsg_currency')); ?>
+ <?php } else { ?>
+ <?php echo wpsg_ff($c['set'], '%'); ?>
+ <?php } ?>
+
+ </td>
+ <?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
+ <td class="wpsg_cell_mwst"><?php echo $arTaxShort[$c['tax_key']]; ?></td>
+ <?php } ?>
+ <td>1</td>
+ <td class="wpsg_cell_mwst_value wpsg_cell_gesamtpreis"><?php
+
+ echo wpsg_ff($c[$display]); ?> <?php echo $this->get_option('wpsg_currency');
+
+ if (strpos($c['set'], '%') !== false) {
+
+ echo '<span class="procent_payship">('.wpsg_ff(wpsg_tf($c['set']), '%').')</span>';
+
+ }
+
+ ?></td>
+ </tr>
+
+ <?php } ?>
+
+ <tr class="wpsg_row_gesamt">
+ <td colspan="<?php echo $this->view['colspan']; ?>" class="wpsg_cell_summe_label">
+ <strong><?php echo __('Zu zahlen', 'wpsg'); ?></strong>
+ <?php if ($this->getBackendTaxView() === WPSG_BRUTTO) { ?>
+ <?php echo __('(inkl. MwSt.)', 'wpsg'); ?>
+ <?php } else { ?>
+ <?php echo __('(zzgl. MwSt.)', 'wpsg'); ?>
+ <?php } ?>
+ </td>
+ <td class="wpsg_cell_gesamt_value wpsg_cell_gesamtpreis">
+ <strong><?php echo wpsg_ff($arCalculation['sum']['topay_brutto']); ?> <?php echo $this->get_option('wpsg_currency'); ?></strong>
+ </td>
+ </tr>
+
+ <?php } ?>
</tbody>
</table>
diff --git a/views/order/view_orderdata.phtml b/views/order/view_orderdata.phtml
index 69df736..5f63a8d 100644
--- a/views/order/view_orderdata.phtml
+++ b/views/order/view_orderdata.phtml
@@ -182,13 +182,13 @@
var WPSG_BE_Voucher = {
- editVoucher: function() {
+ editVoucher: function(order_voucher_id) {
jQuery('#wpsg_voucher_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
jQuery('#wpsg_voucher_dialog').modal( { } ).modal('show');
jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editVoucher&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editVoucher&edit_id=<?php echo $_REQUEST['edit_id']; ?>&order_voucher_id=' + order_voucher_id + '&noheader=1',
success: function(data) {
jQuery('#wpsg_voucher_dialog .modal-body').html(data);
@@ -200,12 +200,12 @@
},
- removeVoucher: function() {
+ removeVoucher: function(order_voucher_id) {
jQuery('#wpsg_product_table_wrap').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
jQuery.ajax( {
- url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editVoucher&do=remove&edit_id=<?php echo $_REQUEST['edit_id']; ?>&noheader=1',
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=editVoucher&do=remove&edit_id=<?php echo $_REQUEST['edit_id']; ?>&order_voucher_id=' + order_voucher_id + '&noheader=1',
success: function(data) {
jQuery('#wpsg_product_table_wrap').html(data.product_table);