Merge branch 'hytha/fixe/fixing-pdf-client-name-section-position' into staging
This commit is contained in:
commit
286181f816
@ -2957,6 +2957,7 @@ class Bdd {
|
||||
$factureData["client_mail"] = $devis["client_mail"];
|
||||
$factureData["siret"] = $devis["client_legal_one"];
|
||||
$factureData["group_name"] = $devis["client_nom"] ?? "";
|
||||
$factureData["group_type"] = "single";
|
||||
}
|
||||
else{
|
||||
$factureData["client_real_adress"] = $devis["group_address"] ?? "";
|
||||
@ -2965,6 +2966,8 @@ class Bdd {
|
||||
$factureData["siret"] = $devis["group_siret_number"];
|
||||
$factureData["group_name"] = $devis["group_name"] ?? "";
|
||||
$templateType = $devis['fk_template_type_key'] ?? ClientTemplateTypeConstant::PRIVEES;
|
||||
$factureData["group_type"] = "group";
|
||||
|
||||
}
|
||||
}
|
||||
$products = $this->getDevisProduits($devis["devis_id"]);
|
||||
|
||||
@ -160,16 +160,28 @@ class InvoiceGroupPdfHandler extends FPDF {
|
||||
public function DrawInvoiceClientInfo(){
|
||||
$this->SetFont('ComicSans', '', 10);
|
||||
$clientName = $this->factureData['group_name'];
|
||||
$clientInfoXAxis = 125;
|
||||
$clientInfoXAxis = 135;
|
||||
|
||||
$clientAddress = $this->factureData['client_real_adress'];
|
||||
$maxWidth = $this->GetPageWidth();
|
||||
$availableWidhtForClientInfo = $maxWidth - 10 - $clientInfoXAxis;
|
||||
$availableWidhtForClientInfo = $maxWidth - 20 - $clientInfoXAxis;
|
||||
|
||||
$clientInfoYAxis = 40;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->Cell(0, 4, FileExportHelpers::FormatTextForExport($clientName));
|
||||
$clientInfoYAxis += 4;
|
||||
if ( $this->factureData['group_type'] == 'single' ) {
|
||||
$addressWidth = $this->GetStringWidth($clientAddress);
|
||||
$isMultiline = $addressWidth > $availableWidhtForClientInfo;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->MultiCell( 0, 4, trim(FileExportHelpers::FormatTextForExport($clientAddress)));
|
||||
|
||||
if($isMultiline){
|
||||
$clientInfoYAxis += 4;
|
||||
}
|
||||
$clientInfoYAxis += 4;
|
||||
|
||||
}else{
|
||||
$clientAddresses = explode(",",$clientAddress);
|
||||
foreach ($clientAddresses as $address) {
|
||||
$addressWidth = $this->GetStringWidth($address);
|
||||
@ -181,6 +193,8 @@ class InvoiceGroupPdfHandler extends FPDF {
|
||||
}
|
||||
$clientInfoYAxis += 4;
|
||||
}
|
||||
}
|
||||
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis + 1);
|
||||
$this->Cell(0, 4, trim(FileExportHelpers::FormatTextForExport($this->factureData['client_adress_city'])));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user