From 0f06187fc463de35d0b7edbdba6d31014b41a52d Mon Sep 17 00:00:00 2001 From: Narindra ezway Date: Mon, 7 Apr 2025 11:17:24 +0300 Subject: [PATCH 1/3] update address facture funecap 22, 35 --- .../InvoiceFunecapPdfHandler.php | 6 +++-- .../InvoiceGroupPdfHandler.php | 22 +++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceFunecapPdfHandler.php b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceFunecapPdfHandler.php index 08a75df..82cc4f8 100644 --- a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceFunecapPdfHandler.php +++ b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceFunecapPdfHandler.php @@ -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; } } diff --git a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php index bff6755..75087cd 100644 --- a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php +++ b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php @@ -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(){ From 5ddc42f11ac4ef5a1e7c54f31b47ccda5a1d6fbc Mon Sep 17 00:00:00 2001 From: Narindra ezway Date: Mon, 7 Apr 2025 13:34:29 +0300 Subject: [PATCH 2/3] Add group type handling for invoice client information display (Manda demande) --- gestion/lib/Db/Bdd.php | 3 +++ .../InvoiceGroupPdfHandler.php | 26 ++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/gestion/lib/Db/Bdd.php b/gestion/lib/Db/Bdd.php index d6b1fa9..66250b0 100644 --- a/gestion/lib/Db/Bdd.php +++ b/gestion/lib/Db/Bdd.php @@ -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"]); diff --git a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php index 75087cd..1fae1f0 100644 --- a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php +++ b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php @@ -160,27 +160,41 @@ 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; - $clientAddresses = explode(",",$clientAddress); - foreach ($clientAddresses as $address) { - $addressWidth = $this->GetStringWidth($address); + if ( $this->factureData['group_type'] == 'single' ) { + $addressWidth = $this->GetStringWidth($clientAddress); $isMultiline = $addressWidth > $availableWidhtForClientInfo; $this->SetXY($clientInfoXAxis,$clientInfoYAxis); - $this->MultiCell( 0, 4, trim(FileExportHelpers::FormatTextForExport($address))); + $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); + $isMultiline = $addressWidth > $availableWidhtForClientInfo; + $this->SetXY($clientInfoXAxis,$clientInfoYAxis); + $this->MultiCell( 0, 4, trim(FileExportHelpers::FormatTextForExport($address))); + if($isMultiline){ + $clientInfoYAxis += 4; + } + $clientInfoYAxis += 4; + } } + $this->SetXY($clientInfoXAxis,$clientInfoYAxis + 1); $this->Cell(0, 4, trim(FileExportHelpers::FormatTextForExport($this->factureData['client_adress_city']))); } From 7742b03639d2068bce7c40a23998a01ff0722e88 Mon Sep 17 00:00:00 2001 From: Faniry Arilanto Date: Mon, 7 Apr 2025 13:32:53 +0000 Subject: [PATCH 3/3] modify hytha staging path --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d24f2a7..3af4d74 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,7 +5,7 @@ pipeline { when { branch 'staging' } agent { label 'apache && dev' } steps { - sh '''cd /var/www/nextcloud/nextcloud/custom_apps + sh '''cd /var/www/hytha35-sottye/nextcloud/custom_apps sudo su jenkins -c "git stash && git pull origin staging" ''' } }