From b58d8090632d9679a6b43ca755dc3f705c8dd26b Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Dec 2024 08:09:51 +0100 Subject: [PATCH] Auto commit for release 'develop' on 2024-12-31 --- .../Controllers/Chart/AccountController.php | 12 ++--- .../ReturnsAvailableChannels.php | 2 +- app/Repositories/Bill/BillRepository.php | 4 +- app/Support/Preferences.php | 46 ++++++++++--------- app/Support/Steam.php | 13 +++--- config/firefly.php | 2 +- package-lock.json | 6 +-- 7 files changed, 43 insertions(+), 42 deletions(-) diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 1d8b580b17..83b0409def 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -137,13 +137,13 @@ class AccountController extends Controller continue; } - //Log::debug(sprintf('Will process expense array "%s" with amount %s', $key, $endBalance)); + // Log::debug(sprintf('Will process expense array "%s" with amount %s', $key, $endBalance)); $searchCode = $this->convertToNative ? $this->defaultCurrency->code : $key; - //Log::debug(sprintf('Search code is %s', $searchCode)); + // Log::debug(sprintf('Search code is %s', $searchCode)); // see if there is an accompanying start amount. // grab the difference and find the currency. $startBalance = ($startBalances[$account->id][$key] ?? '0'); -// Log::debug(sprintf('Start balance is %s', $startBalance)); + // Log::debug(sprintf('Start balance is %s', $startBalance)); $diff = bcsub($endBalance, $startBalance); $currencies[$searchCode] ??= $this->currencyRepository->findByCode($searchCode); if (0 !== bccomp($diff, '0')) { @@ -596,13 +596,13 @@ class AccountController extends Controller continue; } - //Log::debug(sprintf('Will process expense array "%s" with amount %s', $key, $endBalance)); + // Log::debug(sprintf('Will process expense array "%s" with amount %s', $key, $endBalance)); $searchCode = $this->convertToNative ? $this->defaultCurrency->code : $key; - //Log::debug(sprintf('Search code is %s', $searchCode)); + // Log::debug(sprintf('Search code is %s', $searchCode)); // see if there is an accompanying start amount. // grab the difference and find the currency. $startBalance = ($startBalances[$account->id][$key] ?? '0'); - //Log::debug(sprintf('Start balance is %s', $startBalance)); + // Log::debug(sprintf('Start balance is %s', $startBalance)); $diff = bcsub($endBalance, $startBalance); $currencies[$searchCode] ??= $this->currencyRepository->findByCode($searchCode); if (0 !== bccomp($diff, '0')) { diff --git a/app/Notifications/ReturnsAvailableChannels.php b/app/Notifications/ReturnsAvailableChannels.php index 17ba9a13bf..21ee5c49f9 100644 --- a/app/Notifications/ReturnsAvailableChannels.php +++ b/app/Notifications/ReturnsAvailableChannels.php @@ -91,7 +91,7 @@ class ReturnsAvailableChannels } // validate presence of of Ntfy settings. - $ntfyTopic = (string) app('preferences')->getEncryptedForUser($user, 'ntfy_topic', '')->data; + $ntfyTopic = (string) app('preferences')->getEncryptedForUser($user, 'ntfy_topic', '')->data; if ('' !== $ntfyTopic) { Log::debug(sprintf('Enabled ntfy, "%s"', $ntfyTopic)); $channels[] = NtfyChannel::class; diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 9de9567370..8c35166830 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -550,9 +550,9 @@ class BillRepository implements BillRepositoryInterface foreach ($set as $transactionJournal) { $setAmount = bcadd($setAmount, Amount::getAmountFromJournalObject($transactionJournal)); } - //Log::debug(sprintf('Bill #%d ("%s") with %d transaction(s) and sum %s %s', $bill->id, $bill->name, $set->count(), $currency->code, $setAmount)); + // Log::debug(sprintf('Bill #%d ("%s") with %d transaction(s) and sum %s %s', $bill->id, $bill->name, $set->count(), $currency->code, $setAmount)); $return[$currency->id]['sum'] = bcadd($return[$currency->id]['sum'], $setAmount); - //Log::debug(sprintf('Total sum is now %s', $return[$currency->id]['sum'])); + // Log::debug(sprintf('Total sum is now %s', $return[$currency->id]['sum'])); } return $return; diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index babe2d9a09..d627b00afd 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -47,15 +47,16 @@ class Preferences } return Preference::where('user_id', $user->id) - ->where('name', '!=', 'currencyPreference') - ->where(function (Builder $q) use ($user): void { - $q->whereNull('user_group_id'); - $q->orWhere('user_group_id', $user->user_group_id); - }) - ->get(); + ->where('name', '!=', 'currencyPreference') + ->where(function (Builder $q) use ($user): void { + $q->whereNull('user_group_id'); + $q->orWhere('user_group_id', $user->user_group_id); + }) + ->get() + ; } - public function get(string $name, null | array | bool | int | string $default = null): ?Preference + public function get(string $name, null|array|bool|int|string $default = null): ?Preference { /** @var null|User $user */ $user = auth()->user(); @@ -69,7 +70,7 @@ class Preferences return $this->getForUser($user, $name, $default); } - public function getForUser(User $user, string $name, null | array | bool | int | string $default = null): ?Preference + public function getForUser(User $user, string $name, null|array|bool|int|string $default = null): ?Preference { // don't care about user group ID, except for some specific preferences. $userGroupId = $this->getUserGroupId($user, $name); @@ -121,16 +122,16 @@ class Preferences Cache::put($key, '', 5); } - public function setForUser(User $user, string $name, null | array | bool | int | string $value): Preference + public function setForUser(User $user, string $name, null|array|bool|int|string $value): Preference { - $fullName = sprintf('preference%s%s', $user->id, $name); - $groupId = $this->getUserGroupId($user, $name); - $groupId = 0 === (int) $groupId ? null : (int) $groupId; + $fullName = sprintf('preference%s%s', $user->id, $name); + $groupId = $this->getUserGroupId($user, $name); + $groupId = 0 === (int) $groupId ? null : (int) $groupId; Cache::forget($fullName); /** @var null|Preference $pref */ - $pref = Preference::where('user_group_id', $groupId)->where('user_id', $user->id)->where('name', $name)->first(['id', 'name', 'data', 'updated_at', 'created_at']); + $pref = Preference::where('user_group_id', $groupId)->where('user_id', $user->id)->where('name', $name)->first(['id', 'name', 'data', 'updated_at', 'created_at']); if (null !== $pref && null === $value) { $pref->delete(); @@ -173,12 +174,13 @@ class Preferences { $result = []; $preferences = Preference::where('user_id', $user->id) - ->where(function (Builder $q) use ($user): void { - $q->whereNull('user_group_id'); - $q->orWhere('user_group_id', $user->user_group_id); - }) - ->whereIn('name', $list) - ->get(['id', 'name', 'data']); + ->where(function (Builder $q) use ($user): void { + $q->whereNull('user_group_id'); + $q->orWhere('user_group_id', $user->user_group_id); + }) + ->whereIn('name', $list) + ->get(['id', 'name', 'data']) + ; /** @var Preference $preference */ foreach ($preferences as $preference) { @@ -220,7 +222,7 @@ class Preferences return $result; } - public function getEncryptedForUser(User $user, string $name, null | array | bool | int | string $default = null): ?Preference + public function getEncryptedForUser(User $user, string $name, null|array|bool|int|string $default = null): ?Preference { $result = $this->getForUser($user, $name, $default); if ('' === $result->data) { @@ -245,7 +247,7 @@ class Preferences return $result; } - public function getFresh(string $name, null | array | bool | int | string $default = null): ?Preference + public function getFresh(string $name, null|array|bool|int|string $default = null): ?Preference { /** @var null|User $user */ $user = auth()->user(); @@ -283,7 +285,7 @@ class Preferences Session::forget('first'); } - public function set(string $name, null | array | bool | int | string $value): Preference + public function set(string $name, null|array|bool|int|string $value): Preference { /** @var null|User $user */ $user = auth()->user(); diff --git a/app/Support/Steam.php b/app/Support/Steam.php index de646bdf74..2dfd7c8529 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -331,7 +331,7 @@ class Steam if ($native->id === $accountCurrency?->id) { $return['balance'] = bcadd('' === (string) $account->virtual_balance ? '0' : $account->virtual_balance, $return['balance']); } - //Log::debug(sprintf('balance is (%s only) %s (with virtual balance)', $native->code, $this->bcround($return['balance'], 2))); + // Log::debug(sprintf('balance is (%s only) %s (with virtual balance)', $native->code, $this->bcround($return['balance'], 2))); // native balance $return['native_balance'] = (string) $account->transactions() @@ -342,7 +342,7 @@ class Steam ; // plus native virtual balance. $return['native_balance'] = bcadd('' === (string) $account->native_virtual_balance ? '0' : $account->native_virtual_balance, $return['native_balance']); - //Log::debug(sprintf('native_balance is (all transactions to %s) %s (with virtual balance)', $native->code, $this->bcround($return['native_balance']))); + // Log::debug(sprintf('native_balance is (all transactions to %s) %s (with virtual balance)', $native->code, $this->bcround($return['native_balance']))); // plus foreign transactions in THIS currency. $sum = (string) $account->transactions() @@ -379,16 +379,15 @@ class Steam // } if (!$hasCurrency && array_key_exists('balance', $return) && array_key_exists('native_balance', $return)) { -// Log::debug('Account has no currency preference, dropping balance in favor of native balance.'); + // Log::debug('Account has no currency preference, dropping balance in favor of native balance.'); $sum = bcadd($return['balance'], $return['native_balance']); -// Log::debug(sprintf('%s + %s = %s', $return['balance'], $return['native_balance'], $sum)); + // Log::debug(sprintf('%s + %s = %s', $return['balance'], $return['native_balance'], $sum)); $return['native_balance'] = $sum; unset($return['balance']); } - $final = array_merge($return, $others); - // Log::debug('Return is', $final); - return $final; + return array_merge($return, $others); + // Log::debug('Return is', $final); } public function filterAccountBalances(array $total, Account $account, bool $convertToNative, ?TransactionCurrency $currency = null): array diff --git a/config/firefly.php b/config/firefly.php index 516c519d79..5bed9902fa 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -81,7 +81,7 @@ return [ 'running_balance_column' => env('USE_RUNNING_BALANCE', false), // see cer.php for exchange rates feature flag. ], - 'version' => '6.2.0-alpha.1', + 'version' => 'develop/2024-12-31', 'api_version' => '2.1.0', // field is no longer used. 'db_version' => 25, diff --git a/package-lock.json b/package-lock.json index bc0e566e97..f3b689ef4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12114,9 +12114,9 @@ "license": "ISC" }, "node_modules/yaml": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.1.tgz", - "integrity": "sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "dev": true, "license": "ISC", "bin": {