Skip to content

Firefly III: a personal finances manager

Quicklink fiscal year report feature. As per github issue #131.

Graham Miller41188a1bd66b
diff --git a/app/Support/Binder/Date.php b/app/Support/Binder/Date.php
index e03a3238f9..d2db45ef9e 100644
--- a/app/Support/Binder/Date.php
+++ b/app/Support/Binder/Date.php
@@ -11,6 +11,7 @@ namespace FireflyIII\Support\Binder;
use Auth;
use Carbon\Carbon;
+use FireflyIII\Helpers\FiscalHelper;
use Exception;
use Log;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -32,6 +33,8 @@ class Date implements BinderInterface
*/
public static function routeBinder($value, $route)
{
+ $fiscalHelper = new FiscalHelper;
+
switch ($value) {
default:
try {
@@ -50,6 +53,10 @@ class Date implements BinderInterface
return Carbon::now()->startOfYear();
case 'currentYearEnd':
return Carbon::now()->endOfYear();
+ case 'currentFiscalYearStart':
+ return $fiscalHelper->startOfFiscalYear(Carbon::now());
+ case 'currentFiscalYearEnd':
+ return $fiscalHelper->endOfFiscalYear(Carbon::now());
}
}
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index fb8aaa0b34..6e46df8d46 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -488,6 +488,7 @@ return [
'quick_link_default_report' => 'Default financial report',
'report_this_month_quick' => 'Current month, 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',
'reports_can_bookmark' => 'Remember that reports can be bookmarked.',
'incomeVsExpenses' => 'Income vs. expenses',
diff --git a/resources/views/reports/index.twig b/resources/views/reports/index.twig
index 9be5d59c57..f79e8eb82c 100644
--- a/resources/views/reports/index.twig
+++ b/resources/views/reports/index.twig
@@ -108,6 +108,14 @@
accountList
]) }}">{{ 'report_this_year_quick'|_ }}</a>
</li>
+ <li>
+ <a href="{{ route('reports.report',
+ ['default',
+ 'currentFiscalYearStart',
+ 'currentFiscalYearEnd',
+ accountList
+ ]) }}">{{ 'report_this_fiscal_year_quick'|_ }}</a>
+ </li>
<li>
<a href="{{ route('reports.report',
['default',