forked from Wavyzz/dolibarr
FIX: pdf: overlap when linked elements and incoterms/public note displayed + port PR #8155 into supplier docs & contracts
This commit is contained in:
@@ -301,18 +301,14 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
$tab_top = 90+$top_shift;
|
$tab_top = 90+$top_shift;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
||||||
$tab_height = 130-$top_shift;
|
|
||||||
$tab_height_newpage = 150;
|
|
||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift;
|
|
||||||
|
|
||||||
// Incoterm
|
// Incoterm
|
||||||
$height_incoterms = 0;
|
|
||||||
if ($conf->incoterm->enabled)
|
if ($conf->incoterm->enabled)
|
||||||
{
|
{
|
||||||
$desc_incoterms = $object->getIncotermsForPDF();
|
$desc_incoterms = $object->getIncotermsForPDF();
|
||||||
if ($desc_incoterms)
|
if ($desc_incoterms)
|
||||||
{
|
{
|
||||||
$tab_top = 88;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||||
@@ -323,8 +319,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
||||||
|
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6+$height_incoterms;
|
||||||
$height_incoterms += 4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,10 +338,10 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
if ($notetoshow)
|
if ($notetoshow)
|
||||||
{
|
{
|
||||||
$tab_top = 88 + $height_incoterms;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_note=$nexY-$tab_top;
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
@@ -354,12 +349,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_top = $nexY+6+$height_note;
|
||||||
$tab_top = $nexY+6;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$height_note=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$iniY = $tab_top + 7;
|
$iniY = $tab_top + 7;
|
||||||
|
|||||||
@@ -214,16 +214,14 @@ class pdf_strato extends ModelePDFContract
|
|||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
||||||
$tab_height = 130;
|
|
||||||
$tab_height_newpage = 150;
|
|
||||||
|
|
||||||
// Affiche notes
|
// Affiche notes
|
||||||
if (! empty($object->note_public))
|
if (! empty($object->note_public))
|
||||||
{
|
{
|
||||||
$tab_top = 88;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_note=$nexY-$tab_top;
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
@@ -231,12 +229,7 @@ class pdf_strato extends ModelePDFContract
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_top = $nexY+6+$height_note;
|
||||||
$tab_top = $nexY+6;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$height_note=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$iniY = $tab_top + 7;
|
$iniY = $tab_top + 7;
|
||||||
|
|||||||
@@ -338,18 +338,14 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
|
|
||||||
$tab_top = 90+$top_shift;
|
$tab_top = 90+$top_shift;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
||||||
$tab_height = 130-$top_shift;
|
|
||||||
$tab_height_newpage = 150;
|
|
||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift;
|
|
||||||
|
|
||||||
// Incoterm
|
// Incoterm
|
||||||
$height_incoterms = 0;
|
|
||||||
if ($conf->incoterm->enabled)
|
if ($conf->incoterm->enabled)
|
||||||
{
|
{
|
||||||
$desc_incoterms = $object->getIncotermsForPDF();
|
$desc_incoterms = $object->getIncotermsForPDF();
|
||||||
if ($desc_incoterms)
|
if ($desc_incoterms)
|
||||||
{
|
{
|
||||||
$tab_top = 88;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||||
@@ -360,8 +356,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
||||||
|
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6+$height_incoterms;
|
||||||
$height_incoterms += 4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,10 +375,10 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
if ($notetoshow)
|
if ($notetoshow)
|
||||||
{
|
{
|
||||||
$tab_top = 88 + $height_incoterms;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_note=$nexY-$tab_top;
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
@@ -391,12 +386,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_top = $nexY+6+$height_note;
|
||||||
$tab_top = $nexY+6;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$height_note=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$iniY = $tab_top + 7;
|
$iniY = $tab_top + 7;
|
||||||
|
|||||||
@@ -337,18 +337,14 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
$tab_top = 90+$top_shift;
|
$tab_top = 90+$top_shift;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
||||||
$tab_height = 130-$top_shift;
|
|
||||||
$tab_height_newpage = 150;
|
|
||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift;
|
|
||||||
|
|
||||||
// Incoterm
|
// Incoterm
|
||||||
$height_incoterms = 0;
|
|
||||||
if ($conf->incoterm->enabled)
|
if ($conf->incoterm->enabled)
|
||||||
{
|
{
|
||||||
$desc_incoterms = $object->getIncotermsForPDF();
|
$desc_incoterms = $object->getIncotermsForPDF();
|
||||||
if ($desc_incoterms)
|
if ($desc_incoterms)
|
||||||
{
|
{
|
||||||
$tab_top = 88;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||||
@@ -359,8 +355,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
||||||
|
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6+$height_incoterms;
|
||||||
$height_incoterms += 4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,10 +382,10 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
if ($notetoshow)
|
if ($notetoshow)
|
||||||
{
|
{
|
||||||
$tab_top = 88 + $height_incoterms;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_note=$nexY-$tab_top;
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
@@ -398,12 +393,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_top = $nexY+6+$height_note;
|
||||||
$tab_top = $nexY+6;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$height_note=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$iniY = $tab_top + 7;
|
$iniY = $tab_top + 7;
|
||||||
|
|||||||
@@ -260,24 +260,21 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90+$top_shift;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
||||||
$tab_height = 130;
|
|
||||||
$tab_height_newpage = 150;
|
|
||||||
|
|
||||||
// Incoterm
|
// Incoterm
|
||||||
$height_incoterms = 0;
|
|
||||||
if ($conf->incoterm->enabled)
|
if ($conf->incoterm->enabled)
|
||||||
{
|
{
|
||||||
$desc_incoterms = $object->getIncotermsForPDF();
|
$desc_incoterms = $object->getIncotermsForPDF();
|
||||||
if ($desc_incoterms)
|
if ($desc_incoterms)
|
||||||
{
|
{
|
||||||
$tab_top = 88;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||||
@@ -288,18 +285,17 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
||||||
|
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6+$height_incoterms;
|
||||||
$height_incoterms += 4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche notes
|
// Affiche notes
|
||||||
if (! empty($object->note_public))
|
if (! empty($object->note_public))
|
||||||
{
|
{
|
||||||
$tab_top = 88 + $height_incoterms;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_note=$nexY-$tab_top;
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
@@ -307,12 +303,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_top = $nexY+6+$height_note;
|
||||||
$tab_top = $nexY+6;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$height_note=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$iniY = $tab_top + 7;
|
$iniY = $tab_top + 7;
|
||||||
@@ -1080,8 +1071,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$posy+=1;
|
$posy+=1;
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
|
||||||
|
$top_shift = 0;
|
||||||
// Show list of linked objects
|
// Show list of linked objects
|
||||||
|
$current_y = $pdf->getY();
|
||||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
|
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
|
||||||
|
if ($current_y < $pdf->getY())
|
||||||
|
{
|
||||||
|
$top_shift = $pdf->getY() - $current_y;
|
||||||
|
}
|
||||||
|
|
||||||
if ($showaddress)
|
if ($showaddress)
|
||||||
{
|
{
|
||||||
@@ -1098,7 +1095,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
||||||
|
|
||||||
// Show sender
|
// Show sender
|
||||||
$posy=42;
|
$posy=42+$top_shift;
|
||||||
$posx=$this->marge_gauche;
|
$posx=$this->marge_gauche;
|
||||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
|
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
|
||||||
$hautcadre=40;
|
$hautcadre=40;
|
||||||
@@ -1150,7 +1147,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
// Show recipient
|
// Show recipient
|
||||||
$widthrecbox=100;
|
$widthrecbox=100;
|
||||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||||
$posy=42;
|
$posy=42+$top_shift;
|
||||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||||
|
|
||||||
@@ -1173,6 +1170,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$pdf->SetXY($posx+2,$posy);
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $top_shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -272,24 +272,21 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90+$top_shift;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
||||||
$tab_height = 130;
|
|
||||||
$tab_height_newpage = 150;
|
|
||||||
|
|
||||||
// Incoterm
|
// Incoterm
|
||||||
$height_incoterms = 0;
|
|
||||||
if ($conf->incoterm->enabled)
|
if ($conf->incoterm->enabled)
|
||||||
{
|
{
|
||||||
$desc_incoterms = $object->getIncotermsForPDF();
|
$desc_incoterms = $object->getIncotermsForPDF();
|
||||||
if ($desc_incoterms)
|
if ($desc_incoterms)
|
||||||
{
|
{
|
||||||
$tab_top = 88;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1);
|
||||||
@@ -300,18 +297,17 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1);
|
||||||
|
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6+$height_incoterms;
|
||||||
$height_incoterms += 4;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche notes
|
// Affiche notes
|
||||||
if (! empty($object->note_public))
|
if (! empty($object->note_public))
|
||||||
{
|
{
|
||||||
$tab_top = 88 + $height_incoterms;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($object->note_public), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_note=$nexY-$tab_top;
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
@@ -319,13 +315,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
|
||||||
$tab_top = $nexY+6;
|
$tab_top = $nexY+6;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
$height_note=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$iniY = $tab_top + 7;
|
$iniY = $tab_top + 7;
|
||||||
$curY = $tab_top + 7;
|
$curY = $tab_top + 7;
|
||||||
@@ -1130,8 +1121,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$posy+=1;
|
$posy+=1;
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
|
|
||||||
|
$top_shift = 0;
|
||||||
// Show list of linked objects
|
// Show list of linked objects
|
||||||
|
$current_y = $pdf->getY();
|
||||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
|
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
|
||||||
|
if ($current_y < $pdf->getY())
|
||||||
|
{
|
||||||
|
$top_shift = $pdf->getY() - $current_y;
|
||||||
|
}
|
||||||
|
|
||||||
if ($showaddress)
|
if ($showaddress)
|
||||||
{
|
{
|
||||||
@@ -1148,7 +1145,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
||||||
|
|
||||||
// Show sender
|
// Show sender
|
||||||
$posy=42;
|
$posy=42+$top_shift;
|
||||||
$posx=$this->marge_gauche;
|
$posx=$this->marge_gauche;
|
||||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
|
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
|
||||||
$hautcadre=40;
|
$hautcadre=40;
|
||||||
@@ -1200,7 +1197,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
// Show recipient
|
// Show recipient
|
||||||
$widthrecbox=100;
|
$widthrecbox=100;
|
||||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||||
$posy=42;
|
$posy=42+$top_shift;
|
||||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||||
|
|
||||||
@@ -1223,6 +1220,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$pdf->SetXY($posx+2,$posy);
|
$pdf->SetXY($posx+2,$posy);
|
||||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $top_shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -289,15 +289,13 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$pdf->AddPage();
|
$pdf->AddPage();
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pagenb++;
|
$pagenb++;
|
||||||
$this->_pagehead($pdf, $object, 1, $outputlangs);
|
$top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs);
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
$pdf->MultiCell(0, 3, ''); // Set interline to 3
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$tab_top = 90;
|
$tab_top = 90+$top_shift;
|
||||||
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
|
$tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10);
|
||||||
$tab_height = 130;
|
|
||||||
$tab_height_newpage = 150;
|
|
||||||
|
|
||||||
// Affiche notes
|
// Affiche notes
|
||||||
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
$notetoshow=empty($object->note_public)?'':$object->note_public;
|
||||||
@@ -314,10 +312,10 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
}
|
}
|
||||||
if ($notetoshow)
|
if ($notetoshow)
|
||||||
{
|
{
|
||||||
$tab_top = 88;
|
$tab_top -= 2;
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1);
|
$pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1);
|
||||||
$nexY = $pdf->GetY();
|
$nexY = $pdf->GetY();
|
||||||
$height_note=$nexY-$tab_top;
|
$height_note=$nexY-$tab_top;
|
||||||
|
|
||||||
@@ -325,12 +323,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$pdf->SetDrawColor(192,192,192);
|
$pdf->SetDrawColor(192,192,192);
|
||||||
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
$pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
|
||||||
|
|
||||||
$tab_height = $tab_height - $height_note;
|
$tab_top = $nexY+6+$height_note;
|
||||||
$tab_top = $nexY+6;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$height_note=0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$iniY = $tab_top + 7;
|
$iniY = $tab_top + 7;
|
||||||
@@ -1300,8 +1293,14 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
|
|
||||||
$posy+=2;
|
$posy+=2;
|
||||||
|
|
||||||
|
$top_shift = 0;
|
||||||
// Show list of linked objects
|
// Show list of linked objects
|
||||||
|
$current_y = $pdf->getY();
|
||||||
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
|
$posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
|
||||||
|
if ($current_y < $pdf->getY())
|
||||||
|
{
|
||||||
|
$top_shift = $pdf->getY() - $current_y;
|
||||||
|
}
|
||||||
|
|
||||||
if ($showaddress)
|
if ($showaddress)
|
||||||
{
|
{
|
||||||
@@ -1319,7 +1318,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
$carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty);
|
||||||
|
|
||||||
// Show sender
|
// Show sender
|
||||||
$posy=42;
|
$posy=42+$top_shift;
|
||||||
$posx=$this->marge_gauche;
|
$posx=$this->marge_gauche;
|
||||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
|
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
|
||||||
$hautcadre=40;
|
$hautcadre=40;
|
||||||
@@ -1373,7 +1372,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
// Show recipient
|
// Show recipient
|
||||||
$widthrecbox=100;
|
$widthrecbox=100;
|
||||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||||
$posy=42;
|
$posy=42+$top_shift;
|
||||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||||
|
|
||||||
@@ -1396,6 +1395,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
|
|||||||
}
|
}
|
||||||
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
return $top_shift;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user