Merge branch 'hytha/fixe/fixing-pdf-bug' into staging
This commit is contained in:
commit
f8364de3cb
@ -44,6 +44,8 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
|
||||
$maxDescriptionWidth = 102;
|
||||
$currentIndexPosition = $this->currentIndexPosition;
|
||||
for($currentIndexPosition;$currentIndexPosition<($this->initialIndexPosition + $this->devisCountToGet);$currentIndexPosition++){
|
||||
$this->SetFont('ComicSans', '', 8);
|
||||
|
||||
$currentDevis = $devisData[$currentIndexPosition];
|
||||
$devisDate = $currentDevis['devis_date'];
|
||||
$devisDate = DateTime::createFromFormat('Y-m-d',$devisDate);
|
||||
@ -59,6 +61,7 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
|
||||
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($subcontractorCaseNumberText),0,'0',);
|
||||
$yValue += 6;
|
||||
foreach($products as $product){
|
||||
|
||||
$valueHt = $product['produit_price'] * $product["quantite"];
|
||||
$valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue);
|
||||
$totalHt+=$valueHt;
|
||||
@ -90,7 +93,6 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
|
||||
$this->Cell($maxDescriptionWidth, 6, $productDescription);
|
||||
}
|
||||
|
||||
$this->SetFont('ComicSans', '', 8);
|
||||
|
||||
$this->SetXY( 135,$yValue );
|
||||
$this->Cell(20, 6, number_format($valueHt,2,'.','').chr(128), 0, 0, 'C');
|
||||
@ -112,7 +114,7 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
|
||||
$this->initialIndexPosition = $this->currentIndexPosition;
|
||||
$chargedDevisCount = $this->currentIndexPosition + 1;
|
||||
$devisLeftToGet = $this->devisCount - $chargedDevisCount;
|
||||
$this->devisCountToGet = ($devisLeftToGet <= $this->maxArticlePerPage) ? $devisLeftToGet + 1 : $this->maxArticlePerPage;
|
||||
$this->devisCountToGet = ($devisLeftToGet < $this->maxArticlePerPage) ? $devisLeftToGet + 1: $this->maxArticlePerPage;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -163,22 +163,25 @@ class InvoiceGroupPdfHandler extends FPDF {
|
||||
$clientInfoXAxis = 125;
|
||||
|
||||
$clientAddress = $this->factureData['client_real_adress'];
|
||||
$clientAdressWidth = $this->GetStringWidth($clientAddress);
|
||||
$maxWidth = $this->GetPageWidth();
|
||||
$availableWidhtForClientInfo = $maxWidth - 10 - $clientInfoXAxis;
|
||||
$clientAdressIsMultiline = $clientAdressWidth > $availableWidhtForClientInfo;
|
||||
|
||||
$clientInfoYAxis = $clientAdressIsMultiline ? 35 : 40;
|
||||
$clientInfoYAxis = 40;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->Cell(0, 4, FileExportHelpers::FormatTextForExport($clientName));
|
||||
$clientInfoYAxis += 4;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->MultiCell( 0, 4, trim(FileExportHelpers::FormatTextForExport($clientAddress)));
|
||||
if($clientAdressIsMultiline){
|
||||
$clientAddresses = explode(",",$clientAddress);
|
||||
foreach ($clientAddresses as $address) {
|
||||
$addressWidth = $this->GetStringWidth($address);
|
||||
$isMultiline = $addressWidth > $availableWidhtForClientInfo;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->MultiCell( 0, 4, trim(FileExportHelpers::FormatTextForExport($address)));
|
||||
if($isMultiline){
|
||||
$clientInfoYAxis += 4;
|
||||
}
|
||||
$clientInfoYAxis += 4;
|
||||
}
|
||||
$clientInfoYAxis += 4;
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis);
|
||||
$this->SetXY($clientInfoXAxis,$clientInfoYAxis + 1);
|
||||
$this->Cell(0, 4, trim(FileExportHelpers::FormatTextForExport($this->factureData['client_adress_city'])));
|
||||
}
|
||||
|
||||
@ -319,7 +322,8 @@ class InvoiceGroupPdfHandler extends FPDF {
|
||||
$this->initialIndexPosition = $this->currentIndexPosition;
|
||||
$chargedDevisCount = $this->currentIndexPosition + 1;
|
||||
$devisLeftToGet = $this->devisCount - $chargedDevisCount;
|
||||
$this->devisCountToGet = ($devisLeftToGet <= $this->maxArticlePerPage) ? $devisLeftToGet + 1 : $this->maxArticlePerPage;
|
||||
$this->devisCountToGet = ($devisLeftToGet < $this->maxArticlePerPage) ? $devisLeftToGet + 1: $this->maxArticlePerPage;
|
||||
|
||||
}
|
||||
|
||||
public function DrawBankAndTotalPriceInfo(){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user