Various improvs to the report generator.

This commit is contained in:
James Cole
2021-10-30 11:42:35 +02:00
parent a16b6cb2b8
commit 8b81526e54
8 changed files with 177 additions and 17 deletions

View File

@@ -59,7 +59,6 @@ class ReportController extends Controller
'category-entry' => $this->categoryEntry($attributes),
'budget-entry' => $this->budgetEntry($attributes),
};
return response()->json(['html' => $html]);
}
}

View File

@@ -648,10 +648,9 @@ class CategoryController extends Controller
* @param Carbon $start
* @param Carbon $end
*
* @return mixed|string
* @throws JsonException
* @return string
*/
public function operations(Collection $accounts, Carbon $start, Carbon $end)
public function operations(Collection $accounts, Carbon $start, Carbon $end): string
{
// chart properties for cache:
$cache = new CacheProperties;
@@ -673,7 +672,7 @@ class CategoryController extends Controller
try {
$result = prefixView('reports.partials.categories', compact('report'))->render();
$result = (string)prefixView('reports.partials.categories', compact('report'))->render();
$cache->store($result);
} catch (Throwable $e) { // @phpstan-ignore-line
Log::error(sprintf('Could not render category::expenses: %s', $e->getMessage()));