From cc80695ec5b0d4eb7d243380962f9492d421604e Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Fri, 29 May 2020 16:08:22 +0200 Subject: [PATCH] =?UTF-8?q?Unterschriftsfeld=20auf=20Anlieferung=20eingef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pdf/pdf_thwsupplierorder.modules.php | 216 ++---------------- 1 file changed, 17 insertions(+), 199 deletions(-) diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_thwsupplierorder.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_thwsupplierorder.modules.php index 5b15b08..a6e54a0 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_thwsupplierorder.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_thwsupplierorder.modules.php @@ -126,7 +126,7 @@ class pdf_thwsupplierorder extends ModelePDFSuppliersOrders { $langs->loadLangs(array("main", "bills")); $this->db = $db; - $this->name = "thwsupplierorder"; + $this->name = "THW-Anlieferung"; $this->description = $langs->trans('SuppliersCommandModel'); // Page size for A4 format @@ -300,7 +300,7 @@ class pdf_thwsupplierorder extends ModelePDFSuppliersOrders { $pdf=pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $heightforinfotot = /*50*/0; // Height reserved to output the info and total part + $heightforinfotot = 20; // Height reserved to output the info and total part $heightforfreetext= /*(isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5)*/0; // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) { @@ -651,7 +651,7 @@ class pdf_thwsupplierorder extends ModelePDFSuppliersOrders { //$posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs); // Affiche zone totaux - //$posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); + $posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs); // Affiche zone versements if ($deja_regle || $amount_credit_notes_included || $amount_deposits_included) @@ -791,205 +791,23 @@ class pdf_thwsupplierorder extends ModelePDFSuppliersOrders { * @return int Position pour suite */ protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) { - // phpcs:enable - global $conf,$mysoc; + $tab2_top = $posy; + $tab2_hl = 4; + $index = 0; - $default_font_size = pdf_getPDFFontSize($outputlangs); - - $tab2_top = $posy; - $tab2_hl = 4; - $pdf->SetFont('', '', $default_font_size - 1); - - // Tableau total - $col1x = 120; $col2x = 170; - if ($this->page_largeur < 210) // To work with US executive format - { - $col2x-=20; - } - $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x); - - $useborder=0; - $index = 0; - - // Total HT - $pdf->SetFillColor(255, 255, 255); - $pdf->SetXY($col1x, $tab2_top + 0); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); - - $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); - $pdf->SetXY($col2x, $tab2_top + 0); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1); - - // Show VAT by rates and total - $pdf->SetFillColor(248, 248, 248); - - $this->atleastoneratenotnull=0; - foreach($this->tva as $tvakey => $tvaval) - { - if ($tvakey > 0) // On affiche pas taux 0 - { - $this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - - if (preg_match('/\*/', $tvakey)) - { - $tvakey=str_replace('*', '', $tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - - $totalvat =$outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' '; - $totalvat.=vatrate($tvakey, 1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); - } - } - if (! $this->atleastoneratenotnull) // If no vat at all - { - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); - - // Total LocalTax1 - if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0) - { - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); - } - - // Total LocalTax2 - if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0) - { - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', 1); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); - } - } - else - { - //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') - //{ - //Local tax 1 - foreach($this->localtax1 as $localtax_type => $localtax_rate) - { - if (in_array((string) $localtax_type, array('2','4','6'))) continue; - - foreach($localtax_rate as $tvakey => $tvaval) - { - if ($tvakey != 0) // On affiche pas taux 0 - { - //$this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/', $tvakey)) - { - $tvakey=str_replace('*', '', $tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - $totalvat =$outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; - $totalvat.=vatrate(abs($tvakey), 1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } - } - } - - //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') - //{ - //Local tax 2 - foreach($this->localtax2 as $localtax_type => $localtax_rate) - { - if (in_array((string) $localtax_type, array('2','4','6'))) continue; - - foreach($localtax_rate as $tvakey => $tvaval) - { - if ($tvakey != 0) // On affiche pas taux 0 - { - //$this->atleastoneratenotnull++; - - $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - - $tvacompl=''; - if (preg_match('/\*/', $tvakey)) - { - $tvakey=str_replace('*', '', $tvakey); - $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; - } - $totalvat =$outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; - $totalvat.=vatrate(abs($tvakey), 1).$tvacompl; - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); - } - } - } - } - - // Total TTC + $pdf->SetTextColor(0, 0, 0); + $pdf->SetFillColor(255, 255, 255); + + $index++; $index++; - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); - - $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); - $pdf->SetFont('', '', $default_font_size - 1); - $pdf->SetTextColor(0, 0, 0); - - $creditnoteamount=0; - $depositsamount=0; - //$creditnoteamount=$object->getSumCreditNotesUsed(); - //$depositsamount=$object->getSumDepositsUsed(); - //print "x".$creditnoteamount."-".$depositsamount;exit; - $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); - if (! empty($object->paye)) $resteapayer=0; - - if ($deja_regle > 0) - { - // Already paid + Deposits - $index++; - - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0); - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); - - $index++; - $pdf->SetTextColor(0, 0, 60); - $pdf->SetFillColor(224, 224, 224); - $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); - - $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1); - - $pdf->SetFont('', '', $default_font_size - 1); - $pdf->SetTextColor(0, 0, 0); - } - $index++; + + $pdf->SetXY(130, $tab2_top + $tab2_hl * $index); + $pdf->MultiCell(0, $tab2_hl, "Unterschrift Kontrolle", 0, 'L', 1); + + $h = $tab2_top + $tab2_hl * ($index - 0.2); + $pdf->Line(130, $h, 190, $h); + return ($tab2_top + ($tab2_hl * $index)); }