Merge branch 'staging' into production

This commit is contained in:
Tiavina 2025-06-02 15:08:10 +03:00
commit 416f4b030a

View File

@ -186,15 +186,15 @@ class InvoiceGroupPdfHandler extends FPDF
$address = FileExportHelpers::FormatTextForExport(trim($clientAddress));
$addressWidth = $this->GetStringWidth($address);
$addressWidthGreaterThanMaxWidth = $addressWidth > $availableWidhtForClientInfo;
$addressIsMoreThanTwoLines = ($addressWidth/$availableWidhtForClientInfo) > 2;
$addressIsMoreThanTwoLines = ($addressWidth / $availableWidhtForClientInfo) > 2;
$clientInfoYAxis =$addressIsMoreThanTwoLines ? 35 : 40;
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
$clientInfoYAxis = $addressIsMoreThanTwoLines ? 35 : 40;
$this->SetXY($clientInfoXAxis, $clientInfoYAxis);
$this->Cell(0, $this->interLigneHeader, FileExportHelpers::FormatTextForExport($clientName));
$clientInfoYAxis += $this->interLigneHeader;
$gapBetweenAddressLines = 0;
if ( $this->factureData['group_type'] == 'single' ) {
if ($this->factureData['group_type'] == 'single') {
$isMultiline = false;
$this->SetXY($clientInfoXAxis, $clientInfoYAxis);
if ($addressWidthGreaterThanMaxWidth) {
@ -203,24 +203,23 @@ class InvoiceGroupPdfHandler extends FPDF
$yAfter = $this->GetY();
$gapBetweenAddressLines = $yAfter - $yBefore;
$isMultiline = ($gapBetweenAddressLines) > $this->interLigneHeader;
if($isMultiline){
$this->SetXY($this->GetX(),$yBefore);
if ($isMultiline) {
$this->SetXY($this->GetX(), $yBefore);
}
} else {
$this->Cell($availableWidhtForClientInfo, $this->interLigneHeader, $address);
}
if($isMultiline){
if($gapBetweenAddressLines > 0){
$modulo = (int) round($gapBetweenAddressLines/$this->interLigneHeader);
$clientInfoYAxis += $modulo*$this->interLigneHeader;
if ($isMultiline) {
if ($gapBetweenAddressLines > 0) {
$modulo = (int) round($gapBetweenAddressLines / $this->interLigneHeader);
$clientInfoYAxis += $modulo * $this->interLigneHeader;
}
}
else{
} else {
$clientInfoYAxis += $this->interLigneHeader;
}
}else{
$clientAddresses = explode(",",$clientAddress);
} else {
$clientAddresses = explode(",", $clientAddress);
foreach ($clientAddresses as $address) {
$address = FileExportHelpers::FormatTextForExport(trim($address));
$addressWidth = $this->GetStringWidth($address);
@ -244,10 +243,11 @@ class InvoiceGroupPdfHandler extends FPDF
$clientInfoYAxis += $this->interLigneHeader;
}
}
$this->SetXY($clientInfoXAxis, $clientInfoYAxis);
$this->Cell(0, $this->interLigneHeader, trim(FileExportHelpers::FormatTextForExport($this->factureData['client_adress_city'])));
if($this->factureData['siret']){
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
if ($this->factureData['siret']) {
$clientInfoYAxis += $this->interLigneHeader;
$this->SetXY($clientInfoXAxis, $clientInfoYAxis);
$this->Cell(0, $this->interLigneHeader, 'Siret: ' . $this->factureData['siret']);
}
}