summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2018-11-19 13:59:10 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2018-11-19 13:59:10 +0000
commita99ad8192db9f8b6be6d100f3b38b59d277badd2 (patch)
tree0743025cf504b2585c17b22bd8a7629bad58277b
parentdd9cbbaf329efab4984bc6a0daf13f49eead78e2 (diff)
- Bestellverwaltung
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7210 0d5edaf7-2b12-4e95-93f4-047927463d4b
-rw-r--r--views/css/admin.css1
-rw-r--r--views/mods/mod_productvars/order_view_row.phtml8
-rw-r--r--views/order/backendEdit/addProduct_product_selected.phtml38
-rw-r--r--views/order/product_table.phtml27
-rw-r--r--views/order/view.phtml8
-rw-r--r--views/order/view_customerdata.phtml10
-rw-r--r--views/order/view_orderdata.phtml30
7 files changed, 101 insertions, 21 deletions
diff --git a/views/css/admin.css b/views/css/admin.css
index 8610558..9ffc90d 100644
--- a/views/css/admin.css
+++ b/views/css/admin.css
@@ -265,6 +265,7 @@ table.wpsgitrecht_table { width:100%; }
.wpsg_top_extend .commenticon.admincomment,
.wpsg_order .col_nr .glyphicon.admincomment { color:red; }
.wpsg_order .wpsg-order-tab { padding-top:15px; padding-bottom:15px; }
+.wpsg_order_view #restored_notice { margin-bottom:15px; color:red; }
#wpsg-bs.wpsg_order_view .editableform textarea { height:150px;}
.wpsg_order_view .wpsg_cell_gesamtpreis { text-align:right; }
diff --git a/views/mods/mod_productvars/order_view_row.phtml b/views/mods/mod_productvars/order_view_row.phtml
index 565b4f0..1ff9b1b 100644
--- a/views/mods/mod_productvars/order_view_row.phtml
+++ b/views/mods/mod_productvars/order_view_row.phtml
@@ -10,11 +10,11 @@
<?php foreach ((array)$this->view['wpsg_mod_productvars']['data'] as $k => $pv) { ?>
<tr class="wpsg_<?php echo (($this->view['wpsg_mod_productvars']['i'] == 0)?'odd':'even'); ?> wpsg_productvars">
<td class="wpsg_cell_name"><?php echo __($pv['name'], '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 $this->view['colspan']; ?>">
<div class="wpsg_editable" id="wpsg_productvar_<?php echo $k.'_'.$product_index; ?>"><?php echo wpsg_hspc($pv['value']); ?></div>
- <script type="text/javascript">/* <![CDATA[ */
+ <script type="text/javascript">/
<?php if ($pv['typ'] == 2) { /* Textfeld */ ?>
jQuery('#wpsg_productvar_<?php echo $k.'_'.$product_index; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_productvars&do=inlinedit&noheader=1', {
@@ -57,8 +57,8 @@
tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
});
<?php } ?>
-
- /* ]]> */</script>
+
+ </script>
</td>
</tr>
diff --git a/views/order/backendEdit/addProduct_product_selected.phtml b/views/order/backendEdit/addProduct_product_selected.phtml
index ba13724..93824bd 100644
--- a/views/order/backendEdit/addProduct_product_selected.phtml
+++ b/views/order/backendEdit/addProduct_product_selected.phtml
@@ -39,10 +39,18 @@
<div class="image"><?php echo wp_get_attachment_image($attachment_id, [100, 100]); ?></div>
<?php } ?>
- <?php echo wpsg_drawForm_Input('add_price', __('Produktpreis', 'wpsg').' '.(($this->getBackendTaxView() === WPSG_BRUTTO)?'(BRUTTO)':'(NETTO'), (($oOrderProduct !== false)?$oOrderProduct->getPrice($this->getBackendTaxView()):$oProduct->getPrice($this->getBackendTaxView()))); ?>
+ <?php echo wpsg_drawForm_Input('add_price', __('Produktpreis', 'wpsg').' '.(($this->getBackendTaxView() === WPSG_BRUTTO)?'(BRUTTO)':'(NETTO'), wpsg_ff((($oOrderProduct !== false)?$oOrderProduct->getPrice($this->getBackendTaxView()):$oProduct->getPrice($this->getBackendTaxView())), $this->get_option('wpsg_currency'))); ?>
<?php echo wpsg_drawForm_Input('add_amount', __('Menge', 'wpsg'), (($oOrderProduct !== false)?$oOrderProduct->getCount():'1')); ?>
-
- <?php if ($this->callMod('wpsg_mod_productvariants', 'isVariantsProduct', [$oProduct->id])) { $arVariants = $this->callMod('wpsg_mod_productvariants', 'getVariants', [$oProduct->id, true, true, true]); ?>
+ <?php echo wpsg_drawForm_Checkbox('add_eu',__('EU-Leistungsortregel anwenden', 'wpsg'),(($oOrderProduct !== false)?$oOrderProduct->euleistungsortregel:'1')) ?>
+
+ <?php if ($this->callMod('wpsg_mod_productvariants', 'isVariantsProduct', [$oProduct->id])) {
+
+ $arVariants = $this->callMod('wpsg_mod_productvariants', 'getVariants', [$oProduct->id, true, true, true]);
+
+ if ($oOrderProduct !== false) $arVariantenInfoArray = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', [$oOrderProduct->getProductKey()]);
+ else $arVariantenInfoArray = [];
+
+ ?>
<?php if (wpsg_isSizedArray($arVariants)) { ?>
@@ -55,11 +63,33 @@
?>
- <?php echo wpsg_drawForm_Select('wpsg_vp['.$var_id.']', $var_data['name'], $arVariSelect,''); ?>
+ <?php echo wpsg_drawForm_Select('wpsg_vp['.$var_id.']', $var_data['name'], $arVariSelect,$arVariantenInfoArray[$var_data['id']]['vari_id'], ['field_class' => 'varichange']); ?>
<?php } ?>
<?php } ?>
+
+ <script>
+
+ jQuery('.varichange').on('change', function() {
+
+ jQuery('#add_price').val('..');
+
+ jQuery.ajax( {
+ url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&subaction=addProduct&do=updatePrice&noheader=1&product_id=<?php echo $oProduct->id; ?>',
+ data: {
+ form_data: jQuery('#wpsg_product_add_form').serialize()
+ },
+ success: function(data) {
+
+ jQuery('#add_price').val(data);
+
+ }
+ } );
+
+ } );
+
+ </script>
<?php } ?>
diff --git a/views/order/product_table.phtml b/views/order/product_table.phtml
index 7ba1ea5..335d55b 100644
--- a/views/order/product_table.phtml
+++ b/views/order/product_table.phtml
@@ -3,7 +3,7 @@
/**
* Template für die Produkttabelle im Backend der Bestellverwaltung
*/
-
+
$arCalculation = $this->view['oCalculation']->getCalculationArray(true);
$arTax = $this->view['oCalculation']->getTaxLabelArray();
$arTaxShort = $this->view['oCalculation']->getTaxLabelArray(true);
@@ -15,16 +15,24 @@
if ($this->getBackendTaxView() === WPSG_NETTO) $display = 'netto';
else $display = 'brutto';
-
+
?>
<style>
.wpsg_row_small td { font-size:0.8em; }
#wpsg-bs .wpsg_row_small .wpsg-glyphlink-td > span { margin-top:0px; }
+ /*.wpsg_productrow_add td { border-top:0px !important; }*/
</style>
+<?php echo wpsg_drawForm_Select('tax_mode', __('Besteuerung'), [
+ \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS => __('Kleinunternehmerregelung'),
+ \wpsg\wpsg_calculation::TAXMODE_B2C => __('Endkundenbesteuerung'),
+ \wpsg\wpsg_calculation::TAXMODE_B2B => __('Firmenkundenbesteuerung')
+ ], $this->view['oCalculation']->getTaxMode(), ['onchange' => 'WPSG_BE.updateCalculation();']); ?>
+
+<br />
<table class="wpsg_produkte table">
<thead>
@@ -43,13 +51,21 @@
<tr><td colspan="<?php echo $this->view['colspan'] + 1; ?>" style="line-height:2px; height:2px; background-color:#999999; padding:0px;"></td></tr>
<?php $i = 0; foreach ($arCalculation['product'] as $p) { $i ++; $product_price = $p[$display]; ?>
<tr class="wpsg_<?php echo (($i % 2 == 0)?'odd':'even'); ?>">
- <td class="wpsg_cell_name">
+ <td colspan="<?php echo $this->view['colspan'] + 1; ?>">
+
+ <?php if (wpsg_isTrue($p['eu'])) { ?>
+ <img src="<?php echo WPSG_URL; ?>views/gfx/eu.png" alt="<?php echo __('Produkt unterliegt der EU-Leistungsortregel', 'wpsg'); ?>" title="<?php echo __('Produkt unterliegt der EU-Leistungsortregel', 'wpsg'); ?>" height="14" />
+ <?php } ?>
+
<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id=<?php echo $p['product_id']; ?>" title="<?php echo __('Zum Produkt', 'wpsg'); ?>">
<?php echo wpsg_hspc($this->getProductName($p['product_id'])); ?>
</a>
<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Produkt bearbeiten', 'wpsg'); ?>" onclick="return WPSG_BE_Product.editProduct(<?php echo $p['order_product_id']; ?>);"><span class="glyphicon glyphicon-pencil"></span></a>
- <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Produkt löschen', 'wpsg'); ?>" onclick="return WPSG_BE_Product.remvoeProduct(<?php echo $p['order_product_id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
+ <a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Produkt löschen', 'wpsg'); ?>" onclick="return WPSG_BE_Product.removeProduct(<?php echo $p['order_product_id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
</td>
+ </tr>
+ <tr class="wpsg_<?php echo (($i % 2 == 0)?'odd':'even'); ?> wpsg_productrow_add">
+ <td class="wpsg_cell_name"></td>
<td class="wpsg_cell_preis"><?php echo wpsg_ff($product_price); ?> <?php echo $this->get_option('wpsg_currency'); ?></td>
<?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
<td class="wpsg_cell_mwst"><?php echo $arTaxShort[$p['tax_key']]; ?></td>
@@ -275,5 +291,4 @@
</tbody>
</table>
-
-<?php wpsg_debug($arCalculation); ?> \ No newline at end of file
+ \ No newline at end of file
diff --git a/views/order/view.phtml b/views/order/view.phtml
index df563f5..5908c22 100644
--- a/views/order/view.phtml
+++ b/views/order/view.phtml
@@ -103,6 +103,14 @@
<div class="wpsg_admin_content form-horizontal">
+ <?php if ($this->view['oCalculation']->restored) { ?>
+
+ <div id="restored_notice">
+ <strong>Die Berechnung dieser Bestellung wurde rekonstruiert, da zum Bestellzeitpunkt nicht alle Shop Einstellungen erfasst wurden. Bitte überprüfen sie die Berechnung und vergleichen diese ggf. mit dem Bestellprotokoll. </strong>
+ </div>
+
+ <?php } ?>
+
<?php $i = 0; foreach ($this->view['arSubAction'] as $k => $v) { $i ++; ?>
<div id="tab<?php echo $k; ?>" style="display:<?php echo ((wpsg_getStr($_COOKIE['wpsg_order_view_tab'], 'general') == $k)?'block':'none'); ?>;" class="wpsg_order_view_tab_content">
diff --git a/views/order/view_customerdata.phtml b/views/order/view_customerdata.phtml
index 0b89194..30cfad4 100644
--- a/views/order/view_customerdata.phtml
+++ b/views/order/view_customerdata.phtml
@@ -137,11 +137,11 @@
<?php echo wpsg_drawForm_Text(__('Telefon', 'wpsg'), $this->view['data']['tel'], array('text' => true)); ?>
<?php } ?>
<?php } ?>
- <?php if ($this->view['pflicht']['ustidnr'] != '2') { ?>
- <?php if (strlen($this->view['data']['ustidnr']) > 0) { ?>
- <?php echo wpsg_drawForm_Text(__('UStIdNr.', 'wpsg'), $this->view['data']['ustidnr'], array('text' => true)); ?>
- <?php } ?>
- <?php } ?>
+
+
+ <?php echo wpsg_drawForm_Text(__('UStIdNr.', 'wpsg'), $this->view['data']['ustidnr'], array('text' => true)); ?>
+ <br />
+
<?php $this->callMods('wpsg_order_view_customerdata', array(&$this->view['data']['id'])); ?>
<?php echo wpsg_drawForm_TextStart(); ?>
diff --git a/views/order/view_orderdata.phtml b/views/order/view_orderdata.phtml
index 84c6dc2..69df736 100644
--- a/views/order/view_orderdata.phtml
+++ b/views/order/view_orderdata.phtml
@@ -17,6 +17,32 @@
<script type="text/javascript">
+ var WPSG_BE = {
+
+ updateCalculation: function() {
+
+ var tax_mode = jQuery('#tax_mode').val();
+
+ 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=updateCalculation&noheader=1&edit_id=<?php echo $_REQUEST['edit_id']; ?>',
+ data: {
+ tax_mode: tax_mode
+ },
+ success: function(data) {
+
+ jQuery('#wpsg_product_table_wrap').html(data.product_table);
+
+ }
+ } );
+
+ return false;
+
+ }
+
+ };
+
var WPSG_BE_Pay_Ship = {
changeShippingPayment: function (id, oid) {
@@ -90,8 +116,8 @@
return false;
},
-
- remvoeProduct: function(order_product_id) {
+
+ removeProduct: function(order_product_id) {
jQuery('#wpsg_product_table_wrap').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');