Merge branch 'staging' into production

This commit is contained in:
Tiavina 2025-06-10 17:01:09 +03:00
commit f2f737d6f8

View File

@ -128,6 +128,7 @@ class ExportThanatoStatisticService {
'HEURES TOTAL DE MALADIE'.';'. 'HEURES TOTAL DE MALADIE'.';'.
'HEURES TOTAL DE TRAVAIL'.';'. 'HEURES TOTAL DE TRAVAIL'.';'.
'HEURES TOTAL DE PARCOURS ENTRE DEVIS'.';'. 'HEURES TOTAL DE PARCOURS ENTRE DEVIS'.';'.
'NOMBRE DE SOINS ET TOILETTES'.';'.
"\n"; "\n";
return $fileHeader; return $fileHeader;
} }
@ -170,6 +171,7 @@ class ExportThanatoStatisticService {
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'.
''.';'."\n"; ''.';'."\n";
return $fileContent; return $fileContent;
} }
@ -183,6 +185,7 @@ class ExportThanatoStatisticService {
$g_totalTravelingHoursBetweenDevisLocation = 0; $g_totalTravelingHoursBetweenDevisLocation = 0;
$g_totalDiseaseHours = 0; $g_totalDiseaseHours = 0;
$g_totalRestHours = 0; $g_totalRestHours = 0;
$g_totalDevisCount = 0;
foreach($exportData as $devisDate => $devisData){ foreach($exportData as $devisDate => $devisData){
$totalDevisHours = 0; $totalDevisHours = 0;
@ -191,6 +194,7 @@ class ExportThanatoStatisticService {
$totalDiseaseHours = 0; $totalDiseaseHours = 0;
$totalRestHours = 0; $totalRestHours = 0;
$totalDistance = 0; $totalDistance = 0;
$totalDevisCount = 0;
$totalTravelingHoursBetweenDevisLocation = 0; $totalTravelingHoursBetweenDevisLocation = 0;
$hasDevisInTheCurrentDate = $devisData['hasDevis']; $hasDevisInTheCurrentDate = $devisData['hasDevis'];
if($hasDevisInTheCurrentDate === false){ if($hasDevisInTheCurrentDate === false){
@ -214,6 +218,7 @@ class ExportThanatoStatisticService {
$totalWorkedHours -= $totalAbsenceHours; $totalWorkedHours -= $totalAbsenceHours;
} }
else{ else{
$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"];
@ -253,7 +258,7 @@ class ExportThanatoStatisticService {
$totalLeaveHours, $totalLeaveHours,
$totalTravelingHoursBetweenDevisLocation, $totalTravelingHoursBetweenDevisLocation,
$totalDiseaseHours, $totalDiseaseHours,
$totalRestHours $totalRestHours,$totalDevisCount
); );
$g_totalDistance += $totalDistance; $g_totalDistance += $totalDistance;
@ -263,6 +268,7 @@ class ExportThanatoStatisticService {
$g_totalTravelingHoursBetweenDevisLocation += $totalTravelingHoursBetweenDevisLocation; $g_totalTravelingHoursBetweenDevisLocation += $totalTravelingHoursBetweenDevisLocation;
$g_totalDiseaseHours += $totalDiseaseHours; $g_totalDiseaseHours += $totalDiseaseHours;
$g_totalRestHours += $totalRestHours; $g_totalRestHours += $totalRestHours;
$g_totalDevisCount += $totalDevisCount;
} }
$fileContent = $this->populateLastRecapForTheLine( $fileContent = $this->populateLastRecapForTheLine(
@ -273,13 +279,13 @@ class ExportThanatoStatisticService {
$g_totalLeaveHours, $g_totalLeaveHours,
$g_totalTravelingHoursBetweenDevisLocation, $g_totalTravelingHoursBetweenDevisLocation,
$g_totalDiseaseHours, $g_totalDiseaseHours,
$g_totalRestHours $g_totalRestHours,$g_totalDevisCount
); );
return $fileContent; return $fileContent;
} }
private function populateLastRecapForTheLine(string $fileContent,$distance,$totalDevisHours,$totalWorkedHours,$totalLeaveHours,$totalTravelingHours ,$totalDiseaseHours = 0,$totalRestHours = 0){ private function populateLastRecapForTheLine(string $fileContent,$distance,$totalDevisHours,$totalWorkedHours,$totalLeaveHours,$totalTravelingHours ,$totalDiseaseHours = 0,$totalRestHours = 0,$totalDevisCount = 0){
$fileContent = $fileContent. $fileContent = $fileContent.
''.';'. ''.';'.
''.';'. ''.';'.
@ -301,7 +307,8 @@ class ExportThanatoStatisticService {
"$totalRestHours".';'. "$totalRestHours".';'.
"$totalDiseaseHours".';'. "$totalDiseaseHours".';'.
"$totalWorkedHours".';'. "$totalWorkedHours".';'.
"$totalTravelingHours"."\n"; "$totalTravelingHours".';'.
"$totalDevisCount"."\n";
return $fileContent; return $fileContent;
} }
@ -339,6 +346,7 @@ class ExportThanatoStatisticService {
''.';'. ''.';'.
''.';'. ''.';'.
''.';'. ''.';'.
''.';'.
''.';'."\n"; ''.';'."\n";
return $fileContent; return $fileContent;