Compare commits

..

10 Commits

Author SHA1 Message Date
github-actions
12629a1955 Auto commit for release 'develop' on 2025-02-20 2025-02-20 08:00:12 +01:00
James Cole
2e3669a32f Fix #9871 2025-02-20 07:43:32 +01:00
James Cole
ea337607c4 Fix #9868 2025-02-20 07:30:30 +01:00
James Cole
f7f317a3b2 Fix #9863 2025-02-20 07:28:24 +01:00
James Cole
adbf6defe5 Catch nullpointer. 2025-02-20 06:21:29 +01:00
github-actions
e0709f2975 Auto commit for release 'develop' on 2025-02-19 2025-02-19 09:14:18 +01:00
James Cole
30007b05cb Fix #9861 2025-02-19 06:37:40 +01:00
James Cole
13fc7f0d8d Fix #9862 2025-02-19 06:21:27 +01:00
github-actions
7c85138115 Auto commit for release 'v6.2.7' on 2025-02-18 2025-02-18 19:52:25 +01:00
James Cole
2c25f65f7f Expand changelog. 2025-02-18 19:46:01 +01:00
13 changed files with 96 additions and 84 deletions

View File

@@ -406,16 +406,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.69.0",
"version": "v3.69.1",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "630a59448c00729bc235d5e95cfedefeaca37523"
"reference": "13b0c0eede38c11cd674b080f2b485d0f14ffa9f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/630a59448c00729bc235d5e95cfedefeaca37523",
"reference": "630a59448c00729bc235d5e95cfedefeaca37523",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/13b0c0eede38c11cd674b080f2b485d0f14ffa9f",
"reference": "13b0c0eede38c11cd674b080f2b485d0f14ffa9f",
"shasum": ""
},
"require": {
@@ -497,7 +497,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.69.0"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.69.1"
},
"funding": [
{
@@ -505,7 +505,7 @@
"type": "github"
}
],
"time": "2025-02-14T16:19:23+00:00"
"time": "2025-02-18T23:57:43+00:00"
},
{
"name": "psr/container",

View File

@@ -498,6 +498,8 @@ class AccountRepository implements AccountRepositoryInterface
}
$query->orderBy('accounts.active', 'DESC');
$query->orderBy('accounts.name', 'ASC');
$query->orderBy('accounts.account_type_id', 'ASC');
$query->orderBy('accounts.id', 'ASC');
}
return $query->get(['accounts.*']);

View File

@@ -233,8 +233,8 @@ trait ModifiesPiggyBanks
$difference = bcsub($piggyBank->target_amount, $currentAmount);
// an amount will be removed, create "negative" event:
Log::debug(sprintf('ChangedAmount: is triggered with difference "%s"', $difference));
event(new ChangedAmount($piggyBank, $difference, null, null));
// Log::debug(sprintf('ChangedAmount: is triggered with difference "%s"', $difference));
// event(new ChangedAmount($piggyBank, $difference, null, null));
// question is, from which account(s) to remove the difference?
// solution: just start from the top until there is no more money left to remove.

View File

@@ -361,6 +361,8 @@ class AccountRepository implements AccountRepositoryInterface
}
$query->orderBy('accounts.order', 'ASC');
$query->orderBy('accounts.name', 'ASC');
$query->orderBy('accounts.account_type_id', 'ASC');
$query->orderBy('accounts.id', 'ASC');
}
return $query->get(['accounts.*']);

View File

@@ -117,30 +117,6 @@ class AccountEnrichment implements EnrichmentInterface
$this->collectNotes();
$this->collectLocations();
$this->collectOpeningBalances();
// $this->default = app('amount')->getNativeCurrency();
// $this->currencies = [];
// $this->balances = [];
// $this->objectGroups = [];
// $this->grouped = [];
//
// // do everything here:
// $this->getLastActivity();
// $this->collectAccountTypes();
// $this->collectMetaData();
// $this->getMetaBalances();
// $this->getObjectGroups();
// $this->collection->transform(function (Account $account) {
// $account->user_array = ['id' => 1, 'bla bla' => 'bla'];
// $account->balances = collect([
// ['balance_id' => 1, 'balance' => 5],
// ['balance_id' => 2, 'balance' => 5],
// ['balance_id' => 3, 'balance' => 5],
// ]);
//
// return $account;
// });
$this->appendCollectedData();
return $this->collection;
@@ -258,7 +234,7 @@ class AccountEnrichment implements EnrichmentInterface
private function collectMetaData(): void
{
$set = AccountMeta::whereIn('name', ['is_multi_currency', 'currency_id', 'account_role', 'account_number', 'liability_direction', 'interest', 'interest_period', 'current_debt'])
$set = AccountMeta::whereIn('name', ['is_multi_currency', 'include_net_worth', 'currency_id', 'account_role', 'account_number', 'liability_direction', 'interest', 'interest_period', 'current_debt'])
->whereIn('account_id', $this->accountIds)
->get(['account_meta.id', 'account_meta.account_id', 'account_meta.name', 'account_meta.data'])->toArray()
;
@@ -275,7 +251,7 @@ class AccountEnrichment implements EnrichmentInterface
$this->currencies[(int) $currency->id] = $currency;
}
foreach ($this->currencies as $id => $currency) {
if (true === $currency) {
if (true === $currency && 0 !== (int) $id) {
throw new FireflyException(sprintf('Currency #%d not found.', $id));
}
}

View File

@@ -72,20 +72,32 @@ class Preferences
public function getForUser(User $user, string $name, null|array|bool|int|string $default = null): ?Preference
{
Log::debug(sprintf('getForUser(#%d, "%s")', $user->id, $name));
// don't care about user group ID, except for some specific preferences.
$userGroupId = $this->getUserGroupId($user, $name);
$preference = Preference::where('user_group_id', $userGroupId)->where('user_id', $user->id)->where('name', $name)->first(['id', 'user_id', 'name', 'data', 'updated_at', 'created_at']);
$query = Preference::where('user_id', $user->id)->where('name', $name);
if (null !== $userGroupId) {
Log::debug('Include user group ID in query');
$query->where('user_group_id', $userGroupId);
}
$preference = $query->first(['id', 'user_id', 'user_group_id', 'name', 'data', 'updated_at', 'created_at']);
if (null !== $preference && null === $preference->data) {
$preference->delete();
$preference = null;
Log::debug('Removed empty preference.');
}
if (null !== $preference) {
Log::debug(sprintf('Found preference #%d for user #%d: %s', $preference->id, $user->id, $name));
return $preference;
}
// no preference found and default is null:
if (null === $default) {
Log::debug('Return NULL, create no preference.');
// return NULL
return null;
}
@@ -124,35 +136,40 @@ class Preferences
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);
$userGroupId = $this->getUserGroupId($user, $name);
$userGroupId = 0 === (int) $userGroupId ? null : (int) $userGroupId;
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']);
$query = Preference::where('user_id', $user->id)->where('name', $name);
if (null !== $userGroupId) {
Log::debug('Include user group ID in query');
$query->where('user_group_id', $userGroupId);
}
if (null !== $pref && null === $value) {
$pref->delete();
$preference = $query->first(['id', 'user_id', 'user_group_id', 'name', 'data', 'updated_at', 'created_at']);
if (null !== $preference && null === $value) {
$preference->delete();
return new Preference();
}
if (null === $value) {
return new Preference();
}
if (null === $pref) {
$pref = new Preference();
$pref->user_id = (int) $user->id;
$pref->user_group_id = $groupId;
$pref->name = $name;
if (null === $preference) {
$preference = new Preference();
$preference->user_id = (int) $user->id;
$preference->user_group_id = $userGroupId;
$preference->name = $name;
}
$pref->data = $value;
$pref->save();
Cache::forever($fullName, $pref);
$preference->data = $value;
$preference->save();
Cache::forever($fullName, $preference);
return $pref;
return $preference;
}
public function beginsWith(User $user, string $search): Collection

View File

@@ -92,7 +92,7 @@ class AccountTransformer extends AbstractTransformer
$decimalPlaces = (int) $account->meta['currency']?->decimal_places;
$decimalPlaces = 0 === $decimalPlaces ? 2 : $decimalPlaces;
$openingBalance = Steam::bcround($openingBalance, $decimalPlaces);
$includeNetWorth = '0' !== ($account->meta['include_net_worth'] ?? null);
$includeNetWorth = 1 === (int) ($account->meta['include_net_worth'] ?? 0);
$longitude = $account->meta['location']['longitude'] ?? null;
$latitude = $account->meta['location']['latitude'] ?? null;
$zoomLevel = $account->meta['location']['zoom_level'] ?? null;

View File

@@ -131,7 +131,7 @@ class TransactionGroupTransformer extends AbstractTransformer
return [
'user' => (string) $transaction['user_id'],
'transaction_journal_id' => $transaction['transaction_journal_id'],
'transaction_journal_id' => (string) $transaction['transaction_journal_id'],
'type' => strtolower($type),
'date' => $transaction['date']->toAtomString(),
'order' => $transaction['order'],
@@ -320,17 +320,17 @@ class TransactionGroupTransformer extends AbstractTransformer
return [
'user' => $journal->user_id,
'transaction_journal_id' => $journal->id,
'transaction_journal_id' => (string) $journal->id,
'type' => strtolower($type),
'date' => $journal->date->toAtomString(),
'order' => $journal->order,
'currency_id' => $currency->id,
'currency_id' => (string) $currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
'foreign_currency_id' => $foreignCurrency['id'],
'foreign_currency_id' => (string) $foreignCurrency['id'],
'foreign_currency_code' => $foreignCurrency['code'],
'foreign_currency_symbol' => $foreignCurrency['symbol'],
'foreign_currency_decimal_places' => $foreignCurrency['decimal_places'],
@@ -340,23 +340,23 @@ class TransactionGroupTransformer extends AbstractTransformer
'description' => $journal->description,
'source_id' => $source->account_id,
'source_id' => (string) $source->account_id,
'source_name' => $source->account->name,
'source_iban' => $source->account->iban,
'source_type' => $source->account->accountType->type,
'destination_id' => $destination->account_id,
'destination_id' => (string) $destination->account_id,
'destination_name' => $destination->account->name,
'destination_iban' => $destination->account->iban,
'destination_type' => $destination->account->accountType->type,
'budget_id' => $budget['id'],
'budget_id' => (string) $budget['id'],
'budget_name' => $budget['name'],
'category_id' => $category['id'],
'category_id' => (string) $category['id'],
'category_name' => $category['name'],
'bill_id' => $bill['id'],
'bill_id' => (string) $bill['id'],
'bill_name' => $bill['name'],
'reconciled' => $source->reconciled,

View File

@@ -3,6 +3,21 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 6.2.7 - 2025-02-19
### Changed
- Optimised Account and Transaction API endpoints, should be a lot faster
- Optimized account deletion, should be a lot faster
### Fixed
- [Issue 9803](https://github.com/firefly-iii/firefly-iii/issues/9803) (Left to spend - All negativ after update.) reported by @nedsined
- [Issue 9835](https://github.com/firefly-iii/firefly-iii/issues/9835) (Failed to create transaction in recurring transactions on 6.2.6) reported by @hhl5350
- [Issue 9842](https://github.com/firefly-iii/firefly-iii/issues/9842) (Net worth on dashboard does not go up to the end of month for the current month) reported by @standingduck3
- [Issue 9848](https://github.com/firefly-iii/firefly-iii/issues/9848) (Failed to export accounts data) reported by @Jaeger87
- [Issue 9855](https://github.com/firefly-iii/firefly-iii/issues/9855) (Demo Website not working) reported by @xfarrow
## 6.2.6 - 2025-02-13
### Fixed

20
composer.lock generated
View File

@@ -1874,16 +1874,16 @@
},
{
"name": "laravel/framework",
"version": "v11.42.1",
"version": "v11.43.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "ff392f42f6c55cc774ce75553a11c6b031da67f8"
"reference": "99d1573698abc42222f04d25fcd5b213d0eedf21"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/ff392f42f6c55cc774ce75553a11c6b031da67f8",
"reference": "ff392f42f6c55cc774ce75553a11c6b031da67f8",
"url": "https://api.github.com/repos/laravel/framework/zipball/99d1573698abc42222f04d25fcd5b213d0eedf21",
"reference": "99d1573698abc42222f04d25fcd5b213d0eedf21",
"shasum": ""
},
"require": {
@@ -2085,7 +2085,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2025-02-12T20:58:18+00:00"
"time": "2025-02-19T21:53:48+00:00"
},
{
"name": "laravel/passport",
@@ -11267,16 +11267,16 @@
},
{
"name": "phpstan/phpstan",
"version": "2.1.5",
"version": "2.1.6",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "451b17f9665481ee502adc39be987cb71067ece2"
"reference": "6eaec7c6c9e90dcfe46ad1e1ffa5171e2dab641c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/451b17f9665481ee502adc39be987cb71067ece2",
"reference": "451b17f9665481ee502adc39be987cb71067ece2",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/6eaec7c6c9e90dcfe46ad1e1ffa5171e2dab641c",
"reference": "6eaec7c6c9e90dcfe46ad1e1ffa5171e2dab641c",
"shasum": ""
},
"require": {
@@ -11321,7 +11321,7 @@
"type": "github"
}
],
"time": "2025-02-13T12:49:56+00:00"
"time": "2025-02-19T15:46:42+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",

View File

@@ -81,7 +81,7 @@ return [
'running_balance_column' => env('USE_RUNNING_BALANCE', false),
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2025-02-18',
'version' => 'develop/2025-02-20',
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 25,

20
package-lock.json generated
View File

@@ -4510,9 +4510,9 @@
}
},
"node_modules/chart.js": {
"version": "4.4.7",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.7.tgz",
"integrity": "sha512-pwkcKfdzTMAU/+jNosKhNL2bHtJc/sSmYgVbuGTEDhzkrhmyihmP7vUc/5ZK9WopidMDHNe3Wm7jOd/WhuHWuw==",
"version": "4.4.8",
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.8.tgz",
"integrity": "sha512-IkGZlVpXP+83QpMm4uxEiGqSI7jFizwVtF3+n5Pc3k7sMO+tkd0qxh2OzLhenM0K80xtmAONWGBn082EiBQSDA==",
"license": "MIT",
"dependencies": {
"@kurkle/color": "^0.3.0"
@@ -8901,9 +8901,9 @@
}
},
"node_modules/postcss": {
"version": "8.5.2",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.2.tgz",
"integrity": "sha512-MjOadfU3Ys9KYoX0AdkBlFEF1Vx37uCCeN4ZHnmwm9FfpbsGWMZeBLMmmpY+6Ocqod7mkdZ0DT31OlbsFrLlkA==",
"version": "8.5.3",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz",
"integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==",
"dev": true,
"funding": [
{
@@ -11344,14 +11344,14 @@
}
},
"node_modules/vite": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.1.0.tgz",
"integrity": "sha512-RjjMipCKVoR4hVfPY6GQTgveinjNuyLw+qruksLDvA5ktI1150VmcMBKmQaEWJhg/j6Uaf6dNCNA0AfdzUb/hQ==",
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.1.1.tgz",
"integrity": "sha512-4GgM54XrwRfrOp297aIYspIti66k56v16ZnqHvrIM7mG+HjDlAwS7p+Srr7J6fGvEdOJ5JcQ/D9T7HhtdXDTzA==",
"dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "^0.24.2",
"postcss": "^8.5.1",
"postcss": "^8.5.2",
"rollup": "^4.30.1"
},
"bin": {

View File

@@ -172,8 +172,8 @@
},
"list": {
"title": "Titolo",
"active": "Attivo",
"native_currency": "Native currency",
"active": "\u00c8 attivo?",
"native_currency": "Valuta nativa",
"trigger": "Trigger",
"response": "Risposta",
"delivery": "Consegna",