Merge branch 'develop' of https://github.com/JC5/firefly-iii into develop

* 'develop' of https://github.com/JC5/firefly-iii:
  Fix a bug where the frontpage would not honor transaction order.
  Fix a bug where the report page would mess up the session dates.
This commit is contained in:
James Cole
2015-12-22 20:46:52 +01:00
3 changed files with 20 additions and 9 deletions

View File

@@ -44,6 +44,14 @@ class ReportController extends Controller
{ {
$start = Session::get('first'); $start = Session::get('first');
$months = $this->helper->listOfMonths($start); $months = $this->helper->listOfMonths($start);
$startOfMonth = clone Session::get('start');
$endOfMonth = clone Session::get('start');
$startOfYear = clone Session::get('start');
$endOfYear = clone Session::get('start');
$startOfMonth->startOfMonth();
$endOfMonth->endOfMonth();
$startOfYear->startOfYear();
$endOfYear->endOfYear();
// does the user have shared accounts? // does the user have shared accounts?
$accounts = $repository->getAccounts(['Default account', 'Asset account']); $accounts = $repository->getAccounts(['Default account', 'Asset account']);
@@ -56,7 +64,9 @@ class ReportController extends Controller
$accountList = join(',', $accountIds); $accountList = join(',', $accountIds);
return view('reports.index', compact('months', 'accounts', 'start', 'accountList')); return view('reports.index', compact('months', 'accounts', 'start', 'accountList',
'startOfMonth', 'endOfMonth', 'startOfYear', 'endOfYear'
));
} }
/** /**
@@ -194,7 +204,7 @@ class ReportController extends Controller
'firefly.report_default', 'firefly.report_default',
[ [
'start' => $start->formatLocalized($this->monthFormat), 'start' => $start->formatLocalized($this->monthFormat),
'end' => $end->formatLocalized($this->monthFormat) 'end' => $end->formatLocalized($this->monthFormat),
] ]
) )
); );

View File

@@ -172,6 +172,7 @@ class AccountRepository implements AccountRepositoryInterface
->before($end) ->before($end)
->after($start) ->after($start)
->orderBy('transaction_journals.date', 'DESC') ->orderBy('transaction_journals.date', 'DESC')
->orderBy('transaction_journals.order', 'ASC')
->orderBy('transaction_journals.id', 'DESC') ->orderBy('transaction_journals.id', 'DESC')
->take(10) ->take(10)
->get(['transaction_journals.*', 'transaction_currencies.symbol', 'transaction_types.type']); ->get(['transaction_journals.*', 'transaction_currencies.symbol', 'transaction_types.type']);

View File

@@ -95,16 +95,16 @@
<li> <li>
<a href="{{ route('reports.report', <a href="{{ route('reports.report',
['default', ['default',
Session.get('start').startOfMonth.format('Ymd'), startOfMonth.format('Ymd'),
Session.get('start').endOfMonth.format('Ymd'), endOfMonth.format('Ymd'),
accountList accountList
]) }}">{{ 'report_this_month_quick'|_ }}</a> ]) }}">{{ 'report_this_month_quick'|_ }}</a>
</li> </li>
<li> <li>
<a href="{{ route('reports.report', <a href="{{ route('reports.report',
['default', ['default',
Session.get('start').startOfYear.format('Ymd'), startOfYear.format('Ymd'),
Session.get('start').endOfYear.format('Ymd'), endOfYear.format('Ymd'),
accountList accountList
]) }}">{{ 'report_this_year_quick'|_ }}</a> ]) }}">{{ 'report_this_year_quick'|_ }}</a>
</li> </li>
@@ -112,7 +112,7 @@
<a href="{{ route('reports.report', <a href="{{ route('reports.report',
['default', ['default',
start.format('Ymd'), start.format('Ymd'),
Session.get('end').endOfMonth.format('Ymd'), endOfMonth.format('Ymd'),
accountList accountList
]) }}">{{ 'report_all_time_quick'|_ }}</a> ]) }}">{{ 'report_all_time_quick'|_ }}</a>
</li> </li>