mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
New stuff for report.
This commit is contained in:
@@ -47,13 +47,14 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
*/
|
||||
public function generate(): string
|
||||
{
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$expenseIds = join(',', $this->expense->pluck('id')->toArray());
|
||||
$reportType = 'account';
|
||||
$accountIds = join(',', $this->accounts->pluck('id')->toArray());
|
||||
$expenseIds = join(',', $this->expense->pluck('id')->toArray());
|
||||
$reportType = 'account';
|
||||
$preferredPeriod = $this->preferredPeriod();
|
||||
|
||||
return view(
|
||||
'reports.account.report',
|
||||
compact('accountIds', 'reportType','expenseIds')
|
||||
compact('accountIds', 'reportType', 'expenseIds', 'preferredPeriod')
|
||||
)->with('start', $this->start)->with('end', $this->end)->render();
|
||||
}
|
||||
|
||||
@@ -134,4 +135,12 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function preferredPeriod(): string
|
||||
{
|
||||
return 'day';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,4 +28,11 @@ namespace FireflyIII\Generator\Report\Account;
|
||||
class MultiYearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
// Doesn't do anything different.
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function preferredPeriod(): string {
|
||||
return 'year';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,4 +28,11 @@ namespace FireflyIII\Generator\Report\Account;
|
||||
class YearReportGenerator extends MonthReportGenerator
|
||||
{
|
||||
// Doesn't do anything different.
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
protected function preferredPeriod(): string {
|
||||
return 'month';
|
||||
}
|
||||
}
|
||||
|
||||
15
app/Http/Controllers/Report/ExpenseController.php
Normal file
15
app/Http/Controllers/Report/ExpenseController.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Report;
|
||||
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
|
||||
|
||||
/**
|
||||
* Class ExpenseController
|
||||
*/
|
||||
class ExpenseController extends Controller
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user