reduce column tva and ttc

This commit is contained in:
Narindra ezway 2025-04-15 17:48:24 +03:00
parent 0d4b17ae30
commit 7d4f230d7e
3 changed files with 31 additions and 27 deletions

View File

@ -53,11 +53,11 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
$products = $currentDevis["products"];
$subcontractorOrderNumberText = "Numéro de sous traitance ".$currentDevis["order_number"];
$subcontractorCaseNumberText = "Numéro de dossier ".$currentDevis["case_number"];
$this->SetXY( 29,$yValue );
$this->SetXY( 30,$yValue );
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($subcontractorOrderNumberText),0,'0',);
$yValue += 6;
$this->SetXY( 29,$yValue );
$this->SetXY( 30,$yValue );
$this->MultiAlignCell(100, 6, FileExportHelpers::FormatTextForExport($subcontractorCaseNumberText),0,'0',);
$yValue += 6;
foreach($products as $product){
@ -76,7 +76,7 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
$this->SetXY( 4.5,$yValue );
$this->Cell(5, 6, $dateValue, 0,0);
$this->SetXY( 29,$yValue );
$this->SetXY( 30,$yValue );
$productDescription = FileExportHelpers::FormatTextForExport($productDescription);
$productDescriptionWidth = $this->GetStringWidth($productDescription);
$productDescriptionWidthIsGreaterThanMaxWidth = $productDescriptionWidth > $maxDescriptionWidth;
@ -94,10 +94,10 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
}
$this->SetXY( 135,$yValue );
$this->SetXY( 140,$yValue );
$this->Cell(20, 6, number_format($valueHt,2,'.','').chr(128), 0, 0, 'C');
$this->SetXY( 159,$yValue );
$this->SetXY( 163,$yValue );
$this->Cell(20, 6, number_format($tvaAmount,2,'.','').chr(128), 0, 0, 'C');
$this->SetXY( 182,$yValue );

View File

@ -84,7 +84,7 @@ class InvoiceGroupPdfHandler extends FPDF {
$height = $originalHeight * $scale;
// Calculer la position pour centrer l'image
$x = (210 - $width) / 2 + 15; // Décalage à droite de 15 mm
$y = ((297 - $height) / 2 ) + 25; // 297 mm est la hauteur d'une page A4
$y = ((297 - $height) / 2 ) + 19; // 297 mm est la hauteur d'une page A4
// Ajouter l'image en filigrane
$this->Image($imagePath, $x, $y, $width, $height); // Chemin, position x, position y, largeur, hauteur
@ -271,26 +271,28 @@ class InvoiceGroupPdfHandler extends FPDF {
// cadre titre des colonnes
$this->Line(3, $this->startingYOfArticlesTable + $gapBetweenStartingOfArticlesTableAndColumnName, 207,$this->startingYOfArticlesTable + $gapBetweenStartingOfArticlesTableAndColumnName);
// les traits verticaux colonnes
$this->Line(28, $this->startingYOfArticlesTable, 28, 237);
$this->Line(132, $this->startingYOfArticlesTable, 132, 237);
$this->Line(157, $this->startingYOfArticlesTable, 157, 237);
$this->Line(182, $this->startingYOfArticlesTable, 182, 237);
$additionalMargRight = 1;
$this->Line(28 + $additionalMargRight, $this->startingYOfArticlesTable, 28+ $additionalMargRight , 237);
$this->Line(135 + $additionalMargRight, $this->startingYOfArticlesTable, 135+ $additionalMargRight , 237);
$this->Line(162 + $additionalMargRight, $this->startingYOfArticlesTable, 162+ $additionalMargRight , 237);
$this->Line(182 + $additionalMargRight, $this->startingYOfArticlesTable, 182+ $additionalMargRight , 237);
}
public function DrawArticlesTableHeader(){
$additionalMargRight = 1;
$tvaValue = $this->factureData["configuration"]->tva_default;
$columnNameY = $this->startingYOfArticlesTable - 1;
$this->SetFont('ComicSans', '', 10);
$this->SetXY(12, $columnNameY);
$this->SetXY(12 + $additionalMargRight, $columnNameY);
$this->Cell(7, 10, "Date", 0, 0, 'C');
$this->SetXY(28, $columnNameY);
$this->SetXY(30 + $additionalMargRight, $columnNameY);
$this->Cell(100, 10, "Description", 0, 0, 'C');
$this->SetXY(135, $columnNameY);
$this->SetXY(139 + $additionalMargRight, $columnNameY);
$this->Cell(20, 10, "Prix Uni. HT", 0, 0, 'C');
$this->SetXY(159, $columnNameY);
$this->SetXY(162 + $additionalMargRight, $columnNameY);
$this->Cell(20, 10, 'TVA ' . $tvaValue . '%', 0, 0, 'C');
$this->SetXY(185 , $columnNameY);
@ -332,7 +334,7 @@ class InvoiceGroupPdfHandler extends FPDF {
$this->SetXY(4,$yValue );
$this->Cell(5, 6, $dateValue, 0,0);
$this->SetXY( 29,$yValue );
$this->SetXY( 30,$yValue );
$productDescription = FileExportHelpers::FormatTextForExport($productDescription);
$productDescriptionWidth = $this->GetStringWidth($productDescription);
$productDescriptionWidthIsGreaterThanMaxWidth = $productDescriptionWidth > $maxDescriptionWidth;
@ -350,10 +352,10 @@ class InvoiceGroupPdfHandler extends FPDF {
}
$this->SetXY( 135,$yValue );
$this->SetXY( 140,$yValue );
$this->Cell(20, 6, number_format($valueHt,2,'.','').chr(128), 0, 0, 'C');
$this->SetXY( 159,$yValue );
$this->SetXY( 163,$yValue );
$this->Cell(20, 6, number_format($tvaAmount,2,'.','').chr(128), 0, 0, 'C');
$this->SetXY( 182,$yValue );
@ -381,20 +383,22 @@ class InvoiceGroupPdfHandler extends FPDF {
$this->MultiCell(0,4,utf8_decode(html_entity_decode("en indiquant le numéro de facture, ou par virement :")));
$this->Ln(1);
//Table IBAN
$startOftable = 3 ;
$this->SetX($startOftable);
$this->SetFont('ComicSans', '', 8);
$ibanWidth = 62;
$ibanCursorY = $this->GetY();
$this->Cell($ibanWidth, 6.5, 'IBAN : FR76 1360 6000 1436 5418 1800 038', 1, 1, 'C');
$ibanCursorX = $this->GetX();
$this->SetX($startOftable);
$this->Cell($ibanWidth, 6.5, 'Code SWIFT : AGRI FR PP 836', 1, 1, 'C');
//TABLE HT
$tableWidth = 48; // Largeur totale de la 2e table (20+20)
$marginRight = 3; // Marge par rapport au bord droit
$pageWidth = 210; // Largeur d'une page A4 en mm (portrait)
// Position correcte de la 2e table
$startOfArrayX = $pageWidth - $tableWidth - $marginRight ;
$startOfArrayY = $ibanCursorY - 5;
@ -412,7 +416,7 @@ class InvoiceGroupPdfHandler extends FPDF {
public function SetFactureContent(){
$this->AddPage();
$this->SetMargins(3,0,3);
$this->SetMargins(2,0,3);
$this->DrawArticlesTable();
$this->DrawBankAndTotalPriceInfo();
}

View File

@ -82,11 +82,11 @@ class InvoiceOgfPdfHandler extends InvoiceGroupPdfHandler {
$this->Cell(34, 7, 'COMMANDE', 1, 1, 'C');
$this->SetFont('ComicSans', '', 10);
$this->Cell(30, 11, $factureDatePaiement, 1, 0, 'C');
$this->Cell(60, 11, utf8_decode(html_entity_decode($this->factureData['group_name'])), 1, 0, 'C');
$this->Cell(40, 11, $this->factureData['num'], 1, 0, 'C');
$this->Cell(40, 11, $factureDateEcheance, 1, 0, 'C');
$this->Cell(34, 11, $this->factureData["facture_order_number"], 1, 1, 'C');
$this->Cell(30, 9, $factureDatePaiement, 1, 0, 'C');
$this->Cell(60, 9, utf8_decode(html_entity_decode($this->factureData['group_name'])), 1, 0, 'C');
$this->Cell(40, 9, $this->factureData['num'], 1, 0, 'C');
$this->Cell(40, 9, $factureDateEcheance, 1, 0, 'C');
$this->Cell(34, 9, $this->factureData["facture_order_number"], 1, 1, 'C');
$this->startingYOfArticlesTable = $startInvoiceInfoTable + 20;