Fix issue with spaces in tag report.

This commit is contained in:
James Cole
2018-12-20 22:19:07 +01:00
parent 0c2218762c
commit 29b02fcac2
2 changed files with 9 additions and 8 deletions

View File

@@ -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) {

View File

@@ -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')]) }}';
</script>
<script type="text/javascript" src="v1/js/ff/reports/all.js?v={{ FF_VERSION }}"></script>