Small php fixes.

This commit is contained in:
James Cole
2025-09-10 16:16:31 +02:00
parent cb0b42e44b
commit 28e7df2527
17 changed files with 14 additions and 31 deletions

View File

@@ -86,7 +86,7 @@ class CreateController extends Controller
'latitude' => $hasOldInput ? old('location_latitude') : config('firefly.default_location.latitude'),
'longitude' => $hasOldInput ? old('location_longitude') : config('firefly.default_location.longitude'),
'zoom_level' => $hasOldInput ? old('location_zoom_level') : config('firefly.default_location.zoom_level'),
'has_location' => $hasOldInput ? 'true' === old('location_has_location') : false,
'has_location' => $hasOldInput && 'true' === old('location_has_location'),
],
];
$liabilityDirections = [
@@ -106,7 +106,7 @@ class CreateController extends Controller
'preFilled',
[
'currency_id' => $this->primaryCurrency->id,
'include_net_worth' => $hasOldInput ? (bool) $request->old('include_net_worth') : true,
'include_net_worth' => !$hasOldInput || (bool)$request->old('include_net_worth'),
]
);
// issue #8321

View File

@@ -171,7 +171,7 @@ class BoxController extends Controller
$filtered = $allAccounts->filter(
static function (Account $account) use ($accountRepository) {
$includeNetWorth = $accountRepository->getMetaValue($account, 'include_net_worth');
$result = null === $includeNetWorth ? true : '1' === $includeNetWorth;
$result = null === $includeNetWorth || '1' === $includeNetWorth;
if (false === $result) {
app('log')->debug(sprintf('Will not include "%s" in net worth charts.', $account->name));
}

View File

@@ -291,7 +291,7 @@ class BudgetController extends Controller
$cache->addProperty('budget-period-report');
$cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) {
// return $cache->get();
return $cache->get();
}
$periods = Navigation::listOfPeriods($start, $end);