From 29b02fcac2efb478ef5c41926e28b9f9883237f2 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 20 Dec 2018 22:19:07 +0100 Subject: [PATCH] Fix issue with spaces in tag report. --- app/Generator/Report/Tag/MonthReportGenerator.php | 3 ++- resources/views/v1/reports/tag/month.twig | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/Generator/Report/Tag/MonthReportGenerator.php b/app/Generator/Report/Tag/MonthReportGenerator.php index 5f6de0bbc9..6599ea3443 100644 --- a/app/Generator/Report/Tag/MonthReportGenerator.php +++ b/app/Generator/Report/Tag/MonthReportGenerator.php @@ -80,6 +80,7 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface { $accountIds = implode(',', $this->accounts->pluck('id')->toArray()); $tagTags = implode(',', $this->tags->pluck('tag')->toArray()); + $tagIds = implode(',', $this->tags->pluck('id')->toArray()); $reportType = 'tag'; $expenses = $this->getExpenses(); $income = $this->getIncome(); @@ -95,7 +96,7 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface $result = view( 'reports.tag.month', compact( 'accountIds', 'tagTags', 'reportType', 'accountSummary', 'tagSummary', 'averageExpenses', 'averageIncome', 'topIncome', - 'topExpenses' + 'topExpenses', 'tagIds' ) )->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render(); } catch (Throwable $e) { diff --git a/resources/views/v1/reports/tag/month.twig b/resources/views/v1/reports/tag/month.twig index 5d51e7184c..04442d99d4 100644 --- a/resources/views/v1/reports/tag/month.twig +++ b/resources/views/v1/reports/tag/month.twig @@ -463,15 +463,15 @@ var tagTags = '{{ tagTags }}'; // chart uri's - var tagIncomeUri = '{{ route('chart.tag.tag-income', [accountIds, tagTags, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}'; - var tagExpenseUri = '{{ route('chart.tag.tag-expense', [accountIds, tagTags, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}'; - var accountIncomeUri = '{{ route('chart.tag.account-income', [accountIds, tagTags, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}'; - var accountExpenseUri = '{{ route('chart.tag.account-expense', [accountIds, tagTags, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}'; + var tagIncomeUri = '{{ route('chart.tag.tag-income', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}'; + var tagExpenseUri = '{{ route('chart.tag.tag-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}'; + var accountIncomeUri = '{{ route('chart.tag.account-income', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}'; + var accountExpenseUri = '{{ route('chart.tag.account-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}'; // two new charts - var tagBudgetUri = '{{ route('chart.tag.budget-expense', [accountIds, tagTags, start.format('Ymd'), end.format('Ymd')]) }}'; - var tagCategoryUri = '{{ route('chart.tag.category-expense', [accountIds, tagTags, start.format('Ymd'), end.format('Ymd')]) }}'; - var mainUri = '{{ route('chart.tag.main', [accountIds, tagTags, start.format('Ymd'), end.format('Ymd')]) }}'; + var tagBudgetUri = '{{ route('chart.tag.budget-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}'; + var tagCategoryUri = '{{ route('chart.tag.category-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}'; + var mainUri = '{{ route('chart.tag.main', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';