add siret on all invoice and ajuste position in facture

This commit is contained in:
narindraezway 2025-05-07 14:51:32 +03:00
parent 3a690ed967
commit 1e8b2c4381

View File

@ -176,16 +176,18 @@ class InvoiceGroupPdfHandler extends FPDF {
$clientAddress = $this->factureData['client_real_adress'];
$maxWidth = $this->GetPageWidth();
$availableWidhtForClientInfo = $maxWidth - 2 - $clientInfoXAxis;
$address = FileExportHelpers::FormatTextForExport(trim($clientAddress));
$addressWidth = $this->GetStringWidth($address);
$addressWidthGreaterThanMaxWidth = $addressWidth > $availableWidhtForClientInfo;
$addressIsMoreThanTwoLines = ($addressWidth/$availableWidhtForClientInfo) > 2;
$clientInfoYAxis = 40;
$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' ) {
$address = FileExportHelpers::FormatTextForExport(trim($clientAddress));
$addressWidth = $this->GetStringWidth($address);
$addressWidthGreaterThanMaxWidth = $addressWidth > $availableWidhtForClientInfo;
$isMultiline = false;
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
if ($addressWidthGreaterThanMaxWidth) {
@ -236,8 +238,13 @@ class InvoiceGroupPdfHandler extends FPDF {
}
}
$this->SetXY($clientInfoXAxis,$clientInfoYAxis + 1);
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
$this->Cell(0, $this->interLigneHeader, trim(FileExportHelpers::FormatTextForExport($this->factureData['client_adress_city'])));
if($this->factureData['siret']){
$clientInfoYAxis += $this->interLigneHeader;
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
$this->Cell(0, $this->interLigneHeader, 'Siret: ' . $this->factureData['siret']);
}
}