From 4ae8124041de9d3f1a8d4fbfe27a3ee5f8ec8531 Mon Sep 17 00:00:00 2001 From: Haja Date: Wed, 30 Apr 2025 17:03:58 +0300 Subject: [PATCH] [Export] Export statistique thanato avec un grand total --- .../Service/ExportThanatoStatisticService.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/gestion/lib/Service/ExportThanatoStatisticService.php b/gestion/lib/Service/ExportThanatoStatisticService.php index 39fdf80..ba58f67 100644 --- a/gestion/lib/Service/ExportThanatoStatisticService.php +++ b/gestion/lib/Service/ExportThanatoStatisticService.php @@ -175,6 +175,15 @@ class ExportThanatoStatisticService { } public function populateExportDataIntoFileContent(array $exportData,string $fileContent): string{ + + $g_totalDistance = 0; + $g_totalDevisHours = 0; + $g_totalWorkedHours = 0; + $g_totalLeaveHours = 0; + $g_totalTravelingHoursBetweenDevisLocation = 0; + $g_totalDiseaseHours = 0; + $g_totalRestHours = 0; + foreach($exportData as $devisDate => $devisData){ $totalDevisHours = 0; $totalWorkedHours = 8; @@ -235,6 +244,7 @@ class ExportThanatoStatisticService { $totalAbsenceHours = $totalLeaveHours + $totalRestHours + $totalDiseaseHours; $totalWorkedHours -= $totalAbsenceHours; } + $fileContent = $this->populateLastRecapForTheLine( $fileContent, $totalDistance, @@ -245,7 +255,27 @@ class ExportThanatoStatisticService { $totalDiseaseHours, $totalRestHours ); + + $g_totalDistance += $totalDistance; + $g_totalDevisHours += $totalDevisHours; + $g_totalWorkedHours += $totalWorkedHours; + $g_totalLeaveHours += $totalLeaveHours; + $g_totalTravelingHoursBetweenDevisLocation += $totalTravelingHoursBetweenDevisLocation; + $g_totalDiseaseHours += $totalDiseaseHours; + $g_totalRestHours += $totalRestHours; } + + $fileContent = $this->populateLastRecapForTheLine( + $fileContent, + $g_totalDistance, + $g_totalDevisHours, + $g_totalWorkedHours, + $g_totalLeaveHours, + $g_totalTravelingHoursBetweenDevisLocation, + $g_totalDiseaseHours, + $g_totalRestHours + ); + return $fileContent; }