mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge 0846a1de2e into 39e8b12c6b
This commit is contained in:
commit
bbf87159e2
|
|
@ -269,13 +269,14 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
|
||||
$pdf = pdf_getInstance($this->format);
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||
$pdf->SetAutoPageBreak(1, 0);
|
||||
|
||||
$heightforinfotot = 40; // Height reserved to output the info and total part
|
||||
$heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // 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 (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) {
|
||||
$heightforfooter += 6;
|
||||
}
|
||||
$pdf->SetAutoPageBreak(1, 0);
|
||||
|
||||
if (class_exists('TCPDF')) {
|
||||
$pdf->setPrintHeader(false);
|
||||
|
|
@ -328,6 +329,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
|
||||
$tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
|
||||
|
||||
$nexY = $tab_top - 1;
|
||||
|
||||
// Incoterm
|
||||
$height_incoterms = 0;
|
||||
if (isModEnabled('incoterm')) {
|
||||
|
|
@ -337,7 +340,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
$nexY = max($pdf->GetY(), $nexY);
|
||||
$height_incoterms = $nexY - $tab_top;
|
||||
|
||||
// Rect takes a length in 3rd parameter
|
||||
|
|
@ -360,6 +363,8 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
|
||||
$pagenb = $pdf->getPage();
|
||||
if (!empty($notetoshow)) {
|
||||
$tab_top -= 2;
|
||||
|
||||
$tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
|
||||
$pageposbeforenote = $pagenb;
|
||||
|
||||
|
|
@ -368,8 +373,6 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
$notetoshow = make_substitutions($notetoshow, $substitutionarray, $outputlangs);
|
||||
$notetoshow = convertBackOfficeMediasLinksToPublicLinks($notetoshow);
|
||||
|
||||
$tab_top -= 2;
|
||||
|
||||
$pdf->startTransaction();
|
||||
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
|
|
@ -484,21 +487,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
// Use new auto column system
|
||||
$this->prepareArrayColumnField($object, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
$nexY = $tab_top + $this->tabTitleHeight;
|
||||
|
||||
$pageposbeforeprintlines = $pdf->getPage();
|
||||
$pagenb = $pageposbeforeprintlines;
|
||||
|
||||
// Show square
|
||||
if ($pagenb == $pageposbeforeprintlines) {
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code);
|
||||
$bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
} else {
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code);
|
||||
$bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
}
|
||||
|
||||
$nexY = $tab_top + $this->tabTitleHeight;
|
||||
|
||||
// Loop on each lines
|
||||
for ($i = 0; $i < $nblines; $i++) {
|
||||
$curY = $nexY;
|
||||
|
|
@ -547,20 +540,20 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
}
|
||||
|
||||
// Description of product line
|
||||
$curX = $this->posxdesc - 1;
|
||||
$showpricebeforepagebreak = 1;
|
||||
|
||||
if ($this->getColumnStatus('desc')) {
|
||||
$pdf->startTransaction();
|
||||
|
||||
$this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc, 1);
|
||||
|
||||
$pageposafter = $pdf->getPage();
|
||||
|
||||
if ($pageposafter > $pageposbefore) { // There is a pagebreak
|
||||
$pdf->rollbackTransaction(true);
|
||||
$pageposafter = $pageposbefore;
|
||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||
|
||||
$this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc, 1);
|
||||
|
||||
$pageposafter = $pdf->getPage();
|
||||
$posyafter = $pdf->GetY();
|
||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text
|
||||
|
|
@ -587,8 +580,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
$posYAfterDescription = $pdf->GetY();
|
||||
}
|
||||
|
||||
$nexY = $pdf->GetY();
|
||||
$nexY = max($pdf->GetY(), $posYAfterImage);
|
||||
|
||||
$pageposafter = $pdf->getPage();
|
||||
|
||||
$pdf->setPage($pageposbefore);
|
||||
$pdf->setTopMargin($this->marge_haute);
|
||||
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
|
||||
|
|
@ -790,6 +785,14 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
|||
}
|
||||
}
|
||||
|
||||
// Show square
|
||||
if ($pagenb == $pageposbeforeprintlines) {
|
||||
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis);
|
||||
} else {
|
||||
$this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis);
|
||||
}
|
||||
$bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
|
||||
|
||||
// Affiche zone infos
|
||||
$posy = $this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user