mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-30 10:01:51 +00:00
Compare commits
43 Commits
eb4b9659cf
...
2bee3d2728
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2bee3d2728 | ||
|
|
73126786b0 | ||
|
|
962a729025 | ||
|
|
f262cb3947 | ||
|
|
212d579c4f | ||
|
|
30937610eb | ||
|
|
3558bf7647 | ||
|
|
3711222f9e | ||
|
|
76899389b8 | ||
|
|
e83fe023d2 | ||
|
|
1dd098a283 | ||
|
|
52164689d4 | ||
|
|
034b14eb0b | ||
|
|
8722d264dc | ||
|
|
3603ef1cc7 | ||
|
|
7abd30f4dd | ||
|
|
3c904c9017 | ||
|
|
d8bdbf2842 | ||
|
|
d08966d141 | ||
|
|
bd71095e40 | ||
|
|
d7967a81e3 | ||
|
|
fa018e80c0 | ||
|
|
7b7b9118cd | ||
|
|
373e5c3733 | ||
|
|
521a496c17 | ||
|
|
5fea35d5b1 | ||
|
|
21a6892601 | ||
|
|
3f386b9003 | ||
|
|
72fb534eb4 | ||
|
|
69b46af245 | ||
|
|
4a901a1b42 | ||
|
|
a8fffc25c0 | ||
|
|
d0dab136b1 | ||
|
|
91184489da | ||
|
|
e4e6cc71c3 | ||
|
|
33d637e618 | ||
|
|
42eb4410f8 | ||
|
|
5f6b345c79 | ||
|
|
30b48a479c | ||
|
|
55d23af802 | ||
|
|
34bfeba63a | ||
|
|
761c20b670 | ||
|
|
d756977ee0 |
251
.ci/php-cs-fixer/composer.lock
generated
251
.ci/php-cs-fixer/composer.lock
generated
@@ -402,16 +402,16 @@
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.89.2",
|
||||
"version": "v3.90.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "7569658f91e475ec93b99bd5964b059ad1336dcf"
|
||||
"reference": "ad732c2e9299c9743f9c55ae53cc0e7642ab1155"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7569658f91e475ec93b99bd5964b059ad1336dcf",
|
||||
"reference": "7569658f91e475ec93b99bd5964b059ad1336dcf",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ad732c2e9299c9743f9c55ae53cc0e7642ab1155",
|
||||
"reference": "ad732c2e9299c9743f9c55ae53cc0e7642ab1155",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -429,17 +429,17 @@
|
||||
"react/socket": "^1.16",
|
||||
"react/stream": "^1.4",
|
||||
"sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0",
|
||||
"symfony/console": "^5.4.47 || ^6.4.24 || ^7.0",
|
||||
"symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0",
|
||||
"symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0",
|
||||
"symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0",
|
||||
"symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0",
|
||||
"symfony/console": "^5.4.47 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
"symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
"symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
"symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
"symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
"symfony/polyfill-mbstring": "^1.33",
|
||||
"symfony/polyfill-php80": "^1.33",
|
||||
"symfony/polyfill-php81": "^1.33",
|
||||
"symfony/polyfill-php84": "^1.33",
|
||||
"symfony/process": "^5.4.47 || ^6.4.24 || ^7.2",
|
||||
"symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0"
|
||||
"symfony/process": "^5.4.47 || ^6.4.24 || ^7.2 || ^8.0",
|
||||
"symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"facile-it/paraunit": "^1.3.1 || ^2.7",
|
||||
@@ -451,8 +451,8 @@
|
||||
"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/var-dumper": "^5.4.48 || ^6.4.24 || ^7.3.2",
|
||||
"symfony/yaml": "^5.4.45 || ^6.4.24 || ^7.3.2"
|
||||
"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"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-dom": "For handling output formats in XML",
|
||||
@@ -493,7 +493,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.89.2"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.90.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -501,7 +501,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-06T21:12:50+00:00"
|
||||
"time": "2025-11-20T15:15:16+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
@@ -805,16 +805,16 @@
|
||||
},
|
||||
{
|
||||
"name": "react/dns",
|
||||
"version": "v1.13.0",
|
||||
"version": "v1.14.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/reactphp/dns.git",
|
||||
"reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5"
|
||||
"reference": "7562c05391f42701c1fccf189c8225fece1cd7c3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5",
|
||||
"reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5",
|
||||
"url": "https://api.github.com/repos/reactphp/dns/zipball/7562c05391f42701c1fccf189c8225fece1cd7c3",
|
||||
"reference": "7562c05391f42701c1fccf189c8225fece1cd7c3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -869,7 +869,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/reactphp/dns/issues",
|
||||
"source": "https://github.com/reactphp/dns/tree/v1.13.0"
|
||||
"source": "https://github.com/reactphp/dns/tree/v1.14.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -877,20 +877,20 @@
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2024-06-13T14:18:03+00:00"
|
||||
"time": "2025-11-18T19:34:28+00:00"
|
||||
},
|
||||
{
|
||||
"name": "react/event-loop",
|
||||
"version": "v1.5.0",
|
||||
"version": "v1.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/reactphp/event-loop.git",
|
||||
"reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354"
|
||||
"reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354",
|
||||
"reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354",
|
||||
"url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a",
|
||||
"reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -941,7 +941,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/reactphp/event-loop/issues",
|
||||
"source": "https://github.com/reactphp/event-loop/tree/v1.5.0"
|
||||
"source": "https://github.com/reactphp/event-loop/tree/v1.6.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -949,7 +949,7 @@
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2023-11-13T13:48:05+00:00"
|
||||
"time": "2025-11-17T20:46:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "react/promise",
|
||||
@@ -1026,16 +1026,16 @@
|
||||
},
|
||||
{
|
||||
"name": "react/socket",
|
||||
"version": "v1.16.0",
|
||||
"version": "v1.17.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/reactphp/socket.git",
|
||||
"reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1"
|
||||
"reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1",
|
||||
"reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1",
|
||||
"url": "https://api.github.com/repos/reactphp/socket/zipball/ef5b17b81f6f60504c539313f94f2d826c5faa08",
|
||||
"reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1094,7 +1094,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/reactphp/socket/issues",
|
||||
"source": "https://github.com/reactphp/socket/tree/v1.16.0"
|
||||
"source": "https://github.com/reactphp/socket/tree/v1.17.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1102,7 +1102,7 @@
|
||||
"type": "open_collective"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-26T10:38:09+00:00"
|
||||
"time": "2025-11-19T20:47:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "react/stream",
|
||||
@@ -1251,47 +1251,39 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v7.3.6",
|
||||
"version": "v8.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "c28ad91448f86c5f6d9d2c70f0cf68bf135f252a"
|
||||
"reference": "307d3cf852f5ead3618ac60ecbedbdd512c348b1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/c28ad91448f86c5f6d9d2c70f0cf68bf135f252a",
|
||||
"reference": "c28ad91448f86c5f6d9d2c70f0cf68bf135f252a",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/307d3cf852f5ead3618ac60ecbedbdd512c348b1",
|
||||
"reference": "307d3cf852f5ead3618ac60ecbedbdd512c348b1",
|
||||
"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 +1317,7 @@
|
||||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/console/tree/v7.3.6"
|
||||
"source": "https://github.com/symfony/console/tree/v8.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1345,7 +1337,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-04T01:21:42+00:00"
|
||||
"time": "2025-11-21T13:19:49+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
@@ -1416,24 +1408,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 +1434,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 +1469,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 +1489,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 +1569,25 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/filesystem",
|
||||
"version": "v7.3.6",
|
||||
"version": "v8.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/filesystem.git",
|
||||
"reference": "e9bcfd7837928ab656276fe00464092cc9e1826a"
|
||||
"reference": "7fc96ae83372620eaba3826874f46e26295768ca"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/e9bcfd7837928ab656276fe00464092cc9e1826a",
|
||||
"reference": "e9bcfd7837928ab656276fe00464092cc9e1826a",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/7fc96ae83372620eaba3826874f46e26295768ca",
|
||||
"reference": "7fc96ae83372620eaba3826874f46e26295768ca",
|
||||
"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 +1615,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.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1642,27 +1635,27 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-05T09:52:27+00:00"
|
||||
"time": "2025-11-05T14:36:47+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 +1683,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 +1703,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 +1754,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 +1774,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 +2357,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 +2398,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 +2418,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 +2509,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 +2551,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 +2562,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.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/string.git",
|
||||
"reference": "f96476035142921000338bad71e5247fbc138872"
|
||||
"reference": "f929eccf09531078c243df72398560e32fa4cf4f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/f96476035142921000338bad71e5247fbc138872",
|
||||
"reference": "f96476035142921000338bad71e5247fbc138872",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/f929eccf09531078c243df72398560e32fa4cf4f",
|
||||
"reference": "f929eccf09531078c243df72398560e32fa4cf4f",
|
||||
"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 +2641,7 @@
|
||||
"utf8"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/string/tree/v7.3.4"
|
||||
"source": "https://github.com/symfony/string/tree/v8.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2664,7 +2661,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-09-11T14:36:48+00:00"
|
||||
"time": "2025-09-11T14:37:55+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
@@ -2675,5 +2672,5 @@
|
||||
"prefer-lowest": false,
|
||||
"platform": {},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.6.0"
|
||||
"plugin-api-version": "2.9.0"
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class IndexController extends Controller
|
||||
{
|
||||
use ValidatesUserGroupTrait;
|
||||
|
||||
public const string RESOURCE_KEY = 'currency_exchange_rates';
|
||||
public const string RESOURCE_KEY = 'exchange-rates';
|
||||
protected array $acceptedRoles = [UserRoleEnum::OWNER];
|
||||
private ExchangeRateRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ class CorrectsDatabase extends Command
|
||||
'correction:group-accounts',
|
||||
'correction:recalculates-liabilities',
|
||||
'correction:preferences',
|
||||
'correction:corrects-inverted-budget-limits',
|
||||
// 'correction:transaction-types', // resource heavy, disabled.
|
||||
'correction:recalculate-pc-amounts',
|
||||
'correction:remove-links-to-deleted-objects',
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/*
|
||||
* CorrectsInversedBudgetLimits.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\BudgetLimit;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class CorrectsInvertedBudgetLimits extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'correction:corrects-inverted-budget-limits';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Reverse budget limits where the dates are inverted.';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
|
||||
$set = BudgetLimit::where('start_date', '>', DB::raw('end_date'))->get();
|
||||
if (0 === $set->count()) {
|
||||
Log::debug('No inverted budget limits found.');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
||||
/** @var BudgetLimit $budgetLimit */
|
||||
foreach ($set as $budgetLimit) {
|
||||
$start = $budgetLimit->start_date->copy();
|
||||
$end = $budgetLimit->end_date->copy();
|
||||
$budgetLimit->start_date = $end;
|
||||
$budgetLimit->end_date = $start;
|
||||
$budgetLimit->saveQuietly();
|
||||
}
|
||||
if (1 === $set->count()) {
|
||||
$this->friendlyInfo('Corrected one budget limit to have the right start/end dates.');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
$this->friendlyInfo(sprintf('Corrected %d budget limits to have the right start/end dates.', count($set)));
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ class ForcesDecimalSize extends Command
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
protected $description = 'This command resizes DECIMAL columns in MySQL or PostgreSQL and correct amounts (only MySQL).';
|
||||
protected $signature = 'firefly-iii:force-decimal-size';
|
||||
protected $signature = 'firefly-iii:force-decimal-size {--force}';
|
||||
private string $cast;
|
||||
private array $classes
|
||||
= [
|
||||
@@ -98,9 +98,14 @@ class ForcesDecimalSize extends Command
|
||||
Log::debug('Now in ForceDecimalSize::handle()');
|
||||
$this->determineDatabaseType();
|
||||
|
||||
$this->friendlyError('Running this command is dangerous and can cause data loss.');
|
||||
$this->friendlyError('Please do not continue.');
|
||||
$question = $this->confirm('Do you want to continue?');
|
||||
$force = $this->option('force');
|
||||
$question = true;
|
||||
if (false === $force) {
|
||||
$this->friendlyError('Running this command is dangerous and can cause data loss.');
|
||||
$this->friendlyError('Please make sure you have a backup.');
|
||||
$question = $this->confirm('Do you want to continue?');
|
||||
}
|
||||
|
||||
if (true === $question) {
|
||||
$this->correctAmounts();
|
||||
$this->updateDecimals();
|
||||
@@ -131,17 +136,17 @@ class ForcesDecimalSize extends Command
|
||||
private function correctAmounts(): void
|
||||
{
|
||||
// if sqlite, add function?
|
||||
if ('sqlite' === (string) config('database.default')) {
|
||||
if ('sqlite' === (string)config('database.default')) {
|
||||
DB::connection()->getPdo()->sqliteCreateFunction('REGEXP', static function ($pattern, $value): int {
|
||||
mb_regex_encoding('UTF-8');
|
||||
$pattern = trim($pattern, '"');
|
||||
|
||||
return (mb_ereg($pattern, (string) $value)) ? 1 : 0;
|
||||
return (mb_ereg($pattern, (string)$value)) ? 1 : 0;
|
||||
});
|
||||
}
|
||||
|
||||
if (!in_array((string) config('database.default'), ['mysql', 'pgsql', 'sqlite'], true)) {
|
||||
$this->friendlyWarning(sprintf('Skip correcting amounts, does not support "%s"...', (string) config('database.default')));
|
||||
if (!in_array((string)config('database.default'), ['mysql', 'pgsql', 'sqlite'], true)) {
|
||||
$this->friendlyWarning(sprintf('Skip correcting amounts, does not support "%s"...', (string)config('database.default')));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -236,7 +241,7 @@ class ForcesDecimalSize extends Command
|
||||
/** @var Builder $query */
|
||||
$query = Account::leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string) $currency->id))
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
;
|
||||
$query->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
@@ -264,7 +269,7 @@ class ForcesDecimalSize extends Command
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string) round($value * $pow), (string) $pow, 12);
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$this->friendlyInfo(sprintf('Account #%d has %s with value "%s", this has been corrected to "%s".', $account->id, $field, $value, $correct));
|
||||
|
||||
/** @var null|Account $updateAccount */
|
||||
@@ -316,7 +321,7 @@ class ForcesDecimalSize extends Command
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string) round($value * $pow), (string) $pow, 12);
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$this->friendlyWarning(sprintf('%s #%d has %s with value "%s", this has been corrected to "%s".', $table, $item->id, $field, $value, $correct));
|
||||
|
||||
/** @var null|Model $model */
|
||||
@@ -340,7 +345,7 @@ class ForcesDecimalSize extends Command
|
||||
->leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id')
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string) $currency->id))
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
->where(static function (Builder $q) use ($fields, $currency, $cast, $operator, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
$q->orWhere(
|
||||
@@ -369,7 +374,7 @@ class ForcesDecimalSize extends Command
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string) round($value * $pow), (string) $pow, 12);
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$this->friendlyWarning(
|
||||
sprintf('Piggy bank event #%d has %s with value "%s", this has been corrected to "%s".', $item->id, $field, $value, $correct)
|
||||
);
|
||||
@@ -396,7 +401,7 @@ class ForcesDecimalSize extends Command
|
||||
->leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id')
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string) $currency->id))
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
$q->orWhere(
|
||||
@@ -425,7 +430,7 @@ class ForcesDecimalSize extends Command
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string) round($value * $pow), (string) $pow, 12);
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$this->friendlyWarning(
|
||||
sprintf('Piggy bank repetition #%d has %s with value "%s", this has been corrected to "%s".', $item->id, $field, $value, $correct)
|
||||
);
|
||||
@@ -450,7 +455,7 @@ class ForcesDecimalSize extends Command
|
||||
$query = PiggyBank::leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id')
|
||||
->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->where('account_meta.name', 'currency_id')
|
||||
->where('account_meta.data', json_encode((string) $currency->id))
|
||||
->where('account_meta.data', json_encode((string)$currency->id))
|
||||
->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void {
|
||||
foreach ($fields as $field) {
|
||||
$q->orWhere(
|
||||
@@ -479,7 +484,7 @@ class ForcesDecimalSize extends Command
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string) round($value * $pow), (string) $pow, 12);
|
||||
$correct = bcdiv((string)round($value * $pow), (string)$pow, 12);
|
||||
$this->friendlyWarning(sprintf('Piggy bank #%d has %s with value "%s", this has been corrected to "%s".', $item->id, $field, $value, $correct));
|
||||
|
||||
/** @var null|PiggyBank $piggyBank */
|
||||
@@ -515,7 +520,7 @@ class ForcesDecimalSize extends Command
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10.0 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string) round((float) $value * $pow), (string) $pow, 12);
|
||||
$correct = bcdiv((string)round((float)$value * $pow), (string)$pow, 12);
|
||||
$this->friendlyWarning(sprintf('Transaction #%d has amount with value "%s", this has been corrected to "%s".', $item->id, $value, $correct));
|
||||
|
||||
/** @var null|Transaction $transaction */
|
||||
@@ -546,7 +551,7 @@ class ForcesDecimalSize extends Command
|
||||
}
|
||||
// fix $field by rounding it down correctly.
|
||||
$pow = 10.0 ** $currency->decimal_places;
|
||||
$correct = bcdiv((string) round((float) $value * $pow), (string) $pow, 12);
|
||||
$correct = bcdiv((string)round((float)$value * $pow), (string)$pow, 12);
|
||||
$this->friendlyWarning(
|
||||
sprintf('Transaction #%d has foreign amount with value "%s", this has been corrected to "%s".', $item->id, $value, $correct)
|
||||
);
|
||||
@@ -560,7 +565,7 @@ class ForcesDecimalSize extends Command
|
||||
private function updateDecimals(): void
|
||||
{
|
||||
$this->friendlyInfo('Going to force the size of DECIMAL columns. Please hold.');
|
||||
$type = (string) config('database.default');
|
||||
$type = (string)config('database.default');
|
||||
|
||||
/**
|
||||
* @var string $name
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Helpers\Report;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Helpers\Fiscal\FiscalHelperInterface;
|
||||
@@ -81,7 +82,7 @@ class ReportHelper implements ReportHelperInterface
|
||||
|
||||
/** @var Carbon $expectedStart */
|
||||
foreach ($expectedDates as $expectedStart) {
|
||||
$expectedEnd = app('navigation')->endOfX($expectedStart, $bill->repeat_freq, null);
|
||||
$expectedEnd = Navigation::endOfX($expectedStart, $bill->repeat_freq, null);
|
||||
|
||||
// is paid in this period maybe?
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -205,7 +206,7 @@ class EditController extends Controller
|
||||
|
||||
$redirect = redirect(route('accounts.edit', [$account->id]))->withInput(['return_to_edit' => 1]);
|
||||
}
|
||||
app('preferences')->mark();
|
||||
Preferences::mark();
|
||||
|
||||
return $redirect;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -167,12 +168,17 @@ class IndexController extends Controller
|
||||
/** @var Carbon $end */
|
||||
$end = clone session('end', today(config('app.timezone'))->endOfMonth());
|
||||
|
||||
$now = now();
|
||||
if ($now->gt($end) || $now->lt($start)) {
|
||||
$now = $end;
|
||||
}
|
||||
|
||||
$ids = $accounts->pluck('id')->toArray();
|
||||
Log::debug(sprintf('index: accountsBalancesInRange("%s", "%s")', $start->format('Y-m-d H:i:s'), $end->format('Y-m-d H:i:s')));
|
||||
[
|
||||
$startBalances,
|
||||
$endBalances,
|
||||
] = Steam::accountsBalancesInRange($accounts, $start, $end, $this->primaryCurrency, $this->convertToPrimary);
|
||||
] = Steam::accountsBalancesInRange($accounts, $start, $now, $this->primaryCurrency, $this->convertToPrimary);
|
||||
$activities = Steam::getLastActivities($ids);
|
||||
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ 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;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
@@ -91,20 +93,20 @@ class ReconcileController extends Controller
|
||||
$currency = $this->accountRepos->getAccountCurrency($account) ?? $this->primaryCurrency;
|
||||
|
||||
// no start or end:
|
||||
$range = app('navigation')->getViewRange(false);
|
||||
$range = Navigation::getViewRange(false);
|
||||
|
||||
// get start and end
|
||||
|
||||
if (!$start instanceof Carbon && !$end instanceof Carbon) {
|
||||
/** @var Carbon $start */
|
||||
$start = clone session('start', app('navigation')->startOfPeriod(new Carbon(), $range));
|
||||
$start = clone session('start', Navigation::startOfPeriod(new Carbon(), $range));
|
||||
|
||||
/** @var Carbon $end */
|
||||
$end = clone session('end', app('navigation')->endOfPeriod(new Carbon(), $range));
|
||||
$end = clone session('end', Navigation::endOfPeriod(new Carbon(), $range));
|
||||
}
|
||||
if (null === $end) {
|
||||
/** @var Carbon $end */
|
||||
$end = app('navigation')->endOfPeriod($start, $range);
|
||||
$end = Navigation::endOfPeriod($start, $range);
|
||||
}
|
||||
|
||||
if ($end->lt($start)) {
|
||||
@@ -174,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'));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -164,7 +165,7 @@ class ShowController extends Controller
|
||||
$timer->stop('collection');
|
||||
$groups->setPath(route('accounts.show', [$account->id, $start->format('Y-m-d'), $end->format('Y-m-d')]));
|
||||
$showAll = false;
|
||||
$now = today()->endOfDay();
|
||||
$now = now();
|
||||
if ($now->gt($end) || $now->lt($start)) {
|
||||
$now = $end;
|
||||
}
|
||||
@@ -173,10 +174,7 @@ class ShowController extends Controller
|
||||
$balances = Steam::accountsBalancesOptimized(new Collection()->push($account), $now)[$account->id];
|
||||
// $balances = Steam::filterAccountBalance(Steam::finalAccountBalance($account, $now), $account, $this->convertToPrimary, $accountCurrency);
|
||||
|
||||
return view(
|
||||
'accounts.show',
|
||||
['account' => $account, 'showAll' => $showAll, 'objectType' => $objectType, 'currency' => $currency, 'today' => $today, 'periods' => $periods, 'subTitleIcon' => $subTitleIcon, 'groups' => $groups, 'attachments' => $attachments, 'subTitle' => $subTitle, 'start' => $start, 'end' => $end, 'chartUrl' => $chartUrl, 'location' => $location, 'balances' => $balances]
|
||||
);
|
||||
return view('accounts.show', ['account' => $account, 'showAll' => $showAll, 'objectType' => $objectType, 'currency' => $currency, 'today' => $today, 'periods' => $periods, 'subTitleIcon' => $subTitleIcon, 'groups' => $groups, 'attachments' => $attachments, 'subTitle' => $subTitle, 'start' => $start, 'end' => $end, 'chartUrl' => $chartUrl, 'location' => $location, 'balances' => $balances]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -202,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();
|
||||
@@ -224,14 +222,16 @@ class ShowController extends Controller
|
||||
// correct
|
||||
Log::debug(sprintf('showAll: Call accountsBalancesOptimized with date/time "%s"', $end->toIso8601String()));
|
||||
|
||||
$now = now();
|
||||
if ($now->gt($end) || $now->lt($start)) {
|
||||
$now = $end;
|
||||
}
|
||||
|
||||
// 2025-10-08 replace finalAccountBalance with accountsBalancesOptimized.
|
||||
// $balances = Steam::finalAccountBalance($account, $end);
|
||||
// $balances = Steam::filterAccountBalance($balances, $account, $this->convertToPrimary, $accountCurrency);
|
||||
$balances = Steam::accountsBalancesOptimized(new Collection()->push($account), $end)[$account->id];
|
||||
$balances = Steam::accountsBalancesOptimized(new Collection()->push($account), $now)[$account->id];
|
||||
|
||||
return view(
|
||||
'accounts.show',
|
||||
['account' => $account, 'showAll' => $showAll, 'location' => $location, 'objectType' => $objectType, 'isLiability' => $isLiability, 'attachments' => $attachments, 'currency' => $currency, 'today' => $today, 'chartUrl' => $chartUrl, 'periods' => $periods, 'subTitleIcon' => $subTitleIcon, 'groups' => $groups, 'subTitle' => $subTitle, 'start' => $start, 'end' => $end, 'balances' => $balances]
|
||||
);
|
||||
return view('accounts.show', ['account' => $account, 'showAll' => $showAll, 'location' => $location, 'objectType' => $objectType, 'isLiability' => $isLiability, 'attachments' => $attachments, 'currency' => $currency, 'today' => $today, 'chartUrl' => $chartUrl, 'periods' => $periods, 'subTitleIcon' => $subTitleIcon, 'groups' => $groups, 'subTitle' => $subTitle, 'start' => $start, 'end' => $end, 'balances' => $balances]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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')) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -116,7 +117,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;
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Bill;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Models\Bill;
|
||||
@@ -151,7 +152,7 @@ class IndexController extends Controller
|
||||
private function getSums(array $bills): array
|
||||
{
|
||||
$sums = [];
|
||||
$range = app('navigation')->getViewRange(true);
|
||||
$range = Navigation::getViewRange(true);
|
||||
|
||||
/** @var array $group */
|
||||
foreach ($bills as $groupOrder => $group) {
|
||||
|
||||
@@ -24,6 +24,8 @@ 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;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -105,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]));
|
||||
}
|
||||
@@ -131,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();
|
||||
@@ -139,8 +141,8 @@ class ShowController extends Controller
|
||||
$manager->parseIncludes(['attachments', 'notes']);
|
||||
|
||||
// add another period to end, could fix 8163
|
||||
$range = app('navigation')->getViewRange(true);
|
||||
$end = app('navigation')->addPeriod($end, $range);
|
||||
$range = Navigation::getViewRange(true);
|
||||
$end = Navigation::addPeriod($end, $range);
|
||||
|
||||
// Make a resource out of the data and
|
||||
$parameters = new ParameterBag();
|
||||
|
||||
@@ -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;
|
||||
@@ -255,7 +256,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(
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -126,7 +127,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);
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ 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;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -94,11 +96,11 @@ class IndexController extends Controller
|
||||
Log::debug(sprintf('Start of IndexController::index("%s", "%s")', $start?->format('Y-m-d'), $end?->format('Y-m-d')));
|
||||
|
||||
// collect some basic vars:
|
||||
$range = app('navigation')->getViewRange(true);
|
||||
$range = Navigation::getViewRange(true);
|
||||
$isCustomRange = session('is_custom_range', false);
|
||||
if (false === $isCustomRange) {
|
||||
$start ??= session('start', today(config('app.timezone'))->startOfMonth());
|
||||
$end ??= app('navigation')->endOfPeriod($start, $range);
|
||||
$end ??= Navigation::endOfPeriod($start, $range);
|
||||
}
|
||||
|
||||
// overrule start and end if necessary:
|
||||
@@ -112,7 +114,7 @@ class IndexController extends Controller
|
||||
$spent = '0';
|
||||
|
||||
// new period stuff:
|
||||
$periodTitle = app('navigation')->periodShow($start, $range);
|
||||
$periodTitle = Navigation::periodShow($start, $range);
|
||||
$prevLoop = $this->getPreviousPeriods($start, $range);
|
||||
$nextLoop = $this->getNextPeriods($start, $range);
|
||||
|
||||
@@ -307,7 +309,7 @@ class IndexController extends Controller
|
||||
$repository->setBudgetOrder($budget, $index + 1);
|
||||
}
|
||||
}
|
||||
app('preferences')->mark();
|
||||
Preferences::mark();
|
||||
|
||||
return response()->json(['OK']);
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
[
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
@@ -514,7 +515,7 @@ class AccountController extends Controller
|
||||
// have to make sure this chart is always based on the balance at the END of the period.
|
||||
// This period depends on the size of the chart
|
||||
$current = clone $start;
|
||||
$current = app('navigation')->endOfX($current, $step, null);
|
||||
$current = Navigation::endOfX($current, $step, null);
|
||||
$format = (string)trans('config.month_and_day_js', [], $locale);
|
||||
$accountCurrency = $this->accountRepository->getAccountCurrency($account);
|
||||
Log::debug('Get and filter balance for entire range start');
|
||||
@@ -574,9 +575,9 @@ class AccountController extends Controller
|
||||
$label = $current->isoFormat($format);
|
||||
$return[$key]['entries'][$label] = $amount;
|
||||
}
|
||||
$current = app('navigation')->addPeriod($current, $step);
|
||||
$current = Navigation::addPeriod($current, $step);
|
||||
// here too, to fix #8041, the data is corrected to the end of the period.
|
||||
$current = app('navigation')->endOfX($current, $step, null);
|
||||
$current = Navigation::endOfX($current, $step, null);
|
||||
}
|
||||
Log::debug('End of chart loop.');
|
||||
// second loop (yes) to create nice array with info! Yay!
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -81,8 +82,8 @@ class CategoryController extends Controller
|
||||
/** @var CategoryRepositoryInterface $repository */
|
||||
$repository = app(CategoryRepositoryInterface::class);
|
||||
$start = $repository->firstUseDate($category) ?? $this->getDate();
|
||||
$range = app('navigation')->getViewRange(false);
|
||||
$start = app('navigation')->startOfPeriod($start, $range);
|
||||
$range = Navigation::getViewRange(false);
|
||||
$start = Navigation::startOfPeriod($start, $range);
|
||||
$end = $this->getDate();
|
||||
|
||||
/** @var WholePeriodChartGenerator $chartGenerator */
|
||||
@@ -178,8 +179,8 @@ class CategoryController extends Controller
|
||||
$income = $opsRepository->listIncome($start, $end, $accounts, $collection);
|
||||
}
|
||||
$currencies = array_unique(array_merge(array_keys($income), array_keys($expenses)));
|
||||
$periods = app('navigation')->listOfPeriods($start, $end);
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$periods = Navigation::listOfPeriods($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$chartData = [];
|
||||
// make empty data array:
|
||||
// double foreach (bad) to make empty array:
|
||||
@@ -260,8 +261,8 @@ class CategoryController extends Controller
|
||||
*/
|
||||
public function specificPeriod(Category $category, Carbon $date): JsonResponse
|
||||
{
|
||||
$range = app('navigation')->getViewRange(false);
|
||||
$start = app('navigation')->startOfPeriod($date, $range);
|
||||
$range = Navigation::getViewRange(false);
|
||||
$start = Navigation::startOfPeriod($date, $range);
|
||||
$end = session()->get('end');
|
||||
if ($end < $start) {
|
||||
[$end, $start] = [$start, $end];
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -210,7 +211,7 @@ class CategoryReportController extends Controller
|
||||
$chartData = [];
|
||||
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, new Collection()->push($category));
|
||||
$earned = $this->opsRepository->listIncome($start, $end, $accounts, new Collection()->push($category));
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
// loop expenses.
|
||||
foreach ($spent as $currency) {
|
||||
// add things to chart Data for each currency:
|
||||
@@ -276,11 +277,11 @@ class CategoryReportController extends Controller
|
||||
private function makeEntries(Carbon $start, Carbon $end): array
|
||||
{
|
||||
$return = [];
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = app('navigation')->preferredRangeFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = Navigation::preferredRangeFormat($start, $end);
|
||||
$currentStart = clone $start;
|
||||
while ($currentStart <= $end) {
|
||||
$currentEnd = app('navigation')->endOfPeriod($currentStart, $preferredRange);
|
||||
$currentEnd = Navigation::endOfPeriod($currentStart, $preferredRange);
|
||||
$key = $currentStart->isoFormat($format);
|
||||
$return[$key] = '0';
|
||||
$currentStart = clone $currentEnd;
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -154,7 +155,7 @@ class DoubleReportController extends Controller
|
||||
$accounts = $accounts->merge($opposing);
|
||||
$spent = $this->opsRepository->listExpenses($start, $end, $accounts);
|
||||
$earned = $this->opsRepository->listIncome($start, $end, $accounts);
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
|
||||
// loop expenses.
|
||||
foreach ($spent as $currency) {
|
||||
@@ -238,11 +239,11 @@ class DoubleReportController extends Controller
|
||||
private function makeEntries(Carbon $start, Carbon $end): array
|
||||
{
|
||||
$return = [];
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = app('navigation')->preferredRangeFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = Navigation::preferredRangeFormat($start, $end);
|
||||
$currentStart = clone $start;
|
||||
while ($currentStart <= $end) {
|
||||
$currentEnd = app('navigation')->endOfPeriod($currentStart, $preferredRange);
|
||||
$currentEnd = Navigation::endOfPeriod($currentStart, $preferredRange);
|
||||
$key = $currentStart->isoFormat($format);
|
||||
$return[$key] = '0';
|
||||
$currentStart = clone $currentEnd;
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -83,8 +84,8 @@ class ExpenseReportController extends Controller
|
||||
return response()->json($cache->get());
|
||||
}
|
||||
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$function = app('navigation')->preferredEndOfPeriod($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$function = Navigation::preferredEndOfPeriod($start, $end);
|
||||
$chartData = [];
|
||||
$currentStart = clone $start;
|
||||
$combined = $this->combineAccounts($expense);
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -92,7 +93,7 @@ class PiggyBankController extends Controller
|
||||
$currentSum = $filtered->sum('amount');
|
||||
$label = $oldest->isoFormat((string) trans('config.month_and_day_js', [], $locale));
|
||||
$chartData[$label] = $currentSum;
|
||||
$oldest = app('navigation')->addPeriod($oldest, $step);
|
||||
$oldest = Navigation::addPeriod($oldest, $step);
|
||||
}
|
||||
$finalFiltered = $set->filter(
|
||||
static fn (PiggyBankEvent $event) => $event->date->lte($today)
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
@@ -154,9 +155,9 @@ class ReportController extends Controller
|
||||
|
||||
Log::debug('Going to do operations for accounts ', $accounts->pluck('id')->toArray());
|
||||
Log::debug(sprintf('Period: %s to %s', $start->toW3cString(), $end->toW3cString()));
|
||||
$format = app('navigation')->preferredCarbonFormat($start, $end);
|
||||
$titleFormat = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = app('navigation')->preferredRangeFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonFormat($start, $end);
|
||||
$titleFormat = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = Navigation::preferredRangeFormat($start, $end);
|
||||
$ids = $accounts->pluck('id')->toArray();
|
||||
$data = [];
|
||||
$chartData = [];
|
||||
@@ -242,7 +243,7 @@ class ReportController extends Controller
|
||||
|
||||
// #8374. Sloppy fix for yearly charts. Not really interested in a better fix with v2 layout and all.
|
||||
if ('1Y' === $preferredRange) {
|
||||
$currentEnd = app('navigation')->endOfPeriod($currentEnd, $preferredRange);
|
||||
$currentEnd = Navigation::endOfPeriod($currentEnd, $preferredRange);
|
||||
}
|
||||
Log::debug('Start of sub-loop');
|
||||
while ($currentStart <= $currentEnd) {
|
||||
@@ -260,7 +261,7 @@ class ReportController extends Controller
|
||||
$expense['entries'][$title] = '0';
|
||||
|
||||
}
|
||||
$currentStart = app('navigation')->addPeriod($currentStart, $preferredRange);
|
||||
$currentStart = Navigation::addPeriod($currentStart, $preferredRange);
|
||||
}
|
||||
Log::debug('End of sub-loop');
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Chart;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
@@ -214,7 +215,7 @@ class TagReportController extends Controller
|
||||
$chartData = [];
|
||||
$spent = $this->opsRepository->listExpenses($start, $end, $accounts, new Collection()->push($tag));
|
||||
$earned = $this->opsRepository->listIncome($start, $end, $accounts, new Collection()->push($tag));
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
|
||||
// loop expenses.
|
||||
foreach ($spent as $currency) {
|
||||
@@ -281,11 +282,11 @@ class TagReportController extends Controller
|
||||
private function makeEntries(Carbon $start, Carbon $end): array
|
||||
{
|
||||
$return = [];
|
||||
$format = app('navigation')->preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = app('navigation')->preferredRangeFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonLocalizedFormat($start, $end);
|
||||
$preferredRange = Navigation::preferredRangeFormat($start, $end);
|
||||
$currentStart = clone $start;
|
||||
while ($currentStart <= $end) {
|
||||
$currentEnd = app('navigation')->endOfPeriod($currentStart, $preferredRange);
|
||||
$currentEnd = Navigation::endOfPeriod($currentStart, $preferredRange);
|
||||
$key = $currentStart->isoFormat($format);
|
||||
$return[$key] = '0';
|
||||
$currentStart = clone $currentEnd;
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
@@ -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;
|
||||
@@ -107,7 +108,7 @@ class JavascriptController extends Controller
|
||||
$locale = app('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);
|
||||
|
||||
@@ -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)]);
|
||||
}
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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'));
|
||||
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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;
|
||||
@@ -121,7 +122,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 */
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedPrimaryCurrency;
|
||||
@@ -101,7 +102,7 @@ class PreferencesController extends Controller
|
||||
|
||||
/** @var array<int, int> $accountIds */
|
||||
$accountIds = $accounts->pluck('id')->toArray();
|
||||
$viewRange = app('navigation')->getViewRange(false);
|
||||
$viewRange = Navigation::getViewRange(false);
|
||||
$frontpageAccountsPref = Preferences::get('frontpageAccounts', $accountIds);
|
||||
$frontpageAccounts = $frontpageAccountsPref->data;
|
||||
if (!is_array($frontpageAccounts)) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
@@ -151,7 +152,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 +166,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 +375,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 +393,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 +407,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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -173,15 +174,15 @@ class EditController extends Controller
|
||||
*/
|
||||
public function update(RecurrenceFormRequest $request, Recurrence $recurrence)
|
||||
{
|
||||
$data = $request->getAll();
|
||||
$this->repository->update($recurrence, $data);
|
||||
$data = $request->getAll();
|
||||
$recurrence = $this->repository->update($recurrence, $data);
|
||||
|
||||
$request->session()->flash('success', (string) trans('firefly.updated_recurrence', ['title' => $recurrence->title]));
|
||||
Log::channel('audit')->info(sprintf('Updated recurrence #%d.', $recurrence->id), $data);
|
||||
|
||||
// store new attachment(s):
|
||||
/** @var null|array $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
if (null !== $files && !auth()->user()->hasRole('demo')) {
|
||||
$this->attachments->saveAttachmentsForModel($recurrence, $files);
|
||||
}
|
||||
@@ -193,8 +194,8 @@ class EditController extends Controller
|
||||
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments'));
|
||||
}
|
||||
app('preferences')->mark();
|
||||
$redirect = redirect($this->getPreviousUrl('recurrences.edit.url'));
|
||||
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:
|
||||
$request->session()->put('recurrences.edit.fromUpdate', true);
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Report;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
@@ -485,7 +486,7 @@ class CategoryController extends Controller
|
||||
|
||||
// depending on the carbon format (a reliable way to determine the general date difference)
|
||||
// change the "listOfPeriods" call so the entire period gets included correctly.
|
||||
$format = app('navigation')->preferredCarbonFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonFormat($start, $end);
|
||||
|
||||
if ('Y' === $format) {
|
||||
$start->startOfYear();
|
||||
@@ -494,7 +495,7 @@ class CategoryController extends Controller
|
||||
$start->startOfMonth();
|
||||
}
|
||||
|
||||
$periods = app('navigation')->listOfPeriods($start, $end);
|
||||
$periods = Navigation::listOfPeriods($start, $end);
|
||||
$data = [];
|
||||
$with = $this->opsRepository->listExpenses($start, $end, $accounts);
|
||||
$without = $this->noCatRepository->listExpenses($start, $end, $accounts);
|
||||
@@ -559,7 +560,7 @@ class CategoryController extends Controller
|
||||
|
||||
// depending on the carbon format (a reliable way to determine the general date difference)
|
||||
// change the "listOfPeriods" call so the entire period gets included correctly.
|
||||
$format = app('navigation')->preferredCarbonFormat($start, $end);
|
||||
$format = Navigation::preferredCarbonFormat($start, $end);
|
||||
|
||||
if ('Y' === $format) {
|
||||
$start->startOfYear();
|
||||
@@ -568,7 +569,7 @@ class CategoryController extends Controller
|
||||
$start->startOfMonth();
|
||||
}
|
||||
|
||||
$periods = app('navigation')->listOfPeriods($start, $end);
|
||||
$periods = Navigation::listOfPeriods($start, $end);
|
||||
$data = [];
|
||||
$with = $this->opsRepository->listIncome($start, $end, $accounts);
|
||||
$without = $this->noCatRepository->listIncome($start, $end, $accounts);
|
||||
|
||||
@@ -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]
|
||||
);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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']) {
|
||||
|
||||
@@ -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')) {
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
@@ -129,7 +130,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'));
|
||||
}
|
||||
|
||||
@@ -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 = [];
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Controllers\Transaction;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
@@ -84,7 +85,7 @@ 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;
|
||||
$pageSize = (int) Preferences::get('listPageSize', 50)->data;
|
||||
|
||||
if (!$start instanceof Carbon) {
|
||||
$start = session('start');
|
||||
@@ -137,7 +138,7 @@ 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;
|
||||
$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();
|
||||
|
||||
@@ -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;
|
||||
@@ -86,7 +87,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'));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -110,7 +111,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:
|
||||
@@ -177,7 +178,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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Http\Middleware;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use Closure;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
@@ -69,14 +71,14 @@ 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';
|
||||
}
|
||||
|
||||
$today = today(config('app.timezone'));
|
||||
$start = app('navigation')->updateStartDate((string) $viewRange, $today);
|
||||
$end = app('navigation')->updateEndDate((string) $viewRange, $start);
|
||||
$start = Navigation::updateStartDate((string) $viewRange, $today);
|
||||
$end = Navigation::updateEndDate((string) $viewRange, $start);
|
||||
|
||||
app('session')->put('start', $start);
|
||||
app('session')->put('end', $end);
|
||||
@@ -137,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:
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Jobs;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AutoBudgetType;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
@@ -122,8 +123,8 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
);
|
||||
|
||||
// get date range for budget limit, based on range in auto-budget
|
||||
$start = app('navigation')->startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = app('navigation')->endOfPeriod($start, $autoBudget->period);
|
||||
$start = Navigation::startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = Navigation::endOfPeriod($start, $autoBudget->period);
|
||||
|
||||
// find budget limit:
|
||||
$budgetLimit = $this->findBudgetLimit($autoBudget->budget, $start, $end);
|
||||
@@ -237,12 +238,12 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
{
|
||||
Log::debug(sprintf('Will now manage rollover for auto budget #%d', $autoBudget->id));
|
||||
// current period:
|
||||
$start = app('navigation')->startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = app('navigation')->endOfPeriod($start, $autoBudget->period);
|
||||
$start = Navigation::startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = Navigation::endOfPeriod($start, $autoBudget->period);
|
||||
|
||||
// which means previous period:
|
||||
$previousStart = app('navigation')->subtractPeriod($start, $autoBudget->period);
|
||||
$previousEnd = app('navigation')->endOfPeriod($previousStart, $autoBudget->period);
|
||||
$previousStart = Navigation::subtractPeriod($start, $autoBudget->period);
|
||||
$previousEnd = Navigation::endOfPeriod($previousStart, $autoBudget->period);
|
||||
|
||||
Log::debug(
|
||||
sprintf(
|
||||
@@ -297,12 +298,12 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
{
|
||||
Log::debug(sprintf('Will now manage rollover for auto budget #%d', $autoBudget->id));
|
||||
// current period:
|
||||
$start = app('navigation')->startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = app('navigation')->endOfPeriod($start, $autoBudget->period);
|
||||
$start = Navigation::startOfPeriod($this->date, $autoBudget->period);
|
||||
$end = Navigation::endOfPeriod($start, $autoBudget->period);
|
||||
|
||||
// which means previous period:
|
||||
$previousStart = app('navigation')->subtractPeriod($start, $autoBudget->period);
|
||||
$previousEnd = app('navigation')->endOfPeriod($previousStart, $autoBudget->period);
|
||||
$previousStart = Navigation::subtractPeriod($start, $autoBudget->period);
|
||||
$previousEnd = Navigation::endOfPeriod($previousStart, $autoBudget->period);
|
||||
|
||||
Log::debug(
|
||||
sprintf(
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Jobs;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Events\RequestedReportOnJournals;
|
||||
use FireflyIII\Events\StoredTransactionGroup;
|
||||
@@ -132,7 +133,7 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
$this->groupRepository->setUser($recurrence->user);
|
||||
|
||||
// clear cache for user
|
||||
app('preferences')->setForUser($recurrence->user, 'lastActivity', microtime());
|
||||
Preferences::setForUser($recurrence->user, 'lastActivity', microtime());
|
||||
|
||||
Log::debug(sprintf('Now at recurrence #%d of user #%d', $recurrence->id, $recurrence->user_id));
|
||||
$createdReps = $this->handleRepetitions($recurrence);
|
||||
@@ -150,7 +151,7 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
Log::debug('Done with handle()');
|
||||
|
||||
// clear cache:
|
||||
app('preferences')->mark();
|
||||
Preferences::mark();
|
||||
}
|
||||
|
||||
private function filterRecurrences(Collection $recurrences): Collection
|
||||
@@ -414,6 +415,9 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
$transactions->first();
|
||||
$return = [];
|
||||
|
||||
|
||||
|
||||
|
||||
/** @var RecurrenceTransaction $transaction */
|
||||
foreach ($transactions as $index => $transaction) {
|
||||
$single = [
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Notifications;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use FireflyIII\Support\Notifications\UrlValidator;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
@@ -94,7 +95,7 @@ class ReturnsAvailableChannels
|
||||
$channels = ['mail'];
|
||||
|
||||
if (true === config('notifications.channels.slack.enabled', false)) {
|
||||
$slackUrl = (string) app('preferences')->getEncryptedForUser($user, 'slack_webhook_url', '')->data;
|
||||
$slackUrl = (string) Preferences::getEncryptedForUser($user, 'slack_webhook_url', '')->data;
|
||||
if (UrlValidator::isValidWebhookURL($slackUrl)) {
|
||||
$channels[] = 'slack';
|
||||
}
|
||||
@@ -102,20 +103,20 @@ class ReturnsAvailableChannels
|
||||
|
||||
// // validate presence of of Ntfy settings.
|
||||
// if (true === config('notifications.channels.nfy.enabled', false)) {
|
||||
// $ntfyTopic = (string) app('preferences')->getEncryptedForUser($user, 'ntfy_topic', '')->data;
|
||||
// $ntfyTopic = (string) \FireflyIII\Support\Facades\Preferences::getEncryptedForUser($user, 'ntfy_topic', '')->data;
|
||||
// if ('' !== $ntfyTopic) {
|
||||
// Log::debug(sprintf('Enabled ntfy, "%s"', $ntfyTopic));
|
||||
// $channels[] = NtfyChannel::class;
|
||||
// }
|
||||
// if ('' === (string) app('preferences')->getEncryptedForUser($user, 'ntfy_topic', '')->data) {
|
||||
// if ('' === (string) \FireflyIII\Support\Facades\Preferences::getEncryptedForUser($user, 'ntfy_topic', '')->data) {
|
||||
// Log::warning('No topic name for Ntfy, channel is disabled.');
|
||||
// }
|
||||
// }
|
||||
|
||||
// pushover
|
||||
if (true === config('notifications.channels.slack.enabled', false)) {
|
||||
$pushoverAppToken = (string) app('preferences')->getEncryptedForUser($user, 'pushover_app_token', '')->data;
|
||||
$pushoverUserToken = (string) app('preferences')->getEncryptedForUser($user, 'pushover_user_token', '')->data;
|
||||
$pushoverAppToken = (string) Preferences::getEncryptedForUser($user, 'pushover_app_token', '')->data;
|
||||
$pushoverUserToken = (string) Preferences::getEncryptedForUser($user, 'pushover_user_token', '')->data;
|
||||
if ('' === $pushoverAppToken || '' === $pushoverUserToken) {
|
||||
Log::warning('[b] No Pushover token, channel is disabled.');
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Bill;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Factory\BillFactory;
|
||||
@@ -463,11 +464,11 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
|
||||
|
||||
while ($start < $date) {
|
||||
Log::debug(sprintf('$start (%s) < $date (%s)', $start->format('Y-m-d H:i:s'), $date->format('Y-m-d H:i:s')));
|
||||
$start = app('navigation')->addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
$start = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
Log::debug('Start is now '.$start->format('Y-m-d H:i:s'));
|
||||
}
|
||||
|
||||
$end = app('navigation')->addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
$end = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
$end->endOfDay();
|
||||
|
||||
// see if the bill was paid in this period.
|
||||
@@ -477,7 +478,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
|
||||
// this period had in fact a bill. The new start is the current end, and we create a new end.
|
||||
Log::debug(sprintf('Journal count is %d, so start becomes %s', $journalCount, $end->format('Y-m-d')));
|
||||
$start = clone $end;
|
||||
$end = app('navigation')->addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
$end = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
}
|
||||
Log::debug('nextExpectedMatch: Final start is '.$start->format('Y-m-d'));
|
||||
Log::debug('nextExpectedMatch: Matching end is '.$end->format('Y-m-d'));
|
||||
@@ -681,7 +682,7 @@ class BillRepository implements BillRepositoryInterface, UserGroupInterface
|
||||
$start = clone $bill->date;
|
||||
|
||||
while ($start < $date) {
|
||||
$start = app('navigation')->addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
$start = Navigation::addPeriod($start, $bill->repeat_freq, $bill->skip);
|
||||
}
|
||||
$cache->store($start);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Budget;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AutoBudgetType;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
@@ -790,8 +791,8 @@ class BudgetRepository implements BudgetRepositoryInterface, UserGroupInterface
|
||||
|
||||
// create initial budget limit.
|
||||
$today = today(config('app.timezone'));
|
||||
$start = app('navigation')->startOfPeriod($today, $autoBudget->period);
|
||||
$end = app('navigation')->endOfPeriod($start, $autoBudget->period);
|
||||
$start = Navigation::startOfPeriod($today, $autoBudget->period);
|
||||
$end = Navigation::endOfPeriod($start, $autoBudget->period);
|
||||
|
||||
$limitRepos = app(BudgetLimitRepositoryInterface::class);
|
||||
$limitRepos->setUser($this->user);
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Budget;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
@@ -45,7 +46,7 @@ class NoBudgetRepository implements NoBudgetRepositoryInterface, UserGroupInterf
|
||||
#[Deprecated]
|
||||
public function getNoBudgetPeriodReport(Collection $accounts, Carbon $start, Carbon $end): array
|
||||
{
|
||||
$carbonFormat = app('navigation')->preferredCarbonFormat($start, $end);
|
||||
$carbonFormat = Navigation::preferredCarbonFormat($start, $end);
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Budget;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use Deprecated;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
@@ -82,7 +83,7 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
#[Deprecated]
|
||||
public function getBudgetPeriodReport(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): array
|
||||
{
|
||||
$carbonFormat = app('navigation')->preferredCarbonFormat($start, $end);
|
||||
$carbonFormat = Navigation::preferredCarbonFormat($start, $end);
|
||||
$data = [];
|
||||
|
||||
// get all transactions:
|
||||
|
||||
@@ -76,7 +76,6 @@ class JournalRepository implements JournalRepositoryInterface, UserGroupInterfac
|
||||
*/
|
||||
public function firstNull(): ?TransactionJournal
|
||||
{
|
||||
/** @var null|TransactionJournal $entry */
|
||||
return $this->user->transactionJournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']);
|
||||
}
|
||||
|
||||
@@ -113,7 +112,6 @@ class JournalRepository implements JournalRepositoryInterface, UserGroupInterfac
|
||||
|
||||
public function getLast(): ?TransactionJournal
|
||||
{
|
||||
/** @var null|TransactionJournal $entry */
|
||||
return $this->user->transactionJournals()->orderBy('date', 'DESC')->first(['transaction_journals.*']);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Recurring;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Factory\RecurrenceFactory;
|
||||
@@ -436,7 +437,7 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte
|
||||
Log::debug('Now in repetitionDescription()');
|
||||
|
||||
/** @var Preference $pref */
|
||||
$pref = app('preferences')->getForUser($this->user, 'language', config('firefly.default_language', 'en_US'));
|
||||
$pref = Preferences::getForUser($this->user, 'language', config('firefly.default_language', 'en_US'));
|
||||
$language = $pref->data;
|
||||
if (is_array($language)) {
|
||||
$language = 'en_US';
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\User;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
@@ -57,12 +58,12 @@ class UserRepository implements UserRepositoryInterface
|
||||
$oldEmail = $user->email;
|
||||
|
||||
// save old email as pref
|
||||
app('preferences')->setForUser($user, 'previous_email_latest', $oldEmail);
|
||||
app('preferences')->setForUser($user, 'previous_email_'.Carbon::now()->format('Y-m-d-H-i-s'), $oldEmail);
|
||||
Preferences::setForUser($user, 'previous_email_latest', $oldEmail);
|
||||
Preferences::setForUser($user, 'previous_email_'.Carbon::now()->format('Y-m-d-H-i-s'), $oldEmail);
|
||||
|
||||
// set undo and confirm token:
|
||||
app('preferences')->setForUser($user, 'email_change_undo_token', bin2hex(random_bytes(16)));
|
||||
app('preferences')->setForUser($user, 'email_change_confirm_token', bin2hex(random_bytes(16)));
|
||||
Preferences::setForUser($user, 'email_change_undo_token', bin2hex(random_bytes(16)));
|
||||
Preferences::setForUser($user, 'email_change_confirm_token', bin2hex(random_bytes(16)));
|
||||
// update user
|
||||
|
||||
$user->email = $newEmail;
|
||||
@@ -367,8 +368,8 @@ class UserRepository implements UserRepositoryInterface
|
||||
$oldEmail = $user->email;
|
||||
|
||||
// save old email as pref
|
||||
app('preferences')->setForUser($user, 'admin_previous_email_latest', $oldEmail);
|
||||
app('preferences')->setForUser($user, 'admin_previous_email_'.Carbon::now()->format('Y-m-d-H-i-s'), $oldEmail);
|
||||
Preferences::setForUser($user, 'admin_previous_email_latest', $oldEmail);
|
||||
Preferences::setForUser($user, 'admin_previous_email_'.Carbon::now()->format('Y-m-d-H-i-s'), $oldEmail);
|
||||
|
||||
$user->email = $newEmail;
|
||||
$user->save();
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Services\Internal\Support;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Carbon\Carbon;
|
||||
use Deprecated;
|
||||
@@ -193,7 +194,7 @@ trait AccountServiceTrait
|
||||
protected function createOBGroup(Account $account, array $data): TransactionGroup
|
||||
{
|
||||
Log::debug('Now going to create an OB group.');
|
||||
$language = app('preferences')->getForUser($account->user, 'language', 'en_US')->data;
|
||||
$language = Preferences::getForUser($account->user, 'language', 'en_US')->data;
|
||||
if (is_array($language)) {
|
||||
$language = 'en_US';
|
||||
}
|
||||
@@ -425,7 +426,7 @@ trait AccountServiceTrait
|
||||
throw new FireflyException('Amount for new liability credit was unexpectedly 0.');
|
||||
}
|
||||
|
||||
$language = app('preferences')->getForUser($account->user, 'language', 'en_US')->data;
|
||||
$language = Preferences::getForUser($account->user, 'language', 'en_US')->data;
|
||||
if (is_array($language)) {
|
||||
$language = 'en_US';
|
||||
}
|
||||
@@ -615,7 +616,7 @@ trait AccountServiceTrait
|
||||
protected function createOBGroupV2(Account $account, string $openingBalance, Carbon $openingBalanceDate): TransactionGroup
|
||||
{
|
||||
Log::debug('Now going to create an OB group.');
|
||||
$language = app('preferences')->getForUser($account->user, 'language', 'en_US')->data;
|
||||
$language = Preferences::getForUser($account->user, 'language', 'en_US')->data;
|
||||
if (is_array($language)) {
|
||||
$language = 'en_US';
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Services\Internal\Update;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Events\UpdatedAccount;
|
||||
@@ -291,7 +292,7 @@ class AccountUpdateService
|
||||
if (true === $account->active) {
|
||||
return;
|
||||
}
|
||||
$preference = app('preferences')->getForUser($account->user, 'frontpageAccounts');
|
||||
$preference = Preferences::getForUser($account->user, 'frontpageAccounts');
|
||||
if (null === $preference) {
|
||||
return;
|
||||
}
|
||||
@@ -310,6 +311,6 @@ class AccountUpdateService
|
||||
}
|
||||
}
|
||||
Log::debug('Final new array is', $new);
|
||||
app('preferences')->setForUser($account->user, 'frontpageAccounts', $new);
|
||||
Preferences::setForUser($account->user, 'frontpageAccounts', $new);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Services\Internal\Update;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use FireflyIII\Events\TriggeredAuditLog;
|
||||
use FireflyIII\Exceptions\DuplicateTransactionException;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
@@ -83,7 +84,7 @@ class GroupUpdateService
|
||||
$this->updateTransactionJournal($transactionGroup, $first, reset($transactions));
|
||||
$transactionGroup->touch();
|
||||
$transactionGroup->refresh();
|
||||
app('preferences')->mark();
|
||||
Preferences::mark();
|
||||
|
||||
return $transactionGroup;
|
||||
}
|
||||
@@ -98,7 +99,7 @@ class GroupUpdateService
|
||||
Log::error('There were no transactions updated or created. Will not delete anything.');
|
||||
$transactionGroup->touch();
|
||||
$transactionGroup->refresh();
|
||||
app('preferences')->mark();
|
||||
Preferences::mark();
|
||||
|
||||
return $transactionGroup;
|
||||
}
|
||||
@@ -116,7 +117,7 @@ class GroupUpdateService
|
||||
$service->destroy($journal);
|
||||
}
|
||||
|
||||
app('preferences')->mark();
|
||||
Preferences::mark();
|
||||
$transactionGroup->touch();
|
||||
$transactionGroup->refresh();
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Services\Internal\Update;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Carbon\Carbon;
|
||||
use Carbon\Exceptions\InvalidDateException;
|
||||
use Carbon\Exceptions\InvalidFormatException;
|
||||
@@ -165,7 +166,7 @@ class JournalUpdateService
|
||||
$this->updateAmount();
|
||||
$this->updateForeignAmount();
|
||||
|
||||
app('preferences')->mark();
|
||||
Preferences::mark();
|
||||
|
||||
$this->transactionJournal->refresh();
|
||||
Log::debug('Done with update journal routine');
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Binder;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use Illuminate\Routing\Route;
|
||||
@@ -46,7 +47,7 @@ class CLIToken implements BinderInterface
|
||||
}
|
||||
|
||||
foreach ($users as $user) {
|
||||
$accessToken = app('preferences')->getForUser($user, 'access_token');
|
||||
$accessToken = Preferences::getForUser($user, 'access_token');
|
||||
if (null !== $accessToken && $accessToken->data === $value) {
|
||||
Log::info(sprintf('Recognized user #%d (%s) from his access token.', $user->id, $user->email));
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use Illuminate\Support\Collection;
|
||||
@@ -44,7 +45,7 @@ class CacheProperties
|
||||
$this->properties = new Collection();
|
||||
if (auth()->check()) {
|
||||
$this->addProperty(auth()->user()->id);
|
||||
$this->addProperty(app('preferences')->lastActivity());
|
||||
$this->addProperty(Preferences::lastActivity());
|
||||
$this->addProperty(Steam::anonymous());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Chart\Category;
|
||||
|
||||
use FireflyIII\Support\Facades\Navigation;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Models\Category;
|
||||
@@ -59,10 +60,10 @@ class WholePeriodChartGenerator
|
||||
|
||||
while ($current <= $end) {
|
||||
$key = $current->format('Y-m-d');
|
||||
$currentEnd = app('navigation')->endOfPeriod($current, $step);
|
||||
$currentEnd = Navigation::endOfPeriod($current, $step);
|
||||
$spent[$key] = $opsRepository->sumExpenses($current, $currentEnd, $accounts, $collection);
|
||||
$earned[$key] = $opsRepository->sumIncome($current, $currentEnd, $accounts, $collection);
|
||||
$current = app('navigation')->addPeriod($current, $step);
|
||||
$current = Navigation::addPeriod($current, $step);
|
||||
}
|
||||
|
||||
$currencies = $this->extractCurrencies($spent) + $this->extractCurrencies($earned);
|
||||
@@ -91,7 +92,7 @@ class WholePeriodChartGenerator
|
||||
|
||||
while ($current <= $end) {
|
||||
$key = $current->format('Y-m-d');
|
||||
$label = app('navigation')->periodShow($current, $step);
|
||||
$label = Navigation::periodShow($current, $step);
|
||||
|
||||
/** @var array $currency */
|
||||
foreach ($currencies as $currency) {
|
||||
@@ -104,7 +105,7 @@ class WholePeriodChartGenerator
|
||||
$chartData[$spentInfoKey]['entries'][$label] = app('steam')->bcround($spentAmount, $currency['currency_decimal_places']);
|
||||
$chartData[$earnedInfoKey]['entries'][$label] = app('steam')->bcround($earnedAmount, $currency['currency_decimal_places']);
|
||||
}
|
||||
$current = app('navigation')->addPeriod($current, $step);
|
||||
$current = Navigation::addPeriod($current, $step);
|
||||
}
|
||||
|
||||
return $chartData;
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Cronjobs;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Jobs\CreateAutoBudgetLimits;
|
||||
use FireflyIII\Models\Configuration;
|
||||
@@ -62,7 +63,7 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
}
|
||||
|
||||
$this->fireAutoBudget();
|
||||
app('preferences')->mark();
|
||||
Preferences::mark();
|
||||
}
|
||||
|
||||
private function fireAutoBudget(): void
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Cronjobs;
|
||||
|
||||
use FireflyIII\Support\Facades\Preferences;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Jobs\WarnAboutBills;
|
||||
@@ -74,7 +75,7 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
|
||||
$this->fireWarnings();
|
||||
|
||||
app('preferences')->mark();
|
||||
Preferences::mark();
|
||||
}
|
||||
|
||||
private function fireWarnings(): void
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user