fix stats devis thanato

This commit is contained in:
Tolotsoa 2025-11-19 12:01:51 +03:00
parent 411cc2d5a8
commit 03784fd8e6
2 changed files with 355 additions and 275 deletions

View File

@ -2615,7 +2615,7 @@ class Bdd
return $data; return $data;
} }
private function getThanatoDevisListByDate($thanatoId, $date) private function getThanatoDevisListByDateSave($thanatoId, $date)
{ {
$dateFormatted = $date->format('Y-m-d'); $dateFormatted = $date->format('Y-m-d');
$sql = "SELECT $sql = "SELECT
@ -2656,6 +2656,42 @@ class Bdd
return $devisList; return $devisList;
} }
private function getThanatoDevisListByDate($thanatoId, $date)
{
$dateFormatted = $date->format('Y-m-d');
$sql = "SELECT
devis.id,
devis.date,
devis.mentions,
devis.num as calendar_uuid,
devis.id_defunt as id_defunt,
devis.id_lieu as id_lieu,
devis.id_client as id_client,
devis.id_thanato as id_thanato,
thanato.nom as nom_thanato,
thanato.prenom as prenom_thanato,
defunt.nom as nom_defunt,
lieu.nom as nom_lieu,
lieu.latitude as lieu_latitude,
lieu.longitude as lieu_longitude,
client.nom as nom_client,
client.entreprise as client_entreprise,
client.adresse as client_adresse
FROM ".$this->tableprefix."devis as devis
LEFT JOIN ".$this->tableprefix."thanato as thanato on devis.id_thanato = thanato.id
LEFT JOIN ".$this->tableprefix."lieu as lieu on devis.id_lieu = lieu.id
LEFT JOIN ".$this->tableprefix."defunt as defunt on devis.id_defunt = defunt.id
LEFT JOIN ".$this->tableprefix."client as client on devis.id_client = client.id
WHERE devis.date = ? AND
devis.id_thanato = ?
ORDER BY devis.date ASC;";
$devisList = $this->execSQLNoJsonReturn(
$sql,
[$dateFormatted,$thanatoId]
);
return $devisList;
}
public function getThanatoById($thanatoId) public function getThanatoById($thanatoId)
{ {
$sql = "SELECT id, nom, prenom,fk_user_uuid FROM ".$this->tableprefix."thanato WHERE id = ? LIMIT 1;"; $sql = "SELECT id, nom, prenom,fk_user_uuid FROM ".$this->tableprefix."thanato WHERE id = ? LIMIT 1;";

View File

@ -34,149 +34,158 @@ use OCA\Gestion\Constants\BddConstant;
use OCA\Gestion\Helpers\FileExportHelpers; use OCA\Gestion\Helpers\FileExportHelpers;
use OCA\Gestion\Constants\AbsenceTypeConstant; use OCA\Gestion\Constants\AbsenceTypeConstant;
class ExportThanatoStatisticService { class ExportThanatoStatisticService
/** @var Bdd */ {
private $gestionBdd; /** @var Bdd */
private $gestionBdd;
/** @var LoggerInterface */ /** @var LoggerInterface */
private $logger; private $logger;
/** @var IRootFolder */ /** @var IRootFolder */
private $rootFolder; private $rootFolder;
private $geoService; private $geoService;
public function __construct( public function __construct(
Bdd $gestionBdd, Bdd $gestionBdd,
LoggerInterface $logger, LoggerInterface $logger,
IRootFolder $rootFolder, IRootFolder $rootFolder,
GeoService $geoService) { GeoService $geoService
$this->geoService = $geoService; ) {
$this->rootFolder = $rootFolder; $this->geoService = $geoService;
$this->logger = $logger; $this->rootFolder = $rootFolder;
$this->gestionBdd = $gestionBdd; $this->logger = $logger;
} $this->gestionBdd = $gestionBdd;
}
private function getFilename($thanatoName,$thanatoLastName,$month,$year){ private function getFilename($thanatoName, $thanatoLastName, $month, $year)
$filename = "$year-$month-"; {
$filename .= $thanatoName . '-' . $thanatoLastName; $filename = "$year-$month-";
$filename = str_replace(' ','-', $filename); $filename .= $thanatoName . '-' . $thanatoLastName;
$filename = str_replace(' ','-', $filename); $filename = str_replace(' ', '-', $filename);
$filename = str_replace(' ', '-', $filename);
return $filename; return $filename;
} }
private function exportThanatoStatistic($thanatoId,$month,$year,$idNextcloud){ private function exportThanatoStatistic($thanatoId, $month, $year, $idNextcloud)
$thanato = $this->gestionBdd->getThanatoById($thanatoId); {
if($thanato == null){ $thanato = $this->gestionBdd->getThanatoById($thanatoId);
return null; if($thanato == null) {
} return null;
$exportData = $this->gestionBdd->getExportThanatoStatisticData($thanatoId,$month,$year); }
if(empty($exportData)){ $exportData = $this->gestionBdd->getExportThanatoStatisticData($thanatoId, $month, $year);
return null; if(empty($exportData)) {
} return null;
$defaultConfig = json_decode($this->gestionBdd->getConfiguration(BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD)); }
$racineFolder = html_entity_decode($defaultConfig[0]->path).'/'; $defaultConfig = json_decode($this->gestionBdd->getConfiguration(BddConstant::DEFAULT_ADMIN_ID_NEXTCLOUD));
$thanatoFolder = $racineFolder.'STATISTIQUES/THANATOS/'; $racineFolder = html_entity_decode($defaultConfig[0]->path).'/';
$fileHeader = $this->getExportThanatoFileHeader(); $thanatoFolder = $racineFolder.'STATISTIQUES/THANATOS/';
$fileContent = $this->populateExportDataIntoFileContent($exportData,$fileHeader); $fileHeader = $this->getExportThanatoFileHeader();
$storage = $this->rootFolder->getUserFolder($idNextcloud); $fileContent = $this->populateExportDataIntoFileContent($exportData, $fileHeader);
try{ $storage = $this->rootFolder->getUserFolder($idNextcloud);
$storage->newFolder($thanatoFolder); try {
} $storage->newFolder($thanatoFolder);
catch(\OCP\Files\NotPermittedException $e) { } catch(\OCP\Files\NotPermittedException $e) {
}
$filename = $this->getFilename($thanato["nom"],$thanato["prenom"],$month,$year);
$fileNamePath = $thanatoFolder."STAT-THANATO-" . $filename . '.csv';
$storage->newFile($fileNamePath);
$file = $storage->get($fileNamePath);
$file->putContent($fileContent);
return $fileNamePath;
}
public function exportThanatosListStatistic(array $thanatoIds,$month,$year,$idNextcloud){ }
$filenames = []; $filename = $this->getFilename($thanato["nom"], $thanato["prenom"], $month, $year);
foreach($thanatoIds as $thanatoId){ $fileNamePath = $thanatoFolder."STAT-THANATO-" . $filename . '.csv';
$filename = $this->exportThanatoStatistic($thanatoId,$month,$year,$idNextcloud); $storage->newFile($fileNamePath);
if($filename != null){ $file = $storage->get($fileNamePath);
$filenames[] = $filename; $file->putContent($fileContent);
} return $fileNamePath;
} }
return $filenames;
}
public function getExportThanatoFileHeader(): string{ public function exportThanatosListStatistic(array $thanatoIds, $month, $year, $idNextcloud)
$fileHeader = {
'FACTURE'.';'. $filenames = [];
'THANATOPRACTEUR'.';'. foreach($thanatoIds as $thanatoId) {
'DATE'.';'. $filename = $this->exportThanatoStatistic($thanatoId, $month, $year, $idNextcloud);
'HEURE DE DEBUT'.';'. if($filename != null) {
'HEURE DE FIN'.';'. $filenames[] = $filename;
'SOINS'.';'. }
'JOUR/FERIE'.';'. }
'CONGE'.';'. return $filenames;
'REPOS'.';'. }
'MALADIE'.';'.
'NOM ET PRENOM'.';'.
'LIEU'.';'.
'POMPES FUNEBRES'.';'.
'ADRESSE'.';'.
'DISTANCE TOTALE KM'.';'.
'HEURES TOTAL DE SOIN'.';'.
'HEURES TOTAL DE CONGE'.';'.
'HEURES TOTAL DE REPOS'.';'.
'HEURES TOTAL DE MALADIE'.';'.
'HEURES TOTAL DE TRAVAIL'.';'.
'HEURES TOTAL DE PARCOURS ENTRE DEVIS'.';'.
'NOMBRE DE SOINS ET TOILETTES'.';'.
"\n";
return $fileHeader;
}
private function populateNoDevisDataInADay(string $fileContent,$leave){ public function getExportThanatoFileHeader(): string
$startTimeValue = ""; {
$endTimeValue = ""; $fileHeader =
$leaveValue = "Non"; 'DEVIS'.';'.
if($leave["onLeave"]){ 'THANATOPRACTEUR'.';'.
$startTimeValue = $leave["startTime"]; 'DATE'.';'.
$endTimeValue = $leave["endTime"]; 'HEURE DE DEBUT'.';'.
if($leave["absenceTypeKey"] == AbsenceTypeConstant::LEAVE){ 'HEURE DE FIN'.';'.
$leaveValue = "Oui"; 'SOINS'.';'.
} 'JOUR/FERIE'.';'.
if($leave["absenceTypeKey"] == AbsenceTypeConstant::DISEASE){ 'CONGE'.';'.
$diseaseValue = "Oui"; 'REPOS'.';'.
} 'MALADIE'.';'.
if($leave["absenceTypeKey"] == AbsenceTypeConstant::REST){ 'NOM ET PRENOM'.';'.
$restValue = "Oui"; 'LIEU'.';'.
} 'POMPES FUNEBRES'.';'.
} 'ADRESSE'.';'.
$fileContent = $fileContent. 'DISTANCE TOTALE KM'.';'.
''.';'. 'HEURES TOTAL DE SOIN'.';'.
FileExportHelpers::FormatTextForExport($leave['thanatoName']).';'. 'HEURES TOTAL DE CONGE'.';'.
$leave['date'].';'. 'HEURES TOTAL DE REPOS'.';'.
$startTimeValue.';'. 'HEURES TOTAL DE MALADIE'.';'.
$endTimeValue.';'. 'HEURES TOTAL DE TRAVAIL'.';'.
''.';'. 'HEURES TOTAL DE PARCOURS ENTRE DEVIS'.';'.
DateHelpers::getPublicHolidayText($leave['isPublicHoliday']).';'. 'NOMBRE DE SOINS ET TOILETTES'.';'.
$leaveValue.';'. "\n";
$restValue.';'. return $fileHeader;
$diseaseValue.';'. }
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'."\n";
return $fileContent;
}
public function populateExportDataIntoFileContent(array $exportData,string $fileContent): string{ private function populateNoDevisDataInADay(string $fileContent, $leave)
{
$startTimeValue = "";
$endTimeValue = "";
$leaveValue = "Non";
$restValue = "Non"; // AJOUTER CETTE LIGNE
$diseaseValue = "Non"; // AJOUTER CETTE LIGNE
if($leave["onLeave"]) {
$startTimeValue = $leave["startTime"];
$endTimeValue = $leave["endTime"];
if($leave["absenceTypeKey"] == AbsenceTypeConstant::LEAVE) {
$leaveValue = "Oui";
}
if($leave["absenceTypeKey"] == AbsenceTypeConstant::DISEASE) {
$diseaseValue = "Oui";
}
if($leave["absenceTypeKey"] == AbsenceTypeConstant::REST) {
$restValue = "Oui";
}
}
$fileContent = $fileContent.
''.';'.
FileExportHelpers::FormatTextForExport($leave['thanatoName']).';'.
$leave['date'].';'.
$startTimeValue.';'.
$endTimeValue.';'.
''.';'.
DateHelpers::getPublicHolidayText($leave['isPublicHoliday']).';'.
$leaveValue.';'.
$restValue.';'.
$diseaseValue.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'."\n";
return $fileContent;
}
public function populateExportDataIntoFileContent(array $exportData, string $fileContent): string
{
$g_totalDistance = 0; $g_totalDistance = 0;
$g_totalDevisHours = 0; $g_totalDevisHours = 0;
@ -185,81 +194,81 @@ class ExportThanatoStatisticService {
$g_totalTravelingHoursBetweenDevisLocation = 0; $g_totalTravelingHoursBetweenDevisLocation = 0;
$g_totalDiseaseHours = 0; $g_totalDiseaseHours = 0;
$g_totalRestHours = 0; $g_totalRestHours = 0;
$g_totalDevisCount = 0; $g_totalDevisCount = 0;
foreach($exportData as $devisDate => $devisData){ foreach($exportData as $devisDate => $devisData) {
$totalDevisHours = 0; $totalDevisHours = 0;
$totalWorkedHours = 8; $totalWorkedHours = 8;
$totalLeaveHours = 0; $totalLeaveHours = 0;
$totalDiseaseHours = 0; $totalDiseaseHours = 0;
$totalRestHours = 0; $totalRestHours = 0;
$totalDistance = 0; $totalDistance = 0;
$totalDevisCount = 0; $totalDevisCount = 0;
$totalTravelingHoursBetweenDevisLocation = 0; $totalTravelingHoursBetweenDevisLocation = 0;
$hasDevisInTheCurrentDate = $devisData['hasDevis']; $hasDevisInTheCurrentDate = $devisData['hasDevis'];
if($hasDevisInTheCurrentDate === false){ if($hasDevisInTheCurrentDate === false) {
$leaves = $devisData["leaves"]; $leaves = $devisData["leaves"];
foreach($leaves as $leave){ foreach($leaves as $leave) {
$fileContent = $this->populateNoDevisDataInADay($fileContent,$leave); $fileContent = $this->populateNoDevisDataInADay($fileContent, $leave);
if($leave["onLeave"]){ if($leave["onLeave"]) {
$totalLeaveHoursInsideWorkingHours = $leave["totalWorkedHours"]; $totalLeaveHoursInsideWorkingHours = $leave["totalWorkedHours"];
if($leave["absenceTypeKey"] == AbsenceTypeConstant::LEAVE ){ if($leave["absenceTypeKey"] == AbsenceTypeConstant::LEAVE) {
$totalLeaveHours += $totalLeaveHoursInsideWorkingHours; $totalLeaveHours += $totalLeaveHoursInsideWorkingHours;
} }
if($leave["absenceTypeKey"] == AbsenceTypeConstant::REST){ if($leave["absenceTypeKey"] == AbsenceTypeConstant::REST) {
$totalRestHours += $totalLeaveHoursInsideWorkingHours; $totalRestHours += $totalLeaveHoursInsideWorkingHours;
} }
if($leave["absenceTypeKey"] == AbsenceTypeConstant::DISEASE){ if($leave["absenceTypeKey"] == AbsenceTypeConstant::DISEASE) {
$totalDiseaseHours += $totalLeaveHoursInsideWorkingHours; $totalDiseaseHours += $totalLeaveHoursInsideWorkingHours;
} }
} }
} }
$totalAbsenceHours = $totalLeaveHours + $totalRestHours + $totalDiseaseHours; $totalAbsenceHours = $totalLeaveHours + $totalRestHours + $totalDiseaseHours;
$totalWorkedHours -= $totalAbsenceHours; $totalWorkedHours -= $totalAbsenceHours;
} } else {
else{ $totalDevisCount += count($devisData["devisId"]);
$totalDevisCount += count($devisData["devisId"]); $routeLines = $this->gestionBdd->getRouteLinesByDevisIdList($devisData["devisId"]);
$routeLines = $this->gestionBdd->getRouteLinesByDevisIdList($devisData["devisId"]); $totalDistanceAndTotalTravelingHoursBetweenDevis = $this->geoService->getTotalDistanceAndTotalTravelingHoursBetweenDevisLocationByRouteLines($routeLines);
$totalDistanceAndTotalTravelingHoursBetweenDevis = $this->geoService->getTotalDistanceAndTotalTravelingHoursBetweenDevisLocationByRouteLines($routeLines); $totalDistance = $totalDistanceAndTotalTravelingHoursBetweenDevis["totalDistance"];
$totalDistance = $totalDistanceAndTotalTravelingHoursBetweenDevis["totalDistance"]; $totalTravelingHoursBetweenDevisLocation = $totalDistanceAndTotalTravelingHoursBetweenDevis["totalTravelingHours"];
$totalTravelingHoursBetweenDevisLocation = $totalDistanceAndTotalTravelingHoursBetweenDevis["totalTravelingHours"]; $devisList = $devisData["devis"];
$devisList = $devisData["devis"]; $leaves = $devisData["leaves"];
$leaves = $devisData["leaves"]; if(!empty($devisList)) {
if(!empty($devisList)){ foreach($devisList as $devis) {
foreach($devisList as $devis){ $fileContent = $this->populateDevisDataIntoThanatoExportFileContent($fileContent, $devis);
$fileContent = $this->populateDevisDataIntoThanatoExportFileContent($fileContent,$devis); $totalDevisHours += $devis["totalHours"];
$totalDevisHours += $devis["totalHours"]; }
} }
} foreach($leaves as $leave) {
foreach($leaves as $leave){ $fileContent = $this->populateNoDevisDataInADay($fileContent, $leave);
$fileContent = $this->populateNoDevisDataInADay($fileContent,$leave); if($leave["onLeave"]) {
if($leave["onLeave"]){ $totalLeaveHoursInsideWorkingHours = $leave["totalWorkedHours"];
$totalLeaveHoursInsideWorkingHours = $leave["totalWorkedHours"]; if($leave["absenceTypeKey"] == AbsenceTypeConstant::LEAVE) {
if($leave["absenceTypeKey"] == AbsenceTypeConstant::LEAVE){ $totalLeaveHours += $totalLeaveHoursInsideWorkingHours;
$totalLeaveHours += $totalLeaveHoursInsideWorkingHours; }
} if($leave["absenceTypeKey"] == AbsenceTypeConstant::REST) {
if($leave["absenceTypeKey"] == AbsenceTypeConstant::REST){ $totalRestHours += $totalLeaveHoursInsideWorkingHours;
$totalRestHours += $totalLeaveHoursInsideWorkingHours; }
} if($leave["absenceTypeKey"] == AbsenceTypeConstant::DISEASE) {
if($leave["absenceTypeKey"] == AbsenceTypeConstant::DISEASE){ $totalDiseaseHours += $totalLeaveHoursInsideWorkingHours;
$totalDiseaseHours += $totalLeaveHoursInsideWorkingHours; }
} }
} }
} $totalAbsenceHours = $totalLeaveHours + $totalRestHours + $totalDiseaseHours;
$totalAbsenceHours = $totalLeaveHours + $totalRestHours + $totalDiseaseHours; $totalWorkedHours -= $totalAbsenceHours;
$totalWorkedHours -= $totalAbsenceHours; }
}
$fileContent = $this->populateLastRecapForTheLine( $fileContent = $this->populateLastRecapForTheLine(
$fileContent, $fileContent,
$totalDistance, $totalDistance,
$totalDevisHours, $totalDevisHours,
$totalWorkedHours, $totalWorkedHours,
$totalLeaveHours, $totalLeaveHours,
$totalTravelingHoursBetweenDevisLocation, $totalTravelingHoursBetweenDevisLocation,
$totalDiseaseHours, $totalDiseaseHours,
$totalRestHours,$totalDevisCount $totalRestHours,
); $totalDevisCount
);
$g_totalDistance += $totalDistance; $g_totalDistance += $totalDistance;
$g_totalDevisHours += $totalDevisHours; $g_totalDevisHours += $totalDevisHours;
@ -268,8 +277,8 @@ class ExportThanatoStatisticService {
$g_totalTravelingHoursBetweenDevisLocation += $totalTravelingHoursBetweenDevisLocation; $g_totalTravelingHoursBetweenDevisLocation += $totalTravelingHoursBetweenDevisLocation;
$g_totalDiseaseHours += $totalDiseaseHours; $g_totalDiseaseHours += $totalDiseaseHours;
$g_totalRestHours += $totalRestHours; $g_totalRestHours += $totalRestHours;
$g_totalDevisCount += $totalDevisCount; $g_totalDevisCount += $totalDevisCount;
} }
$fileContent = $this->populateLastRecapForTheLine( $fileContent = $this->populateLastRecapForTheLine(
$fileContent, $fileContent,
@ -279,77 +288,112 @@ class ExportThanatoStatisticService {
$g_totalLeaveHours, $g_totalLeaveHours,
$g_totalTravelingHoursBetweenDevisLocation, $g_totalTravelingHoursBetweenDevisLocation,
$g_totalDiseaseHours, $g_totalDiseaseHours,
$g_totalRestHours,$g_totalDevisCount $g_totalRestHours,
$g_totalDevisCount
); );
return $fileContent; return $fileContent;
} }
private function populateLastRecapForTheLine(string $fileContent,$distance,$totalDevisHours,$totalWorkedHours,$totalLeaveHours,$totalTravelingHours ,$totalDiseaseHours = 0,$totalRestHours = 0,$totalDevisCount = 0){ private function populateLastRecapForTheLine(string $fileContent, $distance, $totalDevisHours, $totalWorkedHours, $totalLeaveHours, $totalTravelingHours, $totalDiseaseHours = 0, $totalRestHours = 0, $totalDevisCount = 0)
$fileContent = $fileContent. {
''.';'. $fileContent = $fileContent.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
"$distance".';'. ''.';'.
"$totalDevisHours".';'. "$distance".';'.
"$totalLeaveHours".';'. "$totalDevisHours".';'.
"$totalRestHours".';'. "$totalLeaveHours".';'.
"$totalDiseaseHours".';'. "$totalRestHours".';'.
"$totalWorkedHours".';'. "$totalDiseaseHours".';'.
"$totalTravelingHours".';'. "$totalWorkedHours".';'.
"$totalDevisCount"."\n"; "$totalTravelingHours".';'.
return $fileContent; "$totalDevisCount"."\n";
} return $fileContent;
}
private function getFormatDevisProduitsAsString($devisProduits){ private function getFormatDevisProduitsAsString($devisProduits)
$result = ''; {
foreach ($devisProduits as $produit) { $result = '';
$result .= $produit['produit_reference'] . '-' . $produit['produit_description'] . '--'; foreach ($devisProduits as $produit) {
} $result .= $produit['produit_reference'] . '-' . $produit['produit_description'] . '--';
// Remove the trailing "--" at the end }
$result = rtrim($result, '-'); // Remove the trailing "--" at the end
return $result; $result = rtrim($result, '-');
} return $result;
}
private function populateDevisDataIntoThanatoExportFileContent(string $fileContent,array $devis){ private function populateDevisDataIntoThanatoExportFileContentSave(string $fileContent, array $devis)
$produitAsString = $this->getFormatDevisProduitsAsString($devis["produits"]); {
$factureNum = $devis["facture_num"] ?? $devis["facture_on_group_num"] ?? ""; $produitAsString = $this->getFormatDevisProduitsAsString($devis["produits"]);
$fileContent = $fileContent. $factureNum = $devis["facture_num"] ?? $devis["facture_on_group_num"] ?? "";
FileExportHelpers::FormatTextForExport($factureNum).';'. $fileContent = $fileContent.
FileExportHelpers::FormatTextForExport($devis['nom_thanato'] . ' ' . $devis['prenom_thanatho']).';'. FileExportHelpers::FormatTextForExport($factureNum).';'.
FileExportHelpers::FormatTextForExport($devis["date"]).';'. FileExportHelpers::FormatTextForExport($devis['nom_thanato'] . ' ' . $devis['prenom_thanatho']).';'.
FileExportHelpers::FormatTextForExport($devis["startTime"]).';'. FileExportHelpers::FormatTextForExport($devis["date"]).';'.
FileExportHelpers::FormatTextForExport($devis["endTime"]).';'. FileExportHelpers::FormatTextForExport($devis["startTime"]).';'.
FileExportHelpers::FormatTextForExport($produitAsString).';'. FileExportHelpers::FormatTextForExport($devis["endTime"]).';'.
FileExportHelpers::FormatTextForExport($devis["dayType"]).';'. FileExportHelpers::FormatTextForExport($produitAsString).';'.
FileExportHelpers::FormatTextForExport('Non').';'. FileExportHelpers::FormatTextForExport($devis["dayType"]).';'.
''.';'. FileExportHelpers::FormatTextForExport('Non').';'.
''.';'. ''.';'.
FileExportHelpers::FormatTextForExport($devis["nom_defunt"]).';'. ''.';'.
FileExportHelpers::FormatTextForExport($devis["nom_lieu"] ?? "").';'. FileExportHelpers::FormatTextForExport($devis["nom_defunt"]).';'.
FileExportHelpers::FormatTextForExport($devis["nom_client"] ?? "").';'. FileExportHelpers::FormatTextForExport($devis["nom_lieu"] ?? "").';'.
FileExportHelpers::FormatTextForExport($devis["client_adresse"] ?? ""). FileExportHelpers::FormatTextForExport($devis["nom_client"] ?? "").';'.
''.';'. FileExportHelpers::FormatTextForExport($devis["client_adresse"] ?? "").
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'."\n"; ''.';'.
''.';'."\n";
return $fileContent;
} return $fileContent;
}
private function populateDevisDataIntoThanatoExportFileContent(string $fileContent, array $devis)
{
$produitAsString = $this->getFormatDevisProduitsAsString($devis["produits"]);
$devisNum = (string)$devis["calendar_uuid"];
$fileContent = $fileContent.
FileExportHelpers::FormatTextForExport($devisNum).';'.
FileExportHelpers::FormatTextForExport($devis['nom_thanato'] . ' ' . $devis['prenom_thanato']).';'.
FileExportHelpers::FormatTextForExport($devis["date"]).';'.
FileExportHelpers::FormatTextForExport($devis["startTime"]).';'.
FileExportHelpers::FormatTextForExport($devis["endTime"]).';'.
FileExportHelpers::FormatTextForExport($produitAsString).';'.
FileExportHelpers::FormatTextForExport($devis["dayType"]).';'.
FileExportHelpers::FormatTextForExport('Non').';'.
''.';'.
''.';'.
FileExportHelpers::FormatTextForExport($devis["nom_defunt"]).';'.
FileExportHelpers::FormatTextForExport($devis["nom_lieu"] ?? "").';'.
FileExportHelpers::FormatTextForExport($devis["nom_client"] ?? "").';'.
FileExportHelpers::FormatTextForExport($devis["client_adresse"] ?? "").
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'.
''.';'."\n";
return $fileContent;
}
} }