From 35950a969ca233e26397e512fcdce53f9a840c27 Mon Sep 17 00:00:00 2001 From: karl Date: Mon, 19 Jun 2023 07:00:27 +0000 Subject: - Bugfix: Modul Rechnungen: standard Rechnungspdf - Darstellung der MwSt. wurde korrigiert git-svn-id: https://[internal]/wordpress/plugins/wpsg4@8301 0d5edaf7-2b12-4e95-93f4-047927463d4b --- views/mods/mod_rechnungen/invoice_pdf.phtml | 65 +++++++++++++++++------------ 1 file changed, 39 insertions(+), 26 deletions(-) (limited to 'views') diff --git a/views/mods/mod_rechnungen/invoice_pdf.phtml b/views/mods/mod_rechnungen/invoice_pdf.phtml index 4f49dad..89fb3b5 100644 --- a/views/mods/mod_rechnungen/invoice_pdf.phtml +++ b/views/mods/mod_rechnungen/invoice_pdf.phtml @@ -34,9 +34,6 @@ $arCalculation = $this->view['basket']['arCalculation']; - if ($this->getFrontendTaxView() === WPSG_NETTO) $taxdisplay = 'netto'; - else $taxdisplay = 'brutto'; - // Damit die Steuer bei der Kleinunternehmerregelung nicht angezeigt wird leer ich den Array sicherheitshalber if ( ($this->get_option('wpsg_kleinunternehmer') == '1') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) ) unset($this->view['basket']['mwst']); @@ -203,12 +200,16 @@ $shipping_cost = $this->view['basket']['arCalculation']['sum']['shipping_netto']; $payment_cost = $this->view['basket']['arCalculation']['sum']['payment_netto']; + $taxdisplay = 'netto'; + } else { $discount_value = abs($this->view['basket']['arCalculation']['sum']['discount_brutto']); $shipping_cost = $this->view['basket']['arCalculation']['sum']['shipping_brutto']; $payment_cost = $this->view['basket']['arCalculation']['sum']['payment_brutto']; + $taxdisplay = 'brutto'; + } $summe = 0; @@ -480,7 +481,7 @@ $gs_value_einzel = wpsg_ff($v[$taxdisplay.'_single'], $this->get_option('wpsg_currency')); $gs_value_gesamt = wpsg_ff($v[$taxdisplay], $this->get_option('wpsg_currency')); - + $pdf->setXY($prod_left + 127, $prod_top + $offset); $pdf->Cell(25, 8, $gs_value_einzel, 1, 0, 'R'); @@ -507,11 +508,20 @@ if ($bTaxCol) { - if ($this->arShipping[$this->view['data']['type_shipping']]['mwst_null'] == '1' && $bNoTax) $mwst = wpsg_ff(0.00, '%'); - else { + // if ($this->arShipping[$this->view['data']['type_shipping']]['mwst_null'] == '1' && $bNoTax) + // { + if ($bNoTax) + { + + $mwst = wpsg_ff(0.00, '%'); + + } else { - if ($this->view['basket']['arCalculation']['shipping'][0]['tax_key'] === '0') $mwst = _('anteilig'); - else { + if ($this->view['basket']['arCalculation']['shipping'][0]['tax_key'] === '0') { + + $mwst = _('anteilig'); + + } else { $mwst = wpsg_ff($this->view['basket']['arCalculation']['shipping'][0]['tax'], '%'); $mwst = wpsg_ff($this->view['basket']['arCalculation']['tax'][$this->view['basket']['arCalculation']['shipping'][0]['tax_key']]['tax_value'], '%'); @@ -552,7 +562,9 @@ if ($bTaxCol) { - if ($this->arPayment[$this->view['data']['type_payment']]['mwst_null'] == '1' && $bNoTax) + // if ($this->arPayment[$this->view['data']['type_payment']]['mwst_null'] == '1' && $bNoTax) + // { + if ($bNoTax) { $mwst = wpsg_ff(0.00, '%'); @@ -639,7 +651,20 @@ $pdf->Cell(37, 8, $this->view['kunde']['ustidnr'], 0, 0, 'R'); } - $offset += 10; // Abstand zwischen Tabelle und Auswertung + $offset += 5; // Abstand zwischen Tabelle und Rabatt + + // Rabatt + if ($discount_value > 0) + { + + $offset += 5; + $pdf->Text($prod_left + 80, $prod_top + $offset, __("Rabatt", "wpsg")); + $pdf->setXY($prod_left + 140, $prod_top + $offset - 5); + $pdf->Cell(37, 8, '-'.wpsg_ff($discount_value, $this->get_option('wpsg_currency')), 0, 0, 'R'); + + } + + $offset += 5; // Abstand zwischen Rabatt und Auswertung if ( ($this->get_option('wpsg_kleinunternehmer') == '1') || ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS) ) { @@ -647,19 +672,18 @@ $pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':'); $pdf->Text($prod_left + 80, $prod_top + $offset, __("Summe", "wpsg")); $pdf->setXY($prod_left + 140, $prod_top + $offset - 5); - $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'] + $this->view['basket']['arCalculation']['sum']['discount_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R'); + $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R'); if ( !$bNoTax || ($arCalculation['sum']['topay_brutto'] != $arCalculation['sum']['brutto']) ) $offset += 5; } else { if ($bNoTax) { - + $pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':'); $pdf->Text($prod_left + 80, $prod_top + $offset, __("Summe", "wpsg")); $pdf->setXY($prod_left + 140, $prod_top + $offset - 5); - $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'] + $this->view['basket']['arCalculation']['sum']['discount_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R'); - //if ( !$bNoTax || ($arCalculation['sum']['topay_brutto'] != $arCalculation['sum']['brutto']) ) + $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R'); $offset += 5; if ( !(($this->view['oOrder']->isInnerEu() || $deliverycountrytax) && ($this->view['oCalculationOrder']->getTaxMode() === \wpsg\wpsg_calculation::TAXMODE_B2B)) ) { @@ -704,7 +728,7 @@ $pdf->Text($prod_left + 80, $prod_top + $offset, __("NETTOBETRAG", "wpsg")); $pdf->setXY($prod_left + 140, $prod_top + $offset - 5); - $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['netto'] + $this->view['basket']['arCalculation']['sum']['discount_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R'); + $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['arCalculation']['sum']['topay_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R'); if (sizeof($this->view['basket']['arCalculation']['tax']) >= 1) { @@ -741,17 +765,6 @@ } } - - // Rabatt - if ($discount_value > 0) - { - - $offset += 5; - $pdf->Text($prod_left + 80, $prod_top + $offset, __("Rabatt", "wpsg")); - $pdf->setXY($prod_left + 140, $prod_top + $offset - 5); - $pdf->Cell(37, 8, '-'.wpsg_ff($discount_value, $this->get_option('wpsg_currency')), 0, 0, 'R'); - - } // Wertgutschein if ( $arCalculation['sum']['topay_brutto'] != $arCalculation['sum']['brutto'] ) { -- cgit v1.2.3