Compare commits

...

10 Commits

14 changed files with 165 additions and 121 deletions

9
Jenkinsfile vendored
View File

@ -9,5 +9,14 @@ pipeline {
sudo su jenkins -c "git stash && git pull origin staging" '''
}
}
stage ("deploy to prod dv-thanato") {
when { branch 'production-dv-thanato' }
agent { label 'apache && dev'}
steps {
input 'Do you approve deployment?'
sh ''' ssh -i ${SOTTYE_DVTHANATO_SSHKEY} ${SOTTYE_DVTHANATO_SSHUSER}@${SOTTYE_DVTHANATO_IPSERVER} "cd ${SOTTYE_DVTHANATO_PATH} && git pull origin production-dv-thanato" '''
}
}
}
}

View File

@ -109,7 +109,7 @@ class InvoiceController extends Controller
$message->attach($content);
$message->setSubject("Facture");
$signature = $this->mailerService->getFooterContent();
$signature = $this->mailerService->getFooterContent( $this->getUserNameForEmailSignature());
$message->setHtmlBody(
"<p>Bonjour.</p>".
@ -128,4 +128,9 @@ class InvoiceController extends Controller
}
return new DataResponse("E-mail envoyé avec succès à ".$email.".", 200, ['Content-Type' => 'application/json']);
}
public function getUserNameForEmailSignature (){
$configs = json_decode($this->gestionRepository->getConfiguration(BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD));
$currentConfig = $configs[0];
return $currentConfig->nom . " " . $currentConfig->prenom;
}
}

View File

@ -1635,7 +1635,7 @@ class PageController extends Controller {
}
}
public function getUserNameForEmailSignature (){
$configs = json_decode($this->myDb->getConfiguration(self::DEFAULT_NEXTCLOUD_ADMIN));
$configs = json_decode($this->myDb->getConfiguration(BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD));
$currentConfig = $configs[0];
return $currentConfig->nom . " " . $currentConfig->prenom;
}

View File

@ -3806,6 +3806,7 @@ class Bdd {
defunt.ref_pacemaker as defunt_reference_pacemaker,
defunt.product_brand as defunt_product_brand,
defunt.product_reference as defunt_product_reference,
defunt.date as defunt_date,
client.nom as client_nom,
client.prenom as client_prenom,
client.mail as client_mail,

View File

@ -16,8 +16,8 @@ class FileExportHelpers
}
public static function GetAddressAndCityFromAddress(string $adresse){
$adresseResult = "Aucun adresse";
$cityResult = "Aucune ville";
$adresseResult = "";
$cityResult = "";
$adresses = explode("-",$adresse);
if(isset($adresses[0])){
$adresseResult = self::RemoveSpaceFromString($adresses[0]);

View File

@ -215,8 +215,8 @@ class CertificateService {
$pdfFilename = $this->getPacemakerCertificateFilename($devisOfDefunt);
$filenamePath = $clean_folder.$pacemakerCertificateFolder.$pdfFilename.'.pdf';
$pdf = new PacemakerCertificatePdfHandler();
$pdf->AddFont('ComicSans','','Comic Sans MS.php');
$pdf->AddFont('ComicSans','B','comic-sans-bold.php');
// $pdf->AddFont('ComicSans','','Comic Sans MS.php');
// $pdf->AddFont('ComicSans','B','comic-sans-bold.php');
$signatureImageExist = $this->signatureImageExists();
$tamponImageExist = $this->tamponImageExist();
$pdf->SetPacemakerCertificateData($devisOfDefunt,$logo,$signatureImageExist ,$tamponImageExist);

View File

@ -94,16 +94,18 @@ class CareCertificatePdfHandler extends FPDF {
$this->MultiCell(0,7, FileExportHelpers::FormatTextForExport('Employé(e) au sein de notre société et titulaire du diplôme national de Thanatopracteur, a effectué des soins de conservation sur le corps du défunt :'));
$this->SetFont('Arial', 'B', 14);
$this->Cell(0,12, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['defunt_nom']),0,1);
$this->SetFont('Arial', '', 14);
$this->Cell(0, 12, FileExportHelpers::FormatTextForExport("Date du décès") . ' : ' . $this->devisOfDefunt['defunt_date'] , 0, 1);
$this->SetFont('Arial', '', 14);
$this->Cell(0,12, FileExportHelpers::FormatTextForExport("Qui reposait à l'adresse suivante") . ' : ',0,1);
$this->SetFont('Arial', 'B', 14);
$this->MultiCell(0,6, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['location_of_devis']));
// $this->Cell(0,12, FileExportHelpers::FormatTextForExport("Qui reposait à l'adresse suivante") . ' : ',0,1);
// $this->SetFont('Arial', 'B', 14);
// $this->MultiCell(0,6, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['location_of_devis']));
$this->SetFont('Arial', '', 14);
$this->Cell(0,12, FileExportHelpers::FormatTextForExport("La présente attestation est établie pour faire valoir ce que de droit."),0,5);
$this->Ln(5);
$this->MultiAlignCell(120,7,FileExportHelpers::FormatTextForExport('Fait à '). FileExportHelpers::FormatTextForExport($this->devisOfDefunt['configuration']->adresse),0);
$this->SetX(140);
$this->Cell(0,7,'le '. $this->devisOfDefunt['devis_date']->format('d/m/Y'),0);
$this->MultiAlignCell(160,7,FileExportHelpers::FormatTextForExport('Fait à '). FileExportHelpers::FormatTextForExport($this->devisOfDefunt['location_of_devis']),0);
$this->SetXY(140, $this->GetY() + 10);
$this->Cell(0,7,'Le '. $this->devisOfDefunt['devis_date']->format('d/m/Y'),0);
}
private function SetCareCertificateTitle(){

View File

@ -93,16 +93,18 @@ class PacemakerCertificatePdfHandler extends FPDF
$this->SetFont('Arial', '', 14);
$this->MultiCell(0, 7, FileExportHelpers::FormatTextForExport('La Société ' . $this->devisOfDefunt['configuration']->entreprise . ' habilitée sous le numéro ' . $this->devisOfDefunt['thanato_reference'] . ', certifie par la présente que : '));
$this->SetFont('Arial', 'B', 14);
$this->Cell(0, 12, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['thanato_nom'] . ' ' . $this->devisOfDefunt['thanato_prenom']), 0, 1);
$this->Cell(0, 12,FileExportHelpers::FormatTextForExport($this->devisOfDefunt['thanato_nom'] . ' ' . $this->devisOfDefunt['thanato_prenom']), 0, 1);
$this->SetFont('Arial', '', 14);
$this->MultiCell(0, 7, FileExportHelpers::FormatTextForExport('Employé(e) au sein de notre société et titulaire du diplôme national de Thanatopracteur, a retiré ce jour, la prothèse fonctionnant à pile implantée sur le corps du défunt :'));
$this->MultiCell(0, 7, FileExportHelpers::FormatTextForExport('Employé(e) au sein de notre société et titulaire du diplôme national de Thanatopracteur, a retiré ce jour, une prothèse fonctionnant au moyen d\'une pile implantée dans le corps du défunt :'));
$this->SetFont('Arial', 'B', 14);
$this->Cell(0, 12, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['defunt_nom']), 0, 1);
$this->SetFont('Arial', '', 14);
$this->Cell(0, 12, FileExportHelpers::FormatTextForExport("Qui reposait à l'adresse suivante") . ' : ', 0, 1);
$this->SetFont('Arial', 'B', 14);
$this->MultiCell(0, 6, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['location_of_devis']));
$this->Ln(6);
$this->Cell(0, 12, FileExportHelpers::FormatTextForExport("Date du décès") . ' : ' . $this->devisOfDefunt['defunt_date'] , 0, 1);
//$this->SetFont('Arial', '', 14);
//$this->Cell(0, 12, FileExportHelpers::FormatTextForExport("Qui reposait à l'adresse suivante") . ' : ', 0, 1);
//$this->SetFont('Arial', 'B', 14);
//$this->MultiCell(0, 6, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['location_of_devis']));
// $this->Ln(6);
$this->SetFont('Arial', '', 14);
$this->Cell(
0,
@ -123,9 +125,9 @@ class PacemakerCertificatePdfHandler extends FPDF
$this->Cell(0, 12, FileExportHelpers::FormatTextForExport("La présente attestation est établie pour faire valoir ce que de droit."), 0, 5);
$this->Ln(5);
$this->MultiAlignCell(120, 7, FileExportHelpers::FormatTextForExport('Fait à ') . FileExportHelpers::FormatTextForExport($this->devisOfDefunt['configuration']->adresse), 0);
$this->SetX(140);
$this->Cell(0, 7, 'le ' . $this->devisOfDefunt['devis_date']->format('d/m/Y'), 0);
$this->MultiAlignCell(160, 7, FileExportHelpers::FormatTextForExport('Fait à ') . FileExportHelpers::FormatTextForExport($this->devisOfDefunt['location_of_devis']), 0);
$this->SetXY(140, $this->GetY() + 10);
$this->Cell(0, 7, 'Le ' . $this->devisOfDefunt['devis_date']->format('d/m/Y'), 0);
}
private function SetPacemakerCertificateTitle()

View File

@ -49,14 +49,14 @@ class DevisPdfHandler extends FPDF
function Footer()
{
$this->SetY(-40);
$this->SetFont('ComicSans', '', 7);
$this->SetFont('Arial', '', 7);
$this->MultiCell(0, 5, utf8_decode(html_entity_decode('Tout retard de paiement entraînera de plein droit une pénalité de retard de 3 fois le taux légal ( Loi 2008-776 du 4 août 2008) et une indemnité forfaitaire de 40 EUR pour frais de recouvrement sera appliquée.')));
$this->Ln(1);
$this->MultiCell(0, 5, utf8_decode(html_entity_decode('Si les frais de recouvrement sont supérieurs à ce montant forfaitaire, une indemnisation complémentaire sera due sur présentation de justificatifs ( articles L.441-3 et L.441-6 du code de commerce ).
')));
$this->SetY(-15);
$this->SetFont('ComicSans', 'B', 8);
$this->SetFont('Arial', 'B', 8);
$this->Cell(0, 10, utf8_decode(html_entity_decode($this->devisData['configuration']->legal_one)), 0, 0, 'C');
}
@ -75,13 +75,12 @@ class DevisPdfHandler extends FPDF
private function DrawDevisCompanyAndClientInfo()
{
$this->SetY(40);
$this->SetFont('ComicSans', '', 12);
$this->SetFont('Arial', '', 12);
$this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->devisData['configuration']->entreprise), 0, 0);
$this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->devisData['client_nom']), 0, 1, 'R');
$this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->devisData['configuration_adresse']), 0, 0);
$this->Cell(0, 7, trim(FileExportHelpers::FormatTextForExport($this->devisData['client_real_adress'])), 0, 1, 'R');
$this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->devisData['configuration_adresse_city']), 0, 0);
border:
$this->Cell(0, 7, trim(FileExportHelpers::FormatTextForExport($this->devisData['client_adress_city'])), 0, 1, 'R');
$this->Cell(0, 7, FileExportHelpers::FormatTextForExport('Tél : ') . FileExportHelpers::FormatTextForExport($this->devisData['configuration']->telephone), 0, 0);
$this->Cell(0, 7, 'Siret: ' . $this->devisData['siret'], 0, 1, 'R');
@ -91,12 +90,12 @@ class DevisPdfHandler extends FPDF
private function DrawDevisInfoTable()
{
$this->SetFont('ComicSans', 'B', 11);
$this->SetFont('Arial', 'B', 11);
$this->Cell(30, 7, 'DATE', 1, 0, 'C');
$this->Cell(80, 7, 'CLIENT', 1, 0, 'C');
$this->Cell(40, 7, 'DEVIS', 1, 1, 'C');
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$this->Cell(30, 7, $this->devisData['devis_date'], 1, 0, 'C');
$this->Cell(80, 7, utf8_decode(html_entity_decode($this->devisData['client_nom'])), 1, 0, 'C');
$this->Cell(40, 7, $this->devisData['devis_full_number'], 1, 1, 'C');
@ -120,7 +119,7 @@ class DevisPdfHandler extends FPDF
private function DrawArticlesTableHeader()
{
$tvaValue = $this->devisData["configuration"]->tva_default;
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$this->SetXY(10, 106);
$this->Cell(20, 8, "Date", 0, 0, 'C');
@ -140,7 +139,7 @@ class DevisPdfHandler extends FPDF
public function DrawArticlesTableValueAndReturnTotalPrice()
{
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$tvaValue = $this->devisData["configuration"]->tva_default;
$totalHt = 0;
$totalTtc = 0;
@ -187,19 +186,19 @@ class DevisPdfHandler extends FPDF
private function DrawBankAndTotalPriceInfo($totalPriceArray)
{
$this->SetY(210);
$this->SetFont('ComicSans', '', 9);
$this->SetFont('Arial', '', 9);
$this->MultiCell(0, 5, utf8_decode(html_entity_decode("Paiement à votre convenance par chèque à l'ordre de " . $this->devisData['configuration']->entreprise)));
$this->MultiCell(0, 5, utf8_decode(html_entity_decode("en indiquant le numéro de facture, ou par virement :")));
$this->Ln(1);
//Table IBAN
$this->SetFont('ComicSans', '', 11);
$this->SetFont('Arial', '', 11);
$ibanWidth = 90;
$ibanCursorY = $this->GetY();
$this->Cell($ibanWidth, 7, 'IBAN : FR76 1360 6000 1436 5418 1800 038', 1, 1, 'C');
$this->Cell($ibanWidth, 7, 'IBAN : FR76 1670 6052 4453 9757 9734 871', 1, 1, 'C');
$ibanCursorX = $this->GetX();
$this->Cell($ibanWidth, 7, 'Code SWIFT : AGRI FR PP 836', 1, 1, 'C');
$this->Cell($ibanWidth, 7, 'Code SWIFT : AGRI FR PP867', 1, 1, 'C');
//TABLE HT
$ibanLastPositionX = $ibanCursorX + $ibanWidth + 20;

View File

@ -34,7 +34,7 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler {
public int $maxArticlePerPage = 6;
public function DrawArticlesTableValue(){
$this->SetFont('ComicSans','',10);
$this->SetFont('Arial','',10);
$devisData = $this->factureData['devis'];
$tvaValue = $this->factureData["configuration"]->tva_default;
$totalHt = 0;

View File

@ -50,7 +50,7 @@ class InvoiceGroupPdfHandler extends FPDF
public $thereIsOrderOrCaseNumber = false;
public $startingYOfArticlesTable = 100;
public int $maxArticlePerPage = 19;
public int $maxArticlePerPage = 7;
public $additionalArticlesLineBasedOnMultiline = 0;
public $interLigneHeader = 5;
@ -68,27 +68,32 @@ class InvoiceGroupPdfHandler extends FPDF
}
function AddWatermark()
{
$this->SetAlpha(0.2);
try {
$this->SetAlpha(0.2);
$imagePath = $this->logoPath . "filigrane_pdf.png";
list($originalWidth, $originalHeight) = getimagesize($imagePath);
$imagePath = $this->logoPath . "filigrane_pdf.png";
list($originalWidth, $originalHeight) = getimagesize($imagePath);
// Convertir les dimensions de pixels à mm (1 pixel = 0.264583 mm)
// Convertir les dimensions de pixels à mm (1 pixel = 0.264583 mm)
$originalWidth = $originalWidth * 0.264583;
$originalHeight = $originalHeight * 0.264583;
// Convertir les dimensions de pixels à mm (1 pixel = 0.264583 mm)
// Convertir les dimensions de pixels à mm (1 pixel = 0.264583 mm)
$originalWidth = $originalWidth * 0.264583;
$originalHeight = $originalHeight * 0.264583;
// Augmenter l'échelle, par exemple, 1.5 pour 150% de la taille d'origine
$scale = 1.7;
$width = $originalWidth * $scale;
$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) + 21; // 297 mm est la hauteur d'une page A4
// Augmenter l'échelle, par exemple, 1.5 pour 150% de la taille d'origine
$scale = 1.7;
$width = $originalWidth * $scale;
$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) + 21; // 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
$this->SetAlpha(0.1); // Définir l'opacité
// Ajouter l'image en filigrane
$this->Image($imagePath, $x, $y, $width, $height); // Chemin, position x, position y, largeur, hauteur
$this->SetAlpha(0.1); // Définir l'opacité
} catch (\Throwable $th) {
}
}
function SetAlpha($alpha)
@ -109,7 +114,7 @@ class InvoiceGroupPdfHandler extends FPDF
function Footer()
{
$this->SetY(-34);
$this->SetFont('ComicSans', '', 7);
$this->SetFont('Arial', '', 7);
$this->MultiCell(0, 4, utf8_decode(html_entity_decode('Tout retard de paiement entraînera de plein droit une pénalité de retard de 3 fois le taux légal ')));
$this->MultiCell(0, 4, utf8_decode(html_entity_decode('(Loi 2008-776 du 4 août 2008) et une indemnité forfaitaire de 40 EUR pour frais de recouvrement sera appliquée.')));
@ -119,7 +124,7 @@ class InvoiceGroupPdfHandler extends FPDF
$this->MultiCell(0, 4, utf8_decode(html_entity_decode('sera due sur présentation de justificatifs (articles L.441-3 et L.441-6 du code de commerce).')));
$this->SetY(-10);
$this->SetFont('ComicSans', '', 7);
$this->SetFont('Arial', '', 7);
$this->Cell(0, 10, utf8_decode(html_entity_decode($this->factureData['configuration']->legal_one)), 0, 0, 'C');
}
@ -167,7 +172,7 @@ class InvoiceGroupPdfHandler extends FPDF
public function DrawInvoiceCompanyInfo()
{
$this->SetY(40);
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$this->Cell(0, $this->interLigneHeader, FileExportHelpers::FormatTextForExport($this->factureData['configuration']->entreprise), 0, 1);
$this->Cell(0, $this->interLigneHeader, FileExportHelpers::FormatTextForExport($this->factureData['configuration_adresse']), 0, 1);
$this->Cell(0, $this->interLigneHeader, FileExportHelpers::FormatTextForExport($this->factureData['configuration_adresse_city']), 0, 1);
@ -176,7 +181,7 @@ class InvoiceGroupPdfHandler extends FPDF
}
public function DrawInvoiceClientInfo()
{
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$clientName = $this->factureData['group_name'];
$clientInfoXAxis = 135;
@ -266,13 +271,13 @@ class InvoiceGroupPdfHandler extends FPDF
$factureDateEcheance->modify('last day of next month');
$factureDateEcheance = $factureDateEcheance->format('d-m-Y');
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$this->Cell(25, 7, 'DATE', 1, 0, 'C');
$this->Cell(104, 7, 'CLIENT', 1, 0, 'C');
$this->Cell(39, 7, 'FACTURE', 1, 0, 'C');
$this->Cell(36, 7, 'ECHEANCE', 1, 1, 'C');
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$this->Cell(25, 7, $factureDatePaiement, 1, 0, 'C');
$this->Cell(104, 7, utf8_decode(html_entity_decode($this->factureData['group_name'])), 1, 0, 'C');
$this->Cell(39, 7, $this->factureData['num'], 1, 0, 'C');
@ -295,7 +300,7 @@ class InvoiceGroupPdfHandler extends FPDF
// les traits verticaux colonnes
$additionalMargRight = 1;
$endingLine = 233 + $additionnalheight;
$this->Line(27 + $additionalMargRight, $this->startingYOfArticlesTable, 27 + $additionalMargRight, $endingLine);
$this->Line( 27 + $additionalMargRight, $this->startingYOfArticlesTable, 27 + $additionalMargRight, $endingLine);
$this->Line(142 + $additionalMargRight, $this->startingYOfArticlesTable, 142 + $additionalMargRight, $endingLine);
$this->Line(164 + $additionalMargRight, $this->startingYOfArticlesTable, 164 + $additionalMargRight, $endingLine);
$this->Line(182 + $additionalMargRight, $this->startingYOfArticlesTable, 182 + $additionalMargRight, $endingLine);
@ -306,8 +311,8 @@ class InvoiceGroupPdfHandler extends FPDF
$additionalMargRight = 1;
$tvaValue = $this->factureData["configuration"]->tva_default;
$columnNameY = $this->startingYOfArticlesTable - 1.5;
$this->SetFont('ComicSans', '', 10);
$this->SetXY(12 + $additionalMargRight, $columnNameY);
$this->SetFont('Arial', '', 10);
$this->SetXY(35 + $additionalMargRight, $columnNameY);
$this->Cell(7, 10, "Date", 0, 0, 'C');
$this->SetXY(30 + $additionalMargRight, $columnNameY);
@ -327,7 +332,7 @@ class InvoiceGroupPdfHandler extends FPDF
{
// Set espacement avant de continue
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$devisData = $this->factureData['devis'];
$tvaValue = $this->factureData["configuration"]->tva_default;
$totalHt = 0;
@ -336,6 +341,7 @@ class InvoiceGroupPdfHandler extends FPDF
$yValue = $this->startingYOfArticlesTable + 13;
// $maxDescriptionWidth = 102;
$maxDescriptionWidth = 104.3;
// $maxDescriptionWidth = 51;
$currentIndexPosition = $this->currentIndexPosition;
for ($currentIndexPosition; $currentIndexPosition < ($this->initialIndexPosition + $this->devisCountToGet); $currentIndexPosition++) {
$currentDevis = $devisData[$currentIndexPosition];
@ -351,16 +357,23 @@ class InvoiceGroupPdfHandler extends FPDF
$totalHt += $valueHt;
$totalTtc += $valueTtc;
$productDescription = $product["produit_description"] ?? "";
$currentDevisDefuntName = $currentDevis["defunt_nom"] ?? "";
$dateValue = "";
$dateAndDefuntName = "";
if ($productIncrement == 0) {
$dateValue = $devisDate;
$productDescription .= " de " . $currentDevis["defunt_nom"] ?? "";
// $productDescription .= " de " . $currentDevis["defunt_nom"] ?? "";
$dateAndDefuntName = $dateValue . " - " . $currentDevisDefuntName;
$this->SetXY(70, $yValue);
$this->Cell(5, 6, $currentDevisDefuntName, 0, 0);
$this->SetXY(4, $yValue + 5);
$this->Cell(5, 6, $dateValue, 0, 0);
}
$tvaAmount = $valueTtc - $valueHt;
$this->SetXY(4, $yValue);
$this->Cell(5, 6, $dateValue, 0, 0);
$this->SetXY(30, $yValue);
$tvaAmount = $valueTtc - $valueHt;
$this->SetXY(30, $yValue + 5);
$productDescription = FileExportHelpers::FormatTextForExport($productDescription);
$productDescriptionWidth = $this->GetStringWidth($productDescription);
$productDescriptionWidthIsGreaterThanMaxWidth = $productDescriptionWidth > $maxDescriptionWidth;
@ -378,13 +391,13 @@ class InvoiceGroupPdfHandler extends FPDF
}
$this->SetXY(144, $yValue);
$this->SetXY(144, $yValue + 5);
$this->Cell(20, 6, number_format($valueHt, 2, '.', '') . chr(128), 0, 0, 'C');
$this->SetXY(165, $yValue);
$this->SetXY(165, $yValue + 5);
$this->Cell(20, 6, number_format($tvaAmount, 2, '.', '') . chr(128), 0, 0, 'C');
$this->SetXY(182, $yValue);
$this->SetXY(182, $yValue + 5);
$this->Cell(25, 6, number_format($valueTtc, 2, '.', '') . chr(128), 0, 1, 'C');
$yValue += 6;
$totalTva += $tvaAmount;
@ -393,6 +406,11 @@ class InvoiceGroupPdfHandler extends FPDF
}
$productIncrement++;
}
$yValue += 6;
$isLastLigneDevis = $currentIndexPosition == (($this->initialIndexPosition + $this->devisCountToGet) -1);
if (!$isLastLigneDevis) {
$this->Line(3, $yValue , 207, $yValue);
}
}
$this->currentIndexPosition = $currentIndexPosition;
$this->initialIndexPosition = $this->currentIndexPosition;
@ -406,7 +424,7 @@ class InvoiceGroupPdfHandler extends FPDF
{
$startOfYAfterMainTable = 239;
$this->SetY($startOfYAfterMainTable);
$this->SetFont('ComicSans', '', 8);
$this->SetFont('Arial', '', 8);
$this->MultiCell(0, 4, utf8_decode(html_entity_decode("Paiement à votre convenance par chèque à l'ordre de " . $this->factureData['configuration']->entreprise)));
$this->MultiCell(0, 4, utf8_decode(html_entity_decode("en indiquant le numéro de facture, ou par virement :")));
@ -414,13 +432,13 @@ class InvoiceGroupPdfHandler extends FPDF
//Table IBAN
$startOftable = 3;
$this->SetX($startOftable);
$this->SetFont('ComicSans', '', 8);
$this->SetFont('Arial', '', 8);
$ibanWidth = 62;
$this->Cell($ibanWidth, 6.5, 'IBAN : FR76 1360 6000 1436 5418 1800 038', 1, 1, 'C');
$this->Cell($ibanWidth, 6.5, 'IBAN : FR76 1670 6052 4453 9757 9734 871', 1, 1, 'C');
$ibanCursorX = $this->GetX();
$this->SetX($startOftable);
$this->Cell($ibanWidth, 6.5, 'Code SWIFT : AGRI FR PP 836', 1, 1, 'C');
$this->Cell($ibanWidth, 6.5, 'Code SWIFT : AGRI FR PP867', 1, 1, 'C');
//TABLE HT
$tableWidth = 48; // Largeur totale de la 2e table (20+20)
@ -430,7 +448,7 @@ class InvoiceGroupPdfHandler extends FPDF
$startOfArrayX = $pageWidth - $tableWidth - $marginRight;
$startOfArrayY = $startOfYAfterMainTable + 0.5;
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$totalPriceArray = $this->totalPrices;
foreach ($totalPriceArray as $label => $price) {
$this->SetXY($startOfArrayX, $startOfArrayY);

View File

@ -61,27 +61,32 @@ class InvoicePdfHandler extends FPDF
function AddWatermark()
{
$this->SetAlpha(0.2);
try {
$this->SetAlpha(0.2);
$imagePath = $this->logoPath . "filigrane_pdf.png";
list($originalWidth, $originalHeight) = getimagesize($imagePath);
$imagePath = $this->logoPath . "filigrane_pdf.png";
list($originalWidth, $originalHeight) = getimagesize($imagePath);
// Convertir les dimensions de pixels à mm (1 pixel = 0.264583 mm)
// Convertir les dimensions de pixels à mm (1 pixel = 0.264583 mm)
$originalWidth = $originalWidth * 0.264583;
$originalHeight = $originalHeight * 0.264583;
// Convertir les dimensions de pixels à mm (1 pixel = 0.264583 mm)
// Convertir les dimensions de pixels à mm (1 pixel = 0.264583 mm)
$originalWidth = $originalWidth * 0.264583;
$originalHeight = $originalHeight * 0.264583;
// Augmenter l'échelle, par exemple, 1.5 pour 150% de la taille d'origine
$scale = 1.7;
$width = $originalWidth * $scale;
$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) + 21; // 297 mm est la hauteur d'une page A4
// Augmenter l'échelle, par exemple, 1.5 pour 150% de la taille d'origine
$scale = 1.7;
$width = $originalWidth * $scale;
$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) + 21; // 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
$this->SetAlpha(0.1); // Définir l'opacité
// Ajouter l'image en filigrane
$this->Image($imagePath, $x, $y, $width, $height); // Chemin, position x, position y, largeur, hauteur
$this->SetAlpha(0.1); // Définir l'opacité
} catch (\Exception $e) {
}
}
function SetAlpha($alpha)
@ -96,7 +101,7 @@ class InvoicePdfHandler extends FPDF
function Footer()
{
$this->SetY(-34);
$this->SetFont('ComicSans', '', 7);
$this->SetFont('Arial', '', 7);
$this->MultiCell(0, 4, utf8_decode(html_entity_decode('Tout retard de paiement entraînera de plein droit une pénalité de retard de 3 fois le taux légal ')));
$this->MultiCell(0, 4, utf8_decode(html_entity_decode('(Loi 2008-776 du 4 août 2008) et une indemnité forfaitaire de 40 EUR pour frais de recouvrement sera appliquée.')));
@ -105,7 +110,7 @@ class InvoicePdfHandler extends FPDF
$this->MultiCell(0, 4, utf8_decode(html_entity_decode('sera due sur présentation de justificatifs (articles L.441-3 et L.441-6 du code de commerce).')));
$this->SetY(-10);
$this->SetFont('ComicSans', '', 7);
$this->SetFont('Arial', '', 7);
$this->Cell(0, 10, utf8_decode(html_entity_decode($this->factureData['configuration']->legal_one)), 0, 0, 'C');
}
@ -149,7 +154,7 @@ class InvoicePdfHandler extends FPDF
private function DrawInvoiceCompanyInfo()
{
$this->SetY(40);
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$this->Cell(0, $this->interLigneHeader, FileExportHelpers::FormatTextForExport($this->factureData['configuration']->entreprise), 0, 1);
$this->Cell(0, $this->interLigneHeader, FileExportHelpers::FormatTextForExport($this->factureData['configuration_adresse']), 0, 1);
$this->Cell(0, $this->interLigneHeader, FileExportHelpers::FormatTextForExport($this->factureData['configuration_adresse_city']), 0, 1);
@ -158,7 +163,7 @@ class InvoicePdfHandler extends FPDF
}
private function DrawInvoiceClientInfo()
{
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$clientName = $this->factureData['client_nom'];
if ($this->factureData["group_name"] != null && $this->factureData["group_name"] != "") {
$clientName = $this->factureData['group_name'];
@ -228,14 +233,14 @@ class InvoicePdfHandler extends FPDF
$factureDateEcheance->modify('last day of next month');
$factureDateEcheance = $factureDateEcheance->format('d-m-Y');
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$this->Cell(25, 7, 'DATE', 1, 0, 'C');
$this->Cell(104, 7, 'CLIENT', 1, 0, 'C');
$this->Cell(39, 7, 'FACTURE', 1, 0, 'C');
$this->Cell(36, 7, 'ECHEANCE', 1, 1, 'C');
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$this->Cell(25, 7, $factureDatePaiement, 1, 0, 'C');
$this->Cell(104, 7, utf8_decode(html_entity_decode($this->factureData['client_nom'])), 1, 0, 'C');
$this->Cell(39, 7, $this->factureData['num'], 1, 0, 'C');
@ -285,7 +290,7 @@ class InvoicePdfHandler extends FPDF
$additionalMargRight = 1;
$tvaValue = $this->factureData["configuration"]->tva_default;
$columnNameY = $this->startingYOfArticlesTable - 1;
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$this->SetXY(12 + $additionalMargRight, $columnNameY);
$this->Cell(7, 10, "Date", 0, 0, 'C');
@ -304,7 +309,7 @@ class InvoicePdfHandler extends FPDF
public function DrawArticlesTableValueAndReturnTotalPrice()
{
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
$devisDate = $this->factureData['devis_date'];
$devisDate = DateTime::createFromFormat('Y-m-d', $devisDate);
$devisDate = $devisDate->format('d-m-Y');
@ -323,28 +328,31 @@ class InvoicePdfHandler extends FPDF
$totalTtc += $valueTtc;
$productDescription = $product["produit_description"];
$dateValue = "";
if ($product === end($products)) {
if ($product === reset($products)) {
$dateValue = $devisDate;
$productDescription .= " de " . FileExportHelpers::GetSexeLabel($this->factureData['defunt_sexe']) . ' ' . $this->factureData["defunt_nom"];
// $productDescription .= " de " . FileExportHelpers::GetSexeLabel($this->factureData['defunt_sexe']) . ' ' . $this->factureData["defunt_nom"];
$this->SetXY(70, $yValue);
$this->Cell(5, 6, $this->factureData["defunt_nom"], 0, 0);
}
$yValue += 3;
$tvaAmount = $valueTtc - $valueHt;
$this->SetXY(5, $yValue);
$this->SetXY(5, $yValue + 5);
$this->Cell(5, 6, $dateValue, 0, 0);
$this->SetXY(30, $yValue);
$this->SetXY(30, $yValue +5);
$this->MultiAlignCell($maxDescriptionWidth, 6, utf8_decode(html_entity_decode($productDescription)), 0, '0', );
$this->SetXY(144, $yValue);
$this->SetXY(144, $yValue +5);
$this->Cell(20, 6, number_format($valueHt, 2, '.', '') . chr(128), 0, 0, 'C');
$this->SetXY(165, $yValue);
$this->SetXY(165, $yValue + 5);
$this->Cell(20, 6, number_format($tvaAmount, 2, '.', '') . chr(128), 0, 0, 'C');
$this->SetXY(182, $yValue);
$this->SetXY(182, $yValue + 5);
$this->Cell(25, 6, number_format($valueTtc, 2, '.', '') . chr(128), 0, 1, 'C');
$yValue += 12;
$yValue += 6;
$totalTva += $tvaAmount;
}
@ -359,7 +367,7 @@ class InvoicePdfHandler extends FPDF
{
$startOfYAfterMainTable = 236;
$this->SetY($startOfYAfterMainTable);
$this->SetFont('ComicSans', '', 8);
$this->SetFont('Arial', '', 8);
$this->MultiCell(0, 4, utf8_decode(html_entity_decode("Paiement à votre convenance par chèque à l'ordre de " . $this->factureData['configuration']->entreprise)));
$this->MultiCell(0, 4, utf8_decode(html_entity_decode("en indiquant le numéro de facture, ou par virement :")));
@ -367,11 +375,11 @@ class InvoicePdfHandler extends FPDF
$startOftable = 3;
$this->SetX($startOftable);
// Table IBAN
$this->SetFont('ComicSans', '', 8);
$this->SetFont('Arial', '', 8);
$ibanWidth = 62;
$this->Cell($ibanWidth, 6.5, 'IBAN : FR76 1360 6000 1436 5418 1800 038', 1, 1, 'C');
$this->Cell($ibanWidth, 6.5, 'IBAN : FR76 1670 6052 4453 9757 9734 871', 1, 1, 'C');
$this->SetX($startOftable);
$this->Cell($ibanWidth, 6.5, 'Code SWIFT : AGRI FR PP 836', 1, 1, 'C');
$this->Cell($ibanWidth, 6.5, 'Code SWIFT : AGRI FR PP867', 1, 1, 'C');
//TABLE HT
$tableWidth = 48; // Largeur totale de la 2e table (20+20)
@ -382,7 +390,7 @@ class InvoicePdfHandler extends FPDF
$startOfArrayX = $pageWidth - $tableWidth - $marginRight;
$startOfArrayY = $startOfYAfterMainTable + 0.5;
$this->SetFont('ComicSans', '', 10);
$this->SetFont('Arial', '', 10);
foreach ($totalPriceArray as $label => $price) {
$this->SetXY($startOfArrayX, $startOfArrayY);

View File

@ -93,8 +93,8 @@ class InvoicePdfService {
$clean_folder = html_entity_decode(string: $currentConfig->path).'/';
$factureFolders = $this->getFacturesFolder($invoicePdfData,$clean_folder);
$pdf = new InvoicePdfHandler();
$pdf->AddFont('ComicSans','','Comic Sans MS.php');
$pdf->AddFont('ComicSans','B','comic-sans-bold.php');
// $pdf->AddFont('ComicSans','','Comic Sans MS.php');
// $pdf->AddFont('ComicSans','B','comic-sans-bold.php');
$pdf->InvoicePdfFactory($invoicePdfData,$logo);
$pdf->SetFactureContent();
$pdfContent = $pdf->Output('','S');
@ -188,8 +188,8 @@ class InvoicePdfService {
$pdf = new InvoiceGroupPdfHandler();
break;
}
$pdf->AddFont('ComicSans','','Comic Sans MS.php');
$pdf->AddFont('ComicSans','B','comic-sans-bold.php');
// $pdf->AddFont('ComicSans','','Comic Sans MS.php');
// $pdf->AddFont('ComicSans','B','comic-sans-bold.php');
$pdf->InvoicePdfFactory($invoicePdfData,$logo);
$pdf->SetFactureContent();
$pdfContent = $pdf->Output('','S');
@ -230,8 +230,8 @@ class InvoicePdfService {
return null;
}
$pdf = new InvoicePdfHandler();
$pdf->AddFont('ComicSans','','Comic Sans MS.php');
$pdf->AddFont('ComicSans','B','comic-sans-bold.php');
// $pdf->AddFont('ComicSans','','Comic Sans MS.php');
// $pdf->AddFont('ComicSans','B','comic-sans-bold.php');
$pdf->MutlipleInvoicePdfFactory($invoiceData,$logo);
$pdf->SetMultipleFactureContent();
$racinePath = html_entity_decode(string: $currentConfig->path).'/';

View File

@ -38,7 +38,7 @@ class MailerService {
){
$this->adminStorage = $rootFolder->getUserFolder(BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD);
}
public function getFooterContent ($userName = "Johann"){
public function getFooterContent ($userName = "DEKINDT Vanessa"){
$wish = "<p>Vous en souhaitant bonne réception. </p>";
$cordialement = "<p> Cordialement,</p>";
$userName = "<p> {$userName} </p>" ;