From 542cbfdcd8e7104eab0977ac63a3c2050ea1b5f7 Mon Sep 17 00:00:00 2001 From: Leopold Strobl Date: Thu, 21 May 2026 13:38:24 +0200 Subject: [PATCH] Seriennummer wird im Excel Export jetzt immer als String erkannt (bestenfalls....) --- dist/insurance.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/insurance.php b/dist/insurance.php index 7736bfb..4d4b680 100644 --- a/dist/insurance.php +++ b/dist/insurance.php @@ -187,8 +187,10 @@ foreach ($rows as $r) { $sheet->getStyle($cell($c, $rowIdx))->getNumberFormat()->setFormatCode('#,##0.00 [$€-de-DE]'); $c++; - // Seriennummer - $sheet->setCellValue($cell($c++, $rowIdx), $r['serial_no']); + // Seriennummer (immer als Text, damit Excel rein numerische Werte nicht als Zahl interpretiert) + $sheet->getStyle($cell($c, $rowIdx))->getNumberFormat()->setFormatCode('@'); + $sheet->setCellValueExplicit($cell($c, $rowIdx), $r['serial_no'], DataType::TYPE_STRING); + $c++; // Anschaffung (Datum) $excelDate = '';