Merge branch 'fixes/fixe-pdf-adress-line' into staging
This commit is contained in:
commit
569607233a
@ -181,6 +181,7 @@ class InvoiceGroupPdfHandler extends FPDF {
|
|||||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||||
$this->Cell(0, $this->interLigneHeader, FileExportHelpers::FormatTextForExport($clientName));
|
$this->Cell(0, $this->interLigneHeader, FileExportHelpers::FormatTextForExport($clientName));
|
||||||
$clientInfoYAxis += $this->interLigneHeader;
|
$clientInfoYAxis += $this->interLigneHeader;
|
||||||
|
$gapBetweenAddressLines = 0;
|
||||||
if ( $this->factureData['group_type'] == 'single' ) {
|
if ( $this->factureData['group_type'] == 'single' ) {
|
||||||
$address = FileExportHelpers::FormatTextForExport(trim($clientAddress));
|
$address = FileExportHelpers::FormatTextForExport(trim($clientAddress));
|
||||||
$addressWidth = $this->GetStringWidth($address);
|
$addressWidth = $this->GetStringWidth($address);
|
||||||
@ -191,7 +192,8 @@ class InvoiceGroupPdfHandler extends FPDF {
|
|||||||
$yBefore = $this->GetY();
|
$yBefore = $this->GetY();
|
||||||
$this->MultiCell($availableWidhtForClientInfo, $this->interLigneHeader, $address,0,'L');
|
$this->MultiCell($availableWidhtForClientInfo, $this->interLigneHeader, $address,0,'L');
|
||||||
$yAfter = $this->GetY();
|
$yAfter = $this->GetY();
|
||||||
$isMultiline = ($yAfter - $yBefore) > $this->interLigneHeader;
|
$gapBetweenAddressLines = $yAfter - $yBefore;
|
||||||
|
$isMultiline = ($gapBetweenAddressLines) > $this->interLigneHeader;
|
||||||
if($isMultiline){
|
if($isMultiline){
|
||||||
$this->SetXY($this->GetX(),$yBefore);
|
$this->SetXY($this->GetX(),$yBefore);
|
||||||
}
|
}
|
||||||
@ -199,9 +201,14 @@ class InvoiceGroupPdfHandler extends FPDF {
|
|||||||
$this->Cell($availableWidhtForClientInfo, $this->interLigneHeader, $address);
|
$this->Cell($availableWidhtForClientInfo, $this->interLigneHeader, $address);
|
||||||
}
|
}
|
||||||
if($isMultiline){
|
if($isMultiline){
|
||||||
|
if($gapBetweenAddressLines > 0){
|
||||||
|
$modulo = (int) round($gapBetweenAddressLines/$this->interLigneHeader);
|
||||||
|
$clientInfoYAxis += $modulo*$this->interLigneHeader;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
$clientInfoYAxis += $this->interLigneHeader;
|
$clientInfoYAxis += $this->interLigneHeader;
|
||||||
}
|
}
|
||||||
$clientInfoYAxis += $this->interLigneHeader;
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$clientAddresses = explode(",",$clientAddress);
|
$clientAddresses = explode(",",$clientAddress);
|
||||||
|
|||||||
@ -50,6 +50,10 @@ class InvoiceOgfPdfHandler extends InvoiceGroupPdfHandler {
|
|||||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||||
$this->MultiCell( 0, $this->interLigneHeader, trim(FileExportHelpers::FormatTextForExport($clientAddress)));
|
$this->MultiCell( 0, $this->interLigneHeader, trim(FileExportHelpers::FormatTextForExport($clientAddress)));
|
||||||
if ($clientAdressIsMultiline) {
|
if ($clientAdressIsMultiline) {
|
||||||
|
$clientAdressIsMoreThanTwoLines = $clientAdressWidth > ($availableWidhtForClientInfo * 2);
|
||||||
|
if($clientAdressIsMoreThanTwoLines){
|
||||||
|
$clientInfoYAxis += $this->interLigneHeader;
|
||||||
|
}
|
||||||
$clientInfoYAxis += $this->interLigneHeader;
|
$clientInfoYAxis += $this->interLigneHeader;
|
||||||
}
|
}
|
||||||
$clientInfoYAxis += $this->interLigneHeader;
|
$clientInfoYAxis += $this->interLigneHeader;
|
||||||
|
|||||||
@ -178,6 +178,10 @@ class InvoicePdfHandler extends FPDF
|
|||||||
$this->SetXY($clientInfoXAxis, $clientInfoYAxis);
|
$this->SetXY($clientInfoXAxis, $clientInfoYAxis);
|
||||||
$this->MultiCell(0, $this->interLigneHeader, trim(FileExportHelpers::FormatTextForExport($clientAddress)));
|
$this->MultiCell(0, $this->interLigneHeader, trim(FileExportHelpers::FormatTextForExport($clientAddress)));
|
||||||
if ($clientAdressIsMultiline) {
|
if ($clientAdressIsMultiline) {
|
||||||
|
$clientAdressIsMoreThanTwoLines = $clientAdressWidth > ($availableWidhtForClientInfo * 2);
|
||||||
|
if($clientAdressIsMoreThanTwoLines){
|
||||||
|
$clientInfoYAxis += $this->interLigneHeader;
|
||||||
|
}
|
||||||
$clientInfoYAxis += $this->interLigneHeader;
|
$clientInfoYAxis += $this->interLigneHeader;
|
||||||
}
|
}
|
||||||
$clientInfoYAxis += $this->interLigneHeader;
|
$clientInfoYAxis += $this->interLigneHeader;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user