From 91b69a93c8c1f1e5cb1f9051bb4d1211db8a73f0 Mon Sep 17 00:00:00 2001 From: Hamatoma Date: Wed, 26 Feb 2025 23:52:34 +0100 Subject: [PATCH] V 0.2.8 ExportHelperLocal - Total summary --- CHANGELOG.md | 4 ++++ app/Helpers/ExportHelperLocal.php | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 120b9ec..fd56538 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# V 0.2.8 ExportHelperLocal + +- Total summary + # V 0.2.7 ExportHelperLocal - ExportHelperLocal: exportHoursAsCsv improved diff --git a/app/Helpers/ExportHelperLocal.php b/app/Helpers/ExportHelperLocal.php index 77ee85c..490d72d 100644 --- a/app/Helpers/ExportHelperLocal.php +++ b/app/Helpers/ExportHelperLocal.php @@ -41,14 +41,18 @@ class ExportHelperLocal array_push($lines, $line); } $line = "\nKategorie\tGesamtdauer\tInteressierte\n"; + $sumDuration = 0; + $sumInterested = 0; foreach ($sums as $key => $value) { $interested = array_key_exists($key, $interesteds) ? $interesteds[$key] : 0; + $sumInterested += $interested; + $sumDuration += $value; if ($interested == 0) { $interested = ''; } $line .= "$key\t" . ExportHelperLocal::formatDuration(duration: $value) . "\t$interested\n"; } - $line .= "\n"; + $line .= "\nGesamt\t" . ExportHelperLocal::formatDuration($sumDuration) . "\t$sumInterested\n"; array_push($lines, $line); file_put_contents($filename, $lines); return $filename; -- 2.39.5