Skip to content

Firefly III: a personal finances manager

Fix https://github.com/orgs/firefly-iii/discussions/9080

James Cole8538741341d6
diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php
index 726acdb761..5b941ad1e9 100644
--- a/app/Repositories/Account/AccountRepository.php
+++ b/app/Repositories/Account/AccountRepository.php
@@ -554,6 +554,11 @@ class AccountRepository implements AccountRepositoryInterface
++$index;
}
}
+ // reset the rest to zero.
+ $all = [AccountType::DEFAULT, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::CREDITCARD, AccountType::MORTGAGE];
+ $this->user->accounts()->leftJoin('account_types','account_types.id','=','accounts.account_type_id')
+ ->whereNotIn('account_types.type', $all)
+ ->update(['order' => 0]);
}
public function searchAccount(string $query, array $types, int $limit): Collection
diff --git a/app/Repositories/UserGroups/Account/AccountRepository.php b/app/Repositories/UserGroups/Account/AccountRepository.php
index f6790945dd..cbbac08ff2 100644
--- a/app/Repositories/UserGroups/Account/AccountRepository.php
+++ b/app/Repositories/UserGroups/Account/AccountRepository.php
@@ -241,6 +241,11 @@ class AccountRepository implements AccountRepositoryInterface
++$index;
}
}
+ // reset the rest to zero.
+ $all = [AccountType::DEFAULT, AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::CREDITCARD, AccountType::MORTGAGE];
+ $this->user->accounts()->leftJoin('account_types','account_types.id','=','accounts.account_type_id')
+ ->whereNotIn('account_types.type', $all)
+ ->update(['order' => 0]);
}
public function getAccountsByType(array $types, ?array $sort = [], ?array $filters = []): Collection