mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-02-22 19:36:59 +00:00
Compare commits
36 Commits
develop-20
...
develop-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80823cdfe3 | ||
|
|
defaef171e | ||
|
|
81f6f22efb | ||
|
|
4ad2508675 | ||
|
|
35f997be45 | ||
|
|
ad3fec1458 | ||
|
|
25eab80ec3 | ||
|
|
c27e9873b2 | ||
|
|
84f4f63104 | ||
|
|
02d37998f9 | ||
|
|
39c72a60e1 | ||
|
|
1980f73694 | ||
|
|
d135186149 | ||
|
|
3e36287374 | ||
|
|
37c4db2ce9 | ||
|
|
8e6ff3ceaf | ||
|
|
6e0e32dc6c | ||
|
|
b0e21dd553 | ||
|
|
88291c5f63 | ||
|
|
a87e10f734 | ||
|
|
75f42d57f1 | ||
|
|
3f60442281 | ||
|
|
dd14bb1664 | ||
|
|
403a2ce2cd | ||
|
|
e5366dbf6c | ||
|
|
091f264f3e | ||
|
|
3ad1420262 | ||
|
|
018f68b789 | ||
|
|
e23d0de8f9 | ||
|
|
04c3bf966d | ||
|
|
681619f732 | ||
|
|
cab298708c | ||
|
|
c4392f89d1 | ||
|
|
36789a310a | ||
|
|
e92a1b6dda | ||
|
|
1d687a632f |
@@ -43,6 +43,7 @@ return $config->setRules(
|
||||
// rule sets
|
||||
'@PHP8x3Migration' => true,
|
||||
'@PHP8x4Migration' => true,
|
||||
'@PHP8x5Migration' => true,
|
||||
'@PhpCsFixer' => true,
|
||||
'@PhpCsFixer:risky' => true,
|
||||
'@PSR12' => true,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"require": {
|
||||
"php": ">=8.5.0",
|
||||
"friendsofphp/php-cs-fixer": "^3.12"
|
||||
}
|
||||
}
|
||||
|
||||
6
.ci/php-cs-fixer/composer.lock
generated
6
.ci/php-cs-fixer/composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "f1e0b38af4ded66da271a99d2bff5be8",
|
||||
"content-hash": "35b5ad9b3c4e1ffe78ef9bec73987499",
|
||||
"packages": [
|
||||
{
|
||||
"name": "clue/ndjson-react",
|
||||
@@ -2683,7 +2683,9 @@
|
||||
"stability-flags": {},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {},
|
||||
"platform": {
|
||||
"php": ">=8.5.0"
|
||||
},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.9.0"
|
||||
}
|
||||
|
||||
6
.github/ISSUE_TEMPLATE/bug.yml
vendored
6
.github/ISSUE_TEMPLATE/bug.yml
vendored
@@ -4,9 +4,9 @@ body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Support guidelines
|
||||
description: Please read the support guidelines before proceeding.
|
||||
description: Thank you for reading the support guidelines before proceeding.
|
||||
options:
|
||||
- label: I've read the <!-- MZ2udTpin6FL --> [support guidelines](https://github.com/firefly-iii/firefly-iii/blob/main/.github/support.md)
|
||||
- label: I'm smart and I read the <!-- MZ2udTpin6FL --> [support guidelines](https://github.com/firefly-iii/firefly-iii/blob/main/.github/support.md)
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
@@ -29,7 +29,7 @@ body:
|
||||
attributes:
|
||||
label: Debug information
|
||||
description: Please provide the table from the /debug page. Do not add backticks or quotes.
|
||||
placeholder: The output from the /debug page
|
||||
placeholder: The output from the /debug page or "N/A"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
20
.github/pull_request_template.md
vendored
20
.github/pull_request_template.md
vendored
@@ -1,20 +1,22 @@
|
||||
<!--
|
||||
Thank you for submitting new code to Firefly III, or any of the related projects. Please read the following rules carefully.
|
||||
|
||||
- Please do not submit solutions for problems that are not already reported in an issue.
|
||||
- Unfortunately, Firefly III can't be your learning experience. If you're new to all of this, please open an issue first.
|
||||
- Please do not open PRs to "discuss" possible solutions or to "get feedback" on your code. I simply don't have time for that.
|
||||
- Pull requests for the MAIN branch will be closed.
|
||||
- DO NOT include translated strings in your PR.
|
||||
- PRs (or parts thereof) that only fix issues inside code comments will not be accepted.
|
||||
Please TALK TO ME FIRST before you open a PR.
|
||||
|
||||
If it feels necessary to open an issue first, please do so, before you open a PR.
|
||||
1. If you fix a problem that has no ticket, talk to me FIRST.
|
||||
2. If you introduce new financial solutions or concepts, talk to me FIRST.
|
||||
3. If your PR is more than 25 lines, talk to me FIRST.
|
||||
4. If you used AI to write your PR, talk to me FIRST.
|
||||
5. If you fix spelling or code comments, talk to me FIRST.
|
||||
|
||||
Wanna talk to me? Open a GitHub Issue, Discussion, or send me an email: james@firefly-iii.org
|
||||
|
||||
See also: https://docs.firefly-iii.org/explanation/support/#contributing-code
|
||||
|
||||
-->
|
||||
|
||||
@JC5
|
||||
|
||||
This PR fixes issue # (if relevant).
|
||||
This PR fixes issue # <!-- mandatory field! -->.
|
||||
|
||||
Changes in this pull request:
|
||||
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -177,7 +177,7 @@ jobs:
|
||||
rm -rf vendor composer.lock
|
||||
composer update --no-scripts --no-plugins -q
|
||||
mago format || true
|
||||
mago analyze --reporting-format=github || true
|
||||
# mago analyze --reporting-format=github || true
|
||||
sudo chown -R runner:docker resources/lang
|
||||
.ci/phpcs.sh || true
|
||||
- name: Calculate variables
|
||||
|
||||
@@ -4,6 +4,7 @@ Over time, many people have contributed to Firefly III. Their efforts are not al
|
||||
Please find below all the people who contributed to the Firefly III code. Their names are mentioned in the year of their first contribution.
|
||||
|
||||
## 2026
|
||||
- Khoa Nguyen
|
||||
- Nick Huang
|
||||
- mateuszkulapl
|
||||
- Gianluca Martino
|
||||
|
||||
@@ -25,11 +25,15 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Api\V1\Controllers\Search;
|
||||
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Search\CountRequest;
|
||||
use FireflyIII\Api\V1\Requests\Search\TransactionSearchRequest;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use FireflyIII\Support\JsonApi\Enrichments\TransactionGroupEnrichment;
|
||||
use FireflyIII\Support\Search\SearchInterface;
|
||||
use FireflyIII\Transformers\TransactionGroupTransformer;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection;
|
||||
|
||||
@@ -38,6 +42,51 @@ use League\Fractal\Resource\Collection;
|
||||
*/
|
||||
class TransactionController extends Controller
|
||||
{
|
||||
private JournalRepositoryInterface $repository;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->middleware(function ($request, $next) {
|
||||
/** @var User $admin */
|
||||
$admin = auth()->user();
|
||||
|
||||
$this->repository = app(JournalRepositoryInterface::class);
|
||||
$this->repository->setUser($admin);
|
||||
|
||||
return $next($request);
|
||||
});
|
||||
}
|
||||
|
||||
public function count(CountRequest $request, SearchInterface $searcher): JsonResponse
|
||||
{
|
||||
$count = 0;
|
||||
$includeDeleted = $request->attributes->get('include_deleted', false);
|
||||
$externalId = (string) $request->attributes->get('external_identifier');
|
||||
$internalRef = (string) $request->attributes->get('internal_reference');
|
||||
$notes = (string) $request->attributes->get('notes');
|
||||
$description = (string) $request->attributes->get('description');
|
||||
Log::debug(sprintf('Include deleted? %s', var_export($includeDeleted, true)));
|
||||
if ('' !== $externalId) {
|
||||
$count += $this->repository->countByMeta('external_identifier', $externalId, $includeDeleted);
|
||||
Log::debug(sprintf('Search for transactions with external_identifier "%s", count is now %d', $externalId, $count));
|
||||
}
|
||||
if ('' !== $internalRef) {
|
||||
$count += $this->repository->countByMeta('internal_reference', $internalRef, $includeDeleted);
|
||||
Log::debug(sprintf('Search for transactions with internal_reference "%s", count is now %d', $internalRef, $count));
|
||||
}
|
||||
if ('' !== $notes) {
|
||||
$count += $this->repository->countByNotes($notes, $includeDeleted);
|
||||
Log::debug(sprintf('Search for transactions with notes LIKE "%s", count is now %d', $notes, $count));
|
||||
}
|
||||
if ('' !== $description) {
|
||||
$count += $this->repository->countByDescription($description, $includeDeleted);
|
||||
Log::debug(sprintf('Search for transactions with description "%s", count is now %d', $description, $count));
|
||||
}
|
||||
|
||||
return response()->json(['count' => $count]);
|
||||
}
|
||||
|
||||
/**
|
||||
* This endpoint is documented at:
|
||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/search/searchTransactions
|
||||
|
||||
@@ -61,7 +61,7 @@ class TransactionRequest extends FormRequest
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return ['query' => ['required', 'min:1', 'max:255', 'json', new IsValidBulkClause(ClauseType::TRANSACTION)]];
|
||||
return ['query' => ['required', 'min:1', 'max:255', 'json', new IsValidBulkClause(ClauseType::TRANSACTION->value)]];
|
||||
}
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
|
||||
@@ -92,7 +92,7 @@ class UpdateRequest extends FormRequest
|
||||
'description' => 'min:1|max:32768|nullable',
|
||||
'rule_group_id' => 'belongsToUser:rule_groups',
|
||||
'rule_group_title' => 'nullable|min:1|max:255|belongsToUser:rule_groups,title',
|
||||
'trigger' => 'in:store-journal,update-journal.manual-activation',
|
||||
'trigger' => 'in:store-journal,update-journal,manual-activation',
|
||||
'triggers.*.type' => 'required|in:'.implode(',', $validTriggers),
|
||||
'triggers.*.value' => 'required_if:actions.*.type,'.$contextTriggers.'|min:1|ruleTriggerValue|max:1024',
|
||||
'triggers.*.stop_processing' => [new IsBoolean()],
|
||||
|
||||
64
app/Api/V1/Requests/Search/CountRequest.php
Normal file
64
app/Api/V1/Requests/Search/CountRequest.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* SearchRequest.php
|
||||
* Copyright (c) 2026 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace FireflyIII\Api\V1\Requests\Search;
|
||||
|
||||
use FireflyIII\Api\V1\Requests\AggregateFormRequest;
|
||||
use FireflyIII\Rules\IsBoolean;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
use Override;
|
||||
|
||||
class CountRequest extends AggregateFormRequest
|
||||
{
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'notes' => 'string|min:1|max:255',
|
||||
'external_identifier' => 'string|min:1|max:255',
|
||||
'description' => 'string|min:1|max:255',
|
||||
'internal_reference' => 'string|min:1|max:255',
|
||||
'include_deleted' => new IsBoolean(),
|
||||
];
|
||||
}
|
||||
|
||||
public function withValidator(Validator $validator): void
|
||||
{
|
||||
$validator->after(function (Validator $validator): void {
|
||||
if ($validator->failed()) {
|
||||
return;
|
||||
}
|
||||
$this->attributes->set('include_deleted', $this->convertBoolean($this->input('include_deleted', 'false')));
|
||||
$this->attributes->set('notes', $this->convertString('notes'));
|
||||
$this->attributes->set('external_identifier', $this->convertString('external_identifier'));
|
||||
$this->attributes->set('description', $this->convertString('description'));
|
||||
$this->attributes->set('internal_reference', $this->convertString('internal_reference'));
|
||||
});
|
||||
}
|
||||
|
||||
#[Override]
|
||||
protected function getRequests(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
99
app/Console/Commands/Tools/ChecksForUpdates.php
Normal file
99
app/Console/Commands/Tools/ChecksForUpdates.php
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* ChecksForUpdates.php
|
||||
* Copyright (c) 2026 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace FireflyIII\Console\Commands\Tools;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequestInterface;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ChecksForUpdates extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'firefly-iii:check-for-updates {--force}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Checks for Firefly III updates';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
$build = Carbon::createFromTimestamp(config('firefly.build_time'), config('app.timezone'));
|
||||
$version = config('firefly.version');
|
||||
|
||||
$this->friendlyLine(sprintf('You are running version "%s", built on %s', $version, $build->format('Y-m-d H:i')));
|
||||
$permission = FireflyConfig::get('permission_update_check', -1)->data;
|
||||
if (1 !== $permission && false === $this->option('force')) {
|
||||
$this->friendlyWarning('Checking for updates is disabled. To overrule, use --force.');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
if (str_contains(config('firefly.version'), 'develop')) {
|
||||
$this->friendlyWarning('You are running a development version.');
|
||||
}
|
||||
|
||||
/** @var UpdateRequestInterface $request */
|
||||
$request = app(UpdateRequestInterface::class);
|
||||
// stable, alpha or beta
|
||||
$info = $request->getUpdateInformation($version, $build, 'stable');
|
||||
|
||||
if ('' !== $info->getError()) {
|
||||
$this->friendlyError($info->getError());
|
||||
|
||||
return Command::FAILURE;
|
||||
}
|
||||
if (!$info->isNewVersionAvailable()) {
|
||||
$this->friendlyInfo(trans('firefly.no_new_release_available'));
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
// if running develop, slightly different message.
|
||||
if (str_contains($version, 'develop')) {
|
||||
$this->friendlyInfo(trans('firefly.update_current_dev_older', ['version' => $version, 'new_version' => $info->getNewVersion()]));
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
$this->friendlyInfo(trans('firefly.update_new_version_alert', [
|
||||
'your_version' => $version,
|
||||
'new_version' => $info->getNewVersion(),
|
||||
'date' => $info->getPublishedAt()->format('Y-m-d H:i:s'),
|
||||
]));
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* AccountBalance.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Entities;
|
||||
|
||||
use FireflyIII\Models\Account;
|
||||
|
||||
class AccountBalance
|
||||
{
|
||||
public string $amount;
|
||||
public string $currencyId;
|
||||
public string $id;
|
||||
|
||||
public static function fromArray(): self
|
||||
{
|
||||
$balance = new self();
|
||||
$balance->id = (string) random_int(1, 1000);
|
||||
// $balance->name = (string) random_int(1, 1000);
|
||||
$balance->amount = (string) random_int(1, 1000);
|
||||
$balance->currencyId = '1';
|
||||
|
||||
return $balance;
|
||||
}
|
||||
|
||||
public function getAccount(): Account
|
||||
{
|
||||
return Account::inRandomOrder()->first();
|
||||
}
|
||||
}
|
||||
@@ -27,9 +27,9 @@ namespace FireflyIII\Enums;
|
||||
/**
|
||||
* Class ClauseType
|
||||
*/
|
||||
class ClauseType
|
||||
enum ClauseType: string
|
||||
{
|
||||
public const string TRANSACTION = 'transaction';
|
||||
public const string UPDATE = 'update';
|
||||
public const string WHERE = 'where';
|
||||
case TRANSACTION = 'transaction';
|
||||
case UPDATE = 'update';
|
||||
case WHERE = 'where';
|
||||
}
|
||||
|
||||
@@ -24,7 +24,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Update;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequestInterface;
|
||||
use FireflyIII\Services\FireflyIIIOrg\Update\UpdateResponse;
|
||||
use FireflyIII\Support\Facades\FireflyConfig;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
@@ -38,7 +40,7 @@ trait UpdateTrait
|
||||
* 'message' => 'A new version is available.
|
||||
* 'level' => 'info' / 'success' / 'error'
|
||||
*/
|
||||
public function getLatestRelease(): array
|
||||
public function getLatestRelease(): UpdateResponse
|
||||
{
|
||||
Log::debug('Now in getLatestRelease()');
|
||||
|
||||
@@ -46,7 +48,9 @@ trait UpdateTrait
|
||||
$checker = app(UpdateRequestInterface::class);
|
||||
$channelConfig = FireflyConfig::get('update_channel', 'stable');
|
||||
$channel = (string) $channelConfig->data;
|
||||
$build = Carbon::createFromTimestamp(config('firefly.build_time'), config('app.timezone'));
|
||||
$version = config('firefly.version');
|
||||
|
||||
return $checker->getUpdateInformation($channel);
|
||||
return $checker->getUpdateInformation($version, $build, $channel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,8 +114,27 @@ class UpdateController extends Controller
|
||||
public function updateCheck(): RedirectResponse
|
||||
{
|
||||
$release = $this->getLatestRelease();
|
||||
$level = 'info';
|
||||
$message = trans('firefly.no_new_release_available');
|
||||
if ('' !== $release->getError()) {
|
||||
$level = 'error';
|
||||
$message = $release->getError();
|
||||
}
|
||||
if ($release->isNewVersionAvailable()) {
|
||||
// if running develop, slightly different message.
|
||||
if (str_contains(config('firefly.version'), 'develop')) {
|
||||
$message = trans('firefly.update_current_dev_older', ['version' => config('firefly.version'), 'new_version' => $release->getNewVersion()]);
|
||||
}
|
||||
if (!str_contains(config('firefly.version'), 'develop')) {
|
||||
$message = trans('firefly.update_new_version_alert', [
|
||||
'your_version' => config('firefly.version'),
|
||||
'new_version' => $release->getNewVersion(),
|
||||
'date' => $release->getPublishedAt()->format('Y-m-d H:i:s'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
session()->flash($release['level'], $release['message']);
|
||||
session()->flash($level, $message);
|
||||
|
||||
return redirect(route('settings.update-check'));
|
||||
}
|
||||
|
||||
@@ -103,10 +103,10 @@ class CategoryController extends Controller
|
||||
*/
|
||||
public function frontPage(): JsonResponse
|
||||
{
|
||||
$start = session('start', today(config('app.timezone'))->startOfMonth());
|
||||
$end = session('end', today(config('app.timezone'))->endOfMonth());
|
||||
$start = session('start', today(config('app.timezone'))->startOfMonth());
|
||||
$end = session('end', today(config('app.timezone'))->endOfMonth());
|
||||
// chart properties for cache:
|
||||
$cache = new CacheProperties();
|
||||
$cache = new CacheProperties();
|
||||
$cache->addProperty($start);
|
||||
$cache->addProperty($end);
|
||||
$cache->addProperty($this->convertToPrimary);
|
||||
@@ -115,9 +115,11 @@ class CategoryController extends Controller
|
||||
return response()->json($cache->get());
|
||||
}
|
||||
|
||||
$frontpageGenerator = new FrontpageChartGenerator($start, $end);
|
||||
$chartData = $frontpageGenerator->generate();
|
||||
$data = $this->generator->multiSet($chartData);
|
||||
$frontpageGenerator = new FrontpageChartGenerator($start, $end);
|
||||
$frontpageGenerator->convertToPrimary = $this->convertToPrimary;
|
||||
|
||||
$chartData = $frontpageGenerator->generate();
|
||||
$data = $this->generator->multiSet($chartData);
|
||||
$cache->store($data);
|
||||
|
||||
return response()->json($data);
|
||||
|
||||
@@ -147,6 +147,7 @@ class ReportController extends Controller
|
||||
$cache->addProperty($start);
|
||||
$cache->addProperty($accounts);
|
||||
$cache->addProperty($end);
|
||||
$cache->addProperty($this->convertToPrimary);
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get());
|
||||
}
|
||||
@@ -177,17 +178,32 @@ class ReportController extends Controller
|
||||
foreach ($journals as $journal) {
|
||||
$period = $journal['date']->format($format);
|
||||
$currencyId = (int) $journal['currency_id'];
|
||||
$currencySymbol = (string) $journal['currency_symbol'];
|
||||
$currencyCode = (string) $journal['currency_code'];
|
||||
$currencyName = (string) $journal['currency_name'];
|
||||
$currencyDecimalPlaces = (int) $journal['currency_decimal_places'];
|
||||
$amount = (string) $journal['amount'];
|
||||
|
||||
if ($this->convertToPrimary && null !== $this->primaryCurrency && $journal['currency_id'] !== $this->primaryCurrency->id) {
|
||||
$currencyId = $this->primaryCurrency->id;
|
||||
$currencySymbol = $this->primaryCurrency->symbol;
|
||||
$currencyCode = $this->primaryCurrency->code;
|
||||
$currencyName = $this->primaryCurrency->name;
|
||||
$currencyDecimalPlaces = $this->primaryCurrency->decimal_places;
|
||||
$amount = $journal['foreign_currency_id'] === $this->primaryCurrency->id ? $journal['foreign_amount'] : $journal['pc_amount'];
|
||||
}
|
||||
|
||||
$data[$currencyId] ??= [
|
||||
'currency_id' => $currencyId,
|
||||
'currency_symbol' => $journal['currency_symbol'],
|
||||
'currency_code' => $journal['currency_code'],
|
||||
'currency_name' => $journal['currency_name'],
|
||||
'currency_decimal_places' => (int) $journal['currency_decimal_places'],
|
||||
'currency_symbol' => $currencySymbol,
|
||||
'currency_code' => $currencyCode,
|
||||
'currency_name' => $currencyName,
|
||||
'currency_decimal_places' => $currencyDecimalPlaces,
|
||||
];
|
||||
$data[$currencyId][$period] ??= ['period' => $period, 'spent' => '0', 'earned' => '0'];
|
||||
// in our outgoing?
|
||||
$key = 'spent';
|
||||
$amount = Steam::positive($journal['amount']);
|
||||
$amount = Steam::positive($amount);
|
||||
|
||||
// deposit = incoming
|
||||
// transfer or reconcile or opening balance, and these accounts are the destination.
|
||||
|
||||
@@ -76,8 +76,27 @@ class ChecksForNewVersion implements ShouldQueue
|
||||
// last check time was more than a week ago.
|
||||
Log::debug('Have not checked for a new version in a week!');
|
||||
$release = $this->getLatestRelease();
|
||||
$level = 'info';
|
||||
$message = trans('firefly.no_new_release_available');
|
||||
if ('' !== $release->getError()) {
|
||||
$level = 'error';
|
||||
$message = $release->getError();
|
||||
}
|
||||
if ($release->isNewVersionAvailable()) {
|
||||
// if running develop, slightly different message.
|
||||
if (str_contains(config('firefly.version'), 'develop')) {
|
||||
$message = trans('firefly.update_current_dev_older', ['version' => config('firefly.version'), 'new_version' => $release->getNewVersion()]);
|
||||
}
|
||||
if (!str_contains(config('firefly.version'), 'develop')) {
|
||||
$message = trans('firefly.update_new_version_alert', [
|
||||
'your_version' => config('firefly.version'),
|
||||
'new_version' => $release->getNewVersion(),
|
||||
'date' => $release->getPublishedAt()->format('Y-m-d H:i:s'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
session()->flash($release['level'], $release['message']);
|
||||
session()->flash($level, $message);
|
||||
FireflyConfig::set('last_update_check', Carbon::now()->getTimestamp());
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class SendsTestNotification
|
||||
return;
|
||||
}
|
||||
Log::debug(sprintf('Will send %s as a notification.', $class));
|
||||
NotificationSender::send($event->user, new $class());
|
||||
NotificationSender::send($event->{$type}, new $class());
|
||||
Log::debug(sprintf('If you see no errors above this line, test notification was sent over channel "%s"', $event->channel));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Deprecated;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
@@ -32,65 +31,9 @@ class AccountType extends Model
|
||||
{
|
||||
use ReturnsIntegerIdTrait;
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string ASSET = 'Asset account';
|
||||
protected $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string BENEFICIARY = 'Beneficiary account';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string CASH = 'Cash account';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string CREDITCARD = 'Credit card';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string DEBT = 'Debt';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string DEFAULT = 'Default account';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string EXPENSE = 'Expense account';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string IMPORT = 'Import account';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string INITIAL_BALANCE = 'Initial balance account';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string LIABILITY_CREDIT = 'Liability credit account';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string LOAN = 'Loan';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string MORTGAGE = 'Mortgage';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string RECONCILIATION = 'Reconciliation account';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string REVENUE = 'Revenue account';
|
||||
|
||||
protected $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime'];
|
||||
|
||||
protected $fillable = ['type'];
|
||||
protected $fillable = ['type'];
|
||||
|
||||
public function accounts(): HasMany
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Deprecated;
|
||||
use FireflyIII\Handlers\Observer\AutoBudgetObserver;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
@@ -39,20 +38,8 @@ class AutoBudget extends Model
|
||||
use ReturnsIntegerIdTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const int AUTO_BUDGET_ADJUSTED = 3;
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const int AUTO_BUDGET_RESET = 1;
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const int AUTO_BUDGET_ROLLOVER = 2;
|
||||
|
||||
protected $casts = ['amount' => 'string', 'native_amount' => 'string'];
|
||||
protected $fillable = ['budget_id', 'amount', 'period', 'native_amount'];
|
||||
protected $casts = ['amount' => 'string', 'native_amount' => 'string'];
|
||||
protected $fillable = ['budget_id', 'amount', 'period', 'native_amount'];
|
||||
|
||||
public function budget(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Deprecated;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -36,23 +35,7 @@ class RecurrenceRepetition extends Model
|
||||
use ReturnsIntegerIdTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const int WEEKEND_DO_NOTHING = 1;
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const int WEEKEND_SKIP_CREATION = 2;
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const int WEEKEND_TO_FRIDAY = 3;
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const int WEEKEND_TO_MONDAY = 4;
|
||||
|
||||
protected $casts = [
|
||||
protected $casts = [
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime',
|
||||
@@ -62,9 +45,9 @@ class RecurrenceRepetition extends Model
|
||||
'weekend' => 'int',
|
||||
];
|
||||
|
||||
protected $fillable = ['recurrence_id', 'weekend', 'repetition_type', 'repetition_moment', 'repetition_skip'];
|
||||
protected $fillable = ['recurrence_id', 'weekend', 'repetition_type', 'repetition_moment', 'repetition_skip'];
|
||||
|
||||
protected $table = 'recurrences_repetitions';
|
||||
protected $table = 'recurrences_repetitions';
|
||||
|
||||
public function recurrence(): BelongsTo
|
||||
{
|
||||
|
||||
@@ -30,7 +30,6 @@ use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
@@ -39,7 +38,6 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
#[ObservedBy([TransactionObserver::class])]
|
||||
class Transaction extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use ReturnsIntegerIdTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ use Illuminate\Database\Eloquent\Attributes\ObservedBy;
|
||||
use Illuminate\Database\Eloquent\Attributes\Scope;
|
||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
@@ -53,7 +52,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
#[ObservedBy([DeletedTransactionJournalObserver::class])]
|
||||
class TransactionJournal extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use ReturnsIntegerIdTrait;
|
||||
use ReturnsIntegerUserIdTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
@@ -23,7 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
|
||||
use Deprecated;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
@@ -36,36 +35,8 @@ class TransactionType extends Model
|
||||
use ReturnsIntegerIdTrait;
|
||||
use SoftDeletes;
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string DEPOSIT = 'Deposit';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string INVALID = 'Invalid';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string LIABILITY_CREDIT = 'Liability credit';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string OPENING_BALANCE = 'Opening balance';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string RECONCILIATION = 'Reconciliation';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string TRANSFER = 'Transfer';
|
||||
|
||||
/** @deprecated */
|
||||
#[Deprecated]
|
||||
public const string WITHDRAWAL = 'Withdrawal';
|
||||
|
||||
protected $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime'];
|
||||
protected $fillable = ['type'];
|
||||
protected $casts = ['created_at' => 'datetime', 'updated_at' => 'datetime', 'deleted_at' => 'datetime'];
|
||||
protected $fillable = ['type'];
|
||||
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* AccountPolicy.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Policies;
|
||||
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class AccountPolicy
|
||||
{
|
||||
public function create(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO needs better authentication, also for group.
|
||||
*/
|
||||
public function view(User $user, Account $account): bool
|
||||
{
|
||||
return auth()->check() && $user->id === $account->user_id;
|
||||
}
|
||||
|
||||
public function viewAccountBalances(User $user, Account $account): bool
|
||||
{
|
||||
return $this->view($user, $account);
|
||||
}
|
||||
|
||||
/**
|
||||
* Everybody can do this, but selection should limit to user.
|
||||
*/
|
||||
public function viewAny(): bool
|
||||
{
|
||||
Log::debug(__METHOD__);
|
||||
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Everybody can do this, but selection should limit to user.
|
||||
*/
|
||||
public function viewUser(User $user, Account $account): bool
|
||||
{
|
||||
return $this->view($user, $account);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* BalancePolicy.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Policies;
|
||||
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\User;
|
||||
|
||||
class BalancePolicy
|
||||
{
|
||||
/**
|
||||
* TODO needs better authentication.
|
||||
*/
|
||||
public function view(User $user, Account $account): bool
|
||||
{
|
||||
return auth()->check() && $user->id === $account->user_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Everybody can do this, but selection should limit to user.
|
||||
*/
|
||||
public function viewAny(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* UserPolicy.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Policies;
|
||||
|
||||
use FireflyIII\User;
|
||||
|
||||
class UserPolicy
|
||||
{
|
||||
/**
|
||||
* TODO needs better authentication.
|
||||
*/
|
||||
public function view(User $user, User $user1): bool
|
||||
{
|
||||
return true;
|
||||
|
||||
// return auth()->check() && $user->id === $account->user_id;
|
||||
}
|
||||
|
||||
public function viewAccounts(User $user): bool
|
||||
{
|
||||
return true;
|
||||
|
||||
// return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Everybody can do this, but selection should limit to user.
|
||||
*
|
||||
* @return true
|
||||
*/
|
||||
public function viewAny(): bool
|
||||
{
|
||||
return true;
|
||||
|
||||
// return auth()->check();
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,7 @@ use FireflyIII\Repositories\UserGroup\UserGroupRepository;
|
||||
use FireflyIII\Repositories\UserGroup\UserGroupRepositoryInterface;
|
||||
use FireflyIII\Repositories\Webhook\WebhookRepository;
|
||||
use FireflyIII\Repositories\Webhook\WebhookRepositoryInterface;
|
||||
use FireflyIII\Services\FireflyIIIOrg\Update\GitHubUpdateRequest;
|
||||
use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequest;
|
||||
use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequestInterface;
|
||||
use FireflyIII\Services\Password\PwndVerifierV2;
|
||||
@@ -191,7 +192,8 @@ class FireflyServiceProvider extends ServiceProvider
|
||||
$this->app->bind(PopupReportInterface::class, PopupReport::class);
|
||||
$this->app->bind(ReportHelperInterface::class, ReportHelper::class);
|
||||
$this->app->bind(FiscalHelperInterface::class, FiscalHelper::class);
|
||||
$this->app->bind(UpdateRequestInterface::class, UpdateRequest::class);
|
||||
// $this->app->bind(UpdateRequestInterface::class, UpdateRequest::class);
|
||||
$this->app->bind(UpdateRequestInterface::class, GitHubUpdateRequest::class);
|
||||
|
||||
// webhooks:
|
||||
$this->app->bind(MessageGeneratorInterface::class, StandardMessageGenerator::class);
|
||||
|
||||
@@ -48,6 +48,47 @@ class JournalRepository implements JournalRepositoryInterface, UserGroupInterfac
|
||||
{
|
||||
use UserGroupTrait;
|
||||
|
||||
#[Override]
|
||||
public function countByDescription(string $value, bool $includeDeleted): int
|
||||
{
|
||||
$search = $this->user->transactionJournals()->where('description', $value);
|
||||
if ($includeDeleted) {
|
||||
$search->withTrashed();
|
||||
}
|
||||
|
||||
return $search->count();
|
||||
}
|
||||
|
||||
#[Override]
|
||||
public function countByMeta(string $field, string $value, bool $includeDeleted): int
|
||||
{
|
||||
$search = TransactionJournalMeta::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id')
|
||||
->where('name', $field)
|
||||
->where('data', json_encode($value))
|
||||
->where('transaction_journals.user_id', $this->user->id)
|
||||
;
|
||||
if ($includeDeleted) {
|
||||
$search->withTrashed();
|
||||
}
|
||||
|
||||
return $search->count();
|
||||
}
|
||||
|
||||
#[Override]
|
||||
public function countByNotes(string $value, bool $includeDeleted): int
|
||||
{
|
||||
$search = Note::where('noteable_type', TransactionJournal::class)
|
||||
->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'notes.noteable_id')
|
||||
->where('transaction_journals.user_id', $this->user->id)
|
||||
->where('text', 'LIKE', sprintf('%%%s%%', $value))
|
||||
;
|
||||
if ($includeDeleted) {
|
||||
$search->withTrashed();
|
||||
}
|
||||
|
||||
return $search->count();
|
||||
}
|
||||
|
||||
public function destroyGroup(TransactionGroup $transactionGroup): void
|
||||
{
|
||||
/** @var TransactionGroupDestroyService $service */
|
||||
|
||||
@@ -47,6 +47,12 @@ use Illuminate\Support\Collection;
|
||||
*/
|
||||
interface JournalRepositoryInterface
|
||||
{
|
||||
public function countByDescription(string $value, bool $includeDeleted): int;
|
||||
|
||||
public function countByMeta(string $field, string $value, bool $includeDeleted): int;
|
||||
|
||||
public function countByNotes(string $value, bool $includeDeleted): int;
|
||||
|
||||
/**
|
||||
* Deletes a transaction group.
|
||||
*/
|
||||
|
||||
226
app/Services/FireflyIIIOrg/Update/GitHubUpdateRequest.php
Normal file
226
app/Services/FireflyIIIOrg/Update/GitHubUpdateRequest.php
Normal file
@@ -0,0 +1,226 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* GitHubUpdateRequest.php
|
||||
* Copyright (c) 2026 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace FireflyIII\Services\FireflyIIIOrg\Update;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Override;
|
||||
|
||||
class GitHubUpdateRequest implements UpdateRequestInterface
|
||||
{
|
||||
private string $currentVersion = '1.0.0';
|
||||
private Carbon $currentBuild;
|
||||
private string $channel = 'stable';
|
||||
private bool $localDebug = false;
|
||||
|
||||
#[Override]
|
||||
public function getUpdateInformation(string $currentVersion, Carbon $currentBuild, string $channel): UpdateResponse
|
||||
{
|
||||
$this->currentVersion = $currentVersion;
|
||||
$this->channel = $channel;
|
||||
$this->currentBuild = $currentBuild;
|
||||
Log::debug(sprintf('Now in getUpdateInformation(%s, %s)', $currentVersion, $channel));
|
||||
|
||||
$response = new UpdateResponse();
|
||||
$releases = $this->getReleases();
|
||||
$filtered = $this->filterReleases($releases);
|
||||
|
||||
Log::debug(sprintf('Left with %d release(s) to compare', count($filtered)));
|
||||
|
||||
if (0 === count($filtered)) {
|
||||
$response->setNewVersionAvailable(false);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
$newest = $this->getNewest($filtered);
|
||||
|
||||
Log::debug(sprintf('Newest release is "%s" released on %s', $newest['version'], $newest['published_at']->format('Y-m-d H:i')));
|
||||
|
||||
$response->setNewVersion($newest['version']);
|
||||
$response->setPublishedAt($newest['published_at']);
|
||||
|
||||
// main question, is this release newer than the current one?
|
||||
// if current version is "develop", compare date.
|
||||
if (str_contains($currentVersion, 'develop')) {
|
||||
Log::debug(sprintf('Compare with current version "%s", built on %s', $currentVersion, $currentBuild->format('Y-m-d H:i')));
|
||||
if ($currentBuild->lt($newest['published_at']) && $currentBuild->diffInMinutes($newest['published_at']) > 10) {
|
||||
Log::debug(sprintf(
|
||||
'Current build %s is older than newest build %s, so a new release is available.',
|
||||
$currentBuild->format('Y-m-d H:i:s e'),
|
||||
$newest['published_at']->format('Y-m-d H:i:s e')
|
||||
));
|
||||
$response->setNewVersionAvailable(true);
|
||||
|
||||
return $response;
|
||||
}
|
||||
if ($currentBuild->gt($newest['published_at'])) {
|
||||
Log::debug(sprintf(
|
||||
'Current build %s is newer than newest build %s, so NO new release is available.',
|
||||
$currentBuild->format('Y-m-d H:i'),
|
||||
$newest['published_at']->format('Y-m-d H:i')
|
||||
));
|
||||
$response->setNewVersionAvailable(false);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
// if not, compare version.
|
||||
$res = version_compare($newest['version'], $currentVersion);
|
||||
if ($res < 1) {
|
||||
$response->setNewVersionAvailable(false);
|
||||
|
||||
return $response;
|
||||
}
|
||||
if (1 === $res) {
|
||||
$response->setNewVersionAvailable(true);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
private function filterReleases(array $releases): array
|
||||
{
|
||||
$return = [];
|
||||
$weekAgo = now()->subWeek();
|
||||
|
||||
/** @var array $release */
|
||||
foreach ($releases as $release) {
|
||||
if ($release['published_at']->lte($this->currentBuild)) {
|
||||
Log::debug(sprintf('Skip older version "%s"', $release['version']));
|
||||
|
||||
continue;
|
||||
}
|
||||
// new version must be at least a week old, unless it is a develop release.
|
||||
if ($release['published_at']->gt($weekAgo) && !str_contains($release['version'], 'develop')) {
|
||||
Log::debug(sprintf('Skip too new version "%s"', $release['version']));
|
||||
|
||||
continue;
|
||||
}
|
||||
// if channel is stable, and version is "alpha", continue.
|
||||
// if channel is stable, and version is "beta", continue.
|
||||
// if channel is beta, and version is "alpha", continue.
|
||||
if (('stable' === $this->channel || 'beta' === $this->channel) && str_contains($release['version'], 'alpha')) {
|
||||
Log::debug(sprintf('Skip version "%s"', $release['version']));
|
||||
|
||||
continue;
|
||||
}
|
||||
if ('stable' === $this->channel && str_contains($release['version'], 'beta')) {
|
||||
Log::debug(sprintf('Skip version "%s"', $release['version']));
|
||||
|
||||
continue;
|
||||
}
|
||||
$return[] = $release;
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
private function getNewest(array $releases): array
|
||||
{
|
||||
$latest = ['version' => '1.0.0', 'published_at' => now(config('app.timezone'))->startOfYear()];
|
||||
foreach ($releases as $release) {
|
||||
Log::debug(sprintf('Comparing current version "%s" with latest version "%s"', $release['version'], $latest['version']));
|
||||
if (str_contains($release['version'], 'develop') || str_contains($latest['version'], 'develop')) {
|
||||
Log::debug('Compare based on build time.');
|
||||
// compare build times.
|
||||
if ($latest['published_at']->lt($release['published_at'])) {
|
||||
Log::debug(sprintf(
|
||||
'Current date "%s" is newer than latest date "%s"',
|
||||
$release['published_at']->format('Y-m-d H:i'),
|
||||
$latest['published_at']->format('Y-m-d H:i')
|
||||
));
|
||||
$latest = $release;
|
||||
}
|
||||
}
|
||||
if (!str_contains($release['version'], 'develop') && !str_contains($latest['version'], 'develop')) {
|
||||
Log::debug('[a] Compare based on version.');
|
||||
// compare version.
|
||||
$res = version_compare($release['version'], $latest['version']);
|
||||
if (1 === $res) {
|
||||
Log::debug(sprintf('Version "%s" is newer than version "%s".', $release['version'], $latest['version']));
|
||||
$latest = $release;
|
||||
}
|
||||
}
|
||||
}
|
||||
Log::debug(sprintf('Latest version seems to be "%s", released at %s', $latest['version'], $latest['published_at']->format('Y-m-d H:i e')));
|
||||
|
||||
return $latest;
|
||||
}
|
||||
|
||||
private function getReleases(): array
|
||||
{
|
||||
$client = new Client();
|
||||
$opts = ['headers' => ['User-Agent' => 'FireflyIII/'.config('firefly.version')]];
|
||||
$return = [];
|
||||
$body = '';
|
||||
if ($this->localDebug && file_exists('json.json')) {
|
||||
$body = file_get_contents('json.json');
|
||||
}
|
||||
if (!$this->localDebug) {
|
||||
try {
|
||||
$res = $client->get('https://api.github.com/repos/firefly-iii/firefly-iii/releases', $opts);
|
||||
} catch (ClientException $e) {
|
||||
Log::error($e->getMessage());
|
||||
|
||||
return [];
|
||||
}
|
||||
Log::debug('Successfully contacted GitHub');
|
||||
$body = (string) $res->getBody();
|
||||
}
|
||||
|
||||
if (!json_validate($body)) {
|
||||
Log::debug('GitHub returned invalid JSON');
|
||||
|
||||
return [];
|
||||
}
|
||||
$json = json_decode($body, true);
|
||||
|
||||
/** @var array $release */
|
||||
foreach ($json as $release) {
|
||||
$version = $release['tag_name'];
|
||||
$version = 'v' === $version[0] ? substr($version, 1) : $version;
|
||||
$published = Carbon::parse($release['published_at'], config('app.timezone'));
|
||||
|
||||
// always skip "develop" releases, unless user is also running develop.
|
||||
if (str_contains($version, 'develop') && !str_contains($this->currentVersion, 'develop')) {
|
||||
Log::debug(sprintf('Skip version "%s"', $release['tag_name']));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$return[] = ['version' => $version, 'published_at' => $published];
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
@@ -1,252 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* UpdateRequest.php
|
||||
* Copyright (c) 2020 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Services\FireflyIIIOrg\Update;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Events\Security\System\SystemFoundNewVersionOnline;
|
||||
use FireflyIII\Support\System\IsOldVersion;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use JsonException;
|
||||
|
||||
use function Safe\json_decode;
|
||||
|
||||
/**
|
||||
* Class UpdateRequest
|
||||
*/
|
||||
class UpdateRequest implements UpdateRequestInterface
|
||||
{
|
||||
use IsOldVersion;
|
||||
|
||||
public function getUpdateInformation(string $channel): array
|
||||
{
|
||||
Log::debug(sprintf('Now in getUpdateInformation(%s)', $channel));
|
||||
$information = ['level' => 'error', 'message' => (string) trans('firefly.unknown_error')];
|
||||
|
||||
// try to get array from update server:
|
||||
$updateInfo = $this->contactServer($channel);
|
||||
if ('error' === $updateInfo['level']) {
|
||||
Log::error('Update information contains an error.');
|
||||
Log::error($updateInfo['message']);
|
||||
$information['message'] = $updateInfo['message'];
|
||||
|
||||
return $information;
|
||||
}
|
||||
|
||||
// if no error, parse the result and return
|
||||
return $this->parseResult($updateInfo);
|
||||
}
|
||||
|
||||
private function contactServer(string $channel): array
|
||||
{
|
||||
Log::debug(sprintf('Now in contactServer(%s)', $channel));
|
||||
// always fall back to current version:
|
||||
$return = [
|
||||
'version' => config('firefly.version'),
|
||||
'date' => today(config('app.timezone'))->startOfDay(),
|
||||
'level' => 'error',
|
||||
'message' => (string) trans('firefly.unknown_error'),
|
||||
];
|
||||
|
||||
$url = config('firefly.update_endpoint');
|
||||
Log::debug(sprintf('Going to call %s', $url));
|
||||
|
||||
try {
|
||||
$client = new Client();
|
||||
$options = ['headers' => ['User-Agent' => sprintf('FireflyIII/%s/%s', config('firefly.version'), $channel)], 'timeout' => 3.1415];
|
||||
$res = $client->request('GET', $url, $options);
|
||||
} catch (GuzzleException $e) {
|
||||
Log::error('Ran into Guzzle error.');
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
$return['message'] = sprintf('Guzzle: %s', strip_tags($e->getMessage()));
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
if (200 !== $res->getStatusCode()) {
|
||||
Log::error(sprintf('Response status from server is %d.', $res->getStatusCode()));
|
||||
Log::error((string) $res->getBody());
|
||||
$return['message'] = sprintf('Error: %d', $res->getStatusCode());
|
||||
|
||||
return $return;
|
||||
}
|
||||
$body = (string) $res->getBody();
|
||||
|
||||
try {
|
||||
$json = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
|
||||
} catch (JsonException) {
|
||||
Log::error('Body is not valid JSON');
|
||||
Log::error($body);
|
||||
$return['message'] = 'Invalid JSON :(';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
if (!array_key_exists($channel, $json['firefly_iii'])) {
|
||||
Log::error(sprintf('No valid update channel "%s"', $channel));
|
||||
Log::error($body);
|
||||
$return['message'] = sprintf('Unknown update channel "%s" :(', $channel);
|
||||
}
|
||||
|
||||
// parse response a bit. No message yet.
|
||||
$response = $json['firefly_iii'][$channel];
|
||||
$date = Carbon::createFromFormat('Y-m-d', $response['date']);
|
||||
if (!$date instanceof Carbon) {
|
||||
$date = today(config('app.timezone'));
|
||||
}
|
||||
$return['version'] = $response['version'];
|
||||
$return['level'] = 'success';
|
||||
$return['date'] = $date->startOfDay();
|
||||
|
||||
Log::info('Response from update server', $response);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO make shorter
|
||||
*/
|
||||
private function parseResult(array $information): array
|
||||
{
|
||||
Log::debug('Now in parseResult()', $information);
|
||||
$current = (string) config('firefly.version');
|
||||
$latest = (string) $information['version'];
|
||||
|
||||
// strip the 'v' from the version if it's there.
|
||||
if (str_starts_with($latest, 'v')) {
|
||||
$latest = substr($latest, 1);
|
||||
}
|
||||
if (str_starts_with($current, 'develop')) {
|
||||
return $this->parseResultDevelop($current, $latest);
|
||||
}
|
||||
|
||||
$compare = version_compare($latest, $current);
|
||||
|
||||
Log::debug(sprintf('Current version is "%s", latest is "%s", result is: %d', $current, $latest, $compare));
|
||||
|
||||
// -1: you're running a newer version:
|
||||
if (-1 === $compare) {
|
||||
return $this->runsNewerVersion($current, $latest);
|
||||
}
|
||||
// running the current version:
|
||||
if (0 === $compare) {
|
||||
return $this->runsSameVersion($current);
|
||||
}
|
||||
|
||||
// a newer version is available!
|
||||
/** @var Carbon $released */
|
||||
$released = $information['date'];
|
||||
$isBeta = $information['is_beta'] ?? false;
|
||||
$isAlpha = $information['is_alpha'] ?? false;
|
||||
|
||||
// it's new but alpha:
|
||||
if (true === $isAlpha) {
|
||||
return $this->releasedNewAlpha($current, $latest, $released);
|
||||
}
|
||||
|
||||
if (true === $isBeta) {
|
||||
return $this->releasedNewBeta($current, $latest, $released);
|
||||
}
|
||||
|
||||
return $this->releasedNewVersion($current, $latest, $released);
|
||||
}
|
||||
|
||||
private function parseResultDevelop(string $current, string $latest): array
|
||||
{
|
||||
Log::debug(sprintf('User is running develop version "%s"', $current));
|
||||
$compare = $this->compareDevelopVersions($current, $latest);
|
||||
$return = [];
|
||||
|
||||
if (-1 === $compare) {
|
||||
$return['level'] = 'info';
|
||||
$return['message'] = (string) trans('firefly.update_current_dev_older', ['version' => $current, 'new_version' => $latest]);
|
||||
|
||||
return $return;
|
||||
}
|
||||
$return['level'] = 'info';
|
||||
$return['message'] = (string) trans('firefly.update_current_dev_newer', ['version' => $current, 'new_version' => $latest]);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
private function releasedNewAlpha(string $current, string $latest, Carbon $date): array
|
||||
{
|
||||
Log::debug('New release is also a alpha!');
|
||||
$message = (string) trans('firefly.update_new_version_alert', [
|
||||
'your_version' => $current,
|
||||
'new_version' => $latest,
|
||||
'date' => $date->isoFormat((string) trans('config.month_and_day_js')),
|
||||
]);
|
||||
|
||||
return ['level' => 'success', 'message' => sprintf('%s %s', $message, trans('firefly.update_version_alpha'))];
|
||||
}
|
||||
|
||||
private function releasedNewBeta(string $current, string $latest, Carbon $date): array
|
||||
{
|
||||
Log::debug('New release is also a beta!');
|
||||
$message = (string) trans('firefly.update_new_version_alert', [
|
||||
'your_version' => $current,
|
||||
'new_version' => $latest,
|
||||
'date' => $date->isoFormat((string) trans('config.month_and_day_js')),
|
||||
]);
|
||||
|
||||
return ['level' => 'success', 'message' => sprintf('%s %s', $message, trans('firefly.update_version_beta'))];
|
||||
}
|
||||
|
||||
private function releasedNewVersion(string $current, string $latest, Carbon $date): array
|
||||
{
|
||||
Log::debug('New release is old enough.');
|
||||
$message = (string) trans('firefly.update_new_version_alert', [
|
||||
'your_version' => $current,
|
||||
'new_version' => $latest,
|
||||
'date' => $date->isoFormat((string) trans('config.month_and_day_js')),
|
||||
]);
|
||||
Log::debug('New release is here!', [$message]);
|
||||
event(new SystemFoundNewVersionOnline($message));
|
||||
|
||||
return ['level' => 'success', 'message' => $message];
|
||||
}
|
||||
|
||||
private function runsNewerVersion(string $current, string $latest): array
|
||||
{
|
||||
$return = [
|
||||
'level' => 'info',
|
||||
'message' => (string) trans('firefly.update_newer_version_alert', ['your_version' => $current, 'new_version' => $latest]),
|
||||
];
|
||||
Log::debug('User is running a newer version', $return);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
private function runsSameVersion(string $current): array
|
||||
{
|
||||
$return = ['level' => 'info', 'message' => (string) trans('firefly.update_current_version_alert', ['version' => $current])];
|
||||
Log::debug('User is the current version.', $return);
|
||||
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
@@ -24,10 +24,12 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Services\FireflyIIIOrg\Update;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Interface UpdateRequestInterface
|
||||
*/
|
||||
interface UpdateRequestInterface
|
||||
{
|
||||
public function getUpdateInformation(string $channel): array;
|
||||
public function getUpdateInformation(string $currentVersion, Carbon $currentBuild, string $channel): UpdateResponse;
|
||||
}
|
||||
|
||||
75
app/Services/FireflyIIIOrg/Update/UpdateResponse.php
Normal file
75
app/Services/FireflyIIIOrg/Update/UpdateResponse.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* UpdateResponse.php
|
||||
* Copyright (c) 2026 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace FireflyIII\Services\FireflyIIIOrg\Update;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
||||
class UpdateResponse
|
||||
{
|
||||
private bool $newVersionAvailable = false;
|
||||
private string $error = '';
|
||||
private string $newVersion = '1.0.0';
|
||||
private Carbon $publishedAt;
|
||||
|
||||
public function getError(): string
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
public function getNewVersion(): string
|
||||
{
|
||||
return $this->newVersion;
|
||||
}
|
||||
|
||||
public function getPublishedAt(): Carbon
|
||||
{
|
||||
return $this->publishedAt;
|
||||
}
|
||||
|
||||
public function isNewVersionAvailable(): bool
|
||||
{
|
||||
return $this->newVersionAvailable;
|
||||
}
|
||||
|
||||
public function setError(string $error): void
|
||||
{
|
||||
$this->error = $error;
|
||||
}
|
||||
|
||||
public function setNewVersion(string $newVersion): void
|
||||
{
|
||||
$this->newVersion = $newVersion;
|
||||
}
|
||||
|
||||
public function setNewVersionAvailable(bool $newVersionAvailable): void
|
||||
{
|
||||
$this->newVersionAvailable = $newVersionAvailable;
|
||||
}
|
||||
|
||||
public function setPublishedAt(Carbon $publishedAt): void
|
||||
{
|
||||
$this->publishedAt = $publishedAt;
|
||||
}
|
||||
}
|
||||
@@ -75,12 +75,12 @@ class UpdateCheckCronjob extends AbstractCronjob
|
||||
// last check time was more than a week ago.
|
||||
Log::debug('Have not checked for a new version in a week!');
|
||||
$release = $this->getLatestRelease();
|
||||
if ('error' === $release['level']) {
|
||||
if ('' !== $release->getError()) {
|
||||
// get stuff from job:
|
||||
$this->jobFired = true;
|
||||
$this->jobErrored = true;
|
||||
$this->jobSucceeded = false;
|
||||
$this->message = $release['message'];
|
||||
$this->message = $release->getError();
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -88,6 +88,23 @@ class UpdateCheckCronjob extends AbstractCronjob
|
||||
$this->jobFired = true;
|
||||
$this->jobErrored = false;
|
||||
$this->jobSucceeded = false;
|
||||
$this->message = $release['message'];
|
||||
$this->message = trans('firefly.no_new_release_available');
|
||||
|
||||
if ($release->isNewVersionAvailable()) {
|
||||
// if running develop, slightly different message.
|
||||
if (str_contains(config('firefly.version'), 'develop')) {
|
||||
$this->message = trans('firefly.update_current_dev_older', [
|
||||
'version' => config('firefly.version'),
|
||||
'new_version' => $release->getNewVersion(),
|
||||
]);
|
||||
}
|
||||
if (!str_contains(config('firefly.version'), 'develop')) {
|
||||
$this->message = trans('firefly.update_new_version_alert', [
|
||||
'your_version' => config('firefly.version'),
|
||||
'new_version' => $release->getNewVersion(),
|
||||
'date' => $release->getPublishedAt()->format('Y-m-d H:i:s'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +172,20 @@ class ExportDataGenerator
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->accounts = new Collection();
|
||||
|
||||
@@ -40,90 +40,8 @@ use Override;
|
||||
|
||||
class AvailableBudgetEnrichment implements EnrichmentInterface
|
||||
{
|
||||
private Collection $collection; // @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
private readonly bool $convertToPrimary; // @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
private Collection $collection;
|
||||
private readonly bool $convertToPrimary;
|
||||
private array $currencies = [];
|
||||
private array $currencyIds = [];
|
||||
private array $ids = [];
|
||||
|
||||
@@ -40,48 +40,7 @@ use Illuminate\Support\Facades\Log;
|
||||
class BudgetLimitEnrichment implements EnrichmentInterface
|
||||
{
|
||||
private Collection $collection;
|
||||
private readonly bool $convertToPrimary; // @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
private readonly bool $convertToPrimary;
|
||||
private array $currencies = [];
|
||||
private array $currencyIds = [];
|
||||
private Carbon $end;
|
||||
|
||||
@@ -42,90 +42,8 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
class PiggyBankEnrichment implements EnrichmentInterface
|
||||
{
|
||||
private array $accountIds = []; // @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
private array $accounts = []; // @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
private array $accountIds = [];
|
||||
private array $accounts = [];
|
||||
private array $amounts = [];
|
||||
private Collection $collection;
|
||||
private array $currencies = [];
|
||||
|
||||
@@ -37,90 +37,8 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
class PiggyBankEventEnrichment implements EnrichmentInterface
|
||||
{
|
||||
private array $accountCurrencies = []; // @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
private array $accountIds = []; // @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
private array $accountCurrencies = [];
|
||||
private array $accountIds = [];
|
||||
private Collection $collection;
|
||||
private array $currencies = [];
|
||||
private array $groupIds = [];
|
||||
|
||||
@@ -46,48 +46,7 @@ use Illuminate\Support\Facades\Log;
|
||||
class SubscriptionEnrichment implements EnrichmentInterface
|
||||
{
|
||||
private BillDateCalculator $calculator;
|
||||
private Collection $collection; // @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
private Collection $collection;
|
||||
private readonly bool $convertToPrimary;
|
||||
private ?Carbon $end = null;
|
||||
private array $mappedObjects = [];
|
||||
|
||||
@@ -53,89 +53,7 @@ class TransactionGroupEnrichment implements EnrichmentInterface
|
||||
private array $metaData = [];
|
||||
private array $notes = [];
|
||||
private readonly TransactionCurrency $primaryCurrency;
|
||||
private array $tags = []; // @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
|
||||
// @phpstan-ignore-line
|
||||
private array $tags = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@@ -42,90 +42,8 @@ use stdClass;
|
||||
class WebhookEnrichment implements EnrichmentInterface
|
||||
{
|
||||
private Collection $collection;
|
||||
private array $deliveries = []; // @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
private array $ids = []; // @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
// @phpstan-ignore-line
|
||||
private array $deliveries = [];
|
||||
private array $ids = [];
|
||||
private array $responses = [];
|
||||
private array $triggers = [];
|
||||
private array $webhookDeliveries = [];
|
||||
|
||||
@@ -143,7 +143,6 @@ class AvailableBudgetCalculator
|
||||
$availableBudget = $this->abRepository->find($this->currency, $start, $end);
|
||||
$availableBudgets = $this->abRepository->findInRange($this->currency, $start, $end);
|
||||
|
||||
Log::debug(sprintf('Found #%d', $availableBudget->id));
|
||||
foreach ($availableBudgets as $item) {
|
||||
Log::debug(sprintf(
|
||||
'findInRange found available budget #%d (%s - %s), will update it.',
|
||||
|
||||
24
changelog.md
24
changelog.md
@@ -3,7 +3,29 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## v6.4.23
|
||||
## v6.5.0 - 2026-02-20
|
||||
|
||||
> [!IMPORTANT]
|
||||
> This release is the same as 6.4.23, but only works on PHP 8.5 and higher. To continue using the latest version of Firefly III, you must upgrade to (at least) PHP 8.5.0, or switch to the Docker containers. Read more about Firefly III's release and support schedule in [`releases.md`](releases.md).
|
||||
|
||||
And yes, despite my goal not to change things, some very clever users (that's you!) found some interesting bugs that will not make it back to 6.4.x.
|
||||
|
||||
### Added
|
||||
- Support for PHP 8.5
|
||||
|
||||
### Changed
|
||||
- [PR 11776](https://github.com/firefly-iii/firefly-iii/pull/11776) (Convert to primary currency for charts) reported by @dakennguyen
|
||||
- The update check now contacts GitHub directly.
|
||||
|
||||
### Removed
|
||||
- Support for PHP 8.4 and earlier
|
||||
|
||||
### Fixed
|
||||
- [Discussion 11685](https://github.com/orgs/firefly-iii/discussions/11685) (Yearly budget best practices) started by @molnarti
|
||||
- [Issue 11778](https://github.com/firefly-iii/firefly-iii/issues/11778) (API update rule trigger only accepts "store-journal") reported by @jhns-de
|
||||
- Test notification was broken for system owners.
|
||||
|
||||
## v6.4.23 - 2026-02-20
|
||||
|
||||
> [!WARNING]
|
||||
> If no pressing issues get reported, this release will be followed by **v6.5.0**. It will be exactly the same but require PHP 8.5.
|
||||
|
||||
@@ -25,11 +25,11 @@ declare(strict_types=1);
|
||||
use FireflyIII\Enums\ClauseType;
|
||||
|
||||
return [
|
||||
ClauseType::TRANSACTION => [
|
||||
ClauseType::WHERE => [
|
||||
ClauseType::TRANSACTION->value => [
|
||||
ClauseType::WHERE->value => [
|
||||
'account_id' => 'required|numeric|belongsToUser:accounts,id',
|
||||
],
|
||||
ClauseType::UPDATE => [
|
||||
ClauseType::UPDATE->value => [
|
||||
'account_id' => 'required|numeric|belongsToUser:accounts,id',
|
||||
],
|
||||
],
|
||||
|
||||
@@ -78,8 +78,8 @@ return [
|
||||
'running_balance_column' => (bool)envNonEmpty('USE_RUNNING_BALANCE', true), // this is only the default value, is not used.
|
||||
// see cer.php for exchange rates feature flag.
|
||||
],
|
||||
'version' => 'develop/2026-02-20',
|
||||
'build_time' => 1771612586,
|
||||
'version' => 'develop/2026-02-22',
|
||||
'build_time' => 1771741082,
|
||||
'api_version' => '2.1.0', // field is no longer used.
|
||||
'db_version' => 28, // field is no longer used.
|
||||
|
||||
|
||||
12
package-lock.json
generated
12
package-lock.json
generated
@@ -4597,9 +4597,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001770",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001770.tgz",
|
||||
"integrity": "sha512-x/2CLQ1jHENRbHg5PSId2sXq1CIO1CISvwWAj027ltMVG2UNgW+w9oH2+HzgEIRFembL8bUlXtfbBHR1fCg2xw==",
|
||||
"version": "1.0.30001772",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001772.tgz",
|
||||
"integrity": "sha512-mIwLZICj+ntVTw4BT2zfp+yu/AqV6GMKfJVJMx3MwPxs+uk/uj2GLl2dH8LQbjiLDX66amCga5nKFyDgRR43kg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -8328,9 +8328,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.3.tgz",
|
||||
"integrity": "sha512-M2GCs7Vk83NxkUyQV1bkABc4yxgz9kILhHImZiBPAZ9ybuvCb0/H7lEl5XvIg3g+9d4eNotkZA5IWwYl0tibaA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
|
||||
@@ -16,7 +16,10 @@ The different alpha and beta builds will be compiled from their corresponding ta
|
||||
### Minor Release Support Matrix
|
||||
| Version | Supported |
|
||||
|----------------------------------|--------------------|
|
||||
| Firefly III v6.2.x | :white_check_mark: |
|
||||
| Firefly III v6.5.x | :white_check_mark: |
|
||||
| Firefly III v6.4.x | :x: |
|
||||
| Firefly III v6.3.x | :x: |
|
||||
| Firefly III v6.2.x | :x: |
|
||||
| Firefly III v6.1.x | :x: |
|
||||
| Firefly III v6.0.x | :x: |
|
||||
| Firefly III v5.8.x | :x: |
|
||||
|
||||
@@ -331,6 +331,7 @@ return [
|
||||
'update_newer_version_alert' => 'You are running :your_version, which is newer than the latest release, :new_version.',
|
||||
'update_check_error' => 'An error occurred while checking for updates: :error',
|
||||
'unknown_error' => 'Unknown error. Sorry about that.',
|
||||
'no_new_release_available' => 'There is no newer release available. You are up to date.',
|
||||
'disabled_but_check' => 'You disabled update checking. So don\'t forget to check for updates yourself every now and then. Thank you!',
|
||||
'admin_update_channel_title' => 'Update channel',
|
||||
'admin_update_channel_explain' => 'Firefly III has three update "channels" which determine how ahead of the curve you are in terms of features, enhancements and bugs. Use the "beta" channel if you\'re adventurous and the "alpha" when you like to live life dangerously.',
|
||||
|
||||
@@ -699,6 +699,7 @@ Route::group(
|
||||
],
|
||||
static function (): void {
|
||||
Route::get('transactions', ['uses' => 'TransactionController@search', 'as' => 'transactions']);
|
||||
Route::get('transactions/count', ['uses' => 'TransactionController@count', 'as' => 'count']);
|
||||
Route::get('accounts', ['uses' => 'AccountController@search', 'as' => 'accounts']);
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user