From 5cf18b50dcf0b94d8a46d2e6bfbce06edba4494c Mon Sep 17 00:00:00 2001 From: Tiavina Date: Fri, 28 Mar 2025 16:47:58 +0300 Subject: [PATCH] Enhance exportThanatoStatistic method to include month and year parameters; refactor absence hour calculations for clarity --- gestion/lib/Controller/PageController.php | 2 +- gestion/lib/Service/ExportThanatoStatisticService.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gestion/lib/Controller/PageController.php b/gestion/lib/Controller/PageController.php index 55c08e9..88fe45c 100644 --- a/gestion/lib/Controller/PageController.php +++ b/gestion/lib/Controller/PageController.php @@ -2599,7 +2599,7 @@ class PageController extends Controller { * */ - public function exportThanatoStatistic($thanatoIdsToExport){ + public function exportThanatoStatistic($thanatoIdsToExport,$month,$year){ if(empty($thanatoIdsToExport)){ return ""; } diff --git a/gestion/lib/Service/ExportThanatoStatisticService.php b/gestion/lib/Service/ExportThanatoStatisticService.php index f3d33be..2c67f30 100644 --- a/gestion/lib/Service/ExportThanatoStatisticService.php +++ b/gestion/lib/Service/ExportThanatoStatisticService.php @@ -160,8 +160,8 @@ class ExportThanatoStatisticService { ''.';'. DateHelpers::getPublicHolidayText($leave['isPublicHoliday']).';'. $leaveValue.';'. - $diseaseValue.';'. $restValue.';'. + $diseaseValue.';'. ''.';'. ''.';'. ''.';'. @@ -203,7 +203,8 @@ class ExportThanatoStatisticService { } } } - $totalWorkedHours -= $totalLeaveHours - $totalRestHours - $totalDiseaseHours; + $totalAbsenceHours = $totalLeaveHours + $totalRestHours + $totalDiseaseHours; + $totalWorkedHours -= $totalAbsenceHours; } else{ $routeLines = $this->gestionBdd->getRouteLinesByDevisIdList($devisData["devisId"]); @@ -233,7 +234,8 @@ class ExportThanatoStatisticService { } } } - $totalWorkedHours -= $totalLeaveHours - $totalRestHours - $totalDiseaseHours; + $totalAbsenceHours = $totalLeaveHours + $totalRestHours + $totalDiseaseHours; + $totalWorkedHours -= $totalAbsenceHours; } $fileContent = $this->populateLastRecapForTheLine( $fileContent,