Revamp multi-account report.

This commit is contained in:
James Cole
2019-09-03 22:35:41 +02:00
parent 4743230136
commit 47de2fec28
29 changed files with 2286 additions and 628 deletions

View File

@@ -52,13 +52,14 @@ class MonthReportGenerator implements ReportGeneratorInterface
public function generate(): string
{
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
$expenseIds = implode(',', $this->expense->pluck('id')->toArray());
$doubleIds = implode(',', $this->expense->pluck('id')->toArray());
$reportType = 'account';
$preferredPeriod = $this->preferredPeriod();
try {
$result = view(
'reports.double.report', compact('accountIds', 'reportType', 'expenseIds', 'preferredPeriod')
)->with('start', $this->start)->with('end', $this->end)->render();
$result = view('reports.double.report', compact('accountIds', 'reportType', 'doubleIds', 'preferredPeriod'))
->with('start', $this->start)->with('end', $this->end)
->with('doubles', $this->expense)
->render();
} catch (Throwable $e) {
Log::error(sprintf('Cannot render reports.double.report: %s', $e->getMessage()));
$result = sprintf('Could not render report view: %s', $e->getMessage());