forked from Wavyzz/dolibarr
Fix: Bad alignement of fields with some page format.
This commit is contained in:
@@ -100,13 +100,21 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$this->emetteur=$mysoc;
|
||||
if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
|
||||
|
||||
// Defini position des colonnes
|
||||
// Define position of columns
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
$this->posxtva=111;
|
||||
$this->posxup=126;
|
||||
$this->posxqty=145;
|
||||
$this->posxdiscount=162;
|
||||
$this->postotalht=174;
|
||||
if ($this->page_largeur < 210) // To work with US executive format
|
||||
{
|
||||
$this->posxtva-=20;
|
||||
$this->posxup-=20;
|
||||
$this->posxqty-=20;
|
||||
$this->posxdiscount-=20;
|
||||
$this->postotalht-=20;
|
||||
}
|
||||
|
||||
$this->tva=array();
|
||||
$this->localtax1=array();
|
||||
@@ -610,7 +618,12 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
// Tableau total
|
||||
$col1x = 120; $col2x = 170; $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
|
||||
$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;
|
||||
@@ -1039,26 +1052,28 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
|
||||
|
||||
// Show recipient
|
||||
$widthrecbox=100;
|
||||
if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format
|
||||
$posy=42;
|
||||
$posx=$this->page_largeur-$this->marge_droite-100;
|
||||
$posx=$this->page_largeur-$this->marge_droite-$widthrecbox;
|
||||
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
|
||||
|
||||
// Show recipient frame
|
||||
$pdf->SetTextColor(0,0,0);
|
||||
$pdf->SetFont('','', $default_font_size - 2);
|
||||
$pdf->SetXY($posx+2,$posy-5);
|
||||
$pdf->MultiCell(80,5, $outputlangs->transnoentities("BillTo").":",0,'L');
|
||||
$pdf->Rect($posx, $posy, 100, $hautcadre);
|
||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
|
||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||
|
||||
// Show recipient name
|
||||
$pdf->SetXY($posx+2,$posy+3);
|
||||
$pdf->SetFont('','B', $default_font_size);
|
||||
$pdf->MultiCell(96,4, $carac_client_name, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||
|
||||
// Show recipient information
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
$pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
|
||||
$pdf->MultiCell(86,4, $carac_client, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user