finish multiline issue on pdf , wip date
This commit is contained in:
parent
31c4cdd0fb
commit
0f3f330f45
@ -69,15 +69,26 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
|
||||
$dateValue = $devisDate;
|
||||
$productDescription .= " de " . $currentDevis["defunt_nom"] ?? "";
|
||||
}
|
||||
$productDescriptionWidth = $this->GetStringWidth($productDescription);
|
||||
$productDescriptionIsMultiline = $productDescriptionWidth > $maxDescriptionWidth;
|
||||
$tvaAmount = $valueTtc - $valueHt;
|
||||
|
||||
$this->SetXY( 8,$yValue );
|
||||
$this->Cell(20, 6, $dateValue, 0,0);
|
||||
|
||||
|
||||
$this->SetXY( 35,$yValue );
|
||||
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($productDescription),0,'0',);
|
||||
$productDescription = FileExportHelpers::FormatTextForExport($productDescription);
|
||||
$productDescriptionWidth = $this->GetStringWidth($productDescription);
|
||||
$productDescriptionWidthIsGreaterThanMaxWidth = $productDescriptionWidth > $maxDescriptionWidth;
|
||||
$productDescriptionIsMultiline = false;
|
||||
if ($productDescriptionWidthIsGreaterThanMaxWidth) {
|
||||
$yBefore = $this->GetY();
|
||||
$this->MultiCell($maxDescriptionWidth, 6, $productDescription,0,'L');
|
||||
$yAfter = $this->GetY();
|
||||
$productDescriptionIsMultiline = ($yAfter - $yBefore) > 6;
|
||||
if($productDescriptionIsMultiline){
|
||||
$this->SetXY($this->GetX(),$yBefore);
|
||||
}
|
||||
} else {
|
||||
$this->Cell($maxDescriptionWidth, 6, $productDescription);
|
||||
}
|
||||
|
||||
$this->SetXY( 138,$yValue );
|
||||
$this->Cell(20, 6, number_format($valueHt,2,'.','').chr(128), 0, 0, 'C');
|
||||
|
||||
@ -219,7 +219,7 @@ class InvoiceGroupPdfHandler extends FPDF {
|
||||
$totalTtc = 0;
|
||||
$totalTva = 0;
|
||||
$yValue = $this->startingYOfArticlesTable + 11;
|
||||
$maxDescriptionWidth = 104;
|
||||
$maxDescriptionWidth = 98;
|
||||
$currentIndexPosition = $this->currentIndexPosition;
|
||||
for($currentIndexPosition;$currentIndexPosition<($this->initialIndexPosition + $this->devisCountToGet);$currentIndexPosition++){
|
||||
$currentDevis = $devisData[$currentIndexPosition];
|
||||
@ -238,18 +238,25 @@ class InvoiceGroupPdfHandler extends FPDF {
|
||||
$dateValue = $devisDate;
|
||||
$productDescription .= " de " . $currentDevis["defunt_nom"] ?? "";
|
||||
}
|
||||
$productDescriptionWidth = $this->GetStringWidth($productDescription);
|
||||
$productDescriptionIsMultiline = $productDescriptionWidth > $maxDescriptionWidth;
|
||||
$tvaAmount = $valueTtc - $valueHt;
|
||||
$this->SetXY( 8,$yValue );
|
||||
$this->Cell(20, 6, $dateValue, 0,0);
|
||||
|
||||
|
||||
$this->SetXY( 35,$yValue );
|
||||
if($productDescriptionIsMultiline){
|
||||
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($productDescription),0,'0',);
|
||||
}
|
||||
else{
|
||||
$this->Cell(100,6,FileExportHelpers::FormatTextForExport($productDescription),0,0);
|
||||
$productDescription = FileExportHelpers::FormatTextForExport($productDescription);
|
||||
$productDescriptionWidth = $this->GetStringWidth($productDescription);
|
||||
$productDescriptionWidthIsGreaterThanMaxWidth = $productDescriptionWidth > $maxDescriptionWidth;
|
||||
$productDescriptionIsMultiline = false;
|
||||
if ($productDescriptionWidthIsGreaterThanMaxWidth) {
|
||||
$yBefore = $this->GetY();
|
||||
$this->MultiCell($maxDescriptionWidth, 6, $productDescription,0,'L');
|
||||
$yAfter = $this->GetY();
|
||||
$productDescriptionIsMultiline = ($yAfter - $yBefore) > 6;
|
||||
if($productDescriptionIsMultiline){
|
||||
$this->SetXY($this->GetX(),$yBefore);
|
||||
}
|
||||
} else {
|
||||
$this->Cell($maxDescriptionWidth, 6, $productDescription);
|
||||
}
|
||||
|
||||
$this->SetXY( 138,$yValue );
|
||||
@ -262,7 +269,7 @@ class InvoiceGroupPdfHandler extends FPDF {
|
||||
$this->Cell(25, 6, number_format($valueTtc,2,'.','').chr(128), 0, 1, 'C');
|
||||
$yValue += 6;
|
||||
$totalTva += $tvaAmount;
|
||||
if($productDescriptionIsMultiline){
|
||||
if($productDescriptionWidthIsGreaterThanMaxWidth){
|
||||
$yValue += 6;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user