From fe6ad89ca3de920ba60447c08fc8fc1687ce5f76 Mon Sep 17 00:00:00 2001 From: karl Date: Tue, 23 Aug 2022 07:32:50 +0000 Subject: - 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8083 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_rechnungen/multi_invoice_pdf.phtml | 79 ++++++++++++---------- views/mods/mod_rechnungen/multi_invoicemail.phtml | 27 ++++++++ .../mod_rechnungen/multi_invoicemail_html.phtml | 29 ++++++++ views/order/index.phtml | 4 +- 4 files changed, 102 insertions(+), 37 deletions(-) (limited to 'views') 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('/\
/', $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 @@ +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); + +?>view['kunde']['title']], $this->view['kunde']['vname'], $this->view['kunde']['name']); ?> + + + view['arCalculationSum']['sum']['topay_brutto'], $this->get_option('wpsg_currency')); ?> . +callMods('wpsg_mod_rechnungen_mail'); ?> + + + +get_option('wpsg_shopdata_name'), '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 @@ +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); + +?>

view['kunde']['vname']; ?> view['kunde']['name']; ?>,

+ +

view['arCalculationSum']['sum']['topay_brutto'], $this->get_option('wpsg_currency')); ?> .

+ +callMods('wpsg_mod_rechnungen_mail'); ?> + +

+ +

get_option('wpsg_shopdata_name'), 'wpsg'); ?> -

\ 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 @@