Compare commits

..

106 Commits

Author SHA1 Message Date
github-actions[bot]
22448a825b Merge pull request #11390 from firefly-iii/release-1766158480
🤖 Automatically merge the PR into the develop branch.
2025-12-19 16:34:48 +01:00
JC5
476a9ac6e4 🤖 Auto commit for release 'develop' on 2025-12-19 2025-12-19 16:34:41 +01:00
James Cole
0acd07405b Fix #11388 2025-12-19 16:30:39 +01:00
James Cole
1daacb80b1 Fix #11383 2025-12-17 19:27:59 +01:00
github-actions[bot]
2bf841627a Merge pull request #11382 from firefly-iii/release-1765957651
🤖 Automatically merge the PR into the develop branch.
2025-12-17 08:47:38 +01:00
JC5
012df6bb24 🤖 Auto commit for release 'develop' on 2025-12-17 2025-12-17 08:47:31 +01:00
Sander Dorigo
486e0d5ed5 Update reference to Steam 2025-12-17 08:43:39 +01:00
James Cole
e8fe9db181 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2025-12-17 06:04:23 +01:00
James Cole
05f0cb26f8 Remove sentry. 2025-12-17 06:04:17 +01:00
github-actions[bot]
bdaed65207 Merge pull request #11375 from firefly-iii/release-1765863733
🤖 Automatically merge the PR into the develop branch.
2025-12-16 06:42:20 +01:00
JC5
62a9195acc 🤖 Auto commit for release 'v6.4.14' on 2025-12-16 2025-12-16 06:42:13 +01:00
James Cole
40d1e36ba8 Fix changelog. 2025-12-16 06:38:14 +01:00
James Cole
61a8525d26 Merge branch 'main' into develop 2025-12-16 06:36:32 +01:00
James Cole
ef01fbe5f4 Update changelog. 2025-12-16 06:36:17 +01:00
James Cole
9413f49c84 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2025-12-16 06:36:12 +01:00
github-actions[bot]
d9ae99b5fe Merge pull request #11374 from firefly-iii/develop
🤖 Automatically merge the PR into the main branch.
2025-12-16 06:35:19 +01:00
github-actions[bot]
45d2d86bba Merge pull request #11373 from firefly-iii/release-1765863308
🤖 Automatically merge the PR into the develop branch.
2025-12-16 06:35:15 +01:00
JC5
e21d5e5d01 🤖 Auto commit for release 'v6.4.13' on 2025-12-16 2025-12-16 06:35:08 +01:00
James Cole
8781e2a870 Fix #11368 2025-12-16 06:31:19 +01:00
github-actions[bot]
9e4bfd9d1a Merge pull request #11372 from firefly-iii/release-1765862987
🤖 Automatically merge the PR into the develop branch.
2025-12-16 06:29:55 +01:00
JC5
d61d6aa2e2 🤖 Auto commit for release 'develop' on 2025-12-16 2025-12-16 06:29:47 +01:00
github-actions[bot]
230a3a0180 Merge pull request #11371 from firefly-iii/develop
🤖 Automatically merge the PR into the main branch.
2025-12-16 06:25:04 +01:00
github-actions[bot]
002454b995 Merge pull request #11370 from firefly-iii/release-1765862692
🤖 Automatically merge the PR into the develop branch.
2025-12-16 06:24:59 +01:00
JC5
e6d9c2e218 🤖 Auto commit for release 'v6.4.12' on 2025-12-16 2025-12-16 06:24:52 +01:00
github-actions[bot]
eaa5054b00 Merge pull request #11369 from firefly-iii/release-1765861996
🤖 Automatically merge the PR into the develop branch.
2025-12-16 06:13:25 +01:00
JC5
4e9e63ed08 🤖 Auto commit for release 'develop' on 2025-12-16 2025-12-16 06:13:16 +01:00
James Cole
76ea5b6e34 Fix #11367 2025-12-16 06:08:38 +01:00
Sander Dorigo
2f788f7397 Merge branch 'develop' of https://github.com/firefly-iii/firefly-iii into develop 2025-12-15 15:51:13 +01:00
Sander Dorigo
29766aa9b7 Add better running balance 2025-12-15 14:56:58 +01:00
github-actions[bot]
cc30376297 Merge pull request #11364 from firefly-iii/release-1765805210
🤖 Automatically merge the PR into the develop branch.
2025-12-15 14:26:58 +01:00
JC5
5b007fbe01 🤖 Auto commit for release 'develop' on 2025-12-15 2025-12-15 14:26:50 +01:00
Sander Dorigo
e1f8ea3b1a Fix missing user property 2025-12-15 14:19:43 +01:00
James Cole
6f019f0bb4 Merge pull request #11363 from firefly-iii/main
Merge main into develop
2025-12-15 10:48:19 +01:00
github-actions[bot]
f475947776 Merge pull request #11362 from firefly-iii/develop
🤖 Automatically merge the PR into the main branch.
2025-12-15 09:01:26 +01:00
github-actions[bot]
ee6901eb92 Merge pull request #11361 from firefly-iii/release-1765785673
🤖 Automatically merge the PR into the develop branch.
2025-12-15 09:01:21 +01:00
JC5
84d7523d6c 🤖 Auto commit for release 'v6.4.11' on 2025-12-15 2025-12-15 09:01:13 +01:00
github-actions[bot]
6900dc7dae Merge pull request #11360 from firefly-iii/release-1765785184
🤖 Automatically merge the PR into the develop branch.
2025-12-15 08:53:14 +01:00
JC5
6247e516c6 🤖 Auto commit for release 'develop' on 2025-12-15 2025-12-15 08:53:05 +01:00
Sander Dorigo
cdf970a88c Add changelog 2025-12-15 08:42:10 +01:00
Sander Dorigo
a447c387f9 Fix #11357 2025-12-15 08:41:07 +01:00
Sander Dorigo
ce2c94efed Fix #11356 2025-12-15 08:40:19 +01:00
James Cole
205ea4270b Merge pull request #11358 from firefly-iii/dependabot/github_actions/dessant/label-actions-5 2025-12-15 07:27:43 +01:00
github-actions[bot]
dcbb2428f2 Merge pull request #11359 from firefly-iii/release-1765769737
🤖 Automatically merge the PR into the develop branch.
2025-12-15 04:35:45 +01:00
JC5
319916fc8f 🤖 Auto commit for release 'develop' on 2025-12-15 2025-12-15 04:35:37 +01:00
dependabot[bot]
088b0e2f30 Bump dessant/label-actions from 4 to 5
Bumps [dessant/label-actions](https://github.com/dessant/label-actions) from 4 to 5.
- [Release notes](https://github.com/dessant/label-actions/releases)
- [Changelog](https://github.com/dessant/label-actions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/dessant/label-actions/compare/v4...v5)

---
updated-dependencies:
- dependency-name: dessant/label-actions
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 03:06:09 +00:00
github-actions[bot]
b45aadf8a3 Merge pull request #11355 from firefly-iii/develop
🤖 Automatically merge the PR into the main branch.
2025-12-14 19:13:25 +01:00
github-actions[bot]
1fafeb1515 Merge pull request #11354 from firefly-iii/release-1765735989
🤖 Automatically merge the PR into the develop branch.
2025-12-14 19:13:19 +01:00
JC5
f60c64c9c1 🤖 Auto commit for release 'v6.4.10' on 2025-12-14 2025-12-14 19:13:09 +01:00
James Cole
564dcb1c6d Expand changelog. 2025-12-14 19:09:08 +01:00
github-actions[bot]
4044bb85a9 Merge pull request #11353 from firefly-iii/release-1765725243
🤖 Automatically merge the PR into the develop branch.
2025-12-14 16:14:10 +01:00
JC5
18bb0eecff 🤖 Auto commit for release 'develop' on 2025-12-14 2025-12-14 16:14:03 +01:00
James Cole
9af95907e3 Fix patch etc. 2025-12-14 16:10:21 +01:00
James Cole
40ecba4b5a No longer need patch. 2025-12-14 10:31:35 +01:00
James Cole
73312a4ccc Fix #11310 2025-12-14 10:24:27 +01:00
James Cole
d747ac237b Validate title, fix running balance display 2025-12-13 06:36:20 +01:00
github-actions[bot]
b6c4253d76 Merge pull request #11349 from firefly-iii/release-1765602800
🤖 Automatically merge the PR into the develop branch.
2025-12-13 06:13:28 +01:00
JC5
d74d67633d 🤖 Auto commit for release 'develop' on 2025-12-13 2025-12-13 06:13:20 +01:00
James Cole
0b00f35101 Update packages, another fix for the same issue. 2025-12-13 06:08:58 +01:00
James Cole
8f81cb8cc4 Fix #11346 2025-12-13 06:05:39 +01:00
github-actions[bot]
fa665286b5 Merge pull request #11344 from firefly-iii/release-1765164810
🤖 Automatically merge the PR into the develop branch.
2025-12-08 04:33:39 +01:00
JC5
58ae0c1c9b 🤖 Auto commit for release 'develop' on 2025-12-08 2025-12-08 04:33:30 +01:00
github-actions[bot]
7eab4834c8 Merge pull request #11340 from firefly-iii/release-1765124558
🤖 Automatically merge the PR into the develop branch.
2025-12-07 17:22:47 +01:00
JC5
d1332eb592 🤖 Auto commit for release 'develop' on 2025-12-07 2025-12-07 17:22:38 +01:00
James Cole
346f2dfaea Add amount event. 2025-12-07 16:47:04 +01:00
James Cole
f6037318f4 Fix #11337 2025-12-07 07:00:50 +01:00
James Cole
babf9fe96f Add file permissions checks. #11323 2025-12-06 14:55:15 +01:00
James Cole
ca3922d00a Fix #11313 2025-12-06 13:50:51 +01:00
James Cole
aadb685b57 Add YTD fix. 2025-12-06 08:12:18 +01:00
github-actions[bot]
bee62b2115 Merge pull request #11335 from firefly-iii/release-1765004138
🤖 Automatically merge the PR into the develop branch.
2025-12-06 07:55:46 +01:00
JC5
205169a8ad 🤖 Auto commit for release 'develop' on 2025-12-06 2025-12-06 07:55:38 +01:00
James Cole
5f36bb84a4 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2025-12-06 07:51:19 +01:00
James Cole
5b395d870b Fix #11333 2025-12-06 07:32:43 +01:00
github-actions[bot]
bceb526cb3 Merge pull request #11334 from firefly-iii/release-1765002701
🤖 Automatically merge the PR into the develop branch.
2025-12-06 07:31:52 +01:00
JC5
1f89dddb08 🤖 Auto commit for release 'develop' on 2025-12-06 2025-12-06 07:31:41 +01:00
James Cole
a93f2d66af Fix #11329 2025-12-06 07:27:41 +01:00
James Cole
551909ea60 Merge branch 'main' into develop 2025-12-05 08:21:34 +01:00
Sander Dorigo
5667044349 Fix #11328 2025-12-04 17:27:20 +01:00
James Cole
6f73e4f2c9 Merge pull request #11316 from firefly-iii/dependabot/composer/develop/symfony/mailgun-mailer-8.0.0
Bump symfony/mailgun-mailer from 7.4.0 to 8.0.0
2025-12-01 14:32:55 +01:00
dependabot[bot]
1f19f20734 Bump symfony/mailgun-mailer from 7.4.0 to 8.0.0
Bumps [symfony/mailgun-mailer](https://github.com/symfony/mailgun-mailer) from 7.4.0 to 8.0.0.
- [Release notes](https://github.com/symfony/mailgun-mailer/releases)
- [Changelog](https://github.com/symfony/mailgun-mailer/blob/7.3/CHANGELOG.md)
- [Commits](https://github.com/symfony/mailgun-mailer/compare/v7.4.0...v8.0.0)

---
updated-dependencies:
- dependency-name: symfony/mailgun-mailer
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 10:45:09 +00:00
James Cole
91c8f0db80 Merge pull request #11317 from firefly-iii/dependabot/composer/develop/symfony/expression-language-8.0.0
Bump symfony/expression-language from 7.4.0 to 8.0.0
2025-12-01 11:41:22 +01:00
dependabot[bot]
2cdd1aa147 Bump symfony/expression-language from 7.4.0 to 8.0.0
Bumps [symfony/expression-language](https://github.com/symfony/expression-language) from 7.4.0 to 8.0.0.
- [Release notes](https://github.com/symfony/expression-language/releases)
- [Changelog](https://github.com/symfony/expression-language/blob/7.3/CHANGELOG.md)
- [Commits](https://github.com/symfony/expression-language/compare/v7.4.0...v8.0.0)

---
updated-dependencies:
- dependency-name: symfony/expression-language
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 08:17:15 +00:00
James Cole
5ac51218aa Merge pull request #11319 from firefly-iii/dependabot/github_actions/github/command-2.0.3 2025-12-01 05:15:37 +01:00
James Cole
80abd277a0 Merge pull request #11315 from firefly-iii/dependabot/composer/develop/symfony/http-client-8.0.0 2025-12-01 05:14:44 +01:00
mergify[bot]
b644f28882 Merge branch 'develop' into dependabot/composer/develop/symfony/http-client-8.0.0 2025-12-01 03:40:11 +00:00
github-actions[bot]
35a81fd2de Merge pull request #11321 from firefly-iii/release-1764560258
🤖 Automatically merge the PR into the develop branch.
2025-12-01 04:37:44 +01:00
JC5
51e8a1dbe2 🤖 Auto commit for release 'develop' on 2025-12-01 2025-12-01 04:37:38 +01:00
dependabot[bot]
b799379a0a Bump github/command from 2.0.2 to 2.0.3
Bumps [github/command](https://github.com/github/command) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/github/command/releases)
- [Commits](https://github.com/github/command/compare/v2.0.2...v2.0.3)

---
updated-dependencies:
- dependency-name: github/command
  dependency-version: 2.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 03:10:25 +00:00
dependabot[bot]
c8edaee848 Bump symfony/http-client from 7.4.0 to 8.0.0
Bumps [symfony/http-client](https://github.com/symfony/http-client) from 7.4.0 to 8.0.0.
- [Release notes](https://github.com/symfony/http-client/releases)
- [Changelog](https://github.com/symfony/http-client/blob/7.3/CHANGELOG.md)
- [Commits](https://github.com/symfony/http-client/compare/v7.4.0...v8.0.0)

---
updated-dependencies:
- dependency-name: symfony/http-client
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-01 03:03:40 +00:00
github-actions[bot]
bbe47635d3 Merge pull request #11304 from firefly-iii/release-1764397418
🤖 Automatically merge the PR into the develop branch.
2025-11-29 07:23:46 +01:00
JC5
5c73d238a0 🤖 Auto commit for release 'develop' on 2025-11-29 2025-11-29 07:23:38 +01:00
github-actions[bot]
2bee3d2728 Merge pull request #11301 from firefly-iii/develop
🤖 Automatically merge the PR into the main branch.
2025-11-28 21:36:11 +01:00
github-actions[bot]
73126786b0 Merge pull request #11300 from firefly-iii/release-1764362158
🤖 Automatically merge the PR into the develop branch.
2025-11-28 21:36:05 +01:00
JC5
962a729025 🤖 Auto commit for release 'v6.4.9' on 2025-11-28 2025-11-28 21:35:58 +01:00
github-actions[bot]
f262cb3947 Merge pull request #11298 from firefly-iii/release-1764353294
🤖 Automatically merge the PR into the develop branch.
2025-11-28 19:08:24 +01:00
JC5
212d579c4f 🤖 Auto commit for release 'develop' on 2025-11-28 2025-11-28 19:08:14 +01:00
James Cole
30937610eb Update changelog. 2025-11-28 19:02:50 +01:00
James Cole
3558bf7647 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2025-11-28 19:01:21 +01:00
James Cole
3711222f9e Fix #11281 and some other stuff. 2025-11-28 19:01:15 +01:00
github-actions[bot]
76899389b8 Merge pull request #11291 from firefly-iii/release-1764180754
🤖 Automatically merge the PR into the develop branch.
2025-11-26 19:12:42 +01:00
JC5
e83fe023d2 🤖 Auto commit for release 'develop' on 2025-11-26 2025-11-26 19:12:34 +01:00
James Cole
1dd098a283 Fix #11284 2025-11-26 19:06:58 +01:00
James Cole
52164689d4 Switch to 1M when it's MTD. 2025-11-26 19:05:46 +01:00
github-actions[bot]
034b14eb0b Merge pull request #11290 from firefly-iii/release-1764179030
🤖 Automatically merge the PR into the develop branch.
2025-11-26 18:43:56 +01:00
JC5
8722d264dc 🤖 Auto commit for release 'develop' on 2025-11-26 2025-11-26 18:43:50 +01:00
James Cole
3603ef1cc7 Fix #11288 2025-11-26 18:39:05 +01:00
James Cole
7abd30f4dd Attempted fix with sanity check for #11284 2025-11-26 18:35:56 +01:00
164 changed files with 2054 additions and 1942 deletions

View File

@@ -402,16 +402,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.90.0",
"version": "v3.92.3",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "ad732c2e9299c9743f9c55ae53cc0e7642ab1155"
"reference": "2ba8f5a60f6f42fb65758cfb3768434fa2d1c7e8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ad732c2e9299c9743f9c55ae53cc0e7642ab1155",
"reference": "ad732c2e9299c9743f9c55ae53cc0e7642ab1155",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/2ba8f5a60f6f42fb65758cfb3768434fa2d1c7e8",
"reference": "2ba8f5a60f6f42fb65758cfb3768434fa2d1c7e8",
"shasum": ""
},
"require": {
@@ -451,6 +451,7 @@
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6",
"phpunit/phpunit": "^9.6.25 || ^10.5.53 || ^11.5.34",
"symfony/polyfill-php85": "^1.33",
"symfony/var-dumper": "^5.4.48 || ^6.4.24 || ^7.3.2 || ^8.0",
"symfony/yaml": "^5.4.45 || ^6.4.24 || ^7.3.2 || ^8.0"
},
@@ -467,7 +468,7 @@
"PhpCsFixer\\": "src/"
},
"exclude-from-classmap": [
"src/Fixer/Internal/*"
"src/**/Internal/"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -493,7 +494,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.90.0"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.92.3"
},
"funding": [
{
@@ -501,7 +502,7 @@
"type": "github"
}
],
"time": "2025-11-20T15:15:16+00:00"
"time": "2025-12-18T10:45:02+00:00"
},
{
"name": "psr/container",
@@ -1251,47 +1252,39 @@
},
{
"name": "symfony/console",
"version": "v7.3.6",
"version": "v8.0.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "c28ad91448f86c5f6d9d2c70f0cf68bf135f252a"
"reference": "fcb73f69d655b48fcb894a262f074218df08bd58"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/c28ad91448f86c5f6d9d2c70f0cf68bf135f252a",
"reference": "c28ad91448f86c5f6d9d2c70f0cf68bf135f252a",
"url": "https://api.github.com/repos/symfony/console/zipball/fcb73f69d655b48fcb894a262f074218df08bd58",
"reference": "fcb73f69d655b48fcb894a262f074218df08bd58",
"shasum": ""
},
"require": {
"php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-mbstring": "~1.0",
"php": ">=8.4",
"symfony/polyfill-mbstring": "^1.0",
"symfony/service-contracts": "^2.5|^3",
"symfony/string": "^7.2"
},
"conflict": {
"symfony/dependency-injection": "<6.4",
"symfony/dotenv": "<6.4",
"symfony/event-dispatcher": "<6.4",
"symfony/lock": "<6.4",
"symfony/process": "<6.4"
"symfony/string": "^7.4|^8.0"
},
"provide": {
"psr/log-implementation": "1.0|2.0|3.0"
},
"require-dev": {
"psr/log": "^1|^2|^3",
"symfony/config": "^6.4|^7.0",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/event-dispatcher": "^6.4|^7.0",
"symfony/http-foundation": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0",
"symfony/lock": "^6.4|^7.0",
"symfony/messenger": "^6.4|^7.0",
"symfony/process": "^6.4|^7.0",
"symfony/stopwatch": "^6.4|^7.0",
"symfony/var-dumper": "^6.4|^7.0"
"symfony/config": "^7.4|^8.0",
"symfony/dependency-injection": "^7.4|^8.0",
"symfony/event-dispatcher": "^7.4|^8.0",
"symfony/http-foundation": "^7.4|^8.0",
"symfony/http-kernel": "^7.4|^8.0",
"symfony/lock": "^7.4|^8.0",
"symfony/messenger": "^7.4|^8.0",
"symfony/process": "^7.4|^8.0",
"symfony/stopwatch": "^7.4|^8.0",
"symfony/var-dumper": "^7.4|^8.0"
},
"type": "library",
"autoload": {
@@ -1325,7 +1318,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v7.3.6"
"source": "https://github.com/symfony/console/tree/v8.0.1"
},
"funding": [
{
@@ -1345,7 +1338,7 @@
"type": "tidelift"
}
],
"time": "2025-11-04T01:21:42+00:00"
"time": "2025-12-05T15:25:33+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -1416,24 +1409,24 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v7.3.3",
"version": "v8.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "b7dc69e71de420ac04bc9ab830cf3ffebba48191"
"reference": "573f95783a2ec6e38752979db139f09fec033f03"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b7dc69e71de420ac04bc9ab830cf3ffebba48191",
"reference": "b7dc69e71de420ac04bc9ab830cf3ffebba48191",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/573f95783a2ec6e38752979db139f09fec033f03",
"reference": "573f95783a2ec6e38752979db139f09fec033f03",
"shasum": ""
},
"require": {
"php": ">=8.2",
"php": ">=8.4",
"symfony/event-dispatcher-contracts": "^2.5|^3"
},
"conflict": {
"symfony/dependency-injection": "<6.4",
"symfony/security-http": "<7.4",
"symfony/service-contracts": "<2.5"
},
"provide": {
@@ -1442,13 +1435,14 @@
},
"require-dev": {
"psr/log": "^1|^2|^3",
"symfony/config": "^6.4|^7.0",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/error-handler": "^6.4|^7.0",
"symfony/expression-language": "^6.4|^7.0",
"symfony/http-foundation": "^6.4|^7.0",
"symfony/config": "^7.4|^8.0",
"symfony/dependency-injection": "^7.4|^8.0",
"symfony/error-handler": "^7.4|^8.0",
"symfony/expression-language": "^7.4|^8.0",
"symfony/framework-bundle": "^7.4|^8.0",
"symfony/http-foundation": "^7.4|^8.0",
"symfony/service-contracts": "^2.5|^3",
"symfony/stopwatch": "^6.4|^7.0"
"symfony/stopwatch": "^7.4|^8.0"
},
"type": "library",
"autoload": {
@@ -1476,7 +1470,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/event-dispatcher/tree/v7.3.3"
"source": "https://github.com/symfony/event-dispatcher/tree/v8.0.0"
},
"funding": [
{
@@ -1496,7 +1490,7 @@
"type": "tidelift"
}
],
"time": "2025-08-13T11:49:31+00:00"
"time": "2025-10-30T14:17:19+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
@@ -1576,25 +1570,25 @@
},
{
"name": "symfony/filesystem",
"version": "v7.3.6",
"version": "v8.0.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "e9bcfd7837928ab656276fe00464092cc9e1826a"
"reference": "d937d400b980523dc9ee946bb69972b5e619058d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/e9bcfd7837928ab656276fe00464092cc9e1826a",
"reference": "e9bcfd7837928ab656276fe00464092cc9e1826a",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/d937d400b980523dc9ee946bb69972b5e619058d",
"reference": "d937d400b980523dc9ee946bb69972b5e619058d",
"shasum": ""
},
"require": {
"php": ">=8.2",
"php": ">=8.4",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-mbstring": "~1.8"
},
"require-dev": {
"symfony/process": "^6.4|^7.0"
"symfony/process": "^7.4|^8.0"
},
"type": "library",
"autoload": {
@@ -1622,7 +1616,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/filesystem/tree/v7.3.6"
"source": "https://github.com/symfony/filesystem/tree/v8.0.1"
},
"funding": [
{
@@ -1642,27 +1636,27 @@
"type": "tidelift"
}
],
"time": "2025-11-05T09:52:27+00:00"
"time": "2025-12-01T09:13:36+00:00"
},
{
"name": "symfony/finder",
"version": "v7.3.5",
"version": "v8.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "9f696d2f1e340484b4683f7853b273abff94421f"
"reference": "7598dd5770580fa3517ec83e8da0c9b9e01f4291"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/9f696d2f1e340484b4683f7853b273abff94421f",
"reference": "9f696d2f1e340484b4683f7853b273abff94421f",
"url": "https://api.github.com/repos/symfony/finder/zipball/7598dd5770580fa3517ec83e8da0c9b9e01f4291",
"reference": "7598dd5770580fa3517ec83e8da0c9b9e01f4291",
"shasum": ""
},
"require": {
"php": ">=8.2"
"php": ">=8.4"
},
"require-dev": {
"symfony/filesystem": "^6.4|^7.0"
"symfony/filesystem": "^7.4|^8.0"
},
"type": "library",
"autoload": {
@@ -1690,7 +1684,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v7.3.5"
"source": "https://github.com/symfony/finder/tree/v8.0.0"
},
"funding": [
{
@@ -1710,24 +1704,24 @@
"type": "tidelift"
}
],
"time": "2025-10-15T18:45:57+00:00"
"time": "2025-11-05T14:36:47+00:00"
},
{
"name": "symfony/options-resolver",
"version": "v7.3.3",
"version": "v8.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d"
"reference": "d2b592535ffa6600c265a3893a7f7fd2bad82dd7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/0ff2f5c3df08a395232bbc3c2eb7e84912df911d",
"reference": "0ff2f5c3df08a395232bbc3c2eb7e84912df911d",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/d2b592535ffa6600c265a3893a7f7fd2bad82dd7",
"reference": "d2b592535ffa6600c265a3893a7f7fd2bad82dd7",
"shasum": ""
},
"require": {
"php": ">=8.2",
"php": ">=8.4",
"symfony/deprecation-contracts": "^2.5|^3"
},
"type": "library",
@@ -1761,7 +1755,7 @@
"options"
],
"support": {
"source": "https://github.com/symfony/options-resolver/tree/v7.3.3"
"source": "https://github.com/symfony/options-resolver/tree/v8.0.0"
},
"funding": [
{
@@ -1781,7 +1775,7 @@
"type": "tidelift"
}
],
"time": "2025-08-05T10:16:07+00:00"
"time": "2025-11-12T15:55:31+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -2364,20 +2358,20 @@
},
{
"name": "symfony/process",
"version": "v7.3.4",
"version": "v8.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "f24f8f316367b30810810d4eb30c543d7003ff3b"
"reference": "a0a750500c4ce900d69ba4e9faf16f82c10ee149"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/f24f8f316367b30810810d4eb30c543d7003ff3b",
"reference": "f24f8f316367b30810810d4eb30c543d7003ff3b",
"url": "https://api.github.com/repos/symfony/process/zipball/a0a750500c4ce900d69ba4e9faf16f82c10ee149",
"reference": "a0a750500c4ce900d69ba4e9faf16f82c10ee149",
"shasum": ""
},
"require": {
"php": ">=8.2"
"php": ">=8.4"
},
"type": "library",
"autoload": {
@@ -2405,7 +2399,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v7.3.4"
"source": "https://github.com/symfony/process/tree/v8.0.0"
},
"funding": [
{
@@ -2425,7 +2419,7 @@
"type": "tidelift"
}
],
"time": "2025-09-11T10:12:26+00:00"
"time": "2025-10-16T16:25:44+00:00"
},
{
"name": "symfony/service-contracts",
@@ -2516,20 +2510,20 @@
},
{
"name": "symfony/stopwatch",
"version": "v7.3.0",
"version": "v8.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/stopwatch.git",
"reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd"
"reference": "67df1914c6ccd2d7b52f70d40cf2aea02159d942"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd",
"reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/67df1914c6ccd2d7b52f70d40cf2aea02159d942",
"reference": "67df1914c6ccd2d7b52f70d40cf2aea02159d942",
"shasum": ""
},
"require": {
"php": ">=8.2",
"php": ">=8.4",
"symfony/service-contracts": "^2.5|^3"
},
"type": "library",
@@ -2558,7 +2552,7 @@
"description": "Provides a way to profile code",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/stopwatch/tree/v7.3.0"
"source": "https://github.com/symfony/stopwatch/tree/v8.0.0"
},
"funding": [
{
@@ -2569,43 +2563,47 @@
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://github.com/nicolas-grekas",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2025-02-24T10:49:57+00:00"
"time": "2025-08-04T07:36:47+00:00"
},
{
"name": "symfony/string",
"version": "v7.3.4",
"version": "v8.0.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "f96476035142921000338bad71e5247fbc138872"
"reference": "ba65a969ac918ce0cc3edfac6cdde847eba231dc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872",
"reference": "f96476035142921000338bad71e5247fbc138872",
"url": "https://api.github.com/repos/symfony/string/zipball/ba65a969ac918ce0cc3edfac6cdde847eba231dc",
"reference": "ba65a969ac918ce0cc3edfac6cdde847eba231dc",
"shasum": ""
},
"require": {
"php": ">=8.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-grapheme": "~1.0",
"symfony/polyfill-intl-normalizer": "~1.0",
"symfony/polyfill-mbstring": "~1.0"
"php": ">=8.4",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-intl-grapheme": "^1.33",
"symfony/polyfill-intl-normalizer": "^1.0",
"symfony/polyfill-mbstring": "^1.0"
},
"conflict": {
"symfony/translation-contracts": "<2.5"
},
"require-dev": {
"symfony/emoji": "^7.1",
"symfony/http-client": "^6.4|^7.0",
"symfony/intl": "^6.4|^7.0",
"symfony/emoji": "^7.4|^8.0",
"symfony/http-client": "^7.4|^8.0",
"symfony/intl": "^7.4|^8.0",
"symfony/translation-contracts": "^2.5|^3.0",
"symfony/var-exporter": "^6.4|^7.0"
"symfony/var-exporter": "^7.4|^8.0"
},
"type": "library",
"autoload": {
@@ -2644,7 +2642,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v7.3.4"
"source": "https://github.com/symfony/string/tree/v8.0.1"
},
"funding": [
{
@@ -2664,7 +2662,7 @@
"type": "tidelift"
}
],
"time": "2025-09-11T14:36:48+00:00"
"time": "2025-12-01T09:13:36+00:00"
}
],
"packages-dev": [],

View File

@@ -275,16 +275,6 @@ DISABLE_CSP_HEADER=false
TRACKER_SITE_ID=
TRACKER_URL=
#
# You can automatically submit errors to the Firefly III developer using sentry.io
#
# This is entirely optional of course. If you run into errors, I will gladly accept GitHub
# issues or a forwared email message.
#
# If you set this to true, your installation will try to contact sentry.io when it runs into errors.
#
REPORT_ERRORS_ONLINE=false
#
# Firefly III supports webhooks. These are security sensitive and must be enabled manually first.
#

View File

@@ -13,7 +13,7 @@ jobs:
close_duplicates:
runs-on: ubuntu-latest
steps:
- uses: github/command@v2.0.2
- uses: github/command@v2.0.3
id: command
with:
allowed_contexts: "issue"

View File

@@ -18,4 +18,4 @@ jobs:
action:
runs-on: ubuntu-latest
steps:
- uses: dessant/label-actions@v4
- uses: dessant/label-actions@v5

View File

@@ -24,7 +24,6 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Chart;
use Illuminate\Http\Request;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Chart\ChartRequest;
use FireflyIII\Enums\UserRoleEnum;
@@ -32,11 +31,13 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Facades\Navigation;
use FireflyIII\Support\Facades\Steam;
use FireflyIII\Support\Http\Api\ApiSupport;
use FireflyIII\Support\Http\Api\CleansChartData;
use FireflyIII\Support\Http\Api\CollectsAccountsFromFilter;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
/**
@@ -48,9 +49,9 @@ class AccountController extends Controller
use CleansChartData;
use CollectsAccountsFromFilter;
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
private array $chartData = [];
private array $chartData = [];
private AccountRepositoryInterface $repository;
/**
@@ -103,7 +104,7 @@ class AccountController extends Controller
$currency = $this->repository->getAccountCurrency($account);
$currentStart = clone $params['start'];
$range = Steam::finalAccountBalanceInRange($account, $params['start'], clone $params['end'], $this->convertToPrimary);
$period = $params['period'] ?? '1D';
$previous = array_values($range)[0]['balance'];
$pcPrevious = null;
@@ -129,7 +130,7 @@ class AccountController extends Controller
'end_date' => $params['end']->toAtomString(),
'type' => 'line',
'yAxisID' => 0,
'period' => '1D',
'period' => $period,
'entries' => [],
'pc_entries' => [],
];
@@ -141,7 +142,7 @@ class AccountController extends Controller
$currentSet['primary_currency_decimal_places'] = $this->primaryCurrency->decimal_places;
$pcPrevious = array_values($range)[0]['pc_balance'];
}
// create array of values to collect.
while ($currentStart <= $params['end']) {
$format = $currentStart->format('Y-m-d');
@@ -158,8 +159,8 @@ class AccountController extends Controller
$pcPrevious = $pcBalance;
$currentSet['pc_entries'][$label] = $pcBalance;
}
$currentStart->addDay();
$currentStart = Navigation::addPeriod($currentStart, $period);
// $currentStart->addDay();
}
$this->chartData[] = $currentSet;
}

View File

@@ -42,6 +42,7 @@ use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use FireflyIII\Support\Facades\Steam;
/**
* Class BudgetController
@@ -286,7 +287,7 @@ class BudgetController extends Controller
}
if (null !== $limit && $this->convertToPrimary) {
// convert and add all amounts.
$limit->amount = app('steam')->positive($amount);
$limit->amount = Steam::positive($amount);
Log::debug(sprintf('Final amount in limit with converted amount %s', $limit->amount));
}

View File

@@ -486,7 +486,7 @@ class BasicController extends Controller
'currency_decimal_places' => $currencies[$currencyId]->decimal_places,
'value_parsed' => Amount::formatFlat($currencies[$currencyId]->symbol, $currencies[$currencyId]->decimal_places, $availableBudget, false),
'local_icon' => 'money',
'sub_title' => Amount::formatFlat($currencies[$currencyId]->symbol, $currencies[$currencyId]->decimal_places, $availableBudget, false),
'sub_title' => Amount::formatFlat($currencies[$currencyId]->symbol, $currencies[$currencyId]->decimal_places, bcdiv($availableBudget, (string)$days), false),
];
}
foreach ($spent as $row) {

View File

@@ -339,6 +339,9 @@ class UpdateRequest extends FormRequest
// if more than one, verify that there are journal ID's present.
$this->validateJournalIds($validator, $transactionGroup);
// if more than one split, needs group title
$this->validateGroupDescription($validator);
// all transaction types must be equal:
$this->validateTransactionTypesForUpdate($validator);

View File

@@ -0,0 +1,68 @@
<?php
declare(strict_types=1);
/*
* ClearsEmptyForeignAmounts.php
* Copyright (c) 2025 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\Correction;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Models\Transaction;
use Illuminate\Console\Command;
class ClearsEmptyForeignAmounts extends Command
{
use ShowsFriendlyMessages;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'correction:clears-empty-foreign-amounts';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Removes references to foreign amounts if there is no amount.';
/**
* Execute the console command.
*/
public function handle(): int
{
// transaction: has no amount, but reference to currency.
$count = Transaction::whereNull('foreign_amount')->whereNotNull('foreign_currency_id')->count();
if ($count > 0) {
Transaction::whereNull('foreign_amount')->whereNotNull('foreign_currency_id')->update(['foreign_currency_id' => null]);
$this->friendlyInfo(sprintf('Corrected %d invalid foreign amount reference(s)', $count));
}
// transaction: has amount, but no currency.
$count = Transaction::whereNull('foreign_currency_id')->whereNotNull('foreign_amount')->count();
if ($count > 0) {
Transaction::whereNull('foreign_currency_id')->whereNotNull('foreign_amount')->update(['foreign_amount' => null]);
$this->friendlyInfo(sprintf('Corrected %d invalid foreign amount reference(s)', $count));
}
return self::SUCCESS;
}
}

View File

@@ -43,6 +43,7 @@ use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use ValueError;
use FireflyIII\Support\Facades\Steam;
class CorrectsAmounts extends Command
{
@@ -99,6 +100,10 @@ class CorrectsAmounts extends Command
if (null === $source->foreign_currency_id || null === $destination->foreign_currency_id) {
continue;
}
if (null === $source->foreign_amount || null === $destination->foreign_amount) {
continue;
}
$sourceAccount = $source->account;
$destAccount = $destination->account;
if (null === $sourceAccount || null === $destAccount) {
@@ -244,7 +249,7 @@ class CorrectsAmounts extends Command
return false;
}
if (-1 === $check) {
$item->trigger_value = app('steam')->positive($item->trigger_value);
$item->trigger_value = Steam::positive($item->trigger_value);
$item->save();
return true;

View File

@@ -78,6 +78,7 @@ class CorrectsDatabase extends Command
// 'correction:transaction-types', // resource heavy, disabled.
'correction:recalculate-pc-amounts',
'correction:remove-links-to-deleted-objects',
'correction:clears-empty-foreign-amounts',
'firefly-iii:report-integrity',
];
foreach ($commands as $command) {

View File

@@ -29,6 +29,7 @@ use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Models\Account;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
use FireflyIII\Support\Facades\Steam;
class CorrectsIbans extends Command
{
@@ -55,7 +56,7 @@ class CorrectsIbans extends Command
/** @var Account $account */
foreach ($accounts as $account) {
$iban = (string) $account->iban;
$newIban = app('steam')->filterSpaces($iban);
$newIban = Steam::filterSpaces($iban);
if ('' !== $iban && $iban !== $newIban) {
$account->iban = $newIban;
$account->save();
@@ -66,7 +67,7 @@ class CorrectsIbans extends Command
$accountNumber = $account->accountMeta->where('name', 'account_number')->first();
if (null !== $accountNumber) {
$number = (string) $accountNumber->value;
$newNumber = app('steam')->filterSpaces($number);
$newNumber = Steam::filterSpaces($number);
if ('' !== $number && $number !== $newNumber) {
$accountNumber->value = $newNumber;
$accountNumber->save();

View File

@@ -112,9 +112,9 @@ class CorrectsUnevenAmount extends Command
if ($source->transaction_currency_id === $destination->transaction_currency_id) {
Log::debug('Ready to swap data between transactions.');
$destination->foreign_currency_id = $source->transaction_currency_id;
$destination->foreign_amount = app('steam')->positive($source->amount);
$destination->foreign_amount = Steam::positive($source->amount);
$destination->transaction_currency_id = $source->foreign_currency_id;
$destination->amount = app('steam')->positive($source->foreign_amount);
$destination->amount = Steam::positive($source->foreign_amount);
$destination->balance_dirty = true;
$source->balance_dirty = true;
$destination->save();
@@ -132,11 +132,7 @@ class CorrectsUnevenAmount extends Command
private function fixUnevenAmounts(): void
{
Log::debug('fixUnevenAmounts()');
$journals = DB::table('transactions')
->groupBy('transaction_journal_id')
->whereNull('deleted_at')
->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')])
;
$journals = DB::table('transactions')->groupBy('transaction_journal_id')->whereNull('deleted_at')->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')]);
/** @var stdClass $entry */
foreach ($journals as $entry) {
@@ -146,11 +142,7 @@ class CorrectsUnevenAmount extends Command
|| '' === $sum // @phpstan-ignore-line
|| str_contains($sum, 'e')
|| str_contains($sum, ',')) {
$message = sprintf(
'Journal #%d has an invalid sum ("%s"). No sure what to do.',
$entry->transaction_journal_id,
$entry->the_sum
);
$message = sprintf('Journal #%d has an invalid sum ("%s"). No sure what to do.', $entry->transaction_journal_id, $entry->the_sum);
$this->friendlyWarning($message);
Log::warning($message);
++$this->count;
@@ -184,13 +176,7 @@ class CorrectsUnevenAmount extends Command
$source = $journal->transactions()->where('amount', '<', 0)->first();
if (null === $source) {
$this->friendlyError(
sprintf(
'Journal #%d ("%s") has no source transaction. It will be deleted to maintain database consistency.',
$journal->id ?? 0,
$journal->description ?? ''
)
);
$this->friendlyError(sprintf('Journal #%d ("%s") has no source transaction. It will be deleted to maintain database consistency.', $journal->id ?? 0, $journal->description ?? ''));
Transaction::where('transaction_journal_id', $journal->id ?? 0)->forceDelete();
TransactionJournal::where('id', $journal->id ?? 0)->forceDelete();
++$this->count;
@@ -205,13 +191,7 @@ class CorrectsUnevenAmount extends Command
$destination = $journal->transactions()->where('amount', '>', 0)->first();
if (null === $destination) {
$this->friendlyError(
sprintf(
'Journal #%d ("%s") has no destination transaction. It will be deleted to maintain database consistency.',
$journal->id ?? 0,
$journal->description ?? ''
)
);
$this->friendlyError(sprintf('Journal #%d ("%s") has no destination transaction. It will be deleted to maintain database consistency.', $journal->id ?? 0, $journal->description ?? ''));
Transaction::where('transaction_journal_id', $journal->id ?? 0)->forceDelete();
TransactionJournal::where('id', $journal->id ?? 0)->forceDelete();
@@ -257,8 +237,8 @@ class CorrectsUnevenAmount extends Command
// source currency = dest foreign currency
// dest amount = source foreign currency
// dest currency = source foreign currency
// Log::debug(sprintf('[a] %s', bccomp(app('steam')->positive($source->amount), app('steam')->positive($destination->foreign_amount))));
// Log::debug(sprintf('[b] %s', bccomp(app('steam')->positive($destination->amount), app('steam')->positive($source->foreign_amount))));
// Log::debug(sprintf('[a] %s', bccomp(\FireflyIII\Support\Facades\Steam::positive($source->amount), \FireflyIII\Support\Facades\Steam::positive($destination->foreign_amount))));
// Log::debug(sprintf('[b] %s', bccomp(\FireflyIII\Support\Facades\Steam::positive($destination->amount), \FireflyIII\Support\Facades\Steam::positive($source->foreign_amount))));
// Log::debug(sprintf('[c] %s', var_export($source->transaction_currency_id === $destination->foreign_currency_id,true)));
// Log::debug(sprintf('[d] %s', var_export((int) $destination->transaction_currency_id ===(int) $source->foreign_currency_id, true)));
return 0 === bccomp(Steam::positive($source->amount), Steam::positive($destination->foreign_amount))
@@ -428,9 +408,9 @@ class CorrectsUnevenAmount extends Command
// // only fix the destination transaction
// $destination->foreign_currency_id = $source->transaction_currency_id;
// $destination->foreign_amount = app('steam')->positive($source->amount);
// $destination->foreign_amount = \FireflyIII\Support\Facades\Steam::positive($source->amount);
// $destination->transaction_currency_id = $source->foreign_currency_id;
// $destination->amount = app('steam')->positive($source->foreign_amount);
// $destination->amount = \FireflyIII\Support\Facades\Steam::positive($source->foreign_amount);
// $destination->balance_dirty = true;
// $source->balance_dirty = true;
// $destination->save();

View File

@@ -86,17 +86,27 @@ class RemovesLinksToDeletedObjects extends Command
private function cleanupJournals(array $journals): void
{
$count = DB::table('tag_transaction_journal')->whereIn('transaction_journal_id', $journals)->delete();
if ($count > 0) {
$this->friendlyInfo(sprintf('Removed %d old relationship(s) between tags and transactions.', $count));
$countTags = 0;
$countBudgets = 0;
$countCategories = 0;
// #11333
foreach (array_chunk($journals, 1337) as $set) {
$countTags += DB::table('tag_transaction_journal')->whereIn('transaction_journal_id', $set)->delete();
$countBudgets += DB::table('budget_transaction_journal')->whereIn('transaction_journal_id', $set)->delete();
$countCategories += DB::table('category_transaction_journal')->whereIn('transaction_journal_id', $set)->delete();
}
$count = DB::table('budget_transaction_journal')->whereIn('transaction_journal_id', $journals)->delete();
if ($count > 0) {
$this->friendlyInfo(sprintf('Removed %d old relationship(s) between budgets and transactions.', $count));
if ($countTags > 0) {
$this->friendlyInfo(sprintf('Removed %d old relationship(s) between tags and transactions.', $countTags));
}
$count = DB::table('category_transaction_journal')->whereIn('transaction_journal_id', $journals)->delete();
if ($count > 0) {
$this->friendlyInfo(sprintf('Removed %d old relationship(s) categories and transactions.', $count));
if ($countBudgets > 0) {
$this->friendlyInfo(sprintf('Removed %d old relationship(s) between budgets and transactions.', $countBudgets));
}
if ($countCategories > 0) {
$this->friendlyInfo(sprintf('Removed %d old relationship(s) categories and transactions.', $countCategories));
}
}

View File

@@ -1,26 +0,0 @@
<?php
namespace FireflyIII\Console\Commands\Integrity;
use Illuminate\Console\Command;
class ReportSkeleton extends Command
{
protected $description = 'DESCRIPTION HERE';
protected $signature = 'firefly-iii:INT_COMMAND';
/**
* Execute the console command.
*
* @return int
*/
public function handle(): int
{
//
$this->warn('Congrats, you found the skeleton command. Boo!');
return 0;
}
}

View File

@@ -48,6 +48,7 @@ class ReportsIntegrity extends Command
$commands = [
'integrity:empty-objects',
'integrity:total-sums',
'integrity:file-permissions',
];
foreach ($commands as $command) {
$this->friendlyLine(sprintf('Now executing %s', $command));

View File

@@ -0,0 +1,74 @@
<?php
declare(strict_types=1);
/*
* ValidatesFilePermissions.php
* Copyright (c) 2025 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\Integrity;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use Illuminate\Console\Command;
class ValidatesFilePermissions extends Command
{
use ShowsFriendlyMessages;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'integrity:file-permissions';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
*/
public function handle(): int
{
$directories = [storage_path('upload')];
$errors = false;
/** @var string $directory */
foreach ($directories as $directory) {
if (!is_dir($directory)) {
$this->friendlyError(sprintf('Directory "%s" cannot found. It is necessary to allow files to be uploaded.', $directory));
$errors = true;
continue;
}
if (!is_writable($directory)) {
$this->friendlyError(sprintf('Directory "%s" is not writeable. Uploading attachments may fail silently.', $directory));
$errors = true;
}
}
if (false === $errors) {
$this->friendlyInfo('All necessary file paths seem to exist, and are writeable.');
}
return self::SUCCESS;
}
}

View File

@@ -120,7 +120,7 @@ class RemovesDatabaseDecryption extends Command
if (null === $original) {
return;
}
$id = (int) $row->id;
$id = (int)$row->id;
$value = '';
try {
@@ -133,7 +133,7 @@ class RemovesDatabaseDecryption extends Command
}
// A separate routine for preferences table:
if ('preferences' === $table) {
if ('preferences' === $table && is_string($value)) {
$this->decryptPreferencesRow($id, $value);
return;

View File

@@ -1,7 +1,7 @@
<?php
/*
* CorrectAccountBalance.php
* RepairsAccountBalances.php
* Copyright (c) 2024 james@firefly-iii.org.
*
* This file is part of Firefly III (https://github.com/firefly-iii).

View File

@@ -137,7 +137,7 @@ class UpgradesLiabilitiesEight extends Command
return false;
}
return (bool) $openingJournal->date->isSameDay($liabilityJournal->date);
return (bool)$openingJournal->date->isSameDay($liabilityJournal->date);
}
private function deleteCreditTransaction(Account $account): void
@@ -148,7 +148,7 @@ class UpgradesLiabilitiesEight extends Command
->where('transaction_journals.transaction_type_id', $liabilityType->id)
->first(['transaction_journals.*'])
;
if (null !== $liabilityJournal) {
if (null !== $liabilityJournal && null !== $liabilityJournal->transactionGroup) {
$group = $liabilityJournal->transactionGroup;
$service = new TransactionGroupDestroyService();
$service->destroy($group);
@@ -192,11 +192,14 @@ class UpgradesLiabilitiesEight extends Command
->where('transactions.account_id', $account->id)->get(['transaction_journals.*'])
;
$service = app(TransactionGroupDestroyService::class);
/** @var TransactionJournal $journal */
foreach ($journals as $journal) {
$service = app(TransactionGroupDestroyService::class);
$service->destroy($journal->transactionGroup);
++$count;
if (null !== $journal->transactionGroup) {
$service->destroy($journal->transactionGroup);
++$count;
}
}
return $count;

View File

@@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
/*
* TriggeredStoredTransactionGroup.php
* Copyright (c) 2025 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\Events\Model\TransactionGroup;
use FireflyIII\Events\Event;
use FireflyIII\Models\TransactionGroup;
use Illuminate\Queue\SerializesModels;
class TriggeredStoredTransactionGroup extends Event
{
use SerializesModels;
/**
* Create a new event instance.
*/
public function __construct(public TransactionGroup $transactionGroup) {}
}

View File

@@ -42,7 +42,6 @@ use Illuminate\Validation\ValidationException as LaravelValidationException;
use Laravel\Passport\Exceptions\OAuthServerException as LaravelOAuthException;
use League\OAuth2\Server\Exception\OAuthServerException;
use Override;
use Sentry\Laravel\Integration;
use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
@@ -50,6 +49,7 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;
use FireflyIII\Support\Facades\Steam;
use function Safe\json_encode;
use function Safe\parse_url;
@@ -83,14 +83,7 @@ class Handler extends ExceptionHandler
* Register the exception handling callbacks for the application.
*/
#[Override]
public function register(): void
{
if (true === config('firefly.report_errors_online')) {
$this->reportable(function (Throwable $e): void {
Integration::captureUnhandledException($e);
});
}
}
public function register(): void {}
/**
* Render an exception into an HTTP response. It's complex but lucky for us, we never use it because
@@ -287,7 +280,7 @@ class Handler extends ExceptionHandler
protected function invalid($request, LaravelValidationException $exception): \Illuminate\Http\Response|JsonResponse|RedirectResponse
{
// protect against open redirect when submitting invalid forms.
$previous = app('steam')->getSafePreviousUrl();
$previous = Steam::getSafePreviousUrl();
$redirect = $this->getRedirectUrl($exception);
return redirect($redirect ?? $previous)

View File

@@ -34,6 +34,7 @@ use FireflyIII\Services\Internal\Update\AccountUpdateService;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Log;
use FireflyIII\Support\Facades\Steam;
/**
* Class TransactionFactory
@@ -58,10 +59,10 @@ class TransactionFactory
$foreignAmount = null;
}
if (null !== $foreignAmount) {
$foreignAmount = app('steam')->negative($foreignAmount);
$foreignAmount = Steam::negative($foreignAmount);
}
return $this->create(app('steam')->negative($amount), $foreignAmount);
return $this->create(Steam::negative($amount), $foreignAmount);
}
/**
@@ -170,10 +171,10 @@ class TransactionFactory
$foreignAmount = null;
}
if (null !== $foreignAmount) {
$foreignAmount = app('steam')->positive($foreignAmount);
$foreignAmount = Steam::positive($foreignAmount);
}
return $this->create(app('steam')->positive($amount), $foreignAmount);
return $this->create(Steam::positive($amount), $foreignAmount);
}
public function setAccount(Account $account): void

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Generator\Chart\Basic;
use FireflyIII\Support\ChartColour;
use FireflyIII\Support\Facades\Steam;
/**
* Class ChartJsGenerator.
@@ -56,7 +57,7 @@ class ChartJsGenerator implements GeneratorInterface
$index = 0;
foreach ($data as $key => $valueArray) {
// make larger than 0
$chartData['datasets'][0]['data'][] = app('steam')->positive((string) $valueArray['amount']);
$chartData['datasets'][0]['data'][] = Steam::positive((string) $valueArray['amount']);
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
$chartData['datasets'][0]['currency_symbol'][] = $valueArray['currency_symbol'];
$chartData['labels'][] = $key;
@@ -163,7 +164,7 @@ class ChartJsGenerator implements GeneratorInterface
$index = 0;
foreach ($data as $key => $value) {
// make larger than 0
$chartData['datasets'][0]['data'][] = app('steam')->positive((string) $value);
$chartData['datasets'][0]['data'][] = Steam::positive((string) $value);
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
$chartData['labels'][] = $key;

View File

@@ -153,13 +153,13 @@ class MonthReportGenerator implements ReportGeneratorInterface
// make sure amount is in the right "direction".
if ($account->id === $journal['destination_account_id']) {
$transactionAmount = app('steam')->positive($journal['amount']);
$transactionAmount = Steam::positive($journal['amount']);
}
if ($currency->id === $journal['foreign_currency_id']) {
$transactionAmount = $journal['foreign_amount'];
if ($account->id === $journal['destination_account_id']) {
$transactionAmount = app('steam')->positive($journal['foreign_amount']);
$transactionAmount = Steam::positive($journal['foreign_amount']);
}
}
@@ -175,7 +175,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
$journals[$index]['payment_date'] = $journalRepository->getMetaDateById($journal['transaction_journal_id'], 'payment_date');
$journals[$index]['invoice_date'] = $journalRepository->getMetaDateById($journal['transaction_journal_id'], 'invoice_date');
}
$locale = app('steam')->getLocale();
$locale = Steam::getLocale();
// call is correct.
Log::debug(sprintf('getAuditReport end: Call finalAccountBalance with date/time "%s"', $this->end->toIso8601String()));

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Events;
use FireflyIII\Enums\WebhookTrigger;
use FireflyIII\Events\Model\TransactionGroup\TriggeredStoredTransactionGroup;
use FireflyIII\Events\RequestedSendWebhookMessages;
use FireflyIII\Events\StoredTransactionGroup;
use FireflyIII\Generator\Webhook\MessageGeneratorInterface;
@@ -51,6 +52,12 @@ class StoredGroupEventHandler
$this->removePeriodStatistics($event);
}
public function triggerRulesManually(TriggeredStoredTransactionGroup $event): void
{
$newEvent = new StoredTransactionGroup($event->transactionGroup, true, false);
$this->processRules($newEvent);
}
/**
* This method grabs all the users rules and processes them.
*/

View File

@@ -53,8 +53,13 @@ class WebhookEventHandler
)->splice(0, 5)
;
Log::debug(sprintf('Found %d webhook message(s) ready to be send.', $messages->count()));
/** @var WebhookMessage $message */
foreach ($messages as $message) {
if (false === $message->sent) {
// set it to "sent" right away!
$message->sent = true;
$message->save();
Log::debug(sprintf('Send message #%d', $message->id));
SendWebhookMessage::dispatch($message)->afterResponse();
}

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Helpers\Collector\Extensions;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use FireflyIII\Support\Facades\Steam;
/**
* Trait AmountCollection
@@ -39,7 +40,7 @@ trait AmountCollection
{
$this->query->where(
static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$q->where('source.amount', app('steam')->negative($amount));
$q->where('source.amount', Steam::negative($amount));
}
);
@@ -50,7 +51,7 @@ trait AmountCollection
{
$this->query->where(
static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$q->where('source.amount', '!=', app('steam')->negative($amount));
$q->where('source.amount', '!=', Steam::negative($amount));
}
);
@@ -64,7 +65,7 @@ trait AmountCollection
{
$this->query->where(
static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$q->where('destination.amount', '<=', app('steam')->positive($amount));
$q->where('destination.amount', '<=', Steam::positive($amount));
}
);
@@ -78,7 +79,7 @@ trait AmountCollection
{
$this->query->where(
static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$q->where('destination.amount', '>=', app('steam')->positive($amount));
$q->where('destination.amount', '>=', Steam::positive($amount));
}
);
@@ -93,7 +94,7 @@ trait AmountCollection
$this->query->where(
static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$q->whereNotNull('source.foreign_amount');
$q->where('source.foreign_amount', app('steam')->negative($amount));
$q->where('source.foreign_amount', Steam::negative($amount));
}
);
@@ -108,7 +109,7 @@ trait AmountCollection
$this->query->where(
static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$q->whereNull('source.foreign_amount');
$q->orWhere('source.foreign_amount', '!=', app('steam')->negative($amount));
$q->orWhere('source.foreign_amount', '!=', Steam::negative($amount));
}
);
@@ -123,7 +124,7 @@ trait AmountCollection
$this->query->where(
static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$q->whereNotNull('destination.foreign_amount');
$q->where('destination.foreign_amount', '<=', app('steam')->positive($amount));
$q->where('destination.foreign_amount', '<=', Steam::positive($amount));
}
);
@@ -138,7 +139,7 @@ trait AmountCollection
$this->query->where(
static function (EloquentBuilder $q) use ($amount): void { // @phpstan-ignore-line
$q->whereNotNull('destination.foreign_amount');
$q->where('destination.foreign_amount', '>=', app('steam')->positive($amount));
$q->where('destination.foreign_amount', '>=', Steam::positive($amount));
}
);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
@@ -141,18 +142,18 @@ class CreateController extends Controller
$data = $request->getAccountData();
$account = $this->repository->store($data);
$request->session()->flash('success', (string) trans('firefly.stored_new_account', ['name' => $account->name]));
app('preferences')->mark();
Preferences::mark();
Log::channel('audit')->info('Stored new account.', $data);
// update preferences if necessary:
$frontpage = app('preferences')->get('frontpageAccounts', [])->data;
$frontpage = Preferences::get('frontpageAccounts', [])->data;
if (!is_array($frontpage)) {
$frontpage = [];
}
if (AccountTypeEnum::ASSET->value === $account->accountType->type) {
$frontpage[] = $account->id;
app('preferences')->set('frontpageAccounts', $frontpage);
Preferences::set('frontpageAccounts', $frontpage);
}
// store attachment(s):

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
@@ -101,7 +102,7 @@ class DeleteController extends Controller
$this->repository->destroy($account, $moveTo);
$request->session()->flash('success', (string) trans(sprintf('firefly.%s_deleted', $typeName), ['name' => $name]));
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('accounts.delete.url'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\AccountFormRequest;
@@ -37,6 +38,7 @@ use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use FireflyIII\Support\Facades\Steam;
/**
* Class EditController
@@ -147,9 +149,9 @@ class EditController extends Controller
'BIC' => $repository->getMetaValue($account, 'BIC'),
'opening_balance_date' => substr((string) $openingBalanceDate, 0, 10),
'liability_type_id' => $account->account_type_id,
'opening_balance' => app('steam')->bcround($openingBalanceAmount, $currency->decimal_places),
'opening_balance' => Steam::bcround($openingBalanceAmount, $currency->decimal_places),
'liability_direction' => $this->repository->getMetaValue($account, 'liability_direction'),
'virtual_balance' => app('steam')->bcround($virtualBalance, $currency->decimal_places),
'virtual_balance' => Steam::bcround($virtualBalance, $currency->decimal_places),
'currency_id' => $currency->id,
'include_net_worth' => $hasOldInput ? (bool) $request->old('include_net_worth') : $includeNetWorth,
'interest' => $repository->getMetaValue($account, 'interest'),
@@ -205,7 +207,7 @@ class EditController extends Controller
$redirect = redirect(route('accounts.edit', [$account->id]))->withInput(['return_to_edit' => 1]);
}
app('preferences')->mark();
Preferences::mark();
return $redirect;
}

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
@@ -81,7 +82,7 @@ class IndexController extends Controller
$collection = $this->repository->getInactiveAccountsByType($types);
$total = $collection->count();
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$accounts = $collection->slice(($page - 1) * $pageSize, $pageSize);
unset($collection);
@@ -153,7 +154,7 @@ class IndexController extends Controller
$collection = $this->repository->getActiveAccountsByType($types);
$total = $collection->count();
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$accounts = $collection->slice(($page - 1) * $pageSize, $pageSize);
$inactiveCount = $this->repository->getInactiveAccountsByType($types)->count();

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Facades\Navigation;
use Illuminate\Support\Facades\Log;
use Carbon\Carbon;
@@ -175,7 +176,7 @@ class ReconcileController extends Controller
$result = $this->createReconciliation($account, $start, $end, $data['difference']);
}
Log::debug('End of routine.');
app('preferences')->mark();
Preferences::mark();
if ('' === $result) {
session()->flash('success', (string) trans('firefly.reconciliation_stored'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Account;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
@@ -113,7 +114,7 @@ class ShowController extends Controller
$today = today(config('app.timezone'));
$subTitleIcon = config(sprintf('firefly.subIconsByIdentifier.%s', $account->accountType->type));
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$accountCurrency = $this->repository->getAccountCurrency($account);
$currency = $accountCurrency ?? $this->primaryCurrency;
$fStart = $start->isoFormat($this->monthAndDayFormat);
@@ -199,7 +200,7 @@ class ShowController extends Controller
$start = $this->repository->oldestJournalDate($account) ?? today(config('app.timezone'))->startOfMonth();
$subTitleIcon = config('firefly.subIconsByIdentifier.'.$account->accountType->type);
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$currency = $this->repository->getAccountCurrency($account) ?? $this->primaryCurrency;
$subTitle = (string) trans('firefly.all_journals_for_account', ['name' => $account->name]);
$periods = new Collection();

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Http\Requests\ConfigurationRequest;
@@ -95,7 +96,7 @@ class ConfigurationController extends Controller
// flash message
session()->flash('success', (string) trans('firefly.configuration_updated'));
app('preferences')->mark();
Preferences::mark();
return redirect()->route('settings.configuration.index');
}

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser;
use Illuminate\Contracts\View\Factory;
@@ -59,7 +60,7 @@ class HomeController extends Controller
$title = (string) trans('firefly.system_settings');
$mainTitleIcon = 'fa-hand-spock-o';
$email = auth()->user()->email;
$pref = app('preferences')->get('remote_guard_alt_email');
$pref = Preferences::get('remote_guard_alt_email');
if (null !== $pref && is_string($pref->data)) {
$email = $pref->data;
}

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Http\Requests\LinkTypeFormRequest;
@@ -125,7 +126,7 @@ class LinkController extends Controller
$this->repository->destroy($linkType, $moveTo);
$request->session()->flash('success', (string) trans('firefly.deleted_link_type', ['name' => $name]));
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('link-types.delete.url'));
}
@@ -245,7 +246,7 @@ class LinkController extends Controller
Log::channel('audit')->info(sprintf('User update link type #%d.', $linkType->id), $data);
$request->session()->flash('success', (string) trans('firefly.updated_link_type', ['name' => $linkType->name]));
app('preferences')->mark();
Preferences::mark();
$redirect = redirect($this->getPreviousUrl('link-types.edit.url'));
if (1 === (int) $request->get('return_to_edit')) {
// set value so edit routine will not overwrite URL:

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Admin;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log;
use FireflyIII\Events\Admin\InvitationCreated;
use FireflyIII\Exceptions\FireflyException;
@@ -242,7 +243,7 @@ class UserController extends Controller
$this->repository->updateEmail($user, $data['email']);
session()->flash('success', (string) trans('firefly.updated_user', ['email' => $user->email]));
app('preferences')->mark();
Preferences::mark();
$redirect = redirect($this->getPreviousUrl('users.edit.url'));
if (1 === (int) $request->get('return_to_edit')) {
session()->put('users.edit.fromUpdate', true);

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Requests\AttachmentFormRequest;
use FireflyIII\Models\Attachment;
@@ -85,7 +86,7 @@ class AttachmentController extends Controller
$this->repository->destroy($attachment);
$request->session()->flash('success', (string) trans('firefly.attachment_deleted', ['name' => $name]));
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('attachments.delete.url'));
}
@@ -175,7 +176,7 @@ class AttachmentController extends Controller
$this->repository->update($attachment, $data);
$request->session()->flash('success', (string) trans('firefly.attachment_updated', ['name' => $attachment->filename]));
app('preferences')->mark();
Preferences::mark();
$redirect = redirect($this->getPreviousUrl('attachments.edit.url'));
if (1 === (int) $request->get('return_to_edit')) {

View File

@@ -31,6 +31,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Providers\RouteServiceProvider;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\Support\Facades\Steam;
use FireflyIII\User;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
@@ -132,7 +133,7 @@ class LoginController extends Controller
return $this->sendLoginResponse($request);
}
Log::warning('Login attempt failed.');
$username = (string) $request->get($this->username());
$username = (string)$request->get($this->username());
$user = $this->repository->findByEmail($username);
if (!$user instanceof User) {
// send event to owner.
@@ -228,7 +229,7 @@ class LoginController extends Controller
$count = DB::table('users')->count();
$guard = config('auth.defaults.guard');
$title = (string) trans('firefly.login_page_title');
$title = (string)trans('firefly.login_page_title');
if (0 === $count && 'web' === $guard) {
return redirect(route('register'));
@@ -260,4 +261,23 @@ class LoginController extends Controller
return view('auth.login', ['allowRegistration' => $allowRegistration, 'email' => $email, 'remember' => $remember, 'allowReset' => $allowReset, 'title' => $title, 'usernameField' => $usernameField]);
}
/**
* Send the response after the user was authenticated.
*
* @return JsonResponse|RedirectResponse
*/
protected function sendLoginResponse(Request $request)
{
$request->session()->regenerate();
$this->clearLoginAttempts($request);
if ($response = $this->authenticated($request, $this->guard()->user())) {
return $response;
}
$path = Steam::getSafeUrl(session()->pull('url.intended', route('index')), route('index'));
Log::debug(sprintf('SafeURL is %s', $path));
return $request->wantsJson() ? new JsonResponse([], 204) : redirect()->to($path);
}
}

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Auth;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Events\Security\MFABackupFewLeft;
use FireflyIII\Events\Security\MFABackupNoLeft;
@@ -65,7 +66,7 @@ class TwoFactorController extends Controller
public function submitMFA(Request $request): Redirector|RedirectResponse
{
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$mfaHistory = Preferences::get('mfa_history', [])->data;
$mfaCode = (string) $request->get('one_time_password');
// is in history? then refuse to use it.
@@ -149,7 +150,7 @@ class TwoFactorController extends Controller
private function filterMFAHistory(): void
{
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$mfaHistory = Preferences::get('mfa_history', [])->data;
$newHistory = [];
$now = Carbon::now()->getTimestamp();
foreach ($mfaHistory as $entry) {
@@ -162,20 +163,20 @@ class TwoFactorController extends Controller
];
}
}
app('preferences')->set('mfa_history', $newHistory);
Preferences::set('mfa_history', $newHistory);
}
private function addToMFAFailureCounter(): void
{
$preference = (int) app('preferences')->get('mfa_failure_count', 0)->data;
$preference = (int) Preferences::get('mfa_failure_count', 0)->data;
++$preference;
Log::channel('audit')->info(sprintf('MFA failure count is set to %d.', $preference));
app('preferences')->set('mfa_failure_count', $preference);
Preferences::set('mfa_failure_count', $preference);
}
private function getMFAFailureCounter(): int
{
$value = (int) app('preferences')->get('mfa_failure_count', 0)->data;
$value = (int) Preferences::get('mfa_failure_count', 0)->data;
Log::channel('audit')->info(sprintf('MFA failure count is %d.', $value));
return $value;
@@ -184,20 +185,20 @@ class TwoFactorController extends Controller
private function addToMFAHistory(string $mfaCode): void
{
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$mfaHistory = Preferences::get('mfa_history', [])->data;
$entry = [
'time' => Carbon::now()->getTimestamp(),
'code' => $mfaCode,
];
$mfaHistory[] = $entry;
app('preferences')->set('mfa_history', $mfaHistory);
Preferences::set('mfa_history', $mfaHistory);
$this->filterMFAHistory();
}
private function resetMFAFailureCounter(): void
{
app('preferences')->set('mfa_failure_count', 0);
Preferences::set('mfa_failure_count', 0);
Log::channel('audit')->info('MFA failure count is set to zero.');
}
@@ -206,7 +207,7 @@ class TwoFactorController extends Controller
*/
private function isBackupCode(string $mfaCode): bool
{
$list = app('preferences')->get('mfa_recovery', [])->data;
$list = Preferences::get('mfa_recovery', [])->data;
if (!is_array($list)) {
$list = [];
}
@@ -219,7 +220,7 @@ class TwoFactorController extends Controller
*/
private function removeFromBackupCodes(string $mfaCode): void
{
$list = app('preferences')->get('mfa_recovery', [])->data;
$list = Preferences::get('mfa_recovery', [])->data;
if (!is_array($list)) {
$list = [];
}
@@ -238,6 +239,6 @@ class TwoFactorController extends Controller
event(new MFABackupNoLeft($user));
}
app('preferences')->set('mfa_recovery', $newList);
Preferences::set('mfa_recovery', $newList);
}
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Bill;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
@@ -105,7 +106,7 @@ class CreateController extends Controller
Log::channel('audit')->info('Stored new bill.', $billData);
$request->session()->flash('success', (string) trans('firefly.stored_new_bill', ['name' => $bill->name]));
app('preferences')->mark();
Preferences::mark();
/** @var null|array $files */
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Bill;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
@@ -83,7 +84,7 @@ class DeleteController extends Controller
$this->repository->destroy($bill);
$request->session()->flash('success', (string) trans('firefly.deleted_bill', ['name' => $name]));
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('bills.delete.url'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Bill;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\BillUpdateRequest;
@@ -34,6 +35,7 @@ use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use FireflyIII\Support\Facades\Steam;
/**
* Class EditController
@@ -83,8 +85,8 @@ class EditController extends Controller
$this->rememberPreviousUrl('bills.edit.url');
}
$bill->amount_min = app('steam')->bcround($bill->amount_min, $bill->transactionCurrency->decimal_places);
$bill->amount_max = app('steam')->bcround($bill->amount_max, $bill->transactionCurrency->decimal_places);
$bill->amount_min = Steam::bcround($bill->amount_min, $bill->transactionCurrency->decimal_places);
$bill->amount_max = Steam::bcround($bill->amount_max, $bill->transactionCurrency->decimal_places);
$rules = $this->repository->getRulesForBill($bill);
// code to handle active-checkboxes
@@ -116,7 +118,7 @@ class EditController extends Controller
Log::channel('audit')->info(sprintf('Updated bill #%d.', $bill->id), $billData);
$request->session()->flash('success', (string) trans('firefly.updated_bill', ['name' => $bill->name]));
app('preferences')->mark();
Preferences::mark();
/** @var null|array $files */
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Bill;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Facades\Navigation;
use Carbon\Carbon;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
@@ -106,7 +107,7 @@ class ShowController extends Controller
$ruleEngine->fire();
$request->session()->flash('success', trans_choice('firefly.rescanned_bill', $total));
app('preferences')->mark();
Preferences::mark();
return redirect(route('bills.show', [$bill->id]));
}
@@ -132,7 +133,7 @@ class ShowController extends Controller
$end = session('end');
$year = $start->year;
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$yearAverage = $this->repository->getYearAverage($bill, $start);
$overallAverage = $this->repository->getOverallAverage($bill);
$manager = new Manager();

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
@@ -43,6 +44,7 @@ use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Collection;
use Illuminate\View\View;
use FireflyIII\Support\Facades\Steam;
/**
* Class BudgetLimitController
@@ -255,7 +257,7 @@ class BudgetLimitController extends Controller
$limit = $this->blRepository->update($budgetLimit, ['amount' => $amount, 'notes' => $notes]);
app('preferences')->mark();
Preferences::mark();
$array = $limit->toArray();
$spentArr = $this->opsRepository->sumExpenses(
@@ -273,7 +275,7 @@ class BudgetLimitController extends Controller
$array['left_per_day'] = 0 === $daysLeft ? bcadd((string) $array['spent'], (string) $array['amount']) : bcdiv(bcadd((string) $array['spent'], (string) $array['amount']), $array['days_left']);
// left per day formatted.
$array['amount'] = app('steam')->bcround($limit['amount'], $limit->transactionCurrency->decimal_places);
$array['amount'] = Steam::bcround($limit['amount'], $limit->transactionCurrency->decimal_places);
$array['left_per_day_formatted'] = app('amount')->formatAnything($limit->transactionCurrency, $array['left_per_day']);
if ('true' === $request->get('redirect')) {
return redirect(route('budgets.index'));

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\AutoBudgetType;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -116,7 +117,7 @@ class CreateController extends Controller
$budget = $this->repository->store($data);
$this->repository->cleanupBudgets();
$request->session()->flash('success', (string) trans('firefly.stored_new_budget', ['name' => $budget->name]));
app('preferences')->mark();
Preferences::mark();
Log::channel('audit')->info('Stored new budget.', $data);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
@@ -82,7 +83,7 @@ class DeleteController extends Controller
$name = $budget->name;
$this->repository->destroy($budget);
$request->session()->flash('success', (string) trans('firefly.deleted_budget', ['name' => $name]));
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('budgets.delete.url'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\AutoBudgetType;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
@@ -36,6 +37,7 @@ use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use FireflyIII\Support\Facades\Steam;
/**
* Class EditController
@@ -103,7 +105,7 @@ class EditController extends Controller
$amount = '0';
}
$amount = (string) $amount;
$preFilled['auto_budget_amount'] = app('steam')->bcround($amount, $autoBudget->transactionCurrency->decimal_places);
$preFilled['auto_budget_amount'] = Steam::bcround($amount, $autoBudget->transactionCurrency->decimal_places);
}
// put previous url in session if not redirect from store (not "return_to_edit").
@@ -126,7 +128,7 @@ class EditController extends Controller
$request->session()->flash('success', (string) trans('firefly.updated_budget', ['name' => $budget->name]));
$this->repository->cleanupBudgets();
app('preferences')->mark();
Preferences::mark();
Log::channel('audit')->info(sprintf('Updated budget #%d.', $budget->id), $data);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Facades\Navigation;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
@@ -45,6 +46,7 @@ use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use FireflyIII\Support\Facades\Steam;
/**
* Class IndexController
@@ -121,6 +123,9 @@ class IndexController extends Controller
$availableBudgets = $this->getAllAvailableBudgets($start, $end);
// get all active budgets:
$budgets = $this->getAllBudgets($start, $end, $currencies, $this->primaryCurrency);
// echo '<pre>';
// var_dump($budgets[0]);exit;
$sums = $this->getSums($budgets);
// get budgeted for default currency:
@@ -199,7 +204,7 @@ class IndexController extends Controller
foreach ($budgetLimits as $limit) {
Log::debug(sprintf('Working on budget limit #%d', $limit->id));
$currency = $limit->transactionCurrency ?? $primaryCurrency;
$amount = app('steam')->bcround($limit->amount, $currency->decimal_places);
$amount = Steam::bcround($limit->amount, $currency->decimal_places);
$array['budgeted'][] = [
'id' => $limit->id,
'amount' => $amount,
@@ -308,7 +313,7 @@ class IndexController extends Controller
$repository->setBudgetOrder($budget, $index + 1);
}
}
app('preferences')->mark();
Preferences::mark();
return response()->json(['OK']);
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Budget;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\FireflyException;
@@ -98,7 +99,7 @@ class ShowController extends Controller
$firstDate = $first instanceof TransactionJournal ? $first->date : $start;
$periods = $this->getNoModelPeriodOverview('budget', $firstDate, $end);
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
@@ -126,7 +127,7 @@ class ShowController extends Controller
$start = $first instanceof TransactionJournal ? $first->date : new Carbon();
$end = today(config('app.timezone'));
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
@@ -153,7 +154,7 @@ class ShowController extends Controller
$allStart = session('first', today(config('app.timezone'))->startOfYear());
$allEnd = today();
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$limits = $this->getLimits($budget, $allStart, $allEnd);
$repetition = null;
$attachments = $this->repository->getAttachments($budget);
@@ -190,7 +191,7 @@ class ShowController extends Controller
$currencySymbol = $budgetLimit->transactionCurrency->symbol;
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$subTitle = trans(
'firefly.budget_in_period',
[

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
@@ -92,7 +93,7 @@ class CreateController extends Controller
$category = $this->repository->store($data);
$request->session()->flash('success', (string) trans('firefly.stored_category', ['name' => $category->name]));
app('preferences')->mark();
Preferences::mark();
// store attachment(s):
/** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
@@ -83,7 +84,7 @@ class DeleteController extends Controller
$this->repository->destroy($category);
$request->session()->flash('success', (string) trans('firefly.deleted_category', ['name' => $name]));
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('categories.delete.url'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\CategoryFormRequest;
@@ -94,7 +95,7 @@ class EditController extends Controller
$this->repository->update($category, $data);
$request->session()->flash('success', (string) trans('firefly.updated_category', ['name' => $category->name]));
app('preferences')->mark();
Preferences::mark();
// store new attachment(s):
/** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
@@ -72,7 +73,7 @@ class IndexController extends Controller
public function index(Request $request): Factory|\Illuminate\Contracts\View\View
{
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$collection = $this->repository->getCategories();
$total = $collection->count();
$collection = $collection->slice(($page - 1) * $pageSize, $pageSize);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\FireflyException;
@@ -86,7 +87,7 @@ class NoCategoryController extends Controller
/** @var Carbon $start */
/** @var Carbon $end */
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$subTitle = trans('firefly.without_category_between', ['start' => $start->isoFormat($this->monthAndDayFormat), 'end' => $end->isoFormat($this->monthAndDayFormat)]);
$first = $this->journalRepos->firstNull()->date ?? clone $start;
$periods = $this->getNoModelPeriodOverview('category', $first, $end);
@@ -122,7 +123,7 @@ class NoCategoryController extends Controller
$end = null;
$periods = new Collection();
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
Log::debug('Start of noCategory()');
$subTitle = (string) trans('firefly.all_journals_without_category');
$first = $this->journalRepos->firstNull();

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Category;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
@@ -86,7 +87,7 @@ class ShowController extends Controller
$subTitleIcon = 'fa-bookmark';
$page = (int) $request->get('page');
$attachments = $this->repository->getAttachments($category);
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$oldest = $this->repository->firstUseDate($category) ?? today(config('app.timezone'))->startOfYear();
$periods = $this->getCategoryPeriodOverview($category, $oldest, $end);
$path = route('categories.show', [$category->id, $start->format('Y-m-d'), $end->format('Y-m-d')]);
@@ -125,7 +126,7 @@ class ShowController extends Controller
// default values:
$subTitleIcon = 'fa-bookmark';
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$start = null;
$end = null;
$periods = new Collection();

View File

@@ -31,6 +31,7 @@ use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Support\CacheProperties;
use Illuminate\Http\JsonResponse;
use FireflyIII\Support\Facades\Steam;
/**
* Class BillController.
@@ -113,7 +114,7 @@ class BillController extends Controller
if ($cache->has()) {
return response()->json($cache->get());
}
$locale = app('steam')->getLocale();
$locale = Steam::getLocale();
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);

View File

@@ -44,6 +44,7 @@ use FireflyIII\Support\Http\Controllers\DateCalculation;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use FireflyIII\Support\Facades\Steam;
/**
* Class BudgetController.
@@ -166,7 +167,7 @@ class BudgetController extends Controller
if ($cache->has()) {
return response()->json($cache->get());
}
$locale = app('steam')->getLocale();
$locale = Steam::getLocale();
$entries = [];
$amount = $budgetLimit->amount ?? '0';
$budgetCollection = new Collection()->push($budget);
@@ -531,13 +532,13 @@ class BudgetController extends Controller
// get budget limit in this period for this currency.
$limit = $this->blRepository->find($budget, $currency, $currentStart, $currentEnd);
if ($limit instanceof BudgetLimit) {
$chartData[1]['entries'][$title] = app('steam')->bcround($limit->amount, $currency->decimal_places);
$chartData[1]['entries'][$title] = Steam::bcround($limit->amount, $currency->decimal_places);
}
// get spent amount in this period for this currency.
$sum = $this->opsRepository->sumExpenses($currentStart, $currentEnd, $accounts, new Collection()->push($budget), $currency);
$amount = app('steam')->positive($sum[$currency->id]['sum'] ?? '0');
$chartData[0]['entries'][$title] = app('steam')->bcround($amount, $currency->decimal_places);
$amount = Steam::positive($sum[$currency->id]['sum'] ?? '0');
$chartData[0]['entries'][$title] = Steam::bcround($amount, $currency->decimal_places);
$currentStart = clone $currentEnd;
$currentStart->addDay()->startOfDay();
@@ -574,8 +575,8 @@ class BudgetController extends Controller
$currentEnd = Navigation::endOfPeriod($currentStart, $preferredRange);
$title = $currentStart->isoFormat($titleFormat);
$sum = $this->nbRepository->sumExpenses($currentStart, $currentEnd, $accounts, $currency);
$amount = app('steam')->positive($sum[$currency->id]['sum'] ?? '0');
$chartData[$title] = app('steam')->bcround($amount, $currency->decimal_places);
$amount = Steam::positive($sum[$currency->id]['sum'] ?? '0');
$chartData[$title] = Steam::bcround($amount, $currency->decimal_places);
$currentStart = Navigation::addPeriod($currentStart, $preferredRange, 0);
}

View File

@@ -33,6 +33,7 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use FireflyIII\Support\CacheProperties;
use FireflyIII\Support\Http\Controllers\DateCalculation;
use Illuminate\Http\JsonResponse;
use FireflyIII\Support\Facades\Steam;
/**
* Class PiggyBankController.
@@ -70,7 +71,7 @@ class PiggyBankController extends Controller
}
$set = $repository->getEvents($piggyBank);
$set = $set->reverse();
$locale = app('steam')->getLocale();
$locale = Steam::getLocale();
// get first event or start date of piggy bank or today
$startDate = $piggyBank->start_date ?? today(config('app.timezone'));

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use Carbon\Exceptions\InvalidFormatException;
use Exception;
@@ -146,7 +147,7 @@ class HomeController extends Controller
$count = $repository->count($types);
$subTitle = (string) trans('firefly.welcome_back');
$transactions = [];
$frontpage = app('preferences')->getFresh('frontpageAccounts', $repository->getAccountsByType([AccountTypeEnum::ASSET->value])->pluck('id')->toArray());
$frontpage = Preferences::getFresh('frontpageAccounts', $repository->getAccountsByType([AccountTypeEnum::ASSET->value])->pluck('id')->toArray());
$frontpageArray = $frontpage->data;
if (!is_array($frontpageArray)) {
$frontpageArray = [];

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Exceptions\FireflyException;
@@ -104,10 +105,10 @@ class JavascriptController extends Controller
if ($account instanceof Account) {
$currency = $repository->getAccountCurrency($account) ?? $this->primaryCurrency;
}
$locale = app('steam')->getLocale();
$locale = Steam::getLocale();
$accounting = app('amount')->getJsConfig();
$accounting['frac_digits'] = $currency->decimal_places;
$pref = app('preferences')->get('language', config('firefly.default_language', 'en_US'));
$pref = Preferences::get('language', config('firefly.default_language', 'en_US'));
$lang = $pref->data;
$dateRange = $this->getDateRangeConfig();
$uid = substr(hash('sha256', sprintf('%s-%s-%s', (string) config('app.key'), auth()->user()->id, auth()->user()->email)), 0, 12);

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Json;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Support\Http\Controllers\GetConfigurationData;
@@ -98,8 +99,8 @@ class IntroController extends Controller
$key = sprintf('%s_%s', $key, $specialPage);
}
Log::debug(sprintf('Going to mark the following route as NOT done: %s with special "%s" (%s)', $route, $specialPage, $key));
app('preferences')->set($key, false);
app('preferences')->mark();
Preferences::set($key, false);
Preferences::mark();
return response()->json(['message' => (string) trans('firefly.intro_boxes_after_refresh')]);
}
@@ -115,7 +116,7 @@ class IntroController extends Controller
$key = sprintf('%s_%s', $key, $specialPage);
}
Log::debug(sprintf('Going to mark the following route as done: %s with special "%s" (%s)', $route, $specialPage, $key));
app('preferences')->set($key, true);
Preferences::set($key, true);
return response()->json(['result' => sprintf('Reported demo watched for route "%s" (%s): %s.', $route, $specialPage, $key)]);
}

View File

@@ -278,9 +278,9 @@ class ReconcileController extends Controller
}
if ($inverse) {
$journal['amount'] = app('steam')->positive($journal['amount']);
$journal['amount'] = Steam::positive($journal['amount']);
if (null !== $journal['foreign_amount']) {
$journal['foreign_amount'] = app('steam')->positive($journal['foreign_amount']);
$journal['foreign_amount'] = Steam::positive($journal['foreign_amount']);
}
}

View File

@@ -33,6 +33,7 @@ use FireflyIII\Models\RecurrenceRepetition;
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use FireflyIII\Support\Facades\Steam;
/**
* Class RecurrenceController
@@ -167,7 +168,7 @@ class RecurrenceController extends Controller
}
$date->startOfDay();
$preSelected = (string) $request->get('pre_select');
$locale = app('steam')->getLocale();
$locale = Steam::getLocale();
Log::debug(sprintf('date = %s, today = %s. date > today? %s', $date->toAtomString(), $today->toAtomString(), var_export($date > $today, true)));
Log::debug(sprintf('past = true? %s', var_export('true' === (string) $request->get('past'), true)));

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Http\Requests\NewUserFormRequest;
use FireflyIII\Models\TransactionCurrency;
@@ -92,7 +93,7 @@ class NewUserController extends Controller
}
// set language preference:
app('preferences')->set('language', $language);
Preferences::set('language', $language);
// Store currency preference from input:
$currency = $currencyRepository->find((int) $request->input('amount_currency_id_bank_balance'));
@@ -111,10 +112,10 @@ class NewUserController extends Controller
// store frontpage preferences:
$accounts = $this->repository->getAccountsByType([AccountTypeEnum::ASSET->value])->pluck('id')->toArray();
app('preferences')->set('frontpageAccounts', $accounts);
Preferences::set('frontpageAccounts', $accounts);
// mark.
app('preferences')->mark();
Preferences::mark();
// set default optional fields:
$visibleFields = [
@@ -128,10 +129,10 @@ class NewUserController extends Controller
'notes' => true,
'attachments' => true,
];
app('preferences')->set('transaction_journal_optional_fields', $visibleFields);
Preferences::set('transaction_journal_optional_fields', $visibleFields);
session()->flash('success', (string) trans('firefly.stored_new_accounts_new_user'));
app('preferences')->mark();
Preferences::mark();
return redirect(route('index'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\ObjectGroup;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\ObjectGroup;
use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface;
@@ -77,7 +78,7 @@ class DeleteController extends Controller
public function destroy(ObjectGroup $objectGroup): RedirectResponse
{
session()->flash('success', (string) trans('firefly.deleted_object_group', ['title' => $objectGroup->title]));
app('preferences')->mark();
Preferences::mark();
$this->repository->destroy($objectGroup);
return redirect($this->getPreviousUrl('object-groups.delete.url'));

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\ObjectGroup;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\ObjectGroupFormRequest;
use FireflyIII\Models\ObjectGroup;
@@ -87,7 +88,7 @@ class EditController extends Controller
$piggyBank = $this->repository->update($objectGroup, $data);
session()->flash('success', (string) trans('firefly.updated_object_group', ['title' => $objectGroup->title]));
app('preferences')->mark();
Preferences::mark();
$redirect = redirect($this->getPreviousUrl('object-groups.edit.url'));

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Account;
@@ -167,7 +168,7 @@ class AmountController extends Controller
}
if (0 !== bccomp($total, '0')) {
session()->flash('success', (string) trans('firefly.added_amount_to_piggy', ['amount' => app('amount')->formatAnything($piggyBank->transactionCurrency, $total, false), 'name' => $piggyBank->name]));
app('preferences')->mark();
Preferences::mark();
return redirect(route('piggy-banks.index'));
}
@@ -216,7 +217,7 @@ class AmountController extends Controller
['amount' => app('amount')->formatAnything($piggyBank->transactionCurrency, $total, false), 'name' => $piggyBank->name]
)
);
app('preferences')->mark();
Preferences::mark();
return redirect(route('piggy-banks.index'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
@@ -75,6 +76,9 @@ class CreateController extends Controller
$subTitleIcon = 'fa-plus';
$request->old('_token');
$preFilled = $request->old();
if (!array_key_exists('transaction_currency_id', $preFilled)) {
$preFilled['transaction_currency_id'] = $this->primaryCurrency->id;
}
// put previous url in session if not redirect from store (not "create another").
if (true !== session('piggy-banks.create.fromStore')) {
@@ -103,7 +107,7 @@ class CreateController extends Controller
session()->flash('success', (string) trans('firefly.stored_piggy_bank', ['name' => $piggyBank->name]));
session()->flash('success_url', route('piggy-banks.show', [$piggyBank->id]));
app('preferences')->mark();
Preferences::mark();
// store attachment(s):
/** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
@@ -78,7 +79,7 @@ class DeleteController extends Controller
public function destroy(PiggyBank $piggyBank): RedirectResponse
{
session()->flash('success', (string) trans('firefly.deleted_piggy_bank', ['name' => $piggyBank->name]));
app('preferences')->mark();
Preferences::mark();
$this->piggyRepos->destroy($piggyBank);
return redirect($this->getPreviousUrl('piggy-banks.delete.url'));

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\PiggyBank;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\PiggyBankUpdateRequest;
@@ -34,6 +35,7 @@ use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use FireflyIII\Support\Facades\Steam;
/**
* Class EditController
@@ -88,7 +90,7 @@ class EditController extends Controller
$preFilled = [
'name' => $piggyBank->name,
'transaction_currency_id' => (int) $piggyBank->transaction_currency_id,
'target_amount' => app('steam')->bcround($piggyBank->target_amount, $piggyBank->transactionCurrency->decimal_places),
'target_amount' => Steam::bcround($piggyBank->target_amount, $piggyBank->transactionCurrency->decimal_places),
'target_date' => $targetDate,
'start_date' => $startDate,
'accounts' => [],
@@ -121,7 +123,7 @@ class EditController extends Controller
$piggyBank = $this->piggyRepos->update($piggyBank, $data);
session()->flash('success', (string) trans('firefly.updated_piggy_bank', ['name' => $piggyBank->name]));
app('preferences')->mark();
Preferences::mark();
// store new attachment(s):
/** @var null|array $files */

View File

@@ -44,6 +44,7 @@ use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use JsonException;
use Safe\Exceptions\FilesystemException;
use FireflyIII\Support\Facades\Steam;
use function Safe\file_get_contents;
use function Safe\json_decode;
@@ -108,7 +109,7 @@ class PreferencesController extends Controller
if (!is_array($frontpageAccounts)) {
$frontpageAccounts = $accountIds;
}
$language = app('steam')->getLanguage();
$language = Steam::getLanguage();
$languages = config('firefly.languages');
$locale = Preferences::get('locale', config('firefly.default_locale', 'equal'))->data;
$listPageSize = Preferences::get('listPageSize', 50)->data;

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Profile;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Events\Security\DisabledMFA;
use FireflyIII\Events\Security\EnabledMFA;
@@ -124,8 +125,8 @@ class MfaController extends Controller
;
$codes = implode("\r\n", $recoveryCodes);
app('preferences')->set('mfa_recovery', $recoveryCodes);
app('preferences')->mark();
Preferences::set('mfa_recovery', $recoveryCodes);
Preferences::mark();
// send user notification.
$user = auth()->user();
@@ -172,10 +173,10 @@ class MfaController extends Controller
/** @var User $user */
$user = auth()->user();
app('preferences')->delete('temp-mfa-secret');
app('preferences')->delete('temp-mfa-codes');
Preferences::delete('temp-mfa-secret');
Preferences::delete('temp-mfa-codes');
$repository->setMFACode($user, null);
app('preferences')->mark();
Preferences::mark();
session()->flash('success', (string) trans('firefly.pref_two_factor_auth_disabled'));
session()->flash('info', (string) trans('firefly.pref_two_factor_auth_remove_it'));
@@ -218,7 +219,7 @@ class MfaController extends Controller
$secret = Google2FA::generateSecretKey();
$image = Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret);
app('preferences')->set('temp-mfa-secret', $secret);
Preferences::set('temp-mfa-secret', $secret);
return view('profile.mfa.enable-mfa', ['image' => $image, 'secret' => $secret]);
@@ -252,7 +253,7 @@ class MfaController extends Controller
/** @var UserRepositoryInterface $repository */
$repository = app(UserRepositoryInterface::class);
$secret = app('preferences')->get('temp-mfa-secret')?->data;
$secret = Preferences::get('temp-mfa-secret')?->data;
if (is_array($secret)) {
$secret = null;
}
@@ -260,10 +261,10 @@ class MfaController extends Controller
$repository->setMFACode($user, $secret);
app('preferences')->delete('temp-mfa-secret');
Preferences::delete('temp-mfa-secret');
session()->flash('success', (string) trans('firefly.saved_preferences'));
app('preferences')->mark();
Preferences::mark();
// also save the code so replay attack is prevented.
$mfaCode = $request->get('code');
@@ -293,14 +294,14 @@ class MfaController extends Controller
private function addToMFAHistory(string $mfaCode): void
{
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$mfaHistory = Preferences::get('mfa_history', [])->data;
$entry = [
'time' => Carbon::now()->getTimestamp(),
'code' => $mfaCode,
];
$mfaHistory[] = $entry;
app('preferences')->set('mfa_history', $mfaHistory);
Preferences::set('mfa_history', $mfaHistory);
$this->filterMFAHistory();
}
@@ -310,7 +311,7 @@ class MfaController extends Controller
private function filterMFAHistory(): void
{
/** @var array $mfaHistory */
$mfaHistory = app('preferences')->get('mfa_history', [])->data;
$mfaHistory = Preferences::get('mfa_history', [])->data;
$newHistory = [];
$now = Carbon::now()->getTimestamp();
foreach ($mfaHistory as $entry) {
@@ -323,7 +324,7 @@ class MfaController extends Controller
];
}
}
app('preferences')->set('mfa_history', $newHistory);
Preferences::set('mfa_history', $newHistory);
}
public function index(): Factory|RedirectResponse|View

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log;
use Exception;
use FireflyIII\Events\UserChangedEmail;
@@ -98,7 +99,7 @@ class ProfileController extends Controller
// find preference with this token value.
/** @var Collection $set */
$set = app('preferences')->findByName('email_change_confirm_token');
$set = Preferences::findByName('email_change_confirm_token');
$user = null;
/** @var Preference $preference */
@@ -112,6 +113,8 @@ class ProfileController extends Controller
throw new FireflyException('Invalid token.');
}
$repository->unblockUser($user);
// also remove the "remote_guard_alt_email" preference.
Preferences::delete('remote_guard_alt_email');
// return to log in.
session()->flash('success', (string) trans('firefly.login_with_new_email'));
@@ -151,7 +154,7 @@ class ProfileController extends Controller
$subTitle = $user->email;
$userId = $user->id;
$enabled2FA = null !== $user->mfa_secret;
$recoveryData = app('preferences')->get('mfa_recovery', [])->data;
$recoveryData = Preferences::get('mfa_recovery', [])->data;
if (!is_array($recoveryData)) {
$recoveryData = [];
}
@@ -165,10 +168,10 @@ class ProfileController extends Controller
$repository->createPersonalAccessClient(null, $name, 'http://localhost');
}
$accessToken = app('preferences')->get('access_token');
$accessToken = Preferences::get('access_token');
if (null === $accessToken) {
$token = $user->generateAccessToken();
$accessToken = app('preferences')->set('access_token', $token);
$accessToken = Preferences::set('access_token', $token);
}
return view(
@@ -374,7 +377,7 @@ class ProfileController extends Controller
/** @var User $user */
$user = auth()->user();
$token = $user->generateAccessToken();
app('preferences')->set('access_token', $token);
Preferences::set('access_token', $token);
session()->flash('success', (string) trans('firefly.token_regenerated'));
return redirect(route('profile.index'));
@@ -392,7 +395,7 @@ class ProfileController extends Controller
}
// find preference with this token value.
$set = app('preferences')->findByName('email_change_undo_token');
$set = Preferences::findByName('email_change_undo_token');
$user = null;
/** @var Preference $preference */
@@ -406,7 +409,7 @@ class ProfileController extends Controller
}
// found user.which email address to return to?
$set = app('preferences')->beginsWith($user, 'previous_email_');
$set = Preferences::beginsWith($user, 'previous_email_');
/** @var null|string $match */
$match = null;

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Recurring;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\RecurrenceRepetitionWeekend;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -228,7 +229,7 @@ class CreateController extends Controller
Log::channel('audit')->info('Stored new recurrence.', $data);
$request->session()->flash('success', (string) trans('firefly.stored_new_recurrence', ['title' => $recurrence->title]));
app('preferences')->mark();
Preferences::mark();
// store attachment(s):
/** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Recurring;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Recurrence;
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
@@ -83,7 +84,7 @@ class DeleteController extends Controller
{
$repository->destroy($recurrence);
$request->session()->flash('success', (string) trans('firefly.recurrence_deleted', ['title' => $recurrence->title]));
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('recurrences.delete.url'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Recurring;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Enums\RecurrenceRepetitionWeekend;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -193,7 +194,7 @@ class EditController extends Controller
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
}
app('preferences')->mark();
Preferences::mark();
$redirect = redirect($this->getPreviousUrl('recurrences.edit.url'));
if (1 === (int) $request->get('return_to_edit')) {
// set value so edit routine will not overwrite URL:

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Recurring;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
@@ -82,7 +83,7 @@ class IndexController extends Controller
public function index(Request $request): Factory|\Illuminate\Contracts\View\View
{
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$collection = $this->repository->get();
$today = today(config('app.timezone'));
$year = today(config('app.timezone'));

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log;
use Carbon\Carbon;
use FireflyIII\Enums\AccountTypeEnum;
@@ -227,7 +228,7 @@ class ReportController extends Controller
/** @var Carbon $start */
$start = clone session('first', today(config('app.timezone')));
$months = $this->helper->listOfMonths($start);
$customFiscalYear = app('preferences')->get('customFiscalYear', 0)->data;
$customFiscalYear = Preferences::get('customFiscalYear', 0)->data;
$accounts = $repository->getAccountsByType(
[AccountTypeEnum::DEFAULT->value, AccountTypeEnum::ASSET->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value]
);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Rule;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\RuleFormRequest;
@@ -269,7 +270,7 @@ class CreateController extends Controller
$rule = $this->ruleRepos->store($data);
session()->flash('success_url', route('rules.select-transactions', [$rule->id]));
session()->flash('success', (string) trans('firefly.stored_new_rule', ['title' => $rule->title]));
app('preferences')->mark();
Preferences::mark();
// redirect to show bill.
if ('true' === $request->get('return_to_bill') && (int) $request->get('bill_id') > 0) {

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Rule;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\Rule;
use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
@@ -82,7 +83,7 @@ class DeleteController extends Controller
$this->ruleRepos->destroy($rule);
session()->flash('success', (string) trans('firefly.deleted_rule', ['title' => $title]));
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('rules.delete.url'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Rule;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
@@ -204,7 +205,7 @@ class EditController extends Controller
$this->ruleRepos->update($rule, $data);
session()->flash('success', (string) trans('firefly.updated_rule', ['title' => $rule->title]));
app('preferences')->mark();
Preferences::mark();
$redirect = redirect($this->getPreviousUrl('rules.edit.url'));
if (true === $data['run_after_form']) {

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\RuleGroup;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\RuleGroupFormRequest;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
@@ -89,7 +90,7 @@ class CreateController extends Controller
$ruleGroup = $this->repository->store($data);
session()->flash('success', (string) trans('firefly.created_new_rule_group', ['title' => $ruleGroup->title]));
app('preferences')->mark();
Preferences::mark();
$redirect = redirect($this->getPreviousUrl('rule-groups.create.url'));
if (1 === (int) $request->get('create_another')) {

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\RuleGroup;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\RuleGroup;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
@@ -87,7 +88,7 @@ class DeleteController extends Controller
$this->repository->destroy($ruleGroup, $moveTo);
session()->flash('success', (string) trans('firefly.deleted_rule_group', ['title' => $title]));
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('rule-groups.delete.url'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\RuleGroup;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\RuleGroupFormRequest;
use FireflyIII\Models\RuleGroup;
@@ -129,7 +130,7 @@ class EditController extends Controller
$this->repository->update($ruleGroup, $data);
session()->flash('success', (string) trans('firefly.updated_rule_group', ['title' => $ruleGroup->title]));
app('preferences')->mark();
Preferences::mark();
$redirect = redirect($this->getPreviousUrl('rule-groups.edit.url'));
if (1 === (int) $request->get('return_to_edit')) {
session()->put('rule-groups.edit.fromUpdate', true);

View File

@@ -26,14 +26,16 @@ namespace FireflyIII\Http\Controllers\RuleGroup;
use Carbon\Carbon;
use Exception;
use FireflyIII\Events\Model\TransactionGroup\TriggeredStoredTransactionGroup;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\SelectTransactionsRequest;
use FireflyIII\Models\RuleGroup;
use FireflyIII\TransactionRules\Engine\RuleEngineInterface;
use FireflyIII\User;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
/**
@@ -41,18 +43,20 @@ use Illuminate\View\View;
*/
class ExecutionController extends Controller
{
private readonly AccountRepositoryInterface $repository;
/**
* ExecutionController constructor.
*/
public function __construct()
{
parent::__construct();
$this->repository = app(AccountRepositoryInterface::class);
$this->middleware(
function ($request, $next) {
app('view')->share('title', (string) trans('firefly.rules'));
app('view')->share('title', (string)trans('firefly.rules'));
app('view')->share('mainTitleIcon', 'fa-random');
$this->repository->setUser(auth()->user());
return $next($request);
}
@@ -67,34 +71,37 @@ class ExecutionController extends Controller
public function execute(SelectTransactionsRequest $request, RuleGroup $ruleGroup): RedirectResponse
{
// Get parameters specified by the user
/** @var User $user */
$user = auth()->user();
$accounts = implode(',', $request->get('accounts'));
// create new rule engine:
$newRuleEngine = app(RuleEngineInterface::class);
$newRuleEngine->setUser($user);
$accounts = $request->get('accounts');
$set = $this->repository->getAccountsById($accounts);
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$collector->setAccounts($set);
// add date operators.
if (null !== $request->get('start')) {
$startDate = new Carbon($request->get('start'));
$newRuleEngine->addOperator(['type' => 'date_after', 'value' => $startDate->format('Y-m-d')]);
$collector->setStart($startDate);
}
if (null !== $request->get('end')) {
$endDate = new Carbon($request->get('end'));
$newRuleEngine->addOperator(['type' => 'date_before', 'value' => $endDate->format('Y-m-d')]);
$collector->setEnd($endDate);
}
$final = $collector->getGroups();
$ids = $final->pluck('id')->toArray();
Log::debug(sprintf('Found %d groups collected from %d account(s)', $final->count(), $set->count()));
foreach (array_chunk($ids, 1337) as $setOfIds) {
Log::debug(sprintf('Now processing %d groups', count($setOfIds)));
$groups = TransactionGroup::whereIn('id', $setOfIds)->get();
/** @var TransactionGroup $group */
foreach ($groups as $group) {
Log::debug(sprintf('Processing group #%d.', $group->id));
event(new TriggeredStoredTransactionGroup($group));
}
}
// add extra operators:
$newRuleEngine->addOperator(['type' => 'account_id', 'value' => $accounts]);
// set rules:
// #10427, file rule group and not the set of rules.
$collection = new Collection()->push($ruleGroup);
$newRuleEngine->setRuleGroups($collection);
$newRuleEngine->fire();
// Tell the user that the job is queued
session()->flash('success', (string) trans('firefly.applied_rule_group_selection', ['title' => $ruleGroup->title]));
session()->flash('success', (string)trans('firefly.applied_rule_group_selection', ['title' => $ruleGroup->title]));
return redirect()->route('rules.index');
}
@@ -106,7 +113,7 @@ class ExecutionController extends Controller
*/
public function selectTransactions(RuleGroup $ruleGroup): Factory|\Illuminate\Contracts\View\View
{
$subTitle = (string) trans('firefly.apply_rule_group_selection', ['title' => $ruleGroup->title]);
$subTitle = (string)trans('firefly.apply_rule_group_selection', ['title' => $ruleGroup->title]);
return view('rules.rule-group.select-transactions', ['ruleGroup' => $ruleGroup, 'subTitle' => $subTitle]);
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\System;
use FireflyIII\Support\Facades\Preferences;
use Exception;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
@@ -149,7 +150,7 @@ class InstallController extends Controller
}
// clear cache as well.
Cache::clear();
app('preferences')->mark();
Preferences::mark();
return true;
}

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
@@ -212,7 +213,7 @@ class TagController extends Controller
$this->repository->destroy($tag);
session()->flash('success', (string) trans('firefly.deleted_tag', ['tag' => $tagName]));
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('tags.delete.url'));
}
@@ -231,7 +232,7 @@ class TagController extends Controller
// default values:
$subTitleIcon = 'fa-tag';
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$start ??= session('start');
$end ??= session('end');
$location = $this->repository->getLocation($tag);
@@ -275,7 +276,7 @@ class TagController extends Controller
// default values:
$subTitleIcon = 'fa-tag';
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$periods = [];
$subTitle = (string) trans('firefly.all_journals_for_tag', ['tag' => $tag->tag]);
$start = $this->repository->firstUseDate($tag) ?? today(config('app.timezone'));
@@ -309,7 +310,7 @@ class TagController extends Controller
Log::debug('Data after storage', $result->toArray());
session()->flash('success', (string) trans('firefly.created_tag', ['tag' => $data['tag']]));
app('preferences')->mark();
Preferences::mark();
// store attachment(s):
/** @var null|array $files */
@@ -347,7 +348,7 @@ class TagController extends Controller
$tag = $this->repository->update($tag, $data);
session()->flash('success', (string) trans('firefly.updated_tag', ['tag' => $data['tag']]));
app('preferences')->mark();
Preferences::mark();
// store new attachment(s):
/** @var null|array $files */

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log;
use FireflyIII\Events\UpdatedTransactionGroup;
use FireflyIII\Http\Controllers\Controller;
@@ -122,7 +123,7 @@ class BulkController extends Controller
event(new UpdatedTransactionGroup($journal->transactionGroup, true, true, false));
}
app('preferences')->mark();
Preferences::mark();
$request->session()->flash('success', trans_choice('firefly.mass_edited_transactions_success', $count));
// redirect to previous URL:

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log;
use FireflyIII\Events\UpdatedAccount;
use FireflyIII\Http\Controllers\Controller;
@@ -37,6 +38,7 @@ use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Redirector;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use FireflyIII\Support\Facades\Steam;
/**
* Class DeleteController
@@ -82,7 +84,7 @@ class DeleteController extends Controller
}
$objectType = strtolower($journal->transaction_type_type ?? $journal->transactionType->type);
$subTitle = (string) trans('firefly.delete_'.$objectType, ['description' => $group->title ?? $journal->description]);
$previous = app('steam')->getSafePreviousUrl();
$previous = Steam::getSafePreviousUrl();
// put previous url in session
Log::debug('Will try to remember previous URL');
$this->rememberPreviousUrl('transactions.delete.url');
@@ -129,7 +131,7 @@ class DeleteController extends Controller
Log::debug(sprintf('Now going to trigger updated account event for account #%d', $account->id));
event(new UpdatedAccount($account));
}
app('preferences')->mark();
Preferences::mark();
return redirect($this->getPreviousUrl('transactions.delete.url'));
}

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal;
@@ -76,7 +77,7 @@ class EditController extends Controller
*/
public function edit(TransactionGroup $transactionGroup): Factory|\Illuminate\Contracts\View\View|Redirector|RedirectResponse
{
app('preferences')->mark();
Preferences::mark();
if (!$this->isEditableGroup($transactionGroup)) {
return $this->redirectGroupToAccount($transactionGroup);
@@ -98,7 +99,7 @@ class EditController extends Controller
$previousUrl = str_replace($search, '', $previousUrl);
// settings necessary for v2
$optionalFields = app('preferences')->get('transaction_journal_optional_fields', [])->data;
$optionalFields = Preferences::get('transaction_journal_optional_fields', [])->data;
if (!is_array($optionalFields)) {
$optionalFields = [];
}

View File

@@ -30,6 +30,7 @@ use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Http\Controllers\PeriodOverview;
use Illuminate\Contracts\View\Factory;
use Illuminate\Http\Request;
@@ -57,7 +58,7 @@ class IndexController extends Controller
$this->middleware(
function ($request, $next) {
app('view')->share('mainTitleIcon', 'fa-exchange');
app('view')->share('title', (string) trans('firefly.transactions'));
app('view')->share('title', (string)trans('firefly.transactions'));
$this->repository = app(JournalRepositoryInterface::class);
@@ -83,8 +84,8 @@ class IndexController extends Controller
$subTitleIcon = config('firefly.transactionIconsByType.'.$objectType);
$types = config('firefly.transactionTypesByType.'.$objectType);
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$page = (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
if (!$start instanceof Carbon) {
$start = session('start');
@@ -99,11 +100,17 @@ class IndexController extends Controller
[$start, $end] = $end < $start ? [$end, $start] : [$start, $end];
$startStr = $start->isoFormat($this->monthAndDayFormat);
$endStr = $end->isoFormat($this->monthAndDayFormat);
$subTitle = (string) trans(sprintf('firefly.title_%s_between', $objectType), ['start' => $startStr, 'end' => $endStr]);
$subTitle = (string)trans(sprintf('firefly.title_%s_between', $objectType), ['start' => $startStr, 'end' => $endStr]);
$path = route('transactions.index', [$objectType, $start->format('Y-m-d'), $end->format('Y-m-d')]);
$firstJournal = $this->repository->firstNull();
$startPeriod = $firstJournal instanceof TransactionJournal ? $firstJournal->date : new Carbon();
$endPeriod = clone $end;
// limit to 3 years for the time being.
if (now()->diffInYears($startPeriod, true) > 3) {
$startPeriod = now()->subYears(3);
}
$periods = $this->getTransactionPeriodOverview($objectType, $startPeriod, $endPeriod);
/** @var GroupCollectorInterface $collector */
@@ -136,14 +143,14 @@ class IndexController extends Controller
{
$subTitleIcon = config('firefly.transactionIconsByType.'.$objectType);
$types = config('firefly.transactionTypesByType.'.$objectType);
$page = (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$page = (int)$request->get('page');
$pageSize = (int)Preferences::get('listPageSize', 50)->data;
$path = route('transactions.index.all', [$objectType]);
$first = $this->repository->firstNull();
$start = $first instanceof TransactionJournal ? $first->date : new Carbon();
$last = $this->repository->getLast();
$end = $last instanceof TransactionJournal ? $last->date : today(config('app.timezone'));
$subTitle = (string) trans('firefly.all_'.$objectType);
$subTitle = (string)trans('firefly.all_'.$objectType);
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use Illuminate\Support\Facades\Log;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\JournalLinkRequest;
@@ -35,6 +36,7 @@ use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
use Illuminate\View\View;
use FireflyIII\Support\Facades\Steam;
/**
* Class LinkController.
@@ -86,7 +88,7 @@ class LinkController extends Controller
$this->repository->destroyLink($link);
session()->flash('success', (string) trans('firefly.deleted_link'));
app('preferences')->mark();
Preferences::mark();
return redirect((string) session('journal_links.delete.url'));
}
@@ -144,6 +146,6 @@ class LinkController extends Controller
$linkId = (int) $request->get('id');
$this->repository->switchLinkById($linkId);
return redirect(app('steam')->getSafePreviousUrl());
return redirect(Steam::getSafePreviousUrl());
}
}

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Support\Facades\Preferences;
use Carbon\Carbon;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Enums\TransactionTypeEnum;
@@ -42,6 +43,7 @@ use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View as IlluminateView;
use InvalidArgumentException;
use FireflyIII\Support\Facades\Steam;
/**
* Class MassController.
@@ -110,7 +112,7 @@ class MassController extends Controller
Log::debug(sprintf('Could not find transaction journal #%d', $journalId));
}
}
app('preferences')->mark();
Preferences::mark();
session()->flash('success', trans_choice('firefly.mass_deleted_transactions_success', $count));
// redirect to previous URL:
@@ -141,9 +143,9 @@ class MassController extends Controller
// reverse amounts
foreach ($journals as $index => $journal) {
$journals[$index]['amount'] = app('steam')->bcround(app('steam')->positive($journal['amount']), $journal['currency_decimal_places']);
$journals[$index]['amount'] = Steam::bcround(Steam::positive($journal['amount']), $journal['currency_decimal_places']);
$journals[$index]['foreign_amount'] = null === $journal['foreign_amount']
? null : app('steam')->positive($journal['foreign_amount']);
? null : Steam::positive($journal['foreign_amount']);
}
$this->rememberPreviousUrl('transactions.mass-edit.url');
@@ -177,7 +179,7 @@ class MassController extends Controller
}
}
app('preferences')->mark();
Preferences::mark();
session()->flash('success', trans_choice('firefly.mass_edited_transactions_success', $count));
// redirect to previous URL:

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\TransactionCurrency;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Http\Requests\CurrencyFormRequest;
@@ -128,7 +129,7 @@ class EditController extends Controller
$currency = $this->repository->update($currency, $data);
Log::channel('audit')->info('Updated (POST) currency.', $data);
$request->session()->flash('success', (string) trans('firefly.updated_currency', ['name' => $currency->name]));
app('preferences')->mark();
Preferences::mark();
if (1 === (int) $request->get('return_to_edit')) {
$request->session()->put('currencies.edit.fromUpdate', true);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\TransactionCurrency;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
@@ -73,7 +74,7 @@ class IndexController extends Controller
/** @var User $user */
$user = auth()->user();
$page = 0 === (int) $request->get('page') ? 1 : (int) $request->get('page');
$pageSize = (int) app('preferences')->get('listPageSize', 50)->data;
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
$collection = $this->repository->getAll();
// order so default and enabled are on top:

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Middleware;
use FireflyIII\Support\Facades\Preferences;
use Closure;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account;
@@ -54,27 +55,27 @@ class InterestingMessage
}
if ($this->groupMessage($request)) {
app('preferences')->mark();
Preferences::mark();
$this->handleGroupMessage($request);
}
if ($this->userGroupMessage($request)) {
app('preferences')->mark();
Preferences::mark();
$this->handleUserGroupMessage($request);
}
if ($this->accountMessage($request)) {
app('preferences')->mark();
Preferences::mark();
$this->handleAccountMessage($request);
}
if ($this->billMessage($request)) {
app('preferences')->mark();
Preferences::mark();
$this->handleBillMessage($request);
}
if ($this->webhookMessage($request)) {
app('preferences')->mark();
Preferences::mark();
$this->handleWebhookMessage($request);
}
if ($this->currencyMessage($request)) {
app('preferences')->mark();
Preferences::mark();
$this->handleCurrencyMessage($request);
}

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Middleware;
use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Support\Facades\Navigation;
use Carbon\Carbon;
use Closure;
@@ -70,7 +71,7 @@ class Range
// ignore preference. set the range to be the current month:
if (!app('session')->has('start') && !app('session')->has('end')) {
Log::debug('setRange: Session has no start or end.');
$viewRange = app('preferences')->get('viewRange', '1M')->data;
$viewRange = Preferences::get('viewRange', '1M')->data;
if (is_array($viewRange)) {
$viewRange = '1M';
}
@@ -138,7 +139,7 @@ class Range
*/
private function configureList(): void
{
$pref = app('preferences')->get('list-length', config('firefly.list_length', 10))->data;
$pref = Preferences::get('list-length', config('firefly.list_length', 10))->data;
app('view')->share('listLength', $pref);
// share security message:

View File

@@ -27,6 +27,7 @@ use Illuminate\Contracts\Session\Session;
use Illuminate\Http\Request;
use Illuminate\Session\Middleware\StartSession;
use Override;
use FireflyIII\Support\Facades\Steam;
/**
* Class StartFireflySession.
@@ -42,7 +43,7 @@ class StartFireflySession extends StartSession
protected function storeCurrentUrl(Request $request, $session): void
{
$url = $request->fullUrl();
$safeUrl = app('steam')->getSafeUrl($url, route('index'));
$safeUrl = Steam::getSafeUrl($url, route('index'));
if ($url !== $safeUrl) {
return;

Some files were not shown because too many files have changed in this diff Show More