diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php
index b26b1e2b49a7..02c4f63f8779 100644
--- a/resources/lang/en/texts.php
+++ b/resources/lang/en/texts.php
@@ -2097,7 +2097,7 @@ $LANG = array(
'profit_and_loss' => 'Profit and Loss',
'revenue' => 'Revenue',
'profit' => 'Profit',
- 'group_when_sorted' => 'Group When Sorted',
+ 'group_when_sorted' => 'Group Sort',
'group_dates_by' => 'Group Dates By',
'year' => 'Year',
'view_statement' => 'View Statement',
diff --git a/resources/views/reports/report_builder.blade.php b/resources/views/reports/report_builder.blade.php
index 457e96886bbc..7df0c1b8bf8a 100644
--- a/resources/views/reports/report_builder.blade.php
+++ b/resources/views/reports/report_builder.blade.php
@@ -129,11 +129,6 @@
{!! Former::populateField('start_date', $startDate) !!}
{!! Former::populateField('end_date', $endDate) !!}
- @if ( ! request()->report_type)
- {!! Former::populateField('group_when_sorted', 1) !!}
- {!! Former::populateField('group_dates_by', 'monthyear') !!}
- @endif
-
+
+
+ {!! Former::select('group_dates_by')
+ ->label('group_when_sorted')
+ ->addOption(trans('texts.disabled'), '')
+ ->addOption(trans('texts.day'), 'day')
+ ->addOption(trans('texts.month'), 'monthyear')
+ ->addOption(trans('texts.year'), 'year') !!}
+
@@ -196,15 +201,6 @@
->addOption(trans('texts.expense'), 'expense') !!}
-
-
-
- {!! Former::checkbox('group_when_sorted')->text('enable') !!}
- {!! Former::select('group_dates_by')
- ->addOption(trans('texts.day'), 'day')
- ->addOption(trans('texts.month'), 'monthyear')
- ->addOption(trans('texts.year'), 'year') !!}
-
@@ -493,6 +489,12 @@
}
});
+ $('#group_dates_by').change(function() {
+ if (isStorageSupported()) {
+ localStorage.setItem('last:report_group', $('#group_dates_by').val());
+ }
+ });
+
// parse 1,000.00 or 1.000,00
function convertStringToNumber(str) {
str = str + '' || '';
@@ -522,11 +524,11 @@
}).maximizeSelect2Height();
$(".tablesorter-data").tablesorter({
- @if (! request()->group_when_sorted)
+ @if (! request()->group_dates_by)
sortList: [[0,0]],
@endif
theme: 'bootstrap',
- widgets: ['zebra', 'uitheme', 'filter'{!! request()->group_when_sorted ? ", 'group'" : "" !!}, 'columnSelector'],
+ widgets: ['zebra', 'uitheme', 'filter'{!! request()->group_dates_by ? ", 'group'" : "" !!}, 'columnSelector'],
headerTemplate : '{content} {icon}',
@if ($report)
dateFormat: '{{ $report->convertDateFormat() }}',
@@ -588,6 +590,10 @@
if (lastReportType) {
$('#report_type').val(lastReportType);
}
+ var lastGroup = localStorage.getItem('last:report_group');
+ if (group_dates_by) {
+ $('#group_dates_by').val(lastGroup);
+ }
var lastDocumentFilter = localStorage.getItem('last:document_filter');
if (lastDocumentFilter) {
$('#document_filter').val(lastDocumentFilter);