]> gitweb.hamatoma.de Git - oo4f.git/commitdiff
V 0.2.8 ExportHelperLocal
authorHamatoma <author@hamatoma.de>
Wed, 26 Feb 2025 22:52:34 +0000 (23:52 +0100)
committerHamatoma <author@hamatoma.de>
Wed, 26 Feb 2025 22:52:34 +0000 (23:52 +0100)
- Total summary

CHANGELOG.md
app/Helpers/ExportHelperLocal.php

index 120b9eca1e1d683ba2fa205bdf53cb869a1cbfb2..fd56538dd62554154710e293304dff19c4b29523 100644 (file)
@@ -1,3 +1,7 @@
+# V 0.2.8 ExportHelperLocal
+
+- Total summary
+
 # V 0.2.7 ExportHelperLocal
 
 - ExportHelperLocal: exportHoursAsCsv improved
index 77ee85c25371441858668028ef0ad2c8dc4e3006..490d72d91a6caefdf14d73359ca9605595b2c2fe 100644 (file)
@@ -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;