diff options
| author | karl <noreply@maennchen1.de> | 2022-08-23 07:32:50 +0000 |
|---|---|---|
| committer | karl <noreply@maennchen1.de> | 2022-08-23 07:32:50 +0000 |
| commit | fe6ad89ca3de920ba60447c08fc8fc1687ce5f76 (patch) | |
| tree | a3d1e647296167d7a8b2587b035517ba9a30cde0 /views | |
| parent | 7e72d348b3c9d4159013aed9d27839d45df15355 (diff) | |
- Bugfix: Sammelrechnungspdf wird nicht im Dateisystem abgelegt
- Bugfix: Sammelrechnungsemails zeigen nun alle Bestell und Kundendaten an
- Bugfix: Im Erstellformular der Sammelrechnung wird nun die E-Mail Adresse des entsprechenden Kunden vorausgewählt
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8083 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views')
| -rw-r--r-- | views/mods/mod_rechnungen/multi_invoice_pdf.phtml | 79 | ||||
| -rw-r--r-- | views/mods/mod_rechnungen/multi_invoicemail.phtml | 27 | ||||
| -rw-r--r-- | views/mods/mod_rechnungen/multi_invoicemail_html.phtml | 29 | ||||
| -rw-r--r-- | views/order/index.phtml | 4 |
4 files changed, 102 insertions, 37 deletions
diff --git a/views/mods/mod_rechnungen/multi_invoice_pdf.phtml b/views/mods/mod_rechnungen/multi_invoice_pdf.phtml index a7ced2e..c9b7481 100644 --- a/views/mods/mod_rechnungen/multi_invoice_pdf.phtml +++ b/views/mods/mod_rechnungen/multi_invoice_pdf.phtml @@ -135,7 +135,7 @@ $pdf->Text($rdata_left + 55, $rdata_top + 6, (($shop->view['kunde']['knr'] != '')?$shop->view['kunde']['knr']:$shop->view['kunde']['id']));
// Datum
- $pdf->Text($rdata_left + 75, $rdata_top, __("Datum", "wpsg"));
+ $pdf->Text($rdata_left + 75, $rdata_top, __("Rechnungsdatum", "wpsg"));
$pdf->Text($rdata_left + 75, $rdata_top + 6, $shop->view['rDatum']);
// InnerEu Hinweistext
@@ -144,6 +144,8 @@ $pdf->SetFont('Arial', '', 9);
$pdf->Text($adress_left, $rdata_top + 11.5, __("Innergemeinschaftliche Lieferung.", "wpsg"));
+ $offset += 11.5;
+
}
// Benutzerdefinierte Felder
@@ -168,11 +170,6 @@ }
- // wpsg_debug($this->view['basket']); // DEBUG
- // wpsg_debug($this->view['kunde']); // DEBUG
- // wpsg_debug($this->view['data']); // DEBUG
- // wpsg_debug($this->view['multi_data']['orders']); // DEBUG
-
$pdf = new wpsg_fpdf();
$pdf->SetAutoPageBreak(false, 5);
AddRechnungPage($this, $pdf);
@@ -192,9 +189,14 @@ $rhead_count = 1;
$sum_multi_offset = 0;
$orders = $this->view['multi_data']['orders'];
-
+
// noMwSt
- $bNoTax = false;
+ $head_data = array_values($this->view['multi_data']['order_data'])[0];
+ if ($this->view['kunde']['ustidnr'] != "" && $head_data['oCalculation']->getTaxMode() === '3' && $shop->view['oOrder']->isInnerEu()) {
+ $bNoTax = true;
+ } else {
+ $bNoTax = false;
+ }
$bTaxCol = false;
if ($this->get_option('wpsg_showMwstAlways') === '1') $bTaxCol = true;
@@ -224,9 +226,13 @@ $rhead_count++;
$pdf->SetFont('Arial', '', 9);
+ // Bestelltag anzeigen
+ $pdf->Text($rhead_left + 85, $rhead_top + $sum_multi_offset, __("Bestelldatum", "wpsg"));
+ $pdf->Text($rhead_left + 85, $rhead_top + $sum_multi_offset + 6, date("d.m.Y", strtotime($oOrder->cdate)));
+
// Zahlungsbedingung anzeigen
- $pdf->Text($rhead_left + 100, $rhead_top + $sum_multi_offset, __("Zahlungsbedingungen", "wpsg"));
- $pdf->Text($rhead_left + 100, $rhead_top + $sum_multi_offset + 6, $oOrder->getPaymentLabel());
+ $pdf->Text($rhead_left + 115, $rhead_top + $sum_multi_offset, __("Zahlungsbedingungen", "wpsg"));
+ $pdf->Text($rhead_left + 115, $rhead_top + $sum_multi_offset + 6, $oOrder->getPaymentLabel());
// Bestellnummer anzeigen
$pdf->Text($rhead_left + 155, $rhead_top + $sum_multi_offset, __("Best. Nr.", "wpsg"));
@@ -284,16 +290,16 @@ }
- if ($this->get_option('wpsg_rechnungen_pdetailname' == '1')) {
+ if ($this->get_option('wpsg_rechnungen_pdetailname') == '1') {
$produkt_text = $this->getProductName($product_id, true);
} else {
-
+
$produkt_text = $this->getProductName($product_id, false);
}
-
+
$produktBeschreibung = trim(strip_tags($oOrderProduct->getProduct()->getShortDescription()));
if ($this->isOtherLang()) {
@@ -322,9 +328,13 @@ foreach ($arPV as $pv) {
- $produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
- $height += 5;
+ if ($pv['value'] != '') {
+
+ $produkt_text .= "\r\n".$pv['name'].': '.$pv['value'];
+ $height += 5;
+ }
+
}
}
@@ -370,7 +380,7 @@ * 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($oOrderProduct->getShortDescription())) != '') {
$produktBeschreibung = nl2br($produktBeschreibung);
preg_match_all('/\<br \/\>/', $produktBeschreibung, $treffer);
@@ -395,7 +405,7 @@ */
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($oOrderProduct->getId())));
foreach ($attributeInfo as $pa) {
@@ -408,9 +418,9 @@ /**
* Variante ?
*/
- if (preg_match('/pv_(.*)/', $p['productkey'])) {
+ if (preg_match('/pv_(.*)/', $oOrderProduct->getProductKey())) {
- $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($p['productkey']));
+ $variInfo = $this->callMod('wpsg_mod_productvariants', 'getVariantenInfoArray', array($oOrderProduct->getProductKey()));
$height += $pdf->wpsg_MultiCell($prod_left + 10, $prod_top + $height + $offset - 0.5 + $sum_multi_offset, 5, wpsg_translate(__('Variante: #1#', 'wpsg'), $variInfo['key']), 0, 'L', 0, $produkt_text_cell_width);
@@ -523,7 +533,7 @@ if ($bNoTax) {
- $mwst = 0;
+ $mwst = wpsg_ff('0.00', '%');
} else {
@@ -574,7 +584,7 @@ if ($bNoTax) {
- $mwst = 0;
+ $mwst = wpsg_ff('0.00', '%');
} else {
@@ -679,7 +689,7 @@ if ($bNoTax) {
- $mwst = 0;
+ $mwst = wpsg_ff('0.00', '%');
} else {
@@ -758,12 +768,12 @@ if ($bNoTax) {
$pdf->Text($prod_left, $prod_top + $offset + 10, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
- $pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("BRUTTOBETRAG", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("BRUTTOBETRAG GESAMT", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
$offset += 5;
- $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. GESAMT", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -775,21 +785,18 @@ $pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
$pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
- if (sizeof($arCalculation['tax']) >= 1) {
-
- foreach ($arCalculation['tax'] as $k => $mw) {
-
- if ($k === 0) continue;
+ // if (sizeof($arCalculation['tax']) >= 1) {
+ // foreach ($arCalculation['tax'] as $k => $mw) {
+ // if ($k === 0) continue;
- $offset += 5;
+ // $offset += 5;
- $pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. ", "wpsg").wpsg_ff($mw['tax_value'], '%'));
- $pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
- $pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ // $pdf->Text($prod_left + 80, $prod_top + $offset + 10, __("MwSt. ", "wpsg").wpsg_ff($mw['tax_value'], '%'));
+ // $pdf->setXY($prod_left + 140, $prod_top + $offset + 10 - 5);
+ // $pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
- }
-
- }
+ // }
+ // }
if (sizeof($arCalculation['tax']) > 1) {
diff --git a/views/mods/mod_rechnungen/multi_invoicemail.phtml b/views/mods/mod_rechnungen/multi_invoicemail.phtml index e69de29..9e0c31e 100644 --- a/views/mods/mod_rechnungen/multi_invoicemail.phtml +++ b/views/mods/mod_rechnungen/multi_invoicemail.phtml @@ -0,0 +1,27 @@ +<?php
+
+ /**
+ * Template für die Mail, die beim Schreiben einer Rechnung optional an den Kunden versendet werden kann
+ */
+
+ $arPflicht = $this->loadPflichtFeldDaten();
+ $arTitle = explode('|', $arPflicht['anrede_auswahl']);
+
+ foreach ($this->view['multi_data']['order_data'] as $order_data) {
+
+ $oOrder = $order_data['oOrder'];
+ $str['onr'][] = intval($oOrder->getNr());
+
+ }
+
+ //wpsg_debug($this->view);
+
+?><?php echo wpsg_translate(__('Hallo #1# #2# #3#,', 'wpsg'), @$arTitle[$this->view['kunde']['title']], $this->view['kunde']['vname'], $this->view['kunde']['name']); ?>
+
+
+<?php echo __("Sie erhalten hiermit Ihre Sammelrechnung in Höhe von", "wpsg"); ?> <?php echo wpsg_ff($this->view['arCalculationSum']['sum']['topay_brutto'], $this->get_option('wpsg_currency')); ?> <?php echo __("für Ihre Bestellungen mit den Bestellnummern:", "wpsg"); ?> <?php echo implode(',', $str['onr']); ?>.
+<?php $this->callMods('wpsg_mod_rechnungen_mail'); ?>
+
+<?php echo __("Mit freundlichen Grüßen", "wpsg"); ?>
+
+<?php echo __($this->get_option('wpsg_shopdata_name'), 'wpsg'); ?> - <?php echo __('Team', 'wpsg'); ?>
\ No newline at end of file diff --git a/views/mods/mod_rechnungen/multi_invoicemail_html.phtml b/views/mods/mod_rechnungen/multi_invoicemail_html.phtml index e69de29..8e2b02e 100644 --- a/views/mods/mod_rechnungen/multi_invoicemail_html.phtml +++ b/views/mods/mod_rechnungen/multi_invoicemail_html.phtml @@ -0,0 +1,29 @@ +<?php
+
+ /**
+ * Template für die Mail, die beim Schreiben einer Rechnung optional an den Kunden versendet werden kann (HTML)
+ */
+
+ include(WPSG_PATH_VIEW . 'mailtemplates/html/logo.phtml');
+
+ /* Wichtig, da die Module sonst kein HTML zurückgeben */
+ $this->htmlMail = true;
+
+ foreach ($this->view['multi_data']['order_data'] as $order_data) {
+
+ $oOrder = $order_data['oOrder'];
+ $str['onr'][] = intval($oOrder->getNr());
+
+ }
+
+ //wpsg_debug($this->view);
+
+?><p><?php echo __("Hallo", "wpsg"); ?> <?php echo $this->view['kunde']['vname']; ?> <?php echo $this->view['kunde']['name']; ?>,</p>
+
+<p><?php echo __("Sie erhalten hiermit die Sammelrechnung in Höhe von", "wpsg"); ?> <?php echo wpsg_ff($this->view['arCalculationSum']['sum']['topay_brutto'], $this->get_option('wpsg_currency')); ?> <?php echo __("für Ihre Bestellungen mit den Bestellnummern:", "wpsg"); ?> <?php echo implode(',', $str['onr']); ?>.</p>
+
+<?php $this->callMods('wpsg_mod_rechnungen_mail'); ?>
+
+<p><?php echo __("Mit freundlichen Grüßen", "wpsg"); ?></p>
+
+<p><?php echo __($this->get_option('wpsg_shopdata_name'), 'wpsg'); ?> - <?php echo __('Team', 'wpsg'); ?></p>
\ No newline at end of file diff --git a/views/order/index.phtml b/views/order/index.phtml index 324438b..667dff0 100644 --- a/views/order/index.phtml +++ b/views/order/index.phtml @@ -481,10 +481,12 @@ <div class="multiRechnung_tab" id="multiRechnung_inform" style="padding: 15px 0 15px 0; display:none;">
<div style="width: 100%; padding: 1rem; display: grid; row-gap: 0.5rem; column-gap: 0.5rem; grid-template-columns: 25px 1fr 150px; align-items: center; grid-auto-rows: 30px; padding-bottom: 0.5rem;" >
+
+ <?php $oCustomer = wpsg_customer::getInstance(intval($this->view['arFilter']['k_id'])); ?>
<input type="checkbox" name="wpsg_Multirechnung_sendmail" value="1" id="invoice_sendmail" />
<label for="invoice_sendmail"><?php echo __('E-Mail an Kunden senden', 'wpsg'); ?></label>
- <input type="email" name="wpsg_Multirechnung_email" value="" />
+ <input type="email" name="wpsg_Multirechnung_email" value="<?php echo $oCustomer->getEmail(); ?>" />
<input type="checkbox" name="wpsg_Multirechnung_faelligkeit" value="1" id="invoice_faelligkeit" />
<label for="invoice_faelligkeit"><?php echo __('Fälligkeit anzeigen', 'wpsg'); ?></label>
|
