From d49082d7f30840d490d67ce9f3c89541c4e13d60 Mon Sep 17 00:00:00 2001 From: Constantin Graf Date: Tue, 13 May 2025 18:48:37 +0200 Subject: [PATCH] Fixed localization in PDF reports --- app/Service/LocalizationService.php | 2 +- .../time-entry-aggregate/pdf.blade.php | 49 ++++++------------- .../reports/time-entry-index/pdf.blade.php | 1 - .../Unit/Service/LocalizationServiceTest.php | 8 +-- 4 files changed, 20 insertions(+), 40 deletions(-) diff --git a/app/Service/LocalizationService.php b/app/Service/LocalizationService.php index 54f6516e..b2269812 100644 --- a/app/Service/LocalizationService.php +++ b/app/Service/LocalizationService.php @@ -80,7 +80,7 @@ class LocalizationService if ($this->intervalFormat === IntervalFormat::Decimal) { $interval->cascade(); - return $this->formatNumber($interval->totalHours); + return $this->formatNumber($interval->totalHours).' h'; } elseif ($this->intervalFormat === IntervalFormat::HoursMinutes) { $interval->cascade(); diff --git a/resources/views/reports/time-entry-aggregate/pdf.blade.php b/resources/views/reports/time-entry-aggregate/pdf.blade.php index 68757b23..11e9e2e6 100644 --- a/resources/views/reports/time-entry-aggregate/pdf.blade.php +++ b/resources/views/reports/time-entry-aggregate/pdf.blade.php @@ -1,12 +1,12 @@ @use('Brick\Math\BigDecimal') @use('Brick\Money\Money') -@use('PhpOffice\PhpSpreadsheet\Cell\DataType') +@use('Illuminate\Support\Carbon') @use('Carbon\CarbonInterval') @inject('colorService', 'App\Service\ColorService') - + Report