fix funecap address multiline
This commit is contained in:
parent
7742b03639
commit
39848d2ce9
@ -171,11 +171,22 @@ class InvoiceGroupPdfHandler extends FPDF {
|
|||||||
$this->Cell(0, 4, FileExportHelpers::FormatTextForExport($clientName));
|
$this->Cell(0, 4, FileExportHelpers::FormatTextForExport($clientName));
|
||||||
$clientInfoYAxis += 4;
|
$clientInfoYAxis += 4;
|
||||||
if ( $this->factureData['group_type'] == 'single' ) {
|
if ( $this->factureData['group_type'] == 'single' ) {
|
||||||
$addressWidth = $this->GetStringWidth($clientAddress);
|
$address = FileExportHelpers::FormatTextForExport($clientAddress);
|
||||||
$isMultiline = $addressWidth > $availableWidhtForClientInfo;
|
$addressWidth = $this->GetStringWidth($address);
|
||||||
|
$addressWidthGreaterThanMaxWidth = $addressWidth > $availableWidhtForClientInfo;
|
||||||
|
$isMultiline = false;
|
||||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||||
$this->MultiCell( 0, 4, trim(FileExportHelpers::FormatTextForExport($clientAddress)));
|
if ($addressWidthGreaterThanMaxWidth) {
|
||||||
|
$yBefore = $this->GetY();
|
||||||
|
$this->MultiCell($availableWidhtForClientInfo, 4, $address,0,'L');
|
||||||
|
$yAfter = $this->GetY();
|
||||||
|
$isMultiline = ($yAfter - $yBefore) > 4;
|
||||||
|
if($isMultiline){
|
||||||
|
$this->SetXY($this->GetX(),$yBefore);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->Cell($availableWidhtForClientInfo, 4, $address);
|
||||||
|
}
|
||||||
if($isMultiline){
|
if($isMultiline){
|
||||||
$clientInfoYAxis += 4;
|
$clientInfoYAxis += 4;
|
||||||
}
|
}
|
||||||
@ -184,10 +195,22 @@ class InvoiceGroupPdfHandler extends FPDF {
|
|||||||
}else{
|
}else{
|
||||||
$clientAddresses = explode(",",$clientAddress);
|
$clientAddresses = explode(",",$clientAddress);
|
||||||
foreach ($clientAddresses as $address) {
|
foreach ($clientAddresses as $address) {
|
||||||
|
$address = FileExportHelpers::FormatTextForExport($address);
|
||||||
$addressWidth = $this->GetStringWidth($address);
|
$addressWidth = $this->GetStringWidth($address);
|
||||||
$isMultiline = $addressWidth > $availableWidhtForClientInfo;
|
$addressWidthGreaterThanMaxWidth = $addressWidth > $availableWidhtForClientInfo;
|
||||||
|
$isMultiline = false;
|
||||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||||
$this->MultiCell( 0, 4, trim(FileExportHelpers::FormatTextForExport($address)));
|
if ($addressWidthGreaterThanMaxWidth) {
|
||||||
|
$yBefore = $this->GetY();
|
||||||
|
$this->MultiCell($availableWidhtForClientInfo, 4, $address,0,'L');
|
||||||
|
$yAfter = $this->GetY();
|
||||||
|
$isMultiline = ($yAfter - $yBefore) > 4;
|
||||||
|
if($isMultiline){
|
||||||
|
$this->SetXY($this->GetX(),$yBefore);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$this->Cell($availableWidhtForClientInfo, 4, $address);
|
||||||
|
}
|
||||||
if($isMultiline){
|
if($isMultiline){
|
||||||
$clientInfoYAxis += 4;
|
$clientInfoYAxis += 4;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user