Compare commits

..

14 Commits

Author SHA1 Message Date
github-actions[bot]
4ad2508675 Merge pull request #11781 from firefly-iii/release-1771701858
🤖 Automatically merge the PR into the develop branch.
2026-02-21 20:24:25 +01:00
JC5
35f997be45 🤖 Auto commit for release 'develop' on 2026-02-21 2026-02-21 20:24:18 +01:00
James Cole
ad3fec1458 Clean up templates. 2026-02-21 20:18:04 +01:00
github-actions[bot]
25eab80ec3 Merge pull request #11780 from firefly-iii/release-1771686867
🤖 Automatically merge the PR into the develop branch.
2026-02-21 16:14:35 +01:00
JC5
c27e9873b2 🤖 Auto commit for release 'develop' on 2026-02-21 2026-02-21 16:14:27 +01:00
James Cole
84f4f63104 Update changelog. 2026-02-21 16:08:55 +01:00
James Cole
02d37998f9 Merge pull request #11776 from dakennguyen/convert-to-primary-currency-for-charts
Convert to primary currency for charts
2026-02-21 15:44:56 +01:00
James Cole
39c72a60e1 Fix https://github.com/firefly-iii/firefly-iii/issues/11778 2026-02-21 15:42:52 +01:00
Khoa Nguyen
1980f73694 Convert to primary currency for report chart 2026-02-21 13:14:57 +01:00
Khoa Nguyen
d135186149 Convert to primary currency for category chart 2026-02-21 13:14:49 +01:00
github-actions[bot]
3e36287374 Merge pull request #11774 from firefly-iii/release-1771667913
🤖 Automatically merge the PR into the develop branch.
2026-02-21 10:58:39 +01:00
JC5
37c4db2ce9 🤖 Auto commit for release 'develop' on 2026-02-21 2026-02-21 10:58:33 +01:00
James Cole
8e6ff3ceaf Fix small issues reported over mail and from the demo site. 2026-02-21 10:53:14 +01:00
James Cole
6e0e32dc6c You can always grab the latest develop release. 2026-02-21 08:05:01 +01:00
13 changed files with 66 additions and 281 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -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()],

View File

@@ -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);

View File

@@ -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.

View File

@@ -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));
}
}

View File

@@ -120,8 +120,8 @@ class GitHubUpdateRequest implements UpdateRequestInterface
continue;
}
// new version must be at least a week old.
if ($release['published_at']->gt($weekAgo)) {
// 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;

View File

@@ -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;
}
}

View File

@@ -178,6 +178,12 @@ class ExportDataGenerator
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
// @phpstan-ignore-line
public function __construct()
{
$this->accounts = new Collection();

View File

@@ -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.',

View File

@@ -8,12 +8,23 @@ This project adheres to [Semantic Versioning](http://semver.org/).
> [!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]

View File

@@ -79,7 +79,7 @@ return [
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2026-02-21',
'build_time' => 1771657125,
'build_time' => 1771701730,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.