DV : add footer email to Vannessa and rectifie invoice simple template

This commit is contained in:
narindraezway 2025-08-08 10:49:49 +03:00
parent 4dd8b224e3
commit 4569c4e8c5
3 changed files with 19 additions and 11 deletions

View File

@ -109,7 +109,7 @@ class InvoiceController extends Controller
$message->attach($content); $message->attach($content);
$message->setSubject("Facture"); $message->setSubject("Facture");
$signature = $this->mailerService->getFooterContent(); $signature = $this->mailerService->getFooterContent( $this->getUserNameForEmailSignature());
$message->setHtmlBody( $message->setHtmlBody(
"<p>Bonjour.</p>". "<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']); 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 (){ 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]; $currentConfig = $configs[0];
return $currentConfig->nom . " " . $currentConfig->prenom; return $currentConfig->nom . " " . $currentConfig->prenom;
} }

View File

@ -328,28 +328,31 @@ class InvoicePdfHandler extends FPDF
$totalTtc += $valueTtc; $totalTtc += $valueTtc;
$productDescription = $product["produit_description"]; $productDescription = $product["produit_description"];
$dateValue = ""; $dateValue = "";
if ($product === end($products)) { if ($product === reset($products)) {
$dateValue = $devisDate; $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; $tvaAmount = $valueTtc - $valueHt;
$this->SetXY(5, $yValue); $this->SetXY(5, $yValue + 5);
$this->Cell(5, 6, $dateValue, 0, 0); $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->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->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->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'); $this->Cell(25, 6, number_format($valueTtc, 2, '.', '') . chr(128), 0, 1, 'C');
$yValue += 12; $yValue += 6;
$totalTva += $tvaAmount; $totalTva += $tvaAmount;
} }