From 47345df99cd7545aee11ab184cef3665b64e9510 Mon Sep 17 00:00:00 2001 From: Daniel Schmitzer Date: Fri, 10 Jun 2022 14:58:03 +0000 Subject: - Backup git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8010 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/js/admin.js | 2 + views/mods/mod_rechnungen/order_view.phtml | 342 +++---------------- .../order_view_orderdata_after.phtml | 378 +++++++++++++-------- views/mods/mod_rechnungen/order_view_row.phtml | 74 ++-- 4 files changed, 324 insertions(+), 472 deletions(-) diff --git a/views/js/admin.js b/views/js/admin.js index 2e36305..cd1c4dc 100644 --- a/views/js/admin.js +++ b/views/js/admin.js @@ -109,6 +109,8 @@ jQuery.fn.wpsg_tab = function(options) { var aktTab = 1; + if (options.aktTab) aktTab = options.aktTab; + if (jQuery.cookie(options['cookiename']) != null && jQuery.cookie(options['cookiename']) > 0) { aktTab = jQuery.cookie(options['cookiename']); diff --git a/views/mods/mod_rechnungen/order_view.phtml b/views/mods/mod_rechnungen/order_view.phtml index 12b4482..9a900b3 100644 --- a/views/mods/mod_rechnungen/order_view.phtml +++ b/views/mods/mod_rechnungen/order_view.phtml @@ -5,305 +5,53 @@ */ ?> - - - - - - view['mod_rechnungen']['arRechnungen']) == 0 && sizeof($this->view['mod_rechnungen']['arRechnungen_storno']) == 0) { ?> + +
+ + + + view['mod_rechnungen']['arRechnungen']) == 0 && sizeof($this->view['mod_rechnungen']['arRechnungen_storno']) == 0) { ?> +

- - - view['mod_rechnungen']['arRechnungen_gesamt'] as $r) { ?> - - - - - -
# - - - - - - - - - - - - - - callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'], true)).'R'.$r['rnr'].'.pdf'; - } - else if ($r['gnr'] != "") - { - $rfile = $this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'], true)).'G'.$r['gnr'].'.pdf'; - } - + + + +
+ + view['mod_rechnungen']['arRechnungen_gesamt'] as $r) { + + $oInvoice = \wpsg\wpsg_invoice::getInstance($r['id']); + ?> - -   - - -
-
- - - view['mod_rechnungen']['arRechnungen']) > 0 && sizeof($this->view['mod_rechnungen']['arRechnungen_gesamt']) != sizeof($this->view['mod_rechnungen']['arRechnungen_storno'])) { ?> -
- -
-
- - view['data']['id']); ?> - - - -
-
-
- -
-
- - -
- - -
- -
- - view['data']['id']); ?> - - - - - -
- - - get_option("wpsg_rechnungen_faelligkeit") * 86400)); ?>" /> -
- - - -
- - -
- - - " /> -
- - - - get_option("wpsg_rechnungen_footer"); +
+ getNr(true); ?> +
+
- 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'); - - ?> - - 0) { ?> - - - -
-
-
- - - - " /> - " /> - -
- - +   + +
+ + +
-
- - - - \ No newline at end of file + + + + + +
+ + \ 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 index 0decca8..d202652 100755 --- a/views/mods/mod_rechnungen/order_view_orderdata_after.phtml +++ b/views/mods/mod_rechnungen/order_view_orderdata_after.phtml @@ -23,189 +23,260 @@ $default = $this->get_option('wpsg_rechnungen_foottext_standard'); + /** @var \wpsg\wpsg_invoice[] $arInvoice */ + $arInvoice = $this->callMod('wpsg_mod_rechnungen', 'getInvoiceToOrder', [$oOrder->getId()]); + + $bCanInvoice = false; + $bCanStorno = false; + + foreach ($oOrder->getOrderProducts() as $oOrderProduct) { + + if ($this->callMod('wpsg_mod_rechnungen', 'getAmountToInvoice', [$oOrderProduct]) > 0) { + + $bCanInvoice = true; + + } + + if ($this->callMod('wpsg_mod_rechnungen', 'getAmountToStorno', [$oOrderProduct]) > 0) { + + $bCanStorno = true; + + } + + if ($bCanInvoice && $bCanStorno) break; + + } + + $act = 0; + + if ($bCanInvoice) $act = 1; + else if ($bCanStorno) $act = 2; + ?>
-
- -
- - view['data']['id']); ?> - - - - - - + +
- - - - - - - - - - - - - - - - - - - - - - 0) { ?> - - - - - - - + + + + +
+ + + +
- +
- - ?>'; }, 1000);" name="wpsg_rechnungen_write" type="submit" value="Rechnung schreiben"> + view['data']['id']); - - - + $arInvoiceLabel = []; + + foreach ($arInvoice as $oInvoice) { + + if ($oInvoice->isStorno() && $oInvoice->getMeta('include_shipping', false, '0') === '1') { + + $arInvoiceLabel[] = $oInvoice->getNr(true); -
- -
- -
- -
- - view['data']['id']); ?> - - - - - - - - - - - - - - - - - - - + } + + } - - + + + - - - + if (sizeof($arInvoiceLabel) > 0) { + + echo wpsg_translate(__(' (Enthalten in #1#)', 'wpsg'), implode(', ', $arInvoiceLabel)); + + } + + ?> + + + + + + + + + + + + + + + + + + + + +
- - -
+
+
@@ -230,14 +301,19 @@ .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; } + label[for="invoice_shippay"] .link_invoice, + label[for="storno_shippay"] .link_invoice { padding:0; } + + .wpsg_mod_rechnungen_row { display:block; width:100%; padding:5px; } + .wpsg_mod_rechnungen_row .invoice_wrap:not(:only-child) { margin-top:0.5rem; } + .wpsg_mod_rechnungen_row .invoice_wrap > a:first-child { padding-left:0; } \ 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 index 5ab2eab..97e2667 100644 --- a/views/mods/mod_rechnungen/order_view_row.phtml +++ b/views/mods/mod_rechnungen/order_view_row.phtml @@ -12,50 +12,76 @@ $p = $this->view['wpsg_mod_rechnungen']['product']; $product_index = $this->view['wpsg_mod_rechnungen']['product']['product_index']; - + + /** @var \wpsg\wpsg_invoice[] $arInvoice */ + $arInvoice = $this->callMod('wpsg_mod_rechnungen', 'getInvoiceToOrderProduct', [$oOrderProduct]); + $arInvoiceInvoice = []; + $arInvoiceStorno = []; + + foreach ($arInvoice as $oInvoice) { + + if ($oInvoice->isStorno()) $arInvoiceStorno[] = $oInvoice; + else if ($oInvoice->isInvoice()) $arInvoiceInvoice[] = $oInvoice; + + } + ?> -
- + + +
- callMod('wpsg_mod_rechnungen', 'getInvoiceToOrderProduct', [$oOrderProduct]); ?> - 0) { ?> -
- - getNr(true); ?> + 0) { ?> +
+ : + + getNr(true, $oOrderProduct); ?> + +
-
- + + + \ No newline at end of file -- cgit v1.2.3