Merge pull request #153 from webenhanced/feature/current-fiscal-year-quicklink-report

Quicklink fiscal year report feature. As per github issue #131.
This commit is contained in:
James Cole
2016-01-29 06:45:36 +01:00
3 changed files with 16 additions and 0 deletions

View File

@@ -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());
}
}