mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Quicklink fiscal year report feature. As per github issue #131.
The reason for instantiating the helper at the beginning of the static function routeBinder is I am hoping that the object will only be created once.
This commit is contained in:
parent
3d69dc786d
commit
41188a1bd6
@ -11,6 +11,7 @@ namespace FireflyIII\Support\Binder;
|
|||||||
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use FireflyIII\Helpers\FiscalHelper;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Log;
|
use Log;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
@ -32,6 +33,8 @@ class Date implements BinderInterface
|
|||||||
*/
|
*/
|
||||||
public static function routeBinder($value, $route)
|
public static function routeBinder($value, $route)
|
||||||
{
|
{
|
||||||
|
$fiscalHelper = new FiscalHelper;
|
||||||
|
|
||||||
switch ($value) {
|
switch ($value) {
|
||||||
default:
|
default:
|
||||||
try {
|
try {
|
||||||
@ -50,6 +53,10 @@ class Date implements BinderInterface
|
|||||||
return Carbon::now()->startOfYear();
|
return Carbon::now()->startOfYear();
|
||||||
case 'currentYearEnd':
|
case 'currentYearEnd':
|
||||||
return Carbon::now()->endOfYear();
|
return Carbon::now()->endOfYear();
|
||||||
|
case 'currentFiscalYearStart':
|
||||||
|
return $fiscalHelper->startOfFiscalYear(Carbon::now());
|
||||||
|
case 'currentFiscalYearEnd':
|
||||||
|
return $fiscalHelper->endOfFiscalYear(Carbon::now());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -488,6 +488,7 @@ return [
|
|||||||
'quick_link_default_report' => 'Default financial report',
|
'quick_link_default_report' => 'Default financial report',
|
||||||
'report_this_month_quick' => 'Current month, all accounts',
|
'report_this_month_quick' => 'Current month, all accounts',
|
||||||
'report_this_year_quick' => 'Current year, all accounts',
|
'report_this_year_quick' => 'Current year, all accounts',
|
||||||
|
'report_this_fiscal_year_quick' => 'Current fiscal year, all accounts',
|
||||||
'report_all_time_quick' => 'All-time, all accounts',
|
'report_all_time_quick' => 'All-time, all accounts',
|
||||||
'reports_can_bookmark' => 'Remember that reports can be bookmarked.',
|
'reports_can_bookmark' => 'Remember that reports can be bookmarked.',
|
||||||
'incomeVsExpenses' => 'Income vs. expenses',
|
'incomeVsExpenses' => 'Income vs. expenses',
|
||||||
|
@ -108,6 +108,14 @@
|
|||||||
accountList
|
accountList
|
||||||
]) }}">{{ 'report_this_year_quick'|_ }}</a>
|
]) }}">{{ 'report_this_year_quick'|_ }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ route('reports.report',
|
||||||
|
['default',
|
||||||
|
'currentFiscalYearStart',
|
||||||
|
'currentFiscalYearEnd',
|
||||||
|
accountList
|
||||||
|
]) }}">{{ 'report_this_fiscal_year_quick'|_ }}</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ route('reports.report',
|
<a href="{{ route('reports.report',
|
||||||
['default',
|
['default',
|
||||||
|
Loading…
Reference in New Issue
Block a user