Skip to content

Firefly III: a personal finances manager

Code for #2037

James Colecf307a00e1d8
diff --git a/app/Support/Binder/Date.php b/app/Support/Binder/Date.php
index 5105c208ce..07462f9998 100644
--- a/app/Support/Binder/Date.php
+++ b/app/Support/Binder/Date.php
@@ -47,12 +47,20 @@ class Date implements BinderInterface
$fiscalHelper = app(FiscalHelperInterface::class);
$magicWords = [
- 'currentMonthStart' => Carbon::now()->startOfMonth(),
- 'currentMonthEnd' => Carbon::now()->endOfMonth(),
- 'currentYearStart' => Carbon::now()->startOfYear(),
- 'currentYearEnd' => Carbon::now()->endOfYear(),
- 'currentFiscalYearStart' => $fiscalHelper->startOfFiscalYear(Carbon::now()),
- 'currentFiscalYearEnd' => $fiscalHelper->endOfFiscalYear(Carbon::now()),
+ 'currentMonthStart' => Carbon::now()->startOfMonth(),
+ 'currentMonthEnd' => Carbon::now()->endOfMonth(),
+ 'currentYearStart' => Carbon::now()->startOfYear(),
+ 'currentYearEnd' => Carbon::now()->endOfYear(),
+
+ 'previousMonthStart' => Carbon::now()->startOfMonth()->subDay()->startOfMonth(),
+ 'previousMonthEnd' => Carbon::now()->startOfMonth()->subDay()->endOfMonth(),
+ 'previousYearStart' => Carbon::now()->startOfYear()->subDay()->startOfYear(),
+ 'previousYearEnd' => Carbon::now()->startOfYear()->subDay()->endOfYear(),
+
+ 'currentFiscalYearStart' => $fiscalHelper->startOfFiscalYear(Carbon::now()),
+ 'currentFiscalYearEnd' => $fiscalHelper->endOfFiscalYear(Carbon::now()),
+ 'previousFiscalYearStart' => $fiscalHelper->startOfFiscalYear(Carbon::now())->subYear(),
+ 'previousFiscalYearEnd' => $fiscalHelper->endOfFiscalYear(Carbon::now())->subYear(),
];
if (isset($magicWords[$value])) {
return $magicWords[$value];
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index 3152883c63..fb4b9b2cbf 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -953,9 +953,11 @@ return [
'report_budget' => 'Budget report between :start and :end',
'report_tag' => 'Tag report between :start and :end',
'quick_link_reports' => 'Quick links',
+ 'quick_link_examples' => 'These are just some example links to get you started. Check out the help pages under the (?)-button for information on all reports and the magic words you can use.',
'quick_link_default_report' => 'Default financial report',
'quick_link_audit_report' => 'Transaction history overview',
'report_this_month_quick' => 'Current month, all accounts',
+ 'report_last_month_quick' => 'Last 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',
diff --git a/resources/views/v1/reports/index.twig b/resources/views/v1/reports/index.twig
index b89aea175f..34dd4ca639 100644
--- a/resources/views/v1/reports/index.twig
+++ b/resources/views/v1/reports/index.twig
@@ -118,7 +118,9 @@
<h3 class="box-title">{{ 'quick_link_reports'|_ }}</h3>
</div>
<div class="box-body">
-
+ <p>
+ {{ 'quick_link_examples'|_ }}
+ </p>
<h4>{{ ('quick_link_default_report')|_ }}</h4>
<ul>
<li>
@@ -132,6 +134,9 @@
<a href="{{ route('reports.report.default',[accountList, 'currentFiscalYearStart','currentFiscalYearEnd']) }}">{{ 'report_this_fiscal_year_quick'|_ }}</a>
</li>
{% endif %}
+ <li>
+ <a href="{{ route('reports.report.default',[accountList, 'previousMonthStart','previousMonthEnd']) }}">{{ 'report_last_month_quick'|_ }}</a>
+ </li>
<li>
<a href="{{ route('reports.report.default',[accountList, start.format('Ymd'),'currentMonthEnd']) }}">{{ 'report_all_time_quick'|_ }}</a>
</li>