Merge branch 'fixes/fix-facture-group-address-multiline' into staging
This commit is contained in:
commit
943790afac
@ -171,11 +171,22 @@ class InvoiceGroupPdfHandler extends FPDF {
|
||||
$this->Cell(0, 4, FileExportHelpers::FormatTextForExport($clientName));
|
||||
$clientInfoYAxis += 4;
|
||||
if ( $this->factureData['group_type'] == 'single' ) {
|
||||
$addressWidth = $this->GetStringWidth($clientAddress);
|
||||
$isMultiline = $addressWidth > $availableWidhtForClientInfo;
|
||||
$address = FileExportHelpers::FormatTextForExport($clientAddress);
|
||||
$addressWidth = $this->GetStringWidth($address);
|
||||
$addressWidthGreaterThanMaxWidth = $addressWidth > $availableWidhtForClientInfo;
|
||||
$isMultiline = false;
|
||||
$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){
|
||||
$clientInfoYAxis += 4;
|
||||
}
|
||||
@ -184,10 +195,22 @@ class InvoiceGroupPdfHandler extends FPDF {
|
||||
}else{
|
||||
$clientAddresses = explode(",",$clientAddress);
|
||||
foreach ($clientAddresses as $address) {
|
||||
$address = FileExportHelpers::FormatTextForExport($address);
|
||||
$addressWidth = $this->GetStringWidth($address);
|
||||
$isMultiline = $addressWidth > $availableWidhtForClientInfo;
|
||||
$addressWidthGreaterThanMaxWidth = $addressWidth > $availableWidhtForClientInfo;
|
||||
$isMultiline = false;
|
||||
$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){
|
||||
$clientInfoYAxis += 4;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user