diff --git a/app/Helpers/Chart/MetaPieChart.php b/app/Helpers/Chart/MetaPieChart.php index c9fd1e2e9a..f1082cda43 100644 --- a/app/Helpers/Chart/MetaPieChart.php +++ b/app/Helpers/Chart/MetaPieChart.php @@ -359,7 +359,7 @@ class MetaPieChart implements MetaPieChartInterface $repository->setUser($this->user); foreach ($array as $objectId => $amount) { if (!isset($names[$objectId])) { - $object = $repository->find((int)$objectId); + $object = $repository->findNull((int)$objectId); $names[$objectId] = $object->name ?? $object->tag; } $amount = app('steam')->positive($amount); diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index eb3f9559e7..458e0fb014 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -176,7 +176,7 @@ class CategoryController extends Controller $cache->addProperty($accounts->pluck('id')->toArray()); $cache->addProperty($category); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return response()->json($cache->get());// @codeCoverageIgnore } $repository = app(CategoryRepositoryInterface::class); $expenses = $repository->periodExpenses(new Collection([$category]), $accounts, $start, $end); @@ -237,7 +237,7 @@ class CategoryController extends Controller $cache->addProperty('chart.category.period.no-cat'); $cache->addProperty($accounts->pluck('id')->toArray()); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return response()->json($cache->get()); // @codeCoverageIgnore } $repository = app(CategoryRepositoryInterface::class); $expenses = $repository->periodExpensesNoCategory($accounts, $start, $end); diff --git a/app/Http/Controllers/Json/AutoCompleteController.php b/app/Http/Controllers/Json/AutoCompleteController.php index 8e89ac4dd7..a2b1aba242 100644 --- a/app/Http/Controllers/Json/AutoCompleteController.php +++ b/app/Http/Controllers/Json/AutoCompleteController.php @@ -176,15 +176,15 @@ class AutoCompleteController extends Controller * @param JournalCollectorInterface $collector * @param TransactionJournal $except * - * @return JsonResponse|mixed + * @return JsonResponse */ - public function journalsWithId(JournalCollectorInterface $collector, TransactionJournal $except) + public function journalsWithId(JournalCollectorInterface $collector, TransactionJournal $except): JsonResponse { $cache = new CacheProperties; $cache->addProperty('recent-journals-id'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return response()->json($cache->get()); // @codeCoverageIgnore } $collector->setLimit(400)->setPage(1); diff --git a/app/Http/Controllers/Report/ExpenseController.php b/app/Http/Controllers/Report/ExpenseController.php index 892575dd3f..7749607f7f 100644 --- a/app/Http/Controllers/Report/ExpenseController.php +++ b/app/Http/Controllers/Report/ExpenseController.php @@ -107,7 +107,7 @@ class ExpenseController extends Controller try { $result = view('reports.partials.exp-budgets', compact('together'))->render(); } catch (Throwable $e) { - Log::error(sprintf('Could not render category::expenses: %s', $e->getMessage())); + Log::error(sprintf('Could not render category::budget: %s', $e->getMessage())); $result = 'An error prevented Firefly III from rendering. Apologies.'; } $cache->store($result); @@ -271,7 +271,7 @@ class ExpenseController extends Controller try { $result = view('reports.partials.top-transactions', compact('sorted'))->render(); } catch (Throwable $e) { - Log::error(sprintf('Could not render category::expenses: %s', $e->getMessage())); + Log::error(sprintf('Could not render category::topExpense: %s', $e->getMessage())); $result = 'An error prevented Firefly III from rendering. Apologies.'; } $cache->store($result); @@ -320,7 +320,7 @@ class ExpenseController extends Controller try { $result = view('reports.partials.top-transactions', compact('sorted'))->render(); } catch (Throwable $e) { - Log::error(sprintf('Could not render category::expenses: %s', $e->getMessage())); + Log::error(sprintf('Could not render category::topIncome: %s', $e->getMessage())); $result = 'An error prevented Firefly III from rendering. Apologies.'; } $cache->store($result); diff --git a/app/Support/Amount.php b/app/Support/Amount.php index 58650c4cd5..01973c203d 100644 --- a/app/Support/Amount.php +++ b/app/Support/Amount.php @@ -121,7 +121,7 @@ class Amount $locale = explode(',', (string)trans('config.locale')); $locale = array_map('trim', $locale); setlocale(LC_MONETARY, $locale); - $float = round($amount, $format->decimal_places); + $float = round($amount, 12); $info = localeconv(); $formatted = number_format($float, (int)$format->decimal_places, $info['mon_decimal_point'], $info['mon_thousands_sep']);