From d51ca23bb41938901b6fe00ced73b387c01f7b00 Mon Sep 17 00:00:00 2001 From: Gilbert Paquin Date: Mon, 31 Jul 2017 01:32:57 -0400 Subject: [PATCH] Fix undefined offset --- resources/views/reports/chart_builder.blade.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/resources/views/reports/chart_builder.blade.php b/resources/views/reports/chart_builder.blade.php index 6e6fab97c6f4..6f7b7c6cc0eb 100644 --- a/resources/views/reports/chart_builder.blade.php +++ b/resources/views/reports/chart_builder.blade.php @@ -368,13 +368,15 @@ trans("texts.{$key}"), - 'style' => 'tableHeader' - ]; - }, array_keys(array_values(array_values($reportTotals)[0])[0]))); + if(count(array_values($reportTotals))) { + $summary[] = array_merge([ + trans("texts.totals") + ], array_map(function ($key) { + return ['text' => trans("texts.{$key}"), + 'style' => 'tableHeader' + ]; + }, array_keys(array_values(array_values($reportTotals)[0])[0]))); + } foreach ($reportTotals as $currencyId => $each) { foreach ($each as $dimension => $val) {