mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
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:
@@ -42,8 +42,16 @@ class ReportController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(AccountRepositoryInterface $repository)
|
public function index(AccountRepositoryInterface $repository)
|
||||||
{
|
{
|
||||||
$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),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@@ -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']);
|
||||||
|
@@ -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>
|
||||||
|
Reference in New Issue
Block a user