mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-19 17:51:19 +00:00
Compare commits
328 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3bc98bee20 | ||
|
|
f6302bc29b | ||
|
|
43aa1704a9 | ||
|
|
14fe82e361 | ||
|
|
33317c15a2 | ||
|
|
ff1b56c5ef | ||
|
|
25e2063d70 | ||
|
|
1d36c74934 | ||
|
|
aebe7908f0 | ||
|
|
3e2b881296 | ||
|
|
c670a6991d | ||
|
|
f76a7d59e0 | ||
|
|
3d8bf3ec9b | ||
|
|
55e4479454 | ||
|
|
436fe9fea4 | ||
|
|
63a7a4b03b | ||
|
|
0cab974048 | ||
|
|
5fdcf37d06 | ||
|
|
4663fb2f12 | ||
|
|
e844ab592d | ||
|
|
3dcb35710b | ||
|
|
8d87abde64 | ||
|
|
2b78485a61 | ||
|
|
9d057b853f | ||
|
|
bd269eaadf | ||
|
|
7096c65f50 | ||
|
|
1462b0de69 | ||
|
|
86a1f170c4 | ||
|
|
40389fb6d5 | ||
|
|
36021d84cf | ||
|
|
1278f92355 | ||
|
|
573f9adb49 | ||
|
|
431c99c27b | ||
|
|
77cc558931 | ||
|
|
42043de34f | ||
|
|
f2b2c2109f | ||
|
|
7fe29ad983 | ||
|
|
07d9bcfb9d | ||
|
|
fdd235e4cb | ||
|
|
2646acadb8 | ||
|
|
5ef646b810 | ||
|
|
e8bdb5ef38 | ||
|
|
7a851c2cc6 | ||
|
|
624784e54e | ||
|
|
20eb2ebe58 | ||
|
|
25f8acb417 | ||
|
|
f75e6430b1 | ||
|
|
e72a483c49 | ||
|
|
68934858ce | ||
|
|
c08b5177d9 | ||
|
|
fe8635f1ce | ||
|
|
e96d28b981 | ||
|
|
784cc3d52d | ||
|
|
2ab3fb3a71 | ||
|
|
ff765d4687 | ||
|
|
f6e778e1d4 | ||
|
|
ed36604050 | ||
|
|
cbf8c6e80d | ||
|
|
f11db0de61 | ||
|
|
34f16dcdd5 | ||
|
|
f18aae39b8 | ||
|
|
924171e7b9 | ||
|
|
6b580212bf | ||
|
|
208ae1cae7 | ||
|
|
3aa7fe47de | ||
|
|
5318082467 | ||
|
|
941ec095e5 | ||
|
|
d5ebd8e57c | ||
|
|
ebe087984d | ||
|
|
fa993e02dd | ||
|
|
44df77f45a | ||
|
|
0f8f95de9a | ||
|
|
f32283d2f1 | ||
|
|
14f8695599 | ||
|
|
f8b48f7455 | ||
|
|
70e2aab073 | ||
|
|
12db745f17 | ||
|
|
8a48cc690f | ||
|
|
eb313c65a5 | ||
|
|
07d6cbc194 | ||
|
|
8975a462c4 | ||
|
|
2e4f07d058 | ||
|
|
74a2935fea | ||
|
|
3d02468828 | ||
|
|
0438fb5a2e | ||
|
|
a4f9a6fd42 | ||
|
|
a0be4c9daa | ||
|
|
2dc003bd85 | ||
|
|
78aa8bd838 | ||
|
|
f55fde2b52 | ||
|
|
232572549e | ||
|
|
d07705c329 | ||
|
|
688ca8e374 | ||
|
|
160c364d2a | ||
|
|
2b3e6bfbb9 | ||
|
|
5a55d1db24 | ||
|
|
bd252dbc16 | ||
|
|
30124855e3 | ||
|
|
463ebd296f | ||
|
|
2e7a17560d | ||
|
|
374d5a074d | ||
|
|
88b294d873 | ||
|
|
0aa6d5b322 | ||
|
|
1357074dcd | ||
|
|
4a03847c14 | ||
|
|
346289fdb2 | ||
|
|
673c7d98f6 | ||
|
|
9473fb849a | ||
|
|
f60e244739 | ||
|
|
a571106f0f | ||
|
|
244d9be46e | ||
|
|
dcf71c6fdf | ||
|
|
1e1497ff4e | ||
|
|
b72aa92e55 | ||
|
|
527f18c1e3 | ||
|
|
788003dcdc | ||
|
|
c764ddd3be | ||
|
|
057ac0691c | ||
|
|
4334e9bed7 | ||
|
|
a9bb87b0c6 | ||
|
|
43f668dc65 | ||
|
|
6ed5892cf9 | ||
|
|
023a3fdade | ||
|
|
1b52147a05 | ||
|
|
7f7644c92f | ||
|
|
70b756baaf | ||
|
|
0f008b9b1e | ||
|
|
4d956858de | ||
|
|
959370a204 | ||
|
|
336829cd24 | ||
|
|
5975ab5170 | ||
|
|
eba0e942e8 | ||
|
|
f45c20db1e | ||
|
|
79afe09d8d | ||
|
|
334d010a24 | ||
|
|
91947daa5b | ||
|
|
aad2ca4488 | ||
|
|
7c68a96f7b | ||
|
|
2e1e8b5d39 | ||
|
|
178df1ed4a | ||
|
|
28749e2513 | ||
|
|
6cbe57ef40 | ||
|
|
13d3b86309 | ||
|
|
cf8f43cdf2 | ||
|
|
cc83268b2c | ||
|
|
8f23b47a78 | ||
|
|
529611170c | ||
|
|
c1114e889e | ||
|
|
d20e03a7b6 | ||
|
|
6303233bdf | ||
|
|
baa8c00144 | ||
|
|
e6daaa5b6d | ||
|
|
f711fcfd52 | ||
|
|
74992e95f2 | ||
|
|
20c8c1043f | ||
|
|
f00898afba | ||
|
|
95b431535e | ||
|
|
cafd8a9674 | ||
|
|
e1e7f914f9 | ||
|
|
19c2f7d2bf | ||
|
|
7daacd9b66 | ||
|
|
af715de566 | ||
|
|
93e3c89f20 | ||
|
|
b0456c5252 | ||
|
|
f7fa03ddd8 | ||
|
|
4c78e23a9c | ||
|
|
79c2065471 | ||
|
|
c19b89ac93 | ||
|
|
62a1837d61 | ||
|
|
56b34aa624 | ||
|
|
e8392155f9 | ||
|
|
6d532470e6 | ||
|
|
15f683ef7e | ||
|
|
18ba2e563e | ||
|
|
63984f1c37 | ||
|
|
3c082dcf0e | ||
|
|
090eb55226 | ||
|
|
4706cd44de | ||
|
|
cf7c01e5d0 | ||
|
|
0b5e0a268a | ||
|
|
9eea4497e5 | ||
|
|
63fdc2487f | ||
|
|
cf59da7e0c | ||
|
|
e0621affb6 | ||
|
|
6d0906c37b | ||
|
|
a3ede0c6f6 | ||
|
|
72eab3c0eb | ||
|
|
c530961546 | ||
|
|
dd7aba0b51 | ||
|
|
7c54e17a30 | ||
|
|
342d72b0a6 | ||
|
|
22ee504e52 | ||
|
|
4880ee850e | ||
|
|
b45ce27817 | ||
|
|
dfad93d9ec | ||
|
|
52712c8cb2 | ||
|
|
740874e654 | ||
|
|
0f1f37a5df | ||
|
|
d609cbfb16 | ||
|
|
2375857c92 | ||
|
|
10275eb832 | ||
|
|
108867b2ef | ||
|
|
e5a77a86f9 | ||
|
|
309d3e8e95 | ||
|
|
1ef9b83180 | ||
|
|
85757e1a20 | ||
|
|
e2a18e0e7c | ||
|
|
056af8fd8a | ||
|
|
c72a63f218 | ||
|
|
fb823ed422 | ||
|
|
3fae6c0cac | ||
|
|
55b1e22d37 | ||
|
|
e6b95c7894 | ||
|
|
ea2f9e4919 | ||
|
|
08bd405e29 | ||
|
|
8294b2d526 | ||
|
|
b521fb8fae | ||
|
|
3e9789d5e6 | ||
|
|
13b029d7f0 | ||
|
|
59427ba5c2 | ||
|
|
46bba9d799 | ||
|
|
0ef1d1834f | ||
|
|
e39b2f5355 | ||
|
|
03dae53714 | ||
|
|
6be6187532 | ||
|
|
4c26f613ee | ||
|
|
765de2eeba | ||
|
|
49b1fef7ff | ||
|
|
36157afc6a | ||
|
|
c5c3638dbc | ||
|
|
926665a8f5 | ||
|
|
e35743ff42 | ||
|
|
321743dbf6 | ||
|
|
c2e1e25489 | ||
|
|
222387adba | ||
|
|
335414f25a | ||
|
|
ea903c105d | ||
|
|
aab29852b4 | ||
|
|
aa17ea0b68 | ||
|
|
deeb5bf118 | ||
|
|
47d5e8d169 | ||
|
|
033d61abbb | ||
|
|
28efc15820 | ||
|
|
1c7988fad2 | ||
|
|
c8077762ba | ||
|
|
ea53b34cbb | ||
|
|
270ac87e65 | ||
|
|
0a60f63bf8 | ||
|
|
38ed70243e | ||
|
|
0f2a9a9b37 | ||
|
|
ec525849fc | ||
|
|
dee1e1a79d | ||
|
|
98b5ed9e5b | ||
|
|
d8eb084240 | ||
|
|
c2f5fbe7d3 | ||
|
|
60f6542a1b | ||
|
|
93c2edf76c | ||
|
|
f74f4c5719 | ||
|
|
8c67c347e1 | ||
|
|
fcbc341f03 | ||
|
|
2dbce10483 | ||
|
|
8504b3e3a9 | ||
|
|
d4ab5dcefd | ||
|
|
5d11e285bc | ||
|
|
259e1350d5 | ||
|
|
dd54ec6122 | ||
|
|
c2b3791336 | ||
|
|
fc1f15cc14 | ||
|
|
5d74979f50 | ||
|
|
5dea7e5b41 | ||
|
|
a53a8a8529 | ||
|
|
aac7a2691d | ||
|
|
10e7be1729 | ||
|
|
9b1319f970 | ||
|
|
a38f909919 | ||
|
|
d8c0192f54 | ||
|
|
1e8d294b8d | ||
|
|
d3be64114b | ||
|
|
1bddd4da8e | ||
|
|
6b5ff2680b | ||
|
|
efe17f638a | ||
|
|
3c1f4b7377 | ||
|
|
acfc214eb1 | ||
|
|
fe1c605c11 | ||
|
|
891cd94031 | ||
|
|
c620d57f42 | ||
|
|
b076c92eb0 | ||
|
|
9e35216e98 | ||
|
|
3fa4734ba7 | ||
|
|
0144d09325 | ||
|
|
f28274aded | ||
|
|
d5f5df82b6 | ||
|
|
49c27aff2d | ||
|
|
7b1b0cfef9 | ||
|
|
f728bdeb5a | ||
|
|
4712a826d1 | ||
|
|
d7335d71ea | ||
|
|
e6a84ab387 | ||
|
|
fd5269490d | ||
|
|
05e307136c | ||
|
|
2c41215e84 | ||
|
|
d9dc394e7f | ||
|
|
a63daf6166 | ||
|
|
f878af0d3b | ||
|
|
def0578421 | ||
|
|
a2e07b1518 | ||
|
|
dc26ce308d | ||
|
|
0189b91d3b | ||
|
|
fb6706648e | ||
|
|
3c20fd7533 | ||
|
|
82f89ef614 | ||
|
|
4d10ae91b7 | ||
|
|
aebb677c21 | ||
|
|
abf9c65b21 | ||
|
|
524dcc7d97 | ||
|
|
0a4f6fd6b8 | ||
|
|
9c4beab0a7 | ||
|
|
b91e019416 | ||
|
|
ad97e33ec0 | ||
|
|
b1479b5dae | ||
|
|
f1445b0132 | ||
|
|
456dbfd29d | ||
|
|
0eea776b8b | ||
|
|
853a97307b | ||
|
|
3b28b5d07a | ||
|
|
a7bfa503d9 | ||
|
|
a7c3d32370 | ||
|
|
c64ddbec1f |
1
.ci/php-cs-fixer/.gitignore
vendored
1
.ci/php-cs-fixer/.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
vendor
|
vendor
|
||||||
|
.php-cs-fixer.cache
|
||||||
|
|||||||
197
.ci/php-cs-fixer/composer.lock
generated
197
.ci/php-cs-fixer/composer.lock
generated
@@ -379,16 +379,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "friendsofphp/php-cs-fixer",
|
"name": "friendsofphp/php-cs-fixer",
|
||||||
"version": "v3.16.0",
|
"version": "v3.19.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||||
"reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc"
|
"reference": "210dd89560edb27a8e0d5086b734ac5b5fd4e0e4"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d40f9436e1c448d309fa995ab9c14c5c7a96f2dc",
|
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/210dd89560edb27a8e0d5086b734ac5b5fd4e0e4",
|
||||||
"reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc",
|
"reference": "210dd89560edb27a8e0d5086b734ac5b5fd4e0e4",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -463,7 +463,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.16.0"
|
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.19.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -471,7 +471,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-04-02T19:30:06+00:00"
|
"time": "2023-06-25T16:42:58+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/cache",
|
"name": "psr/cache",
|
||||||
@@ -677,16 +677,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/diff",
|
"name": "sebastian/diff",
|
||||||
"version": "5.0.1",
|
"version": "5.0.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/diff.git",
|
"url": "https://github.com/sebastianbergmann/diff.git",
|
||||||
"reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02"
|
"reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02",
|
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/912dc2fbe3e3c1e7873313cc801b100b6c68c87b",
|
||||||
"reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02",
|
"reference": "912dc2fbe3e3c1e7873313cc801b100b6c68c87b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -732,7 +732,7 @@
|
|||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/diff/issues",
|
"issues": "https://github.com/sebastianbergmann/diff/issues",
|
||||||
"security": "https://github.com/sebastianbergmann/diff/security/policy",
|
"security": "https://github.com/sebastianbergmann/diff/security/policy",
|
||||||
"source": "https://github.com/sebastianbergmann/diff/tree/5.0.1"
|
"source": "https://github.com/sebastianbergmann/diff/tree/5.0.3"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -740,27 +740,27 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-03-23T05:12:41+00:00"
|
"time": "2023-05-01T07:48:21+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/console",
|
"name": "symfony/console",
|
||||||
"version": "v6.2.8",
|
"version": "v6.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/console.git",
|
"url": "https://github.com/symfony/console.git",
|
||||||
"reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b"
|
"reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/console/zipball/3582d68a64a86ec25240aaa521ec8bc2342b369b",
|
"url": "https://api.github.com/repos/symfony/console/zipball/8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7",
|
||||||
"reference": "3582d68a64a86ec25240aaa521ec8bc2342b369b",
|
"reference": "8788808b07cf0bdd6e4b7fdd23d8ddb1470c83b7",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1",
|
"php": ">=8.1",
|
||||||
"symfony/deprecation-contracts": "^2.1|^3",
|
"symfony/deprecation-contracts": "^2.5|^3",
|
||||||
"symfony/polyfill-mbstring": "~1.0",
|
"symfony/polyfill-mbstring": "~1.0",
|
||||||
"symfony/service-contracts": "^1.1|^2|^3",
|
"symfony/service-contracts": "^2.5|^3",
|
||||||
"symfony/string": "^5.4|^6.0"
|
"symfony/string": "^5.4|^6.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
@@ -782,12 +782,6 @@
|
|||||||
"symfony/process": "^5.4|^6.0",
|
"symfony/process": "^5.4|^6.0",
|
||||||
"symfony/var-dumper": "^5.4|^6.0"
|
"symfony/var-dumper": "^5.4|^6.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
|
||||||
"psr/log": "For using the console logger",
|
|
||||||
"symfony/event-dispatcher": "",
|
|
||||||
"symfony/lock": "",
|
|
||||||
"symfony/process": ""
|
|
||||||
},
|
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@@ -820,7 +814,7 @@
|
|||||||
"terminal"
|
"terminal"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/console/tree/v6.2.8"
|
"source": "https://github.com/symfony/console/tree/v6.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -836,20 +830,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-03-29T21:42:15+00:00"
|
"time": "2023-05-29T12:49:39+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/deprecation-contracts",
|
"name": "symfony/deprecation-contracts",
|
||||||
"version": "v3.2.1",
|
"version": "v3.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||||
"reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e"
|
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e",
|
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
|
||||||
"reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e",
|
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -858,7 +852,7 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "3.3-dev"
|
"dev-main": "3.4-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/contracts",
|
"name": "symfony/contracts",
|
||||||
@@ -887,7 +881,7 @@
|
|||||||
"description": "A generic function and convention to trigger deprecation notices",
|
"description": "A generic function and convention to trigger deprecation notices",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1"
|
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -903,28 +897,29 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-03-01T10:25:55+00:00"
|
"time": "2023-05-23T14:45:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/event-dispatcher",
|
"name": "symfony/event-dispatcher",
|
||||||
"version": "v6.2.8",
|
"version": "v6.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||||
"reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339"
|
"reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/04046f35fd7d72f9646e721fc2ecb8f9c67d3339",
|
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa",
|
||||||
"reference": "04046f35fd7d72f9646e721fc2ecb8f9c67d3339",
|
"reference": "3af8ac1a3f98f6dbc55e10ae59c9e44bfc38dfaa",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1",
|
"php": ">=8.1",
|
||||||
"symfony/event-dispatcher-contracts": "^2|^3"
|
"symfony/event-dispatcher-contracts": "^2.5|^3"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/dependency-injection": "<5.4"
|
"symfony/dependency-injection": "<5.4",
|
||||||
|
"symfony/service-contracts": "<2.5"
|
||||||
},
|
},
|
||||||
"provide": {
|
"provide": {
|
||||||
"psr/event-dispatcher-implementation": "1.0",
|
"psr/event-dispatcher-implementation": "1.0",
|
||||||
@@ -937,13 +932,9 @@
|
|||||||
"symfony/error-handler": "^5.4|^6.0",
|
"symfony/error-handler": "^5.4|^6.0",
|
||||||
"symfony/expression-language": "^5.4|^6.0",
|
"symfony/expression-language": "^5.4|^6.0",
|
||||||
"symfony/http-foundation": "^5.4|^6.0",
|
"symfony/http-foundation": "^5.4|^6.0",
|
||||||
"symfony/service-contracts": "^1.1|^2|^3",
|
"symfony/service-contracts": "^2.5|^3",
|
||||||
"symfony/stopwatch": "^5.4|^6.0"
|
"symfony/stopwatch": "^5.4|^6.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
|
||||||
"symfony/dependency-injection": "",
|
|
||||||
"symfony/http-kernel": ""
|
|
||||||
},
|
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@@ -970,7 +961,7 @@
|
|||||||
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
|
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/event-dispatcher/tree/v6.2.8"
|
"source": "https://github.com/symfony/event-dispatcher/tree/v6.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -986,33 +977,30 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-03-20T16:06:02+00:00"
|
"time": "2023-04-21T14:41:17+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/event-dispatcher-contracts",
|
"name": "symfony/event-dispatcher-contracts",
|
||||||
"version": "v3.2.1",
|
"version": "v3.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
|
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
|
||||||
"reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd"
|
"reference": "a76aed96a42d2b521153fb382d418e30d18b59df"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0ad3b6f1e4e2da5690fefe075cd53a238646d8dd",
|
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df",
|
||||||
"reference": "0ad3b6f1e4e2da5690fefe075cd53a238646d8dd",
|
"reference": "a76aed96a42d2b521153fb382d418e30d18b59df",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1",
|
"php": ">=8.1",
|
||||||
"psr/event-dispatcher": "^1"
|
"psr/event-dispatcher": "^1"
|
||||||
},
|
},
|
||||||
"suggest": {
|
|
||||||
"symfony/event-dispatcher-implementation": ""
|
|
||||||
},
|
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "3.3-dev"
|
"dev-main": "3.4-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/contracts",
|
"name": "symfony/contracts",
|
||||||
@@ -1049,7 +1037,7 @@
|
|||||||
"standards"
|
"standards"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.1"
|
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1065,20 +1053,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-03-01T10:32:47+00:00"
|
"time": "2023-05-23T14:45:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/filesystem",
|
"name": "symfony/filesystem",
|
||||||
"version": "v6.2.7",
|
"version": "v6.3.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/filesystem.git",
|
"url": "https://github.com/symfony/filesystem.git",
|
||||||
"reference": "82b6c62b959f642d000456f08c6d219d749215b3"
|
"reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/82b6c62b959f642d000456f08c6d219d749215b3",
|
"url": "https://api.github.com/repos/symfony/filesystem/zipball/edd36776956f2a6fcf577edb5b05eb0e3bdc52ae",
|
||||||
"reference": "82b6c62b959f642d000456f08c6d219d749215b3",
|
"reference": "edd36776956f2a6fcf577edb5b05eb0e3bdc52ae",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1112,7 +1100,7 @@
|
|||||||
"description": "Provides basic utilities for the filesystem",
|
"description": "Provides basic utilities for the filesystem",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/filesystem/tree/v6.2.7"
|
"source": "https://github.com/symfony/filesystem/tree/v6.3.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1128,20 +1116,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-02-14T08:44:56+00:00"
|
"time": "2023-06-01T08:30:39+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/finder",
|
"name": "symfony/finder",
|
||||||
"version": "v6.2.7",
|
"version": "v6.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/finder.git",
|
"url": "https://github.com/symfony/finder.git",
|
||||||
"reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb"
|
"reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/finder/zipball/20808dc6631aecafbe67c186af5dcb370be3a0eb",
|
"url": "https://api.github.com/repos/symfony/finder/zipball/d9b01ba073c44cef617c7907ce2419f8d00d75e2",
|
||||||
"reference": "20808dc6631aecafbe67c186af5dcb370be3a0eb",
|
"reference": "d9b01ba073c44cef617c7907ce2419f8d00d75e2",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1176,7 +1164,7 @@
|
|||||||
"description": "Finds files and directories via an intuitive fluent interface",
|
"description": "Finds files and directories via an intuitive fluent interface",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/finder/tree/v6.2.7"
|
"source": "https://github.com/symfony/finder/tree/v6.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1192,25 +1180,25 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-02-16T09:57:23+00:00"
|
"time": "2023-04-02T01:25:41+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/options-resolver",
|
"name": "symfony/options-resolver",
|
||||||
"version": "v6.2.7",
|
"version": "v6.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/options-resolver.git",
|
"url": "https://github.com/symfony/options-resolver.git",
|
||||||
"reference": "aa0e85b53bbb2b4951960efd61d295907eacd629"
|
"reference": "a10f19f5198d589d5c33333cffe98dc9820332dd"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/aa0e85b53bbb2b4951960efd61d295907eacd629",
|
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/a10f19f5198d589d5c33333cffe98dc9820332dd",
|
||||||
"reference": "aa0e85b53bbb2b4951960efd61d295907eacd629",
|
"reference": "a10f19f5198d589d5c33333cffe98dc9820332dd",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1",
|
"php": ">=8.1",
|
||||||
"symfony/deprecation-contracts": "^2.1|^3"
|
"symfony/deprecation-contracts": "^2.5|^3"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -1243,7 +1231,7 @@
|
|||||||
"options"
|
"options"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/options-resolver/tree/v6.2.7"
|
"source": "https://github.com/symfony/options-resolver/tree/v6.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1259,7 +1247,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-02-14T08:44:56+00:00"
|
"time": "2023-05-12T14:21:09+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
@@ -1755,16 +1743,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/process",
|
"name": "symfony/process",
|
||||||
"version": "v6.2.8",
|
"version": "v6.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/process.git",
|
"url": "https://github.com/symfony/process.git",
|
||||||
"reference": "75ed64103df4f6615e15a7fe38b8111099f47416"
|
"reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/process/zipball/75ed64103df4f6615e15a7fe38b8111099f47416",
|
"url": "https://api.github.com/repos/symfony/process/zipball/8741e3ed7fe2e91ec099e02446fb86667a0f1628",
|
||||||
"reference": "75ed64103df4f6615e15a7fe38b8111099f47416",
|
"reference": "8741e3ed7fe2e91ec099e02446fb86667a0f1628",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1796,7 +1784,7 @@
|
|||||||
"description": "Executes commands in sub-processes",
|
"description": "Executes commands in sub-processes",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/process/tree/v6.2.8"
|
"source": "https://github.com/symfony/process/tree/v6.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1812,20 +1800,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-03-09T16:20:02+00:00"
|
"time": "2023-05-19T08:06:44+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/service-contracts",
|
"name": "symfony/service-contracts",
|
||||||
"version": "v3.2.1",
|
"version": "v3.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/service-contracts.git",
|
"url": "https://github.com/symfony/service-contracts.git",
|
||||||
"reference": "a8c9cedf55f314f3a186041d19537303766df09a"
|
"reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a",
|
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4",
|
||||||
"reference": "a8c9cedf55f314f3a186041d19537303766df09a",
|
"reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1835,13 +1823,10 @@
|
|||||||
"conflict": {
|
"conflict": {
|
||||||
"ext-psr": "<1.1|>=2"
|
"ext-psr": "<1.1|>=2"
|
||||||
},
|
},
|
||||||
"suggest": {
|
|
||||||
"symfony/service-implementation": ""
|
|
||||||
},
|
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "3.3-dev"
|
"dev-main": "3.4-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/contracts",
|
"name": "symfony/contracts",
|
||||||
@@ -1881,7 +1866,7 @@
|
|||||||
"standards"
|
"standards"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/service-contracts/tree/v3.2.1"
|
"source": "https://github.com/symfony/service-contracts/tree/v3.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1897,25 +1882,25 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-03-01T10:32:47+00:00"
|
"time": "2023-05-23T14:45:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/stopwatch",
|
"name": "symfony/stopwatch",
|
||||||
"version": "v6.2.7",
|
"version": "v6.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/stopwatch.git",
|
"url": "https://github.com/symfony/stopwatch.git",
|
||||||
"reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f"
|
"reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/f3adc98c1061875dd2edcd45e5b04e63d0e29f8f",
|
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2",
|
||||||
"reference": "f3adc98c1061875dd2edcd45e5b04e63d0e29f8f",
|
"reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1",
|
"php": ">=8.1",
|
||||||
"symfony/service-contracts": "^1|^2|^3"
|
"symfony/service-contracts": "^2.5|^3"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -1943,7 +1928,7 @@
|
|||||||
"description": "Provides a way to profile code",
|
"description": "Provides a way to profile code",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/stopwatch/tree/v6.2.7"
|
"source": "https://github.com/symfony/stopwatch/tree/v6.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -1959,20 +1944,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-02-14T08:44:56+00:00"
|
"time": "2023-02-16T10:14:28+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/string",
|
"name": "symfony/string",
|
||||||
"version": "v6.2.8",
|
"version": "v6.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/string.git",
|
"url": "https://github.com/symfony/string.git",
|
||||||
"reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef"
|
"reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef",
|
"url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f",
|
||||||
"reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef",
|
"reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -1983,13 +1968,13 @@
|
|||||||
"symfony/polyfill-mbstring": "~1.0"
|
"symfony/polyfill-mbstring": "~1.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/translation-contracts": "<2.0"
|
"symfony/translation-contracts": "<2.5"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/error-handler": "^5.4|^6.0",
|
"symfony/error-handler": "^5.4|^6.0",
|
||||||
"symfony/http-client": "^5.4|^6.0",
|
"symfony/http-client": "^5.4|^6.0",
|
||||||
"symfony/intl": "^6.2",
|
"symfony/intl": "^6.2",
|
||||||
"symfony/translation-contracts": "^2.0|^3.0",
|
"symfony/translation-contracts": "^2.5|^3.0",
|
||||||
"symfony/var-exporter": "^5.4|^6.0"
|
"symfony/var-exporter": "^5.4|^6.0"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
@@ -2029,7 +2014,7 @@
|
|||||||
"utf8"
|
"utf8"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/string/tree/v6.2.8"
|
"source": "https://github.com/symfony/string/tree/v6.3.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -2045,7 +2030,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-03-20T16:06:02+00:00"
|
"time": "2023-03-21T21:06:29+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [],
|
"packages-dev": [],
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|||||||
|
|
||||||
# clean up php code
|
# clean up php code
|
||||||
cd $SCRIPT_DIR/php-cs-fixer
|
cd $SCRIPT_DIR/php-cs-fixer
|
||||||
composer update
|
composer update --quiet
|
||||||
rm -f .php-cs-fixer.cache
|
rm -f .php-cs-fixer.cache
|
||||||
PHP_CS_FIXER_IGNORE_ENV=true ./vendor/bin/php-cs-fixer fix --config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php --allow-risky=yes
|
PHP_CS_FIXER_IGNORE_ENV=true ./vendor/bin/php-cs-fixer fix --config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php --allow-risky=yes
|
||||||
cd $SCRIPT_DIR/..
|
cd $SCRIPT_DIR/..
|
||||||
|
|||||||
37
.ci/phpmd.sh
Normal file
37
.ci/phpmd.sh
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
#
|
||||||
|
# phpmd.sh
|
||||||
|
# Copyright (c) 2023 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/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
|
|
||||||
|
cd $SCRIPT_DIR/phpmd
|
||||||
|
composer update --quiet
|
||||||
|
./vendor/bin/phpmd \
|
||||||
|
$SCRIPT_DIR/../app text phpmd.xml \
|
||||||
|
--exclude $SCRIPT_DIR/../app/resources/** \
|
||||||
|
--exclude $SCRIPT_DIR/../app/frontend/** \
|
||||||
|
--exclude $SCRIPT_DIR/../app/public/** \
|
||||||
|
--exclude $SCRIPT_DIR/../app/vendor/** \
|
||||||
|
|
||||||
|
cd $SCRIPT_DIR/..
|
||||||
|
|
||||||
|
exit 0
|
||||||
1
.ci/phpmd/.gitignore
vendored
Normal file
1
.ci/phpmd/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
vendor
|
||||||
5
.ci/phpmd/composer.json
Normal file
5
.ci/phpmd/composer.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"require-dev": {
|
||||||
|
"phpmd/phpmd": "^2.13"
|
||||||
|
}
|
||||||
|
}
|
||||||
1012
.ci/phpmd/composer.lock
generated
Normal file
1012
.ci/phpmd/composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
52
.ci/phpmd/phpmd.xml
Normal file
52
.ci/phpmd/phpmd.xml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ruleset name="pcsg-generated-ruleset"
|
||||||
|
xmlns="http://pmd.sf.net/ruleset/1.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||||
|
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||||
|
<description>Bla bla</description>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Commando vanuit firefly directory:
|
||||||
|
phpmd database,app,tests html /gdrive-all/development/phpmd/phpmd.xml > public/report.html
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Import the entire controversial code rule set -->
|
||||||
|
<rule ref="rulesets/controversial.xml">
|
||||||
|
<exclude name="CamelCasePropertyName" />
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<!-- clean code -->
|
||||||
|
<rule ref="rulesets/codesize.xml" />
|
||||||
|
<rule ref="rulesets/design.xml" />
|
||||||
|
<rule ref="rulesets/naming.xml" />
|
||||||
|
<rule ref="rulesets/unusedcode.xml" />
|
||||||
|
|
||||||
|
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
|
||||||
|
<properties>
|
||||||
|
<property name="reportLevel" value="5"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
<rule ref="rulesets/codesize.xml/NPathComplexity">
|
||||||
|
<properties>
|
||||||
|
<property name="minimum" value="128"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength">
|
||||||
|
<properties>
|
||||||
|
<property name="minimum" value="40"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
<rule ref="rulesets/codesize.xml/ExcessiveParameterList">
|
||||||
|
<properties>
|
||||||
|
<property name="minimum" value="5"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
<!-- include clean code manually -->
|
||||||
|
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag" />
|
||||||
|
<rule ref="rulesets/cleancode.xml/ElseExpression" />
|
||||||
|
|
||||||
|
<!-- no this one -->
|
||||||
|
<!--<rule ref="rulesets/cleancode.xml/StaticAccess" />-->
|
||||||
|
</ruleset>
|
||||||
@@ -59,3 +59,5 @@ fi
|
|||||||
|
|
||||||
# restore .env file
|
# restore .env file
|
||||||
mv $SCRIPT_DIR/../.env.backup $SCRIPT_DIR/../.env
|
mv $SCRIPT_DIR/../.env.backup $SCRIPT_DIR/../.env
|
||||||
|
|
||||||
|
cd $SCRIPT_DIR/..
|
||||||
|
|||||||
@@ -13,8 +13,10 @@ hu_HU
|
|||||||
id_ID
|
id_ID
|
||||||
it_IT
|
it_IT
|
||||||
ja_JP
|
ja_JP
|
||||||
|
ko_KR
|
||||||
nb_NO
|
nb_NO
|
||||||
nl_NL
|
nl_NL
|
||||||
|
nn_NO
|
||||||
pl_PL
|
pl_PL
|
||||||
pt_BR
|
pt_BR
|
||||||
pt_PT
|
pt_PT
|
||||||
|
|||||||
12
.env.example
12
.env.example
@@ -62,7 +62,7 @@ APP_LOG_LEVEL=notice
|
|||||||
AUDIT_LOG_LEVEL=info
|
AUDIT_LOG_LEVEL=info
|
||||||
|
|
||||||
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
|
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
|
||||||
# For other database types, please see the FAQ: https://docs.firefly-iii.org/support/faq
|
# For other database types, please see the FAQ: https://docs.firefly-iii.org/firefly-iii/faq/self-hosted/#i-want-to-use-sqlite
|
||||||
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
||||||
# Use "pgsql" for PostgreSQL
|
# Use "pgsql" for PostgreSQL
|
||||||
# Use "mysql" for MySQL and MariaDB.
|
# Use "mysql" for MySQL and MariaDB.
|
||||||
@@ -134,7 +134,7 @@ COOKIE_SECURE=false
|
|||||||
COOKIE_SAMESITE=lax
|
COOKIE_SAMESITE=lax
|
||||||
|
|
||||||
# If you want Firefly III to email you, update these settings
|
# If you want Firefly III to email you, update these settings
|
||||||
# For instructions, see: https://docs.firefly-iii.org/advanced-installation/email
|
# For instructions, see: https://docs.firefly-iii.org/firefly-iii/advanced-installation/email/#email
|
||||||
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
||||||
MAIL_MAILER=log
|
MAIL_MAILER=log
|
||||||
MAIL_HOST=null
|
MAIL_HOST=null
|
||||||
@@ -143,6 +143,7 @@ MAIL_FROM=changeme@example.com
|
|||||||
MAIL_USERNAME=null
|
MAIL_USERNAME=null
|
||||||
MAIL_PASSWORD=null
|
MAIL_PASSWORD=null
|
||||||
MAIL_ENCRYPTION=null
|
MAIL_ENCRYPTION=null
|
||||||
|
MAIL_SENDMAIL_COMMAND=
|
||||||
|
|
||||||
# Other mail drivers:
|
# Other mail drivers:
|
||||||
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
||||||
@@ -163,9 +164,8 @@ SEND_ERROR_MESSAGE=true
|
|||||||
# These messages contain (sensitive) transaction information:
|
# These messages contain (sensitive) transaction information:
|
||||||
SEND_REPORT_JOURNALS=true
|
SEND_REPORT_JOURNALS=true
|
||||||
|
|
||||||
# Set this value to true if you want to set the location
|
# Set this value to true if you want to set the location of certain things, like transactions.
|
||||||
# of certain things, like transactions. Since this involves an external service, it's optional
|
# Since this involves an external service, it's optional and disabled by default.
|
||||||
# and disabled by default.
|
|
||||||
ENABLE_EXTERNAL_MAP=false
|
ENABLE_EXTERNAL_MAP=false
|
||||||
|
|
||||||
# Set this value to true if you want Firefly III to download currency exchange rates
|
# Set this value to true if you want Firefly III to download currency exchange rates
|
||||||
@@ -188,7 +188,7 @@ MAP_DEFAULT_ZOOM=6
|
|||||||
# - 'web' (default, uses built in DB)
|
# - 'web' (default, uses built in DB)
|
||||||
# - 'remote_user_guard' for Authelia etc
|
# - 'remote_user_guard' for Authelia etc
|
||||||
# Read more about these settings in the documentation.
|
# Read more about these settings in the documentation.
|
||||||
# https://docs.firefly-iii.org/advanced-installation/authentication
|
# https://docs.firefly-iii.org/firefly-iii/advanced-installation/authentication
|
||||||
#
|
#
|
||||||
# LDAP is no longer supported :(
|
# LDAP is no longer supported :(
|
||||||
#
|
#
|
||||||
|
|||||||
29
.github/code_of_conduct.md
vendored
29
.github/code_of_conduct.md
vendored
@@ -2,7 +2,10 @@
|
|||||||
|
|
||||||
## Our Pledge
|
## Our Pledge
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making
|
||||||
|
participation in our project and our community a harassment-free experience for everyone, regardless of age, body size,
|
||||||
|
disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race,
|
||||||
|
religion, or sexual identity and orientation.
|
||||||
|
|
||||||
## Our Standards
|
## Our Standards
|
||||||
|
|
||||||
@@ -24,23 +27,35 @@ Examples of unacceptable behavior by participants include:
|
|||||||
|
|
||||||
## Our Responsibilities
|
## Our Responsibilities
|
||||||
|
|
||||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take
|
||||||
|
appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
|
||||||
|
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
|
||||||
|
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||||
|
|
||||||
## Scope
|
## Scope
|
||||||
|
|
||||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the
|
||||||
|
project or its community. Examples of representing a project or community include using an official project e-mail
|
||||||
|
address, posting via an official social media account, or acting as an appointed representative at an online or offline
|
||||||
|
event. Representation of a project may be further defined and clarified by project maintainers.
|
||||||
|
|
||||||
## Enforcement
|
## Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at james@firefly-iii.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at
|
||||||
|
james@firefly-iii.org. The project team will review and investigate all complaints, and will respond in a way that it
|
||||||
|
deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the
|
||||||
|
reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent
|
||||||
|
repercussions as determined by other members of the project's leadership.
|
||||||
|
|
||||||
## Attribution
|
## Attribution
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available
|
||||||
|
at [http://contributor-covenant.org/version/1/4][version]
|
||||||
|
|
||||||
[homepage]: http://contributor-covenant.org
|
[homepage]: http://contributor-covenant.org
|
||||||
|
|
||||||
[version]: http://contributor-covenant.org/version/1/4/
|
[version]: http://contributor-covenant.org/version/1/4/
|
||||||
|
|||||||
4
.github/contributing.md
vendored
4
.github/contributing.md
vendored
@@ -1,3 +1,3 @@
|
|||||||
# [Contributing guidelines](https://docs.firefly-iii.org/other-pages/contributing)
|
# [Contributing guidelines](https://docs.firefly-iii.org/firefly-iii/support/#contributing-code)
|
||||||
|
|
||||||
[Contributing guidelines](https://docs.firefly-iii.org/other-pages/contributing)
|
[Contributing guidelines](https://docs.firefly-iii.org/firefly-iii/support/#contributing-code)
|
||||||
|
|||||||
10
.github/its_you_not_me.md
vendored
10
.github/its_you_not_me.md
vendored
@@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
Sometimes bugs reported to Firefly III are configuration and system problems on the user's side.
|
Sometimes bugs reported to Firefly III are configuration and system problems on the user's side.
|
||||||
|
|
||||||
If you run into any of the following problems, there's a good chance it's not a Firefly III issue, but a configuration issue.
|
If you run into any of the following problems, there's a good chance it's not a Firefly III issue, but a configuration
|
||||||
|
issue.
|
||||||
|
|
||||||
- ⚠️ Firefly III can't connect to the database when starting or the password is wrong, even though you're sure it's correct.
|
- ⚠️ Firefly III can't connect to the database when starting or the password is wrong, even though you're sure it's
|
||||||
|
correct.
|
||||||
- ⚠️ Errors about a missing `APP_KEY` or other encryption/hash problems
|
- ⚠️ Errors about a missing `APP_KEY` or other encryption/hash problems
|
||||||
- ⚠️ You can't login due to `419` errors (page expired)
|
- ⚠️ You can't login due to `419` errors (page expired)
|
||||||
- ⚠️ Any `500` error when starting Firefly III
|
- ⚠️ Any `500` error when starting Firefly III
|
||||||
@@ -13,4 +15,6 @@ If you run into any of the following problems, there's a good chance it's not a
|
|||||||
- ⚠️ Firefly III does not work behind your reverse proxy
|
- ⚠️ Firefly III does not work behind your reverse proxy
|
||||||
- ⚠️ You can't connect to the Data Importer due to 404's or authentication issues.
|
- ⚠️ You can't connect to the Data Importer due to 404's or authentication issues.
|
||||||
|
|
||||||
If you run into an issue like this, please start a [discussion](https://github.com/firefly-iii/firefly-iii/discussions) or chat on [Gitter.im](https://gitter.im/firefly-iii/firefly-iii). There's a good chance it's not a bug but something we can fix rather quickly :+1:
|
If you run into an issue like this, please start a [discussion](https://github.com/firefly-iii/firefly-iii/discussions)
|
||||||
|
or chat on [Gitter.im](https://gitter.im/firefly-iii/firefly-iii). There's a good chance it's not a bug but something we
|
||||||
|
can fix rather quickly :+1:
|
||||||
|
|||||||
6
.github/support.md
vendored
6
.github/support.md
vendored
@@ -9,7 +9,8 @@ First of all: thank you for reporting a bug instead of ditching the tool altoget
|
|||||||
1. Open bugs will have open issues, so search for one first.
|
1. Open bugs will have open issues, so search for one first.
|
||||||
2. If your feature request is already there, vote on it with :+1: or :-1: reactions.
|
2. If your feature request is already there, vote on it with :+1: or :-1: reactions.
|
||||||
3. Do NOT hijack old issues with the bug you found, open your own issue.
|
3. Do NOT hijack old issues with the bug you found, open your own issue.
|
||||||
4. If relevant, take the time and see if the [demo site](https://demo.firefly-iii.org/) is also suffering from your issue.
|
4. If relevant, take the time and see if the [demo site](https://demo.firefly-iii.org/) is also suffering from your
|
||||||
|
issue.
|
||||||
5. If relevant, read the [documentation](https://docs.firefly-iii.org/).
|
5. If relevant, read the [documentation](https://docs.firefly-iii.org/).
|
||||||
|
|
||||||
Please follow these guidelines when opening new issues:
|
Please follow these guidelines when opening new issues:
|
||||||
@@ -25,7 +26,8 @@ Only then [create a new issue](https://github.com/firefly-iii/firefly-iii/issues
|
|||||||
## Issue closure and abandonment policy
|
## Issue closure and abandonment policy
|
||||||
|
|
||||||
- Issues can be converted into discussions if it's not a bug or feature request.
|
- Issues can be converted into discussions if it's not a bug or feature request.
|
||||||
- Features that won't be implemented will be labelled "wontfix". [This isn't personal](https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/what-its-not/).
|
- Features that won't be implemented will be labelled "
|
||||||
|
wontfix". [This isn't personal](https://docs.firefly-iii.org/firefly-iii/about-firefly-iii/what-its-not/).
|
||||||
- Issues can be closed if they're duplicates of other issues.
|
- Issues can be closed if they're duplicates of other issues.
|
||||||
- Issues can be closed if the answer is in the FAQ.
|
- Issues can be closed if the answer is in the FAQ.
|
||||||
- Issues will be closed automatically after 14 days.
|
- Issues will be closed automatically after 14 days.
|
||||||
|
|||||||
3
.github/workflows/cleanup.yml
vendored
3
.github/workflows/cleanup.yml
vendored
@@ -56,9 +56,12 @@ jobs:
|
|||||||
|
|
||||||
const workflows = [
|
const workflows = [
|
||||||
'cleanup.yml',
|
'cleanup.yml',
|
||||||
|
'closed-issues.yml',
|
||||||
'depsreview.yaml',
|
'depsreview.yaml',
|
||||||
'laravel.yml',
|
'laravel.yml',
|
||||||
'lock.yml',
|
'lock.yml',
|
||||||
|
'qodana.yml',
|
||||||
|
'sonarcloud.yml',
|
||||||
'stale.yml'
|
'stale.yml'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
12
.github/workflows/closed-issues.yml
vendored
12
.github/workflows/closed-issues.yml
vendored
@@ -7,16 +7,16 @@ jobs:
|
|||||||
auto_comment:
|
auto_comment:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
- uses: aws-actions/closed-issue-message@v1
|
||||||
uses: aws-actions/closed-issue-message@v1
|
|
||||||
with:
|
with:
|
||||||
message: |
|
message: |
|
||||||
Hi there! This is an automatic reply. `Share and enjoy`
|
Hi there! This is an automatic reply. `Share and enjoy`
|
||||||
|
|
||||||
This issue is now closed. Please be aware that closed issues are not actively monitored. If you reply, you may get no response.
|
This issue is now 🔒 closed. Please be aware that closed issues are **not** watched.
|
||||||
|
|
||||||
- If the original bug is not actually fixed, please feel free to open a new issue. Please refer to this issue for clarity.
|
- If the original bug is not actually fixed, please feel free to open [a new issue](https://github.com/firefly-iii/firefly-iii/issues/new/choose). Please refer to this issue for clarity.
|
||||||
- Follow-up questions can also be posted in a new [discussion](https://github.com/firefly-iii/firefly-iii/discussions/)
|
- Follow-up questions must be posted in a new [discussion](https://github.com/firefly-iii/firefly-iii/discussions/)
|
||||||
|
- Further replies to this issue will get **no response**.
|
||||||
|
|
||||||
Thank you for your consideration.
|
Thank you for your contributions.
|
||||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
|||||||
21
.github/workflows/lock.yml
vendored
21
.github/workflows/lock.yml
vendored
@@ -5,26 +5,15 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * *'
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lock:
|
lock:
|
||||||
permissions:
|
permissions:
|
||||||
issues: write # for dessant/lock-threads to lock issues
|
issues: write
|
||||||
pull-requests: write # for dessant/lock-threads to lock PRs
|
pull-requests: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/lock-threads@v4
|
- uses: JC5/lock-threads@main
|
||||||
with:
|
with:
|
||||||
github-token: ${{ github.token }}
|
github-token: ${{ github.token }}
|
||||||
issue-lock-inactive-days: '90'
|
issue-inactive-days: 90
|
||||||
issue-comment: >
|
pr-inactive-days: 90
|
||||||
Hi there! This is an automatic reply. `Share and enjoy`
|
|
||||||
|
|
||||||
This issue is now `locked` :lock:.
|
|
||||||
|
|
||||||
- If you feel there is more to be said about this specific issue, please feel free to open a new issue. Please refer to this issue for clarity.
|
|
||||||
- Follow-up questions and comments can also be posted in a new [discussion](https://github.com/firefly-iii/firefly-iii/discussions/)
|
|
||||||
|
|
||||||
Thank you for your consideration.
|
|
||||||
|
|||||||
2
.github/workflows/qodana.yml
vendored
2
.github/workflows/qodana.yml
vendored
@@ -5,8 +5,6 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- develop
|
- develop
|
||||||
pull_request:
|
|
||||||
types: [ opened, synchronize, reopened ]
|
|
||||||
jobs:
|
jobs:
|
||||||
qodana:
|
qodana:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
19
.github/workflows/sonarcloud.yml
vendored
Normal file
19
.github/workflows/sonarcloud.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Sonarcloud
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- develop
|
||||||
|
jobs:
|
||||||
|
sonarcloud:
|
||||||
|
name: SonarCloud
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||||
|
- name: SonarCloud Scan
|
||||||
|
uses: SonarSource/sonarcloud-github-action@master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_PERSONAL_ACCESS_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -31,4 +31,4 @@ jobs:
|
|||||||
Thank you for your contributions.
|
Thank you for your contributions.
|
||||||
days-before-stale: 14
|
days-before-stale: 14
|
||||||
days-before-close: 7
|
days-before-close: 7
|
||||||
exempt-issue-labels: 'enhancement,feature,bug,announcement,layout-v3'
|
exempt-issue-labels: 'enhancement,feature,bug,announcement,epic'
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ class AccountController extends Controller
|
|||||||
|
|
||||||
$return = [];
|
$return = [];
|
||||||
$result = $this->repository->searchAccount((string)$query, $types, $data['limit']);
|
$result = $this->repository->searchAccount((string)$query, $types, $data['limit']);
|
||||||
|
// TODO this code is duplicated in the V2 Autocomplete controller, which means this code is due to be deprecated.
|
||||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||||
|
|
||||||
/** @var Account $account */
|
/** @var Account $account */
|
||||||
@@ -92,7 +93,11 @@ class AccountController extends Controller
|
|||||||
|
|
||||||
if (in_array($account->accountType->type, $this->balanceTypes, true)) {
|
if (in_array($account->accountType->type, $this->balanceTypes, true)) {
|
||||||
$balance = app('steam')->balance($account, $date);
|
$balance = app('steam')->balance($account, $date);
|
||||||
$nameWithBalance = sprintf('%s (%s)', $account->name, app('amount')->formatAnything($currency, $balance, false));
|
$nameWithBalance = sprintf(
|
||||||
|
'%s (%s)',
|
||||||
|
$account->name,
|
||||||
|
app('amount')->formatAnything($currency, $balance, false)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$return[] = [
|
$return[] = [
|
||||||
@@ -109,14 +114,14 @@ class AccountController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// custom order.
|
// custom order.
|
||||||
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
|
|
||||||
usort(
|
usort(
|
||||||
$return,
|
$return,
|
||||||
function ($a, $b) use ($order) {
|
function ($a, $b) {
|
||||||
$pos_a = array_search($a['type'], $order, true);
|
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
|
||||||
$pos_b = array_search($b['type'], $order, true);
|
$posA = array_search($a['type'], $order, true);
|
||||||
|
$posB = array_search($b['type'], $order, true);
|
||||||
|
|
||||||
return $pos_a - $pos_b;
|
return $posA - $posB;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ class AccountController extends Controller
|
|||||||
'yAxisID' => 0, // 0, 1, 2
|
'yAxisID' => 0, // 0, 1, 2
|
||||||
'entries' => [],
|
'entries' => [],
|
||||||
];
|
];
|
||||||
|
// TODO this code is also present in the V2 chart account controller so this method is due to be deprecated.
|
||||||
$currentStart = clone $start;
|
$currentStart = clone $start;
|
||||||
$range = app('steam')->balanceInRange($account, $start, clone $end);
|
$range = app('steam')->balanceInRange($account, $start, clone $end);
|
||||||
// 2022-10-11 this method no longer converts to float.
|
// 2022-10-11 this method no longer converts to float.
|
||||||
|
|||||||
@@ -85,12 +85,11 @@ abstract class Controller extends BaseController
|
|||||||
{
|
{
|
||||||
$bag = new ParameterBag();
|
$bag = new ParameterBag();
|
||||||
$page = (int)request()->get('page');
|
$page = (int)request()->get('page');
|
||||||
|
|
||||||
if ($page < 1) {
|
if ($page < 1) {
|
||||||
$page = 1;
|
$page = 1;
|
||||||
}
|
}
|
||||||
if ($page > (2 ^ 16)) {
|
if ($page > pow(2, 16)) {
|
||||||
$page = (2 ^ 16);
|
$page = pow(2, 16);
|
||||||
}
|
}
|
||||||
$bag->set('page', $page);
|
$bag->set('page', $page);
|
||||||
|
|
||||||
@@ -111,7 +110,13 @@ abstract class Controller extends BaseController
|
|||||||
$obj = Carbon::parse($date);
|
$obj = Carbon::parse($date);
|
||||||
} catch (InvalidDateException | InvalidFormatException $e) {
|
} catch (InvalidDateException | InvalidFormatException $e) {
|
||||||
// don't care
|
// don't care
|
||||||
app('log')->warning(sprintf('Ignored invalid date "%s" in API controller parameter check: %s', substr($date, 0, 20), $e->getMessage()));
|
app('log')->warning(
|
||||||
|
sprintf(
|
||||||
|
'Ignored invalid date "%s" in API controller parameter check: %s',
|
||||||
|
substr($date, 0, 20),
|
||||||
|
$e->getMessage()
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$bag->set($field, $obj);
|
$bag->set($field, $obj);
|
||||||
@@ -171,7 +176,6 @@ abstract class Controller extends BaseController
|
|||||||
return $bag;
|
return $bag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method to help build URL's.
|
* Method to help build URL's.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ class PurgeController extends Controller
|
|||||||
* TODO cleanup and use repositories.
|
* TODO cleanup and use repositories.
|
||||||
* This endpoint is documented at:
|
* This endpoint is documented at:
|
||||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/purgeData
|
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/data/purgeData
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function purge(): JsonResponse
|
public function purge(): JsonResponse
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ use FireflyIII\Models\Account;
|
|||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use FireflyIII\Transformers\AccountTransformer;
|
use FireflyIII\Transformers\AccountTransformer;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use League\Fractal\Resource\Item;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use League\Fractal\Resource\Item;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ use FireflyIII\Transformers\AttachmentTransformer;
|
|||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use League\Fractal\Resource\Item;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use League\Fractal\Resource\Item;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class StoreController
|
* Class StoreController
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ class TriggerController extends Controller
|
|||||||
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
|
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// file the rule(s)
|
// file the rule(s)
|
||||||
$transactions = $ruleEngine->find();
|
$transactions = $ruleEngine->find();
|
||||||
$count = $transactions->count();
|
$count = $transactions->count();
|
||||||
@@ -149,6 +150,7 @@ class TriggerController extends Controller
|
|||||||
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
|
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// fire the rule(s)
|
// fire the rule(s)
|
||||||
$ruleEngine->fire();
|
$ruleEngine->fire();
|
||||||
|
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ use FireflyIII\Support\Http\Api\TransactionFilter;
|
|||||||
use FireflyIII\Transformers\TransactionGroupTransformer;
|
use FireflyIII\Transformers\TransactionGroupTransformer;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use League\Fractal\Resource\Item;
|
use League\Fractal\Resource\Item;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
use Validator;
|
use Validator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface
|
|||||||
use FireflyIII\Transformers\TransactionGroupTransformer;
|
use FireflyIII\Transformers\TransactionGroupTransformer;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use League\Fractal\Resource\Item;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use League\Fractal\Resource\Item;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,10 +32,9 @@ use Illuminate\Http\JsonResponse;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use Illuminate\Pagination\LengthAwarePaginator;
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
use JsonException;
|
use Illuminate\Support\Facades\Log;
|
||||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||||
use League\Fractal\Resource\Collection as FractalCollection;
|
use League\Fractal\Resource\Collection as FractalCollection;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AccountController
|
* Class AccountController
|
||||||
@@ -61,12 +60,12 @@ class AccountController extends Controller
|
|||||||
/**
|
/**
|
||||||
* This endpoint is documented at:
|
* This endpoint is documented at:
|
||||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/search/searchAccounts
|
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/search/searchAccounts
|
||||||
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
*
|
*
|
||||||
* @return JsonResponse|Response
|
* @return JsonResponse|Response
|
||||||
* @throws JsonException
|
|
||||||
*/
|
*/
|
||||||
public function search(Request $request)
|
public function search(Request $request): JsonResponse | Response
|
||||||
{
|
{
|
||||||
Log::debug('Now in account search()');
|
Log::debug('Now in account search()');
|
||||||
$manager = $this->getManager();
|
$manager = $this->getManager();
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ class TransactionController extends Controller
|
|||||||
$resource = new Collection($transactions, $transformer, 'transactions');
|
$resource = new Collection($transactions, $transformer, 'transactions');
|
||||||
$resource->setPaginator(new IlluminatePaginatorAdapter($groups));
|
$resource->setPaginator(new IlluminatePaginatorAdapter($groups));
|
||||||
|
|
||||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
$array = $manager->createData($resource)->toArray();
|
||||||
|
|
||||||
|
return response()->json($array)->header('Content-Type', self::CONTENT_TYPE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,44 +240,43 @@ class BasicController extends Controller
|
|||||||
* Since both this method and the chart use the exact same data, we can suffice
|
* Since both this method and the chart use the exact same data, we can suffice
|
||||||
* with calling the one method in the bill repository that will get this amount.
|
* with calling the one method in the bill repository that will get this amount.
|
||||||
*/
|
*/
|
||||||
$paidAmount = $this->billRepository->getBillsPaidInRangePerCurrency($start, $end);
|
$paidAmount = $this->billRepository->sumPaidInRange($start, $end);
|
||||||
$unpaidAmount = $this->billRepository->getBillsUnpaidInRangePerCurrency($start, $end);
|
$unpaidAmount = $this->billRepository->sumUnpaidInRange($start, $end);
|
||||||
|
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach ($paidAmount as $currencyId => $amount) {
|
/**
|
||||||
$amount = bcmul($amount, '-1');
|
* @var array $info
|
||||||
$currency = $this->currencyRepos->find((int)$currencyId);
|
*/
|
||||||
if (null === $currency) {
|
foreach ($paidAmount as $info) {
|
||||||
continue;
|
$amount = bcmul($info['sum'], '-1');
|
||||||
}
|
|
||||||
$return[] = [
|
$return[] = [
|
||||||
'key' => sprintf('bills-paid-in-%s', $currency->code),
|
'key' => sprintf('bills-paid-in-%s', $info['code']),
|
||||||
'title' => trans('firefly.box_bill_paid_in_currency', ['currency' => $currency->symbol]),
|
'title' => trans('firefly.box_bill_paid_in_currency', ['currency' => $info['symbol']]),
|
||||||
'monetary_value' => $amount,
|
'monetary_value' => $amount,
|
||||||
'currency_id' => $currency->id,
|
'currency_id' => $info['id'],
|
||||||
'currency_code' => $currency->code,
|
'currency_code' => $info['code'],
|
||||||
'currency_symbol' => $currency->symbol,
|
'currency_symbol' => $info['symbol'],
|
||||||
'currency_decimal_places' => $currency->decimal_places,
|
'currency_decimal_places' => $info['decimal_places'],
|
||||||
'value_parsed' => app('amount')->formatAnything($currency, $amount, false),
|
'value_parsed' => app('amount')->formatFlat($info['symbol'], $info['decimal_places'], $amount, false),
|
||||||
'local_icon' => 'check',
|
'local_icon' => 'check',
|
||||||
'sub_title' => '',
|
'sub_title' => '',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($unpaidAmount as $currencyId => $amount) {
|
/**
|
||||||
$amount = bcmul($amount, '-1');
|
* @var array $info
|
||||||
$currency = $this->currencyRepos->find((int)$currencyId);
|
*/
|
||||||
if (null === $currency) {
|
foreach ($unpaidAmount as $info) {
|
||||||
continue;
|
$amount = bcmul($info['sum'], '-1');
|
||||||
}
|
|
||||||
$return[] = [
|
$return[] = [
|
||||||
'key' => sprintf('bills-unpaid-in-%s', $currency->code),
|
'key' => sprintf('bills-unpaid-in-%s', $info['code']),
|
||||||
'title' => trans('firefly.box_bill_unpaid_in_currency', ['currency' => $currency->symbol]),
|
'title' => trans('firefly.box_bill_unpaid_in_currency', ['currency' => $info['symbol']]),
|
||||||
'monetary_value' => $amount,
|
'monetary_value' => $amount,
|
||||||
'currency_id' => $currency->id,
|
'currency_id' => $info['id'],
|
||||||
'currency_code' => $currency->code,
|
'currency_code' => $info['code'],
|
||||||
'currency_symbol' => $currency->symbol,
|
'currency_symbol' => $info['symbol'],
|
||||||
'currency_decimal_places' => $currency->decimal_places,
|
'currency_decimal_places' => $info['decimal_places'],
|
||||||
'value_parsed' => app('amount')->formatAnything($currency, $amount, false),
|
'value_parsed' => app('amount')->formatFlat($info['symbol'], $info['decimal_places'], $amount, false),
|
||||||
'local_icon' => 'calendar-o',
|
'local_icon' => 'calendar-o',
|
||||||
'sub_title' => '',
|
'sub_title' => '',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ class CronController extends Controller
|
|||||||
$return = [];
|
$return = [];
|
||||||
$return['recurring_transactions'] = $this->runRecurring($config['force'], $config['date']);
|
$return['recurring_transactions'] = $this->runRecurring($config['force'], $config['date']);
|
||||||
$return['auto_budgets'] = $this->runAutoBudget($config['force'], $config['date']);
|
$return['auto_budgets'] = $this->runAutoBudget($config['force'], $config['date']);
|
||||||
|
if (true === config('cer.enabled')) {
|
||||||
|
$return['exchange_rates'] = $this->exchangeRatesCronJob($config['force'], $config['date']);
|
||||||
|
}
|
||||||
|
$return['bill_warnings'] = $this->billWarningCronJob($config['force'], $config['date']);
|
||||||
|
|
||||||
return response()->json($return);
|
return response()->json($return);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ class ShowController extends Controller
|
|||||||
*
|
*
|
||||||
* @param Webhook $webhook
|
* @param Webhook $webhook
|
||||||
* @param TransactionGroup $group
|
* @param TransactionGroup $group
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function triggerTransaction(Webhook $webhook, TransactionGroup $group): JsonResponse
|
public function triggerTransaction(Webhook $webhook, TransactionGroup $group): JsonResponse
|
||||||
@@ -141,6 +142,7 @@ class ShowController extends Controller
|
|||||||
|
|
||||||
// trigger event to send them:
|
// trigger event to send them:
|
||||||
event(new RequestedSendWebhookMessages());
|
event(new RequestedSendWebhookMessages());
|
||||||
|
|
||||||
return response()->json([], 204);
|
return response()->json([], 204);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ class MoveTransactionsRequest extends FormRequest
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Validator $validator
|
* @param Validator $validator
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function validateMove(Validator $validator): void
|
private function validateMove(Validator $validator): void
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ use FireflyIII\Support\Request\ChecksLogin;
|
|||||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||||
use FireflyIII\Validation\Api\Data\Bulk\ValidatesBulkTransactionQuery;
|
use FireflyIII\Validation\Api\Data\Bulk\ValidatesBulkTransactionQuery;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Validation\Validator;
|
use Illuminate\Validation\Validator;
|
||||||
use JsonException;
|
use JsonException;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TransactionRequest
|
* Class TransactionRequest
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class DestroyRequest extends FormRequest
|
|||||||
',not_assets_liabilities';
|
',not_assets_liabilities';
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'objects' => sprintf('required|min:1|string|in:%s', $valid),
|
'objects' => sprintf('required|max:255|min:1|string|in:%s', $valid),
|
||||||
'unused' => 'in:true,false',
|
'unused' => 'in:true,false',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ class ExportRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'type' => 'in:csv',
|
'type' => 'in:csv',
|
||||||
'accounts' => 'min:1',
|
'accounts' => 'min:1|max:65536',
|
||||||
'start' => 'date|before:end',
|
'start' => 'date|before:end',
|
||||||
'end' => 'date|after:start',
|
'end' => 'date|after:start',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -103,8 +103,8 @@ class StoreRequest extends FormRequest
|
|||||||
$ccPaymentTypes = implode(',', array_keys(config('firefly.ccTypes')));
|
$ccPaymentTypes = implode(',', array_keys(config('firefly.ccTypes')));
|
||||||
$type = $this->convertString('type');
|
$type = $this->convertString('type');
|
||||||
$rules = [
|
$rules = [
|
||||||
'name' => 'required|min:1|uniqueAccountForUser',
|
'name' => 'required|max:1024|min:1|uniqueAccountForUser',
|
||||||
'type' => 'required|min:1|'.sprintf('in:%s', $types),
|
'type' => 'required|max:1024|min:1|' . sprintf('in:%s', $types),
|
||||||
'iban' => ['iban', 'nullable', new UniqueIban(null, $type)],
|
'iban' => ['iban', 'nullable', new UniqueIban(null, $type)],
|
||||||
'bic' => 'bic|nullable',
|
'bic' => 'bic|nullable',
|
||||||
'account_number' => ['between:1,255', 'nullable', new UniqueAccountNumber(null, $type)],
|
'account_number' => ['between:1,255', 'nullable', new UniqueAccountNumber(null, $type)],
|
||||||
@@ -120,7 +120,7 @@ class StoreRequest extends FormRequest
|
|||||||
'credit_card_type' => sprintf('nullable|in:%s|required_if:account_role,ccAsset', $ccPaymentTypes),
|
'credit_card_type' => sprintf('nullable|in:%s|required_if:account_role,ccAsset', $ccPaymentTypes),
|
||||||
'monthly_payment_date' => 'nullable|date|required_if:account_role,ccAsset|required_if:credit_card_type,monthlyFull',
|
'monthly_payment_date' => 'nullable|date|required_if:account_role,ccAsset|required_if:credit_card_type,monthlyFull',
|
||||||
'liability_type' => 'nullable|required_if:type,liability|required_if:type,liabilities|in:loan,debt,mortgage',
|
'liability_type' => 'nullable|required_if:type,liability|required_if:type,liabilities|in:loan,debt,mortgage',
|
||||||
'liability_amount' => 'required_with:liability_start_date|min:0|numeric',
|
'liability_amount' => 'required_with:liability_start_date|min:0|numeric|max:1000000000',
|
||||||
'liability_start_date' => 'required_with:liability_amount|date',
|
'liability_start_date' => 'required_with:liability_amount|date',
|
||||||
'liability_direction' => 'nullable|required_if:type,liability|required_if:type,liabilities|in:credit,debit',
|
'liability_direction' => 'nullable|required_if:type,liability|required_if:type,liabilities|in:credit,debit',
|
||||||
'interest' => 'between:0,100|numeric',
|
'interest' => 'between:0,100|numeric',
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ use FireflyIII\Support\Request\AppendsLocationData;
|
|||||||
use FireflyIII\Support\Request\ChecksLogin;
|
use FireflyIII\Support\Request\ChecksLogin;
|
||||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UpdateRequest
|
* Class UpdateRequest
|
||||||
@@ -63,9 +62,9 @@ class UpdateRequest extends FormRequest
|
|||||||
'account_role' => ['account_role', 'convertString'],
|
'account_role' => ['account_role', 'convertString'],
|
||||||
'liability_type' => ['liability_type', 'convertString'],
|
'liability_type' => ['liability_type', 'convertString'],
|
||||||
'opening_balance' => ['opening_balance', 'convertString'],
|
'opening_balance' => ['opening_balance', 'convertString'],
|
||||||
'opening_balance_date' => ['opening_balance_date', 'date'],
|
'opening_balance_date' => ['opening_balance_date', 'convertDateTime'],
|
||||||
'cc_type' => ['credit_card_type', 'convertString'],
|
'cc_type' => ['credit_card_type', 'convertString'],
|
||||||
'cc_monthly_payment_date' => ['monthly_payment_date', 'convertString'],
|
'cc_monthly_payment_date' => ['monthly_payment_date', 'convertDateTime'],
|
||||||
'notes' => ['notes', 'stringWithNewlines'],
|
'notes' => ['notes', 'stringWithNewlines'],
|
||||||
'interest' => ['interest', 'convertString'],
|
'interest' => ['interest', 'convertString'],
|
||||||
'interest_period' => ['interest_period', 'convertString'],
|
'interest_period' => ['interest_period', 'convertString'],
|
||||||
@@ -77,6 +76,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'liability_start_date' => ['liability_start_date', 'date'],
|
'liability_start_date' => ['liability_start_date', 'date'],
|
||||||
];
|
];
|
||||||
$data = $this->getAllData($fields);
|
$data = $this->getAllData($fields);
|
||||||
|
|
||||||
return $this->appendLocationData($data, null);
|
return $this->appendLocationData($data, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ class UpdateRequest extends FormRequest
|
|||||||
$ccPaymentTypes = implode(',', array_keys(config('firefly.ccTypes')));
|
$ccPaymentTypes = implode(',', array_keys(config('firefly.ccTypes')));
|
||||||
|
|
||||||
$rules = [
|
$rules = [
|
||||||
'name' => sprintf('min:1|uniqueAccountForUser:%d', $account->id),
|
'name' => sprintf('min:1|max:1024|uniqueAccountForUser:%d', $account->id),
|
||||||
'type' => sprintf('in:%s', $types),
|
'type' => sprintf('in:%s', $types),
|
||||||
'iban' => ['iban', 'nullable', new UniqueIban($account, $this->convertString('type'))],
|
'iban' => ['iban', 'nullable', new UniqueIban($account, $this->convertString('type'))],
|
||||||
'bic' => 'bic|nullable',
|
'bic' => 'bic|nullable',
|
||||||
@@ -104,7 +104,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'virtual_balance' => 'numeric|nullable',
|
'virtual_balance' => 'numeric|nullable',
|
||||||
'order' => 'numeric|nullable',
|
'order' => 'numeric|nullable',
|
||||||
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||||
'currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
'currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||||
'active' => [new IsBoolean()],
|
'active' => [new IsBoolean()],
|
||||||
'include_net_worth' => [new IsBoolean()],
|
'include_net_worth' => [new IsBoolean()],
|
||||||
'account_role' => sprintf('in:%s|nullable|required_if:type,asset', $accountRoles),
|
'account_role' => sprintf('in:%s|nullable|required_if:type,asset', $accountRoles),
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class Request extends FormRequest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||||
'currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
'currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||||
'amount' => 'numeric|gt:0',
|
'amount' => 'numeric|gt:0',
|
||||||
'start' => 'date',
|
'start' => 'date',
|
||||||
'end' => 'date',
|
'end' => 'date',
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ use FireflyIII\Rules\IsBoolean;
|
|||||||
use FireflyIII\Support\Request\ChecksLogin;
|
use FireflyIII\Support\Request\ChecksLogin;
|
||||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Validation\Validator;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class StoreRequest
|
* Class StoreRequest
|
||||||
@@ -82,7 +82,7 @@ class StoreRequest extends FormRequest
|
|||||||
'amount_min' => 'numeric|gt:0|required',
|
'amount_min' => 'numeric|gt:0|required',
|
||||||
'amount_max' => 'numeric|gt:0|required',
|
'amount_max' => 'numeric|gt:0|required',
|
||||||
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||||
'currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
'currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||||
'date' => 'date|required',
|
'date' => 'date|required',
|
||||||
'end_date' => 'date|after:date',
|
'end_date' => 'date|after:date',
|
||||||
'extension_date' => 'date|after:date',
|
'extension_date' => 'date|after:date',
|
||||||
@@ -105,8 +105,8 @@ class StoreRequest extends FormRequest
|
|||||||
$validator->after(
|
$validator->after(
|
||||||
static function (Validator $validator) {
|
static function (Validator $validator) {
|
||||||
$data = $validator->getData();
|
$data = $validator->getData();
|
||||||
$min = $data['amount_min'] ?? '0';
|
$min = (string)($data['amount_min'] ?? '0');
|
||||||
$max = $data['amount_max'] ?? '0';
|
$max = (string)($data['amount_max'] ?? '0');
|
||||||
|
|
||||||
if (1 === bccomp($min, $max)) {
|
if (1 === bccomp($min, $max)) {
|
||||||
$validator->errors()->add('amount_min', (string)trans('validation.amount_min_over_max'));
|
$validator->errors()->add('amount_min', (string)trans('validation.amount_min_over_max'));
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'amount_min' => 'numeric|gt:0',
|
'amount_min' => 'numeric|gt:0',
|
||||||
'amount_max' => 'numeric|gt:0',
|
'amount_max' => 'numeric|gt:0',
|
||||||
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||||
'currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
'currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||||
'date' => 'date',
|
'date' => 'date',
|
||||||
'end_date' => 'date|after:date',
|
'end_date' => 'date|after:date',
|
||||||
'extension_date' => 'date|after:date',
|
'extension_date' => 'date|after:date',
|
||||||
|
|||||||
@@ -79,9 +79,9 @@ class StoreRequest extends FormRequest
|
|||||||
'currency_code' => 'exists:transaction_currencies,code',
|
'currency_code' => 'exists:transaction_currencies,code',
|
||||||
'notes' => 'nullable|between:1,65536',
|
'notes' => 'nullable|between:1,65536',
|
||||||
// auto budget info
|
// auto budget info
|
||||||
'auto_budget_type' => 'in:reset,rollover,none',
|
'auto_budget_type' => 'in:reset,rollover,adjusted,none',
|
||||||
'auto_budget_amount' => 'numeric|min:0|max:1000000000|required_if:auto_budget_type,reset|required_if:auto_budget_type,rollover',
|
'auto_budget_amount' => 'numeric|min:0|max:1000000000|required_if:auto_budget_type,reset|required_if:auto_budget_type,rollover|required_if:auto_budget_type,adjusted',
|
||||||
'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly|required_if:auto_budget_type,reset|required_if:auto_budget_type,rollover',
|
'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly|required_if:auto_budget_type,reset|required_if:auto_budget_type,rollover|required_if:auto_budget_type,adjusted',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'none' => 0,
|
'none' => 0,
|
||||||
'reset' => 1,
|
'reset' => 1,
|
||||||
'rollover' => 2,
|
'rollover' => 2,
|
||||||
|
'adjusted' => 3,
|
||||||
];
|
];
|
||||||
$allData['auto_budget_type'] = $types[$allData['auto_budget_type']] ?? 0;
|
$allData['auto_budget_type'] = $types[$allData['auto_budget_type']] ?? 0;
|
||||||
}
|
}
|
||||||
@@ -88,7 +89,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'name' => sprintf('between:1,100|uniqueObjectForUser:budgets,name,%d', $budget->id),
|
'name' => sprintf('between:1,100|uniqueObjectForUser:budgets,name,%d', $budget->id),
|
||||||
'active' => [new IsBoolean()],
|
'active' => [new IsBoolean()],
|
||||||
'notes' => 'nullable|between:1,65536',
|
'notes' => 'nullable|between:1,65536',
|
||||||
'auto_budget_type' => 'in:reset,rollover,none',
|
'auto_budget_type' => 'in:reset,rollover,adjusted,none',
|
||||||
'auto_budget_currency_id' => 'exists:transaction_currencies,id',
|
'auto_budget_currency_id' => 'exists:transaction_currencies,id',
|
||||||
'auto_budget_currency_code' => 'exists:transaction_currencies,code',
|
'auto_budget_currency_code' => 'exists:transaction_currencies,code',
|
||||||
'auto_budget_amount' => 'min:0|max:1000000000',
|
'auto_budget_amount' => 'min:0|max:1000000000',
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class StoreRequest extends FormRequest
|
|||||||
'end' => 'required|after:start|date',
|
'end' => 'required|after:start|date',
|
||||||
'amount' => 'required|gt:0',
|
'amount' => 'required|gt:0',
|
||||||
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||||
'currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
'currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'end' => 'date',
|
'end' => 'date',
|
||||||
'amount' => 'gt:0',
|
'amount' => 'gt:0',
|
||||||
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
'currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||||
'currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
'currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class UpdateRequest extends FormRequest
|
|||||||
$objectGroup = $this->route()->parameter('objectGroup');
|
$objectGroup = $this->route()->parameter('objectGroup');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'title' => sprintf('min:1|uniqueObjectGroup:%d', $objectGroup->id),
|
'title' => sprintf('max:1024|min:1|uniqueObjectGroup:%d', $objectGroup->id),
|
||||||
'order' => 'numeric',
|
'order' => 'numeric',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ class UpdateRequest extends FormRequest
|
|||||||
'account_id' => ['account_id', 'convertInteger'],
|
'account_id' => ['account_id', 'convertInteger'],
|
||||||
'targetamount' => ['target_amount', 'convertString'],
|
'targetamount' => ['target_amount', 'convertString'],
|
||||||
'current_amount' => ['current_amount', 'convertString'],
|
'current_amount' => ['current_amount', 'convertString'],
|
||||||
'startdate' => ['start_date', 'date'],
|
'startdate' => ['start_date', 'convertDateTime'],
|
||||||
'targetdate' => ['target_date', 'convertString'],
|
'targetdate' => ['target_date', 'convertDateTime'],
|
||||||
'notes' => ['notes', 'stringWithNewlines'],
|
'notes' => ['notes', 'stringWithNewlines'],
|
||||||
'order' => ['order', 'convertInteger'],
|
'order' => ['order', 'convertInteger'],
|
||||||
'object_group_title' => ['object_group_title', 'convertString'],
|
'object_group_title' => ['object_group_title', 'convertString'],
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ class StoreRequest extends FormRequest
|
|||||||
'type' => ['type', 'convertString'],
|
'type' => ['type', 'convertString'],
|
||||||
'title' => ['title', 'convertString'],
|
'title' => ['title', 'convertString'],
|
||||||
'description' => ['description', 'convertString'],
|
'description' => ['description', 'convertString'],
|
||||||
'first_date' => ['first_date', 'date'],
|
'first_date' => ['first_date', 'convertDateTime'],
|
||||||
'repeat_until' => ['repeat_until', 'date'],
|
'repeat_until' => ['repeat_until', 'convertDateTime'],
|
||||||
'nr_of_repetitions' => ['nr_of_repetitions', 'convertInteger'],
|
'nr_of_repetitions' => ['nr_of_repetitions', 'convertInteger'],
|
||||||
'apply_rules' => ['apply_rules', 'boolean'],
|
'apply_rules' => ['apply_rules', 'boolean'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
@@ -158,9 +158,9 @@ class StoreRequest extends FormRequest
|
|||||||
'transactions.*.amount' => 'required|numeric|gt:0',
|
'transactions.*.amount' => 'required|numeric|gt:0',
|
||||||
'transactions.*.foreign_amount' => 'nullable|numeric|gt:0',
|
'transactions.*.foreign_amount' => 'nullable|numeric|gt:0',
|
||||||
'transactions.*.currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
'transactions.*.currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||||
'transactions.*.currency_code' => 'nullable|min:3|max:3|exists:transaction_currencies,code',
|
'transactions.*.currency_code' => 'nullable|min:3|max:51|exists:transaction_currencies,code',
|
||||||
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||||
'transactions.*.foreign_currency_code' => 'nullable|min:3|max:3|exists:transaction_currencies,code',
|
'transactions.*.foreign_currency_code' => 'nullable|min:3|max:51|exists:transaction_currencies,code',
|
||||||
'transactions.*.source_id' => ['numeric', 'nullable', new BelongsUser()],
|
'transactions.*.source_id' => ['numeric', 'nullable', new BelongsUser()],
|
||||||
'transactions.*.source_name' => 'between:1,255|nullable',
|
'transactions.*.source_name' => 'between:1,255|nullable',
|
||||||
'transactions.*.destination_id' => ['numeric', 'nullable', new BelongsUser()],
|
'transactions.*.destination_id' => ['numeric', 'nullable', new BelongsUser()],
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ class UpdateRequest extends FormRequest
|
|||||||
$fields = [
|
$fields = [
|
||||||
'title' => ['title', 'convertString'],
|
'title' => ['title', 'convertString'],
|
||||||
'description' => ['description', 'convertString'],
|
'description' => ['description', 'convertString'],
|
||||||
'first_date' => ['first_date', 'date'],
|
'first_date' => ['first_date', 'convertDateTime'],
|
||||||
'repeat_until' => ['repeat_until', 'date'],
|
'repeat_until' => ['repeat_until', 'convertDateTime'],
|
||||||
'nr_of_repetitions' => ['nr_of_repetitions', 'convertInteger'],
|
'nr_of_repetitions' => ['nr_of_repetitions', 'convertInteger'],
|
||||||
'apply_rules' => ['apply_rules', 'boolean'],
|
'apply_rules' => ['apply_rules', 'boolean'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
@@ -172,9 +172,9 @@ class UpdateRequest extends FormRequest
|
|||||||
'transactions.*.amount' => 'numeric|gt:0',
|
'transactions.*.amount' => 'numeric|gt:0',
|
||||||
'transactions.*.foreign_amount' => 'nullable|numeric|gt:0',
|
'transactions.*.foreign_amount' => 'nullable|numeric|gt:0',
|
||||||
'transactions.*.currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
'transactions.*.currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||||
'transactions.*.currency_code' => 'nullable|min:3|max:3|exists:transaction_currencies,code',
|
'transactions.*.currency_code' => 'nullable|min:3|max:51|exists:transaction_currencies,code',
|
||||||
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||||
'transactions.*.foreign_currency_code' => 'nullable|min:3|max:3|exists:transaction_currencies,code',
|
'transactions.*.foreign_currency_code' => 'nullable|min:3|max:51|exists:transaction_currencies,code',
|
||||||
'transactions.*.source_id' => ['numeric', 'nullable', new BelongsUser()],
|
'transactions.*.source_id' => ['numeric', 'nullable', new BelongsUser()],
|
||||||
'transactions.*.source_name' => 'between:1,255|nullable',
|
'transactions.*.source_name' => 'between:1,255|nullable',
|
||||||
'transactions.*.destination_id' => ['numeric', 'nullable', new BelongsUser()],
|
'transactions.*.destination_id' => ['numeric', 'nullable', new BelongsUser()],
|
||||||
@@ -205,6 +205,11 @@ class UpdateRequest extends FormRequest
|
|||||||
function (Validator $validator) {
|
function (Validator $validator) {
|
||||||
//$this->validateOneRecurrenceTransaction($validator);
|
//$this->validateOneRecurrenceTransaction($validator);
|
||||||
//$this->validateOneRepetitionUpdate($validator);
|
//$this->validateOneRepetitionUpdate($validator);
|
||||||
|
|
||||||
|
|
||||||
|
/** @var Recurrence $recurrence */
|
||||||
|
$recurrence = $this->route()->parameter('recurrence');
|
||||||
|
$this->validateTransactionId($recurrence, $validator);
|
||||||
$this->validateRecurrenceRepetition($validator);
|
$this->validateRecurrenceRepetition($validator);
|
||||||
$this->validateRepetitionMoment($validator);
|
$this->validateRepetitionMoment($validator);
|
||||||
$this->validateForeignCurrencyInformation($validator);
|
$this->validateForeignCurrencyInformation($validator);
|
||||||
@@ -212,4 +217,5 @@ class UpdateRequest extends FormRequest
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class StoreRequest extends FormRequest
|
|||||||
$return[] = [
|
$return[] = [
|
||||||
'type' => $trigger['type'],
|
'type' => $trigger['type'],
|
||||||
'value' => $trigger['value'],
|
'value' => $trigger['value'],
|
||||||
'active' => $this->convertBoolean((string)($trigger['active'] ?? 'false')),
|
'active' => $this->convertBoolean((string)($trigger['active'] ?? 'true')),
|
||||||
'stop_processing' => $this->convertBoolean((string)($trigger['stop_processing'] ?? 'false')),
|
'stop_processing' => $this->convertBoolean((string)($trigger['stop_processing'] ?? 'false')),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ class StoreRequest extends FormRequest
|
|||||||
$return[] = [
|
$return[] = [
|
||||||
'type' => $action['type'],
|
'type' => $action['type'],
|
||||||
'value' => $action['value'],
|
'value' => $action['value'],
|
||||||
'active' => $this->convertBoolean((string)($action['active'] ?? 'false')),
|
'active' => $this->convertBoolean((string)($action['active'] ?? 'true')),
|
||||||
'stop_processing' => $this->convertBoolean((string)($action['stop_processing'] ?? 'false')),
|
'stop_processing' => $this->convertBoolean((string)($action['stop_processing'] ?? 'false')),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ class StoreRequest extends FormRequest
|
|||||||
'rule_group_title' => 'nullable|between:1,255|required_without:rule_group_id|belongsToUser:rule_groups,title',
|
'rule_group_title' => 'nullable|between:1,255|required_without:rule_group_id|belongsToUser:rule_groups,title',
|
||||||
'trigger' => 'required|in:store-journal,update-journal',
|
'trigger' => 'required|in:store-journal,update-journal',
|
||||||
'triggers.*.type' => 'required|in:' . implode(',', $validTriggers),
|
'triggers.*.type' => 'required|in:' . implode(',', $validTriggers),
|
||||||
'triggers.*.value' => 'required_if:actions.*.type,'.$contextTriggers.'|min:1|ruleTriggerValue',
|
'triggers.*.value' => 'required_if:actions.*.type,' . $contextTriggers . '|min:1|ruleTriggerValue|max:1024',
|
||||||
'triggers.*.stop_processing' => [new IsBoolean()],
|
'triggers.*.stop_processing' => [new IsBoolean()],
|
||||||
'triggers.*.active' => [new IsBoolean()],
|
'triggers.*.active' => [new IsBoolean()],
|
||||||
'actions.*.type' => 'required|in:' . implode(',', $validActions),
|
'actions.*.type' => 'required|in:' . implode(',', $validActions),
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'rule_group_title' => 'nullable|between:1,255|belongsToUser:rule_groups,title',
|
'rule_group_title' => 'nullable|between:1,255|belongsToUser:rule_groups,title',
|
||||||
'trigger' => 'in:store-journal,update-journal',
|
'trigger' => 'in:store-journal,update-journal',
|
||||||
'triggers.*.type' => 'required|in:' . implode(',', $validTriggers),
|
'triggers.*.type' => 'required|in:' . implode(',', $validTriggers),
|
||||||
'triggers.*.value' => 'required_if:actions.*.type,'.$contextTriggers.'|min:1|ruleTriggerValue',
|
'triggers.*.value' => 'required_if:actions.*.type,' . $contextTriggers . '|min:1|ruleTriggerValue|max:1024',
|
||||||
'triggers.*.stop_processing' => [new IsBoolean()],
|
'triggers.*.stop_processing' => [new IsBoolean()],
|
||||||
'triggers.*.active' => [new IsBoolean()],
|
'triggers.*.active' => [new IsBoolean()],
|
||||||
'actions.*.type' => 'required|in:' . implode(',', $validActions),
|
'actions.*.type' => 'required|in:' . implode(',', $validActions),
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ class StoreRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
$rules = [
|
$rules = [
|
||||||
'tag' => 'required|min:1|uniqueObjectForUser:tags,tag',
|
'tag' => 'required|min:1|uniqueObjectForUser:tags,tag|max:1024',
|
||||||
'description' => 'min:1|nullable',
|
'description' => 'min:1|nullable|max:65536',
|
||||||
'date' => 'date|nullable',
|
'date' => 'date|nullable',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ class UpdateRequest extends FormRequest
|
|||||||
$tag = $this->route()->parameter('tagOrId');
|
$tag = $this->route()->parameter('tagOrId');
|
||||||
// TODO check if uniqueObjectForUser is obsolete
|
// TODO check if uniqueObjectForUser is obsolete
|
||||||
$rules = [
|
$rules = [
|
||||||
'tag' => 'min:1|uniqueObjectForUser:tags,tag,'.$tag->id,
|
'tag' => 'min:1|max:1024|uniqueObjectForUser:tags,tag,' . $tag->id,
|
||||||
'description' => 'min:1|nullable',
|
'description' => 'min:1|nullable|max:65536',
|
||||||
'date' => 'date|nullable',
|
'date' => 'date|nullable',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ use FireflyIII\Validation\CurrencyValidation;
|
|||||||
use FireflyIII\Validation\GroupValidation;
|
use FireflyIII\Validation\GroupValidation;
|
||||||
use FireflyIII\Validation\TransactionValidation;
|
use FireflyIII\Validation\TransactionValidation;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Validation\Validator;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class StoreRequest
|
* Class StoreRequest
|
||||||
@@ -188,9 +188,9 @@ class StoreRequest extends FormRequest
|
|||||||
|
|
||||||
// currency info
|
// currency info
|
||||||
'transactions.*.currency_id' => 'numeric|exists:transaction_currencies,id|nullable',
|
'transactions.*.currency_id' => 'numeric|exists:transaction_currencies,id|nullable',
|
||||||
'transactions.*.currency_code' => 'min:3|max:3|exists:transaction_currencies,code|nullable',
|
'transactions.*.currency_code' => 'min:3|max:51|exists:transaction_currencies,code|nullable',
|
||||||
'transactions.*.foreign_currency_id' => 'numeric|exists:transaction_currencies,id|nullable',
|
'transactions.*.foreign_currency_id' => 'numeric|exists:transaction_currencies,id|nullable',
|
||||||
'transactions.*.foreign_currency_code' => 'min:3|max:3|exists:transaction_currencies,code|nullable',
|
'transactions.*.foreign_currency_code' => 'min:3|max:51|exists:transaction_currencies,code|nullable',
|
||||||
|
|
||||||
// amount
|
// amount
|
||||||
'transactions.*.amount' => 'required|numeric|gt:0',
|
'transactions.*.amount' => 'required|numeric|gt:0',
|
||||||
@@ -225,25 +225,25 @@ class StoreRequest extends FormRequest
|
|||||||
|
|
||||||
// other interesting fields
|
// other interesting fields
|
||||||
'transactions.*.reconciled' => [new IsBoolean()],
|
'transactions.*.reconciled' => [new IsBoolean()],
|
||||||
'transactions.*.notes' => 'min:1,max:50000|nullable',
|
'transactions.*.notes' => 'min:1|max:50000|nullable',
|
||||||
'transactions.*.tags' => 'between:0,255',
|
'transactions.*.tags' => 'between:0,255',
|
||||||
|
|
||||||
// meta info fields
|
// meta info fields
|
||||||
'transactions.*.internal_reference' => 'min:1,max:255|nullable',
|
'transactions.*.internal_reference' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.external_id' => 'min:1,max:255|nullable',
|
'transactions.*.external_id' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.recurrence_id' => 'min:1,max:255|nullable',
|
'transactions.*.recurrence_id' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.bunq_payment_id' => 'min:1,max:255|nullable',
|
'transactions.*.bunq_payment_id' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.external_url' => 'min:1,max:255|nullable|url',
|
'transactions.*.external_url' => 'min:1|max:255|nullable|url',
|
||||||
|
|
||||||
// SEPA fields:
|
// SEPA fields:
|
||||||
'transactions.*.sepa_cc' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_cc' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_ct_op' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_ct_op' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_ct_id' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_ct_id' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_db' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_db' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_country' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_country' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_ep' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_ep' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_ci' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_ci' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_batch_id' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_batch_id' => 'min:1|max:255|nullable',
|
||||||
|
|
||||||
// dates
|
// dates
|
||||||
'transactions.*.interest_date' => 'date|nullable',
|
'transactions.*.interest_date' => 'date|nullable',
|
||||||
@@ -270,7 +270,9 @@ class StoreRequest extends FormRequest
|
|||||||
$this->validateTransactionArray($validator);
|
$this->validateTransactionArray($validator);
|
||||||
|
|
||||||
// must submit at least one transaction.
|
// must submit at least one transaction.
|
||||||
|
Log::debug('Now going to validateOneTransaction');
|
||||||
$this->validateOneTransaction($validator);
|
$this->validateOneTransaction($validator);
|
||||||
|
Log::debug('Now done with validateOneTransaction');
|
||||||
|
|
||||||
// all journals must have a description
|
// all journals must have a description
|
||||||
$this->validateDescriptions($validator);
|
$this->validateDescriptions($validator);
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Api\V1\Requests\Models\Transaction;
|
namespace FireflyIII\Api\V1\Requests\Models\Transaction;
|
||||||
|
|
||||||
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Models\TransactionGroup;
|
use FireflyIII\Models\TransactionGroup;
|
||||||
use FireflyIII\Rules\BelongsUser;
|
use FireflyIII\Rules\BelongsUser;
|
||||||
use FireflyIII\Rules\IsBoolean;
|
use FireflyIII\Rules\IsBoolean;
|
||||||
@@ -163,6 +164,9 @@ class UpdateRequest extends FormRequest
|
|||||||
|
|
||||||
/** @var array $transaction */
|
/** @var array $transaction */
|
||||||
foreach ($this->get('transactions') as $transaction) {
|
foreach ($this->get('transactions') as $transaction) {
|
||||||
|
if (!is_array($transaction)) {
|
||||||
|
throw new FireflyException('Invalid data submitted: transaction is not array.');
|
||||||
|
}
|
||||||
// default response is to update nothing in the transaction:
|
// default response is to update nothing in the transaction:
|
||||||
$current = [];
|
$current = [];
|
||||||
$current = $this->getIntegerData($current, $transaction);
|
$current = $this->getIntegerData($current, $transaction);
|
||||||
@@ -287,6 +291,7 @@ class UpdateRequest extends FormRequest
|
|||||||
/**
|
/**
|
||||||
* @param array $current
|
* @param array $current
|
||||||
* @param array $transaction
|
* @param array $transaction
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
private function getFloatData(array $current, array $transaction): array
|
private function getFloatData(array $current, array $transaction): array
|
||||||
@@ -295,7 +300,7 @@ class UpdateRequest extends FormRequest
|
|||||||
if (array_key_exists($fieldName, $transaction)) {
|
if (array_key_exists($fieldName, $transaction)) {
|
||||||
$value = $transaction[$fieldName];
|
$value = $transaction[$fieldName];
|
||||||
if (is_float($value)) {
|
if (is_float($value)) {
|
||||||
$current[$fieldName] = sprintf('%.24f', $value);
|
$current[$fieldName] = sprintf('%.12f', $value);
|
||||||
}
|
}
|
||||||
if (!is_float($value)) {
|
if (!is_float($value)) {
|
||||||
$current[$fieldName] = (string)$value;
|
$current[$fieldName] = (string)$value;
|
||||||
@@ -314,6 +319,7 @@ class UpdateRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||||
|
|
||||||
return [
|
return [
|
||||||
// basic fields for group:
|
// basic fields for group:
|
||||||
'group_title' => 'between:1,1000',
|
'group_title' => 'between:1,1000',
|
||||||
@@ -330,9 +336,9 @@ class UpdateRequest extends FormRequest
|
|||||||
|
|
||||||
// currency info
|
// currency info
|
||||||
'transactions.*.currency_id' => 'numeric|exists:transaction_currencies,id',
|
'transactions.*.currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||||
'transactions.*.currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
'transactions.*.currency_code' => 'min:3|max:51|exists:transaction_currencies,code',
|
||||||
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||||
'transactions.*.foreign_currency_code' => 'nullable|min:3|max:3|exists:transaction_currencies,code',
|
'transactions.*.foreign_currency_code' => 'nullable|min:3|max:51|exists:transaction_currencies,code',
|
||||||
|
|
||||||
// amount
|
// amount
|
||||||
'transactions.*.amount' => 'numeric|gt:0|max:100000000000',
|
'transactions.*.amount' => 'numeric|gt:0|max:100000000000',
|
||||||
@@ -359,25 +365,25 @@ class UpdateRequest extends FormRequest
|
|||||||
|
|
||||||
// other interesting fields
|
// other interesting fields
|
||||||
'transactions.*.reconciled' => [new IsBoolean()],
|
'transactions.*.reconciled' => [new IsBoolean()],
|
||||||
'transactions.*.notes' => 'min:1,max:50000|nullable',
|
'transactions.*.notes' => 'min:1|max:50000|nullable',
|
||||||
'transactions.*.tags' => 'between:0,255',
|
'transactions.*.tags' => 'between:0,255',
|
||||||
|
|
||||||
// meta info fields
|
// meta info fields
|
||||||
'transactions.*.internal_reference' => 'min:1,max:255|nullable',
|
'transactions.*.internal_reference' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.external_id' => 'min:1,max:255|nullable',
|
'transactions.*.external_id' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.recurrence_id' => 'min:1,max:255|nullable',
|
'transactions.*.recurrence_id' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.bunq_payment_id' => 'min:1,max:255|nullable',
|
'transactions.*.bunq_payment_id' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.external_url' => 'min:1,max:255|nullable|url',
|
'transactions.*.external_url' => 'min:1|max:255|nullable|url',
|
||||||
|
|
||||||
// SEPA fields:
|
// SEPA fields:
|
||||||
'transactions.*.sepa_cc' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_cc' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_ct_op' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_ct_op' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_ct_id' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_ct_id' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_db' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_db' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_country' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_country' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_ep' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_ep' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_ci' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_ci' => 'min:1|max:255|nullable',
|
||||||
'transactions.*.sepa_batch_id' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_batch_id' => 'min:1|max:255|nullable',
|
||||||
|
|
||||||
// dates
|
// dates
|
||||||
'transactions.*.interest_date' => 'date|nullable',
|
'transactions.*.interest_date' => 'date|nullable',
|
||||||
@@ -398,6 +404,7 @@ class UpdateRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function withValidator(Validator $validator): void
|
public function withValidator(Validator $validator): void
|
||||||
{
|
{
|
||||||
|
Log::debug('Now in withValidator');
|
||||||
/** @var TransactionGroup $transactionGroup */
|
/** @var TransactionGroup $transactionGroup */
|
||||||
$transactionGroup = $this->route()->parameter('transactionGroup');
|
$transactionGroup = $this->route()->parameter('transactionGroup');
|
||||||
$validator->after(
|
$validator->after(
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class StoreRequest extends FormRequest
|
|||||||
'name' => 'required|between:1,255|unique:transaction_currencies,name',
|
'name' => 'required|between:1,255|unique:transaction_currencies,name',
|
||||||
'code' => 'required|between:3,51|unique:transaction_currencies,code',
|
'code' => 'required|between:3,51|unique:transaction_currencies,code',
|
||||||
'symbol' => 'required|between:1,51|unique:transaction_currencies,symbol',
|
'symbol' => 'required|between:1,51|unique:transaction_currencies,symbol',
|
||||||
'decimal_places' => 'between:0,20|numeric|min:0|max:20',
|
'decimal_places' => 'between:0,20|numeric|min:0|max:12',
|
||||||
'enabled' => [new IsBoolean()],
|
'enabled' => [new IsBoolean()],
|
||||||
'default' => [new IsBoolean()],
|
'default' => [new IsBoolean()],
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'name' => sprintf('between:1,255|unique:transaction_currencies,name,%d', $currency->id),
|
'name' => sprintf('between:1,255|unique:transaction_currencies,name,%d', $currency->id),
|
||||||
'code' => sprintf('between:3,51|unique:transaction_currencies,code,%d', $currency->id),
|
'code' => sprintf('between:3,51|unique:transaction_currencies,code,%d', $currency->id),
|
||||||
'symbol' => sprintf('between:1,51|unique:transaction_currencies,symbol,%d', $currency->id),
|
'symbol' => sprintf('between:1,51|unique:transaction_currencies,symbol,%d', $currency->id),
|
||||||
'decimal_places' => 'between:0,20|numeric|min:0|max:20',
|
'decimal_places' => 'between:0,20|numeric|min:0|max:12',
|
||||||
'enabled' => [new IsBoolean()],
|
'enabled' => [new IsBoolean()],
|
||||||
'default' => [new IsBoolean()],
|
'default' => [new IsBoolean()],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ class StoreRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => 'required|unique:link_types,name|min:1',
|
'name' => 'required|unique:link_types,name|min:1|max:1024',
|
||||||
'outward' => 'required|unique:link_types,outward|min:1|different:inward',
|
'outward' => 'required|unique:link_types,outward|min:1|different:inward|max:1024',
|
||||||
'inward' => 'required|unique:link_types,inward|min:1|different:outward',
|
'inward' => 'required|unique:link_types,inward|min:1|different:outward|max:1024',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,9 +64,9 @@ class UpdateRequest extends FormRequest
|
|||||||
$linkType = $this->route()->parameter('linkType');
|
$linkType = $this->route()->parameter('linkType');
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'name' => [Rule::unique('link_types', 'name')->ignore($linkType->id), 'min:1'],
|
'name' => [Rule::unique('link_types', 'name')->ignore($linkType->id), 'min:1', 'max:1024'],
|
||||||
'outward' => ['different:inward', Rule::unique('link_types', 'outward')->ignore($linkType->id), 'min:1'],
|
'outward' => ['different:inward', Rule::unique('link_types', 'outward')->ignore($linkType->id), 'min:1', 'max:1024'],
|
||||||
'inward' => ['different:outward', Rule::unique('link_types', 'inward')->ignore($linkType->id), 'min:1'],
|
'inward' => ['different:outward', Rule::unique('link_types', 'inward')->ignore($linkType->id), 'min:1', 'max:1024'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,10 +29,9 @@ use FireflyIII\Api\V2\Request\Autocomplete\AutocompleteRequest;
|
|||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\AccountType;
|
use FireflyIII\Models\AccountType;
|
||||||
use FireflyIII\Repositories\Administration\Account\AccountRepositoryInterface as AdminAccountRepositoryInterface;
|
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
|
use FireflyIII\Repositories\Administration\Account\AccountRepositoryInterface as AdminAccountRepositoryInterface;
|
||||||
use FireflyIII\Support\Http\Api\AccountFilter;
|
use FireflyIII\Support\Http\Api\AccountFilter;
|
||||||
use FireflyIII\User;
|
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use JsonException;
|
use JsonException;
|
||||||
|
|
||||||
@@ -43,8 +42,8 @@ class AccountController extends Controller
|
|||||||
{
|
{
|
||||||
use AccountFilter;
|
use AccountFilter;
|
||||||
|
|
||||||
private array $balanceTypes;
|
|
||||||
private AdminAccountRepositoryInterface $adminRepository;
|
private AdminAccountRepositoryInterface $adminRepository;
|
||||||
|
private array $balanceTypes;
|
||||||
private AccountRepositoryInterface $repository;
|
private AccountRepositoryInterface $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,8 +54,6 @@ class AccountController extends Controller
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->middleware(
|
$this->middleware(
|
||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
/** @var User $user */
|
|
||||||
$user = auth()->user();
|
|
||||||
$this->repository = app(AccountRepositoryInterface::class);
|
$this->repository = app(AccountRepositoryInterface::class);
|
||||||
$this->adminRepository = app(AdminAccountRepositoryInterface::class);
|
$this->adminRepository = app(AdminAccountRepositoryInterface::class);
|
||||||
|
|
||||||
@@ -113,10 +110,10 @@ class AccountController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// custom order.
|
// custom order.
|
||||||
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
|
|
||||||
usort(
|
usort(
|
||||||
$return,
|
$return,
|
||||||
function ($a, $b) use ($order) {
|
function ($a, $b) {
|
||||||
|
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
|
||||||
$pos_a = array_search($a['type'], $order, true);
|
$pos_a = array_search($a['type'], $order, true);
|
||||||
$pos_b = array_search($b['type'], $order, true);
|
$pos_b = array_search($b['type'], $order, true);
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class AccountController extends Controller
|
|||||||
$this->middleware(
|
$this->middleware(
|
||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
$this->repository = app(AccountRepositoryInterface::class);
|
$this->repository = app(AccountRepositoryInterface::class);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -63,6 +64,7 @@ class AccountController extends Controller
|
|||||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/charts/getChartAccountOverview
|
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/charts/getChartAccountOverview
|
||||||
*
|
*
|
||||||
* @param DateRequest $request
|
* @param DateRequest $request
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
* @throws ContainerExceptionInterface
|
* @throws ContainerExceptionInterface
|
||||||
* @throws NotFoundExceptionInterface
|
* @throws NotFoundExceptionInterface
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ class Controller extends BaseController
|
|||||||
* @param string $key
|
* @param string $key
|
||||||
* @param LengthAwarePaginator $paginator
|
* @param LengthAwarePaginator $paginator
|
||||||
* @param AbstractTransformer $transformer
|
* @param AbstractTransformer $transformer
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
final protected function jsonApiList(string $key, LengthAwarePaginator $paginator, AbstractTransformer $transformer): array
|
final protected function jsonApiList(string $key, LengthAwarePaginator $paginator, AbstractTransformer $transformer): array
|
||||||
@@ -162,6 +163,7 @@ class Controller extends BaseController
|
|||||||
* @param string $key
|
* @param string $key
|
||||||
* @param Model $object
|
* @param Model $object
|
||||||
* @param AbstractTransformer $transformer
|
* @param AbstractTransformer $transformer
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
final protected function jsonApiObject(string $key, Model $object, AbstractTransformer $transformer): array
|
final protected function jsonApiObject(string $key, Model $object, AbstractTransformer $transformer): array
|
||||||
@@ -174,6 +176,7 @@ class Controller extends BaseController
|
|||||||
$transformer->collectMetaData(new Collection([$object]));
|
$transformer->collectMetaData(new Collection([$object]));
|
||||||
|
|
||||||
$resource = new Item($object, $transformer, $key);
|
$resource = new Item($object, $transformer, $key);
|
||||||
|
|
||||||
return $manager->createData($resource)->toArray();
|
return $manager->createData($resource)->toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class SumController extends Controller
|
|||||||
$this->middleware(
|
$this->middleware(
|
||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
$this->repository = app(BillRepositoryInterface::class);
|
$this->repository = app(BillRepositoryInterface::class);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -58,6 +59,7 @@ class SumController extends Controller
|
|||||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/transactions-sum/getBillsPaidTrSum
|
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/transactions-sum/getBillsPaidTrSum
|
||||||
*
|
*
|
||||||
* @param DateRequest $request
|
* @param DateRequest $request
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function paid(DateRequest $request): JsonResponse
|
public function paid(DateRequest $request): JsonResponse
|
||||||
@@ -75,6 +77,7 @@ class SumController extends Controller
|
|||||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/transactions-sum/getBillsUnpaidTrSum
|
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/transactions-sum/getBillsUnpaidTrSum
|
||||||
*
|
*
|
||||||
* @param DateRequest $request
|
* @param DateRequest $request
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function unpaid(DateRequest $request): JsonResponse
|
public function unpaid(DateRequest $request): JsonResponse
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ class ListController extends Controller
|
|||||||
$this->middleware(
|
$this->middleware(
|
||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
$this->repository = app(BudgetRepositoryInterface::class);
|
$this->repository = app(BudgetRepositoryInterface::class);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -51,6 +52,7 @@ class ListController extends Controller
|
|||||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/budgets/listBudgets
|
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/budgets/listBudgets
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function index(Request $request): JsonResponse
|
public function index(Request $request): JsonResponse
|
||||||
@@ -61,6 +63,7 @@ class ListController extends Controller
|
|||||||
|
|
||||||
$paginator = new LengthAwarePaginator($collection, $total, $this->pageSize, $this->parameters->get('page'));
|
$paginator = new LengthAwarePaginator($collection, $total, $this->pageSize, $this->parameters->get('page'));
|
||||||
$transformer = new BudgetTransformer();
|
$transformer = new BudgetTransformer();
|
||||||
|
|
||||||
return response()
|
return response()
|
||||||
->api($this->jsonApiList('budgets', $paginator, $transformer))
|
->api($this->jsonApiList('budgets', $paginator, $transformer))
|
||||||
->header('Content-Type', self::CONTENT_TYPE);
|
->header('Content-Type', self::CONTENT_TYPE);
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class ShowController extends Controller
|
|||||||
$this->middleware(
|
$this->middleware(
|
||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
$this->repository = app(BudgetRepositoryInterface::class);
|
$this->repository = app(BudgetRepositoryInterface::class);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class SumController extends Controller
|
|||||||
$this->middleware(
|
$this->middleware(
|
||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
$this->repository = app(BudgetRepositoryInterface::class);
|
$this->repository = app(BudgetRepositoryInterface::class);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -58,6 +59,7 @@ class SumController extends Controller
|
|||||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/budgets/getBudgetedForBudget
|
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/budgets/getBudgetedForBudget
|
||||||
*
|
*
|
||||||
* @param DateRequest $request
|
* @param DateRequest $request
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function budgeted(DateRequest $request): JsonResponse
|
public function budgeted(DateRequest $request): JsonResponse
|
||||||
@@ -72,7 +74,9 @@ class SumController extends Controller
|
|||||||
/**
|
/**
|
||||||
* This endpoint is documented at:
|
* This endpoint is documented at:
|
||||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/budgets/getSpentForBudget
|
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/budgets/getSpentForBudget
|
||||||
|
*
|
||||||
* @param DateRequest $request
|
* @param DateRequest $request
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function spent(DateRequest $request): JsonResponse
|
public function spent(DateRequest $request): JsonResponse
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class ListController extends Controller
|
|||||||
$this->middleware(
|
$this->middleware(
|
||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
$this->repository = app(BudgetLimitRepositoryInterface::class);
|
$this->repository = app(BudgetLimitRepositoryInterface::class);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -60,6 +61,7 @@ class ListController extends Controller
|
|||||||
|
|
||||||
$paginator = new LengthAwarePaginator($collection, $total, $this->pageSize, $this->parameters->get('page'));
|
$paginator = new LengthAwarePaginator($collection, $total, $this->pageSize, $this->parameters->get('page'));
|
||||||
$transformer = new BudgetLimitTransformer();
|
$transformer = new BudgetLimitTransformer();
|
||||||
|
|
||||||
return response()
|
return response()
|
||||||
->api($this->jsonApiList('budget_limits', $paginator, $transformer))
|
->api($this->jsonApiList('budget_limits', $paginator, $transformer))
|
||||||
->header('Content-Type', self::CONTENT_TYPE);
|
->header('Content-Type', self::CONTENT_TYPE);
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class NetWorthController extends Controller
|
|||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
$this->netWorth = app(NetWorthInterface::class);
|
$this->netWorth = app(NetWorthInterface::class);
|
||||||
$this->netWorth->setUser(auth()->user());
|
$this->netWorth->setUser(auth()->user());
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -56,7 +57,9 @@ class NetWorthController extends Controller
|
|||||||
/**
|
/**
|
||||||
* This endpoint is documented at:
|
* This endpoint is documented at:
|
||||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/net-worth/getNetWorth
|
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/net-worth/getNetWorth
|
||||||
|
*
|
||||||
* @param SingleDateRequest $request
|
* @param SingleDateRequest $request
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function get(SingleDateRequest $request): JsonResponse
|
public function get(SingleDateRequest $request): JsonResponse
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ class PreferencesController extends Controller
|
|||||||
/**
|
/**
|
||||||
* This endpoint is documented at:
|
* This endpoint is documented at:
|
||||||
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/preferences/getPreference
|
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v2)#/preferences/getPreference
|
||||||
|
*
|
||||||
* @param Preference $preference
|
* @param Preference $preference
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function get(Preference $preference): JsonResponse
|
public function get(Preference $preference): JsonResponse
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class AccountController extends Controller
|
|||||||
*
|
*
|
||||||
* @param ListRequest $request
|
* @param ListRequest $request
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function listTransactions(ListRequest $request, Account $account): JsonResponse
|
public function listTransactions(ListRequest $request, Account $account): JsonResponse
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ class AutocompleteRequest extends FormRequest
|
|||||||
$array = array_diff($array, [AccountType::INITIAL_BALANCE, AccountType::RECONCILIATION]);
|
$array = array_diff($array, [AccountType::INITIAL_BALANCE, AccountType::RECONCILIATION]);
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'types' => $array,
|
'types' => $array,
|
||||||
'query' => $this->convertString('query'),
|
'query' => $this->convertString('query'),
|
||||||
|
|||||||
@@ -25,12 +25,14 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Api\V2\Response\Sum;
|
namespace FireflyIII\Api\V2\Response\Sum;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Models\TransactionCurrency;
|
use FireflyIII\Models\TransactionCurrency;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AutoSum
|
* Class AutoSum
|
||||||
|
*
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
class AutoSum
|
class AutoSum
|
||||||
@@ -39,7 +41,9 @@ class AutoSum
|
|||||||
* @param Collection $objects
|
* @param Collection $objects
|
||||||
* @param Closure $getCurrency
|
* @param Closure $getCurrency
|
||||||
* @param Closure $getSum
|
* @param Closure $getSum
|
||||||
|
*
|
||||||
* @return array
|
* @return array
|
||||||
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
public function autoSum(Collection $objects, Closure $getCurrency, Closure $getSum): array
|
public function autoSum(Collection $objects, Closure $getCurrency, Closure $getSum): array
|
||||||
{
|
{
|
||||||
@@ -64,6 +68,6 @@ class AutoSum
|
|||||||
}
|
}
|
||||||
|
|
||||||
var_dump(array_values($return));
|
var_dump(array_values($return));
|
||||||
exit;
|
throw new FireflyException('Not implemented');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
264
app/Console/Commands/Correction/CorrectAmounts.php
Normal file
264
app/Console/Commands/Correction/CorrectAmounts.php
Normal file
@@ -0,0 +1,264 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* CorrectAmounts.php
|
||||||
|
* Copyright (c) 2023 james@firefly-iii.org
|
||||||
|
*
|
||||||
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
|
use FireflyIII\Models\AutoBudget;
|
||||||
|
use FireflyIII\Models\AvailableBudget;
|
||||||
|
use FireflyIII\Models\Bill;
|
||||||
|
use FireflyIII\Models\BudgetLimit;
|
||||||
|
use FireflyIII\Models\CurrencyExchangeRate;
|
||||||
|
use FireflyIII\Models\PiggyBank;
|
||||||
|
use FireflyIII\Models\PiggyBankRepetition;
|
||||||
|
use FireflyIII\Models\RecurrenceTransaction;
|
||||||
|
use FireflyIII\Models\RuleTrigger;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ReportSkeleton
|
||||||
|
*/
|
||||||
|
class CorrectAmounts extends Command
|
||||||
|
{
|
||||||
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
|
protected $description = 'This command makes sure positive and negative amounts are recorded correctly.';
|
||||||
|
protected $signature = 'firefly-iii:fix-amount-pos-neg';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function handle(): int
|
||||||
|
{
|
||||||
|
// auto budgets must be positive
|
||||||
|
$this->fixAutoBudgets();
|
||||||
|
// available budgets must be positive
|
||||||
|
$this->fixAvailableBudgets();
|
||||||
|
// bills must be positive (both amounts)
|
||||||
|
$this->fixBills();
|
||||||
|
// budget limits must be positive
|
||||||
|
$this->fixBudgetLimits();
|
||||||
|
// currency_exchange_rates must be positive
|
||||||
|
$this->fixExchangeRates();
|
||||||
|
// piggy_bank_repetitions must be positive
|
||||||
|
$this->fixRepetitions();
|
||||||
|
// piggy_banks must be positive
|
||||||
|
$this->fixPiggyBanks();
|
||||||
|
// recurrences_transactions amount must be positive
|
||||||
|
$this->fixRecurrences();
|
||||||
|
// rule_triggers must be positive or zero (amount_less, amount_more, amount_is)
|
||||||
|
$this->fixRuleTriggers();
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function fixAutoBudgets(): void
|
||||||
|
{
|
||||||
|
$set = AutoBudget::where('amount', '<', 0)->get();
|
||||||
|
$count = $set->count();
|
||||||
|
if (0 === $count) {
|
||||||
|
$this->friendlyPositive('All auto budget amounts are positive.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/** @var AutoBudget $item */
|
||||||
|
foreach ($set as $item) {
|
||||||
|
$item->amount = app('steam')->positive((string)$item->amount);
|
||||||
|
$item->save();
|
||||||
|
}
|
||||||
|
$this->friendlyInfo(sprintf('Corrected %d auto budget amount(s).', $count));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function fixAvailableBudgets(): void
|
||||||
|
{
|
||||||
|
$set = AvailableBudget::where('amount', '<', 0)->get();
|
||||||
|
$count = $set->count();
|
||||||
|
if (0 === $count) {
|
||||||
|
$this->friendlyPositive('All available budget amounts are positive.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/** @var AvailableBudget $item */
|
||||||
|
foreach ($set as $item) {
|
||||||
|
$item->amount = app('steam')->positive((string)$item->amount);
|
||||||
|
$item->save();
|
||||||
|
}
|
||||||
|
$this->friendlyInfo(sprintf('Corrected %d available budget amount(s).', $count));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function fixBills(): void
|
||||||
|
{
|
||||||
|
$set = Bill::where('amount_min', '<', 0)->orWhere('amount_max', '<', 0)->get();
|
||||||
|
$count = $set->count();
|
||||||
|
if (0 === $count) {
|
||||||
|
$this->friendlyPositive('All bill amounts are positive.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/** @var Bill $item */
|
||||||
|
foreach ($set as $item) {
|
||||||
|
$item->amount_min = app('steam')->positive((string)$item->amount_min);
|
||||||
|
$item->amount_max = app('steam')->positive((string)$item->amount_max);
|
||||||
|
$item->save();
|
||||||
|
}
|
||||||
|
$this->friendlyInfo(sprintf('Corrected %d bill amount(s).', $count));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function fixBudgetLimits(): void
|
||||||
|
{
|
||||||
|
$set = BudgetLimit::where('amount', '<', 0)->get();
|
||||||
|
$count = $set->count();
|
||||||
|
if (0 === $count) {
|
||||||
|
$this->friendlyPositive('All budget limit amounts are positive.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/** @var BudgetLimit $item */
|
||||||
|
foreach ($set as $item) {
|
||||||
|
$item->amount = app('steam')->positive((string)$item->amount);
|
||||||
|
$item->save();
|
||||||
|
}
|
||||||
|
$this->friendlyInfo(sprintf('Corrected %d budget limit amount(s).', $count));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function fixExchangeRates(): void
|
||||||
|
{
|
||||||
|
$set = CurrencyExchangeRate::where('rate', '<', 0)->get();
|
||||||
|
$count = $set->count();
|
||||||
|
if (0 === $count) {
|
||||||
|
$this->friendlyPositive('All currency exchange rates are positive.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/** @var BudgetLimit $item */
|
||||||
|
foreach ($set as $item) {
|
||||||
|
$item->rate = app('steam')->positive((string)$item->rate);
|
||||||
|
$item->save();
|
||||||
|
}
|
||||||
|
$this->friendlyInfo(sprintf('Corrected %d currency exchange rate(s).', $count));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function fixRepetitions(): void
|
||||||
|
{
|
||||||
|
$set = PiggyBankRepetition::where('currentamount', '<', 0)->get();
|
||||||
|
$count = $set->count();
|
||||||
|
if (0 === $count) {
|
||||||
|
$this->friendlyPositive('All piggy bank repetition amounts are positive.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/** @var PiggyBankRepetition $item */
|
||||||
|
foreach ($set as $item) {
|
||||||
|
$item->currentamount = app('steam')->positive((string)$item->currentamount);
|
||||||
|
$item->save();
|
||||||
|
}
|
||||||
|
$this->friendlyInfo(sprintf('Corrected %d piggy bank repetition amount(s).', $count));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function fixPiggyBanks(): void
|
||||||
|
{
|
||||||
|
$set = PiggyBank::where('targetamount', '<', 0)->get();
|
||||||
|
$count = $set->count();
|
||||||
|
if (0 === $count) {
|
||||||
|
$this->friendlyPositive('All piggy bank amounts are positive.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/** @var PiggyBankRepetition $item */
|
||||||
|
foreach ($set as $item) {
|
||||||
|
$item->targetamount = app('steam')->positive((string)$item->targetamount);
|
||||||
|
$item->save();
|
||||||
|
}
|
||||||
|
$this->friendlyInfo(sprintf('Corrected %d piggy bank amount(s).', $count));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function fixRecurrences(): void
|
||||||
|
{
|
||||||
|
$set = RecurrenceTransaction::where('amount', '<', 0)
|
||||||
|
->orWhere('foreign_amount', '<', 0)
|
||||||
|
->get();
|
||||||
|
$count = $set->count();
|
||||||
|
if (0 === $count) {
|
||||||
|
$this->friendlyPositive('All recurring transaction amounts are positive.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
/** @var PiggyBankRepetition $item */
|
||||||
|
foreach ($set as $item) {
|
||||||
|
$item->amount = app('steam')->positive((string)$item->amount);
|
||||||
|
$item->foreign_amount = app('steam')->positive((string)$item->foreign_amount);
|
||||||
|
$item->save();
|
||||||
|
}
|
||||||
|
$this->friendlyInfo(sprintf('Corrected %d recurring transaction amount(s).', $count));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function fixRuleTriggers(): void
|
||||||
|
{
|
||||||
|
$set = RuleTrigger::whereIn('trigger_type', ['amount_less', 'amount_more', 'amount_is'])->get();
|
||||||
|
$fixed = 0;
|
||||||
|
/** @var RuleTrigger $item */
|
||||||
|
foreach ($set as $item) {
|
||||||
|
// basic check:
|
||||||
|
if (-1 === bccomp((string)$item->trigger_value, '0')) {
|
||||||
|
$fixed++;
|
||||||
|
$item->trigger_value = app('steam')->positive((string)$item->trigger_value);
|
||||||
|
$item->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (0 === $fixed) {
|
||||||
|
$this->friendlyPositive('All rule trigger amounts are positive.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$this->friendlyInfo(sprintf('Corrected %d rule trigger amount(s).', $fixed));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
use Artisan;
|
use Artisan;
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Schema;
|
use Schema;
|
||||||
|
|
||||||
@@ -34,17 +35,9 @@ use Schema;
|
|||||||
*/
|
*/
|
||||||
class CorrectDatabase extends Command
|
class CorrectDatabase extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Will correct the integrity of your database, if necessary.';
|
protected $description = 'Will correct the integrity of your database, if necessary.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:correct-database';
|
protected $signature = 'firefly-iii:correct-database';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,6 +47,8 @@ class CorrectDatabase extends Command
|
|||||||
{
|
{
|
||||||
// if table does not exist, return false
|
// if table does not exist, return false
|
||||||
if (!Schema::hasTable('users')) {
|
if (!Schema::hasTable('users')) {
|
||||||
|
$this->friendlyError('No "users"-table, will not continue.');
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
$commands = [
|
$commands = [
|
||||||
@@ -61,7 +56,7 @@ class CorrectDatabase extends Command
|
|||||||
'firefly-iii:create-link-types',
|
'firefly-iii:create-link-types',
|
||||||
'firefly-iii:create-access-tokens',
|
'firefly-iii:create-access-tokens',
|
||||||
'firefly-iii:remove-bills',
|
'firefly-iii:remove-bills',
|
||||||
'firefly-iii:fix-negative-limits',
|
'firefly-iii:fix-amount-pos-neg',
|
||||||
'firefly-iii:enable-currencies',
|
'firefly-iii:enable-currencies',
|
||||||
'firefly-iii:fix-transfer-budgets',
|
'firefly-iii:fix-transfer-budgets',
|
||||||
'firefly-iii:fix-uneven-amount',
|
'firefly-iii:fix-uneven-amount',
|
||||||
@@ -76,16 +71,16 @@ class CorrectDatabase extends Command
|
|||||||
'firefly-iii:fix-ob-currencies',
|
'firefly-iii:fix-ob-currencies',
|
||||||
'firefly-iii:fix-long-descriptions',
|
'firefly-iii:fix-long-descriptions',
|
||||||
'firefly-iii:fix-recurring-transactions',
|
'firefly-iii:fix-recurring-transactions',
|
||||||
'firefly-iii:restore-oauth-keys',
|
|
||||||
'firefly-iii:upgrade-group-information',
|
'firefly-iii:upgrade-group-information',
|
||||||
'firefly-iii:fix-transaction-types',
|
'firefly-iii:fix-transaction-types',
|
||||||
'firefly-iii:fix-frontpage-accounts',
|
'firefly-iii:fix-frontpage-accounts',
|
||||||
|
// new!
|
||||||
|
'firefly-iii:unify-group-accounts',
|
||||||
|
'firefly-iii:trigger-credit-recalculation',
|
||||||
];
|
];
|
||||||
foreach ($commands as $command) {
|
foreach ($commands as $command) {
|
||||||
$this->line(sprintf('Now executing %s', $command));
|
$this->friendlyLine(sprintf('Now executing command "%s"', $command));
|
||||||
Artisan::call($command);
|
$this->call($command);
|
||||||
$result = Artisan::output();
|
|
||||||
echo $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\AccountType;
|
use FireflyIII\Models\AccountType;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
@@ -33,25 +33,16 @@ use FireflyIII\Models\TransactionJournal;
|
|||||||
use FireflyIII\Models\TransactionType;
|
use FireflyIII\Models\TransactionType;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use JsonException;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CorrectOpeningBalanceCurrencies
|
* Class CorrectOpeningBalanceCurrencies
|
||||||
*/
|
*/
|
||||||
class CorrectOpeningBalanceCurrencies extends Command
|
class CorrectOpeningBalanceCurrencies extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Will make sure that opening balance transaction currencies match the account they\'re for.';
|
protected $description = 'Will make sure that opening balance transaction currencies match the account they\'re for.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-ob-currencies';
|
protected $signature = 'firefly-iii:fix-ob-currencies';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,57 +52,55 @@ class CorrectOpeningBalanceCurrencies extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
$journals = $this->getJournals();
|
||||||
// get all OB journals:
|
|
||||||
$set = TransactionJournal::leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
|
||||||
->whereNull('transaction_journals.deleted_at')
|
|
||||||
->where('transaction_types.type', TransactionType::OPENING_BALANCE)->get(['transaction_journals.*']);
|
|
||||||
|
|
||||||
$this->line(sprintf('Going to verify %d opening balance transactions.', $set->count()));
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
foreach ($set as $journal) {
|
foreach ($journals as $journal) {
|
||||||
$count += $this->correctJournal($journal);
|
$count += $this->correctJournal($journal);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
$message = sprintf('Corrected %d opening balance transaction(s).', $count);
|
$message = sprintf('Corrected %d opening balance transaction(s).', $count);
|
||||||
Log::debug($message);
|
$this->friendlyInfo($message);
|
||||||
$this->line($message);
|
|
||||||
}
|
}
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
$message = 'There was nothing to fix in the opening balance transactions.';
|
$message = 'There was nothing to fix in the opening balance transactions.';
|
||||||
Log::debug($message);
|
$this->friendlyPositive($message);
|
||||||
$this->info($message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Log::debug(sprintf('Done with %s', __METHOD__));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection
|
||||||
|
*/
|
||||||
|
private function getJournals(): Collection
|
||||||
|
{
|
||||||
|
/** @var Collection */
|
||||||
|
return TransactionJournal::leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||||
|
->whereNull('transaction_journals.deleted_at')
|
||||||
|
->where('transaction_types.type', TransactionType::OPENING_BALANCE)->get(['transaction_journals.*']);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param TransactionJournal $journal
|
* @param TransactionJournal $journal
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
* @throws FireflyException
|
|
||||||
* @throws JsonException
|
|
||||||
*/
|
*/
|
||||||
private function correctJournal(TransactionJournal $journal): int
|
private function correctJournal(TransactionJournal $journal): int
|
||||||
{
|
{
|
||||||
// get the asset account for this opening balance:
|
// get the asset account for this opening balance:
|
||||||
$account = $this->getAccount($journal);
|
$account = $this->getAccount($journal);
|
||||||
if (null === $account) {
|
if (null === $account) {
|
||||||
$message = sprintf('Transaction journal #%d has no valid account. Cant fix this line.', $journal->id);
|
$message = sprintf('Transaction journal #%d has no valid account. Can\'t fix this line.', $journal->id);
|
||||||
app('log')->warning($message);
|
app('log')->warning($message);
|
||||||
$this->warn($message);
|
$this->friendlyError($message);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$currency = $this->getCurrency($account);
|
|
||||||
|
|
||||||
// update journal and all transactions:
|
// update journal and all transactions:
|
||||||
return $this->setCurrency($journal, $currency);
|
return $this->setCorrectCurrency($account, $journal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,33 +119,18 @@ class CorrectOpeningBalanceCurrencies extends Command
|
|||||||
return $account;
|
return $account;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
*
|
|
||||||
* @return TransactionCurrency
|
|
||||||
* @throws JsonException
|
|
||||||
* @throws FireflyException
|
|
||||||
*/
|
|
||||||
private function getCurrency(Account $account): TransactionCurrency
|
|
||||||
{
|
|
||||||
/** @var AccountRepositoryInterface $repos */
|
|
||||||
$repos = app(AccountRepositoryInterface::class);
|
|
||||||
$repos->setUser($account->user);
|
|
||||||
|
|
||||||
return $repos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrencyByUser($account->user);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param TransactionJournal $journal
|
* @param TransactionJournal $journal
|
||||||
* @param TransactionCurrency $currency
|
|
||||||
*
|
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
private function setCurrency(TransactionJournal $journal, TransactionCurrency $currency): int
|
private function setCorrectCurrency(Account $account, TransactionJournal $journal): int
|
||||||
{
|
{
|
||||||
|
$currency = $this->getCurrency($account);
|
||||||
$count = 0;
|
$count = 0;
|
||||||
if ((int)$journal->transaction_currency_id !== (int)$currency->id) {
|
if ((int)$journal->transaction_currency_id !== (int)$currency->id) {
|
||||||
$journal->transaction_currency_id = $currency->id;
|
$journal->transaction_currency_id = $currency->id;
|
||||||
@@ -175,4 +149,18 @@ class CorrectOpeningBalanceCurrencies extends Command
|
|||||||
|
|
||||||
return $count;
|
return $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Account $account
|
||||||
|
*
|
||||||
|
* @return TransactionCurrency
|
||||||
|
*/
|
||||||
|
private function getCurrency(Account $account): TransactionCurrency
|
||||||
|
{
|
||||||
|
/** @var AccountRepositoryInterface $repos */
|
||||||
|
$repos = app(AccountRepositoryInterface::class);
|
||||||
|
$repos->setUser($account->user);
|
||||||
|
|
||||||
|
return $repos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrencyByUser($account->user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
@@ -33,6 +34,8 @@ use Illuminate\Console\Command;
|
|||||||
*/
|
*/
|
||||||
class CreateAccessTokens extends Command
|
class CreateAccessTokens extends Command
|
||||||
{
|
{
|
||||||
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
@@ -58,7 +61,6 @@ class CreateAccessTokens extends Command
|
|||||||
/** @var UserRepositoryInterface $repository */
|
/** @var UserRepositoryInterface $repository */
|
||||||
$repository = app(UserRepositoryInterface::class);
|
$repository = app(UserRepositoryInterface::class);
|
||||||
|
|
||||||
$start = microtime(true);
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$users = $repository->all();
|
$users = $repository->all();
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
@@ -67,15 +69,13 @@ class CreateAccessTokens extends Command
|
|||||||
if (null === $pref) {
|
if (null === $pref) {
|
||||||
$token = $user->generateAccessToken();
|
$token = $user->generateAccessToken();
|
||||||
app('preferences')->setForUser($user, 'access_token', $token);
|
app('preferences')->setForUser($user, 'access_token', $token);
|
||||||
$this->line(sprintf('Generated access token for user %s', $user->email));
|
$this->friendlyInfo(sprintf('Generated access token for user %s', $user->email));
|
||||||
++$count;
|
++$count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
$this->info('All access tokens OK!');
|
$this->friendlyPositive('Verified access tokens.');
|
||||||
}
|
}
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->info(sprintf('Verify access tokens in %s seconds.', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\LinkType;
|
use FireflyIII\Models\LinkType;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
@@ -31,6 +32,8 @@ use Illuminate\Console\Command;
|
|||||||
*/
|
*/
|
||||||
class CreateLinkTypes extends Command
|
class CreateLinkTypes extends Command
|
||||||
{
|
{
|
||||||
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
@@ -51,7 +54,6 @@ class CreateLinkTypes extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$set = [
|
$set = [
|
||||||
'Related' => ['relates to', 'relates to'],
|
'Related' => ['relates to', 'relates to'],
|
||||||
@@ -68,17 +70,14 @@ class CreateLinkTypes extends Command
|
|||||||
$link->inward = $values[1];
|
$link->inward = $values[1];
|
||||||
$link->outward = $values[0];
|
$link->outward = $values[0];
|
||||||
++$count;
|
++$count;
|
||||||
$this->line(sprintf('Created missing link type "%s"', $name));
|
$this->friendlyInfo(sprintf('Created missing link type "%s"', $name));
|
||||||
}
|
}
|
||||||
$link->editable = false;
|
$link->editable = false;
|
||||||
$link->save();
|
$link->save();
|
||||||
}
|
}
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
$this->info('All link types OK!');
|
$this->friendlyPositive('All link types are OK');
|
||||||
}
|
}
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->info(sprintf('Verified link types in %s seconds', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,26 +24,18 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\TransactionGroup;
|
use FireflyIII\Models\TransactionGroup;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class DeleteEmptyGroups
|
* Class DeleteEmptyGroups
|
||||||
*/
|
*/
|
||||||
class DeleteEmptyGroups extends Command
|
class DeleteEmptyGroups extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Delete empty transaction groups.';
|
protected $description = 'Delete empty transaction groups.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:delete-empty-groups';
|
protected $signature = 'firefly-iii:delete-empty-groups';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,16 +47,13 @@ class DeleteEmptyGroups extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
|
||||||
$start = microtime(true);
|
|
||||||
$groupIds
|
$groupIds
|
||||||
= TransactionGroup::leftJoin('transaction_journals', 'transaction_groups.id', '=', 'transaction_journals.transaction_group_id')
|
= TransactionGroup::leftJoin('transaction_journals', 'transaction_groups.id', '=', 'transaction_journals.transaction_group_id')
|
||||||
->whereNull('transaction_journals.id')->get(['transaction_groups.id'])->pluck('id')->toArray();
|
->whereNull('transaction_journals.id')->get(['transaction_groups.id'])->pluck('id')->toArray();
|
||||||
|
|
||||||
$total = count($groupIds);
|
$total = count($groupIds);
|
||||||
Log::debug(sprintf('Count is %d', $total));
|
|
||||||
if ($total > 0) {
|
if ($total > 0) {
|
||||||
$this->info(sprintf('Deleted %d empty transaction group(s).', $total));
|
$this->friendlyInfo(sprintf('Deleted %d empty transaction group(s).', $total));
|
||||||
|
|
||||||
// again, chunks for SQLite.
|
// again, chunks for SQLite.
|
||||||
$chunks = array_chunk($groupIds, 500);
|
$chunks = array_chunk($groupIds, 500);
|
||||||
@@ -72,8 +61,9 @@ class DeleteEmptyGroups extends Command
|
|||||||
TransactionGroup::whereNull('deleted_at')->whereIn('id', $chunk)->delete();
|
TransactionGroup::whereNull('deleted_at')->whereIn('id', $chunk)->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$end = round(microtime(true) - $start, 2);
|
if (0 === $total) {
|
||||||
$this->info(sprintf('Verified empty groups in %s seconds', $end));
|
$this->friendlyInfo('Verified there are no empty groups.');
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
use DB;
|
use DB;
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
@@ -35,6 +36,8 @@ use Illuminate\Support\Facades\Log;
|
|||||||
*/
|
*/
|
||||||
class DeleteEmptyJournals extends Command
|
class DeleteEmptyJournals extends Command
|
||||||
{
|
{
|
||||||
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
@@ -83,18 +86,19 @@ class DeleteEmptyJournals extends Command
|
|||||||
|
|
||||||
|
|
||||||
Transaction::where('transaction_journal_id', (int)$row->transaction_journal_id)->delete();
|
Transaction::where('transaction_journal_id', (int)$row->transaction_journal_id)->delete();
|
||||||
$this->info(sprintf('Deleted transaction journal #%d because it had an uneven number of transactions.', $row->transaction_journal_id));
|
$this->friendlyWarning(
|
||||||
|
sprintf('Deleted transaction journal #%d because it had an uneven number of transactions.', $row->transaction_journal_id)
|
||||||
|
);
|
||||||
$total++;
|
$total++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (0 === $total) {
|
if (0 === $total) {
|
||||||
$this->info('No uneven transaction journals.');
|
$this->friendlyPositive('No uneven transaction journals.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function deleteEmptyJournals(): void
|
private function deleteEmptyJournals(): void
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$set = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
$set = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||||
->groupBy('transaction_journals.id')
|
->groupBy('transaction_journals.id')
|
||||||
@@ -109,13 +113,11 @@ class DeleteEmptyJournals extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->info(sprintf('Deleted empty transaction journal #%d', $entry->id));
|
$this->friendlyInfo(sprintf('Deleted empty transaction journal #%d', $entry->id));
|
||||||
++$count;
|
++$count;
|
||||||
}
|
}
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
$this->info('No empty transaction journals.');
|
$this->friendlyPositive('No empty transaction journals.');
|
||||||
}
|
}
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->info(sprintf('Verified empty journals in %s seconds', $end));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,6 +35,8 @@ use stdClass;
|
|||||||
*/
|
*/
|
||||||
class DeleteOrphanedTransactions extends Command
|
class DeleteOrphanedTransactions extends Command
|
||||||
{
|
{
|
||||||
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
@@ -56,12 +58,9 @@ class DeleteOrphanedTransactions extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
$this->deleteOrphanedJournals();
|
$this->deleteOrphanedJournals();
|
||||||
$this->deleteOrphanedTransactions();
|
$this->deleteOrphanedTransactions();
|
||||||
$this->deleteFromOrphanedAccounts();
|
$this->deleteFromOrphanedAccounts();
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->info(sprintf('Verified orphans in %s seconds', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -74,15 +73,15 @@ class DeleteOrphanedTransactions extends Command
|
|||||||
->get(['transaction_journals.id', 'transaction_journals.transaction_group_id']);
|
->get(['transaction_journals.id', 'transaction_journals.transaction_group_id']);
|
||||||
$count = $set->count();
|
$count = $set->count();
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
$this->info('No orphaned journals.');
|
$this->friendlyPositive('No orphaned journals.');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if ($count > 0) {
|
$this->friendlyInfo(sprintf('Found %d orphaned journal(s).', $count));
|
||||||
$this->info(sprintf('Found %d orphaned journal(s).', $count));
|
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$journal = TransactionJournal::withTrashed()->find((int)$entry->id);
|
$journal = TransactionJournal::withTrashed()->find((int)$entry->id);
|
||||||
if (null !== $journal) {
|
if (null !== $journal) {
|
||||||
$journal->delete();
|
$journal->delete();
|
||||||
$this->info(
|
$this->friendlyWarning(
|
||||||
sprintf(
|
sprintf(
|
||||||
'Journal #%d (part of deleted transaction group #%d) has been deleted as well.',
|
'Journal #%d (part of deleted transaction group #%d) has been deleted as well.',
|
||||||
$entry->id,
|
$entry->id,
|
||||||
@@ -92,7 +91,6 @@ class DeleteOrphanedTransactions extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
@@ -115,7 +113,7 @@ class DeleteOrphanedTransactions extends Command
|
|||||||
$transaction = Transaction::find((int)$entry->transaction_id);
|
$transaction = Transaction::find((int)$entry->transaction_id);
|
||||||
if (null !== $transaction) {
|
if (null !== $transaction) {
|
||||||
$transaction->delete();
|
$transaction->delete();
|
||||||
$this->info(
|
$this->friendlyWarning(
|
||||||
sprintf(
|
sprintf(
|
||||||
'Transaction #%d (part of deleted transaction journal #%d) has been deleted as well.',
|
'Transaction #%d (part of deleted transaction journal #%d) has been deleted as well.',
|
||||||
$entry->transaction_id,
|
$entry->transaction_id,
|
||||||
@@ -126,7 +124,7 @@ class DeleteOrphanedTransactions extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
$this->info('No orphaned transactions.');
|
$this->friendlyPositive('No orphaned transactions.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +146,7 @@ class DeleteOrphanedTransactions extends Command
|
|||||||
$journal->delete();
|
$journal->delete();
|
||||||
}
|
}
|
||||||
Transaction::where('transaction_journal_id', (int)$transaction->transaction_journal_id)->delete();
|
Transaction::where('transaction_journal_id', (int)$transaction->transaction_journal_id)->delete();
|
||||||
$this->line(
|
$this->friendlyWarning(
|
||||||
sprintf(
|
sprintf(
|
||||||
'Deleted transaction journal #%d because account #%d was already deleted.',
|
'Deleted transaction journal #%d because account #%d was already deleted.',
|
||||||
$transaction->transaction_journal_id,
|
$transaction->transaction_journal_id,
|
||||||
@@ -158,7 +156,7 @@ class DeleteOrphanedTransactions extends Command
|
|||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
$this->info('No orphaned accounts.');
|
$this->friendlyPositive('No orphaned accounts.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
@@ -32,6 +33,8 @@ use Illuminate\Console\Command;
|
|||||||
*/
|
*/
|
||||||
class DeleteZeroAmount extends Command
|
class DeleteZeroAmount extends Command
|
||||||
{
|
{
|
||||||
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
@@ -52,24 +55,20 @@ class DeleteZeroAmount extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
$set = Transaction::where('amount', 0)->get(['transaction_journal_id'])->pluck('transaction_journal_id')->toArray();
|
$set = Transaction::where('amount', 0)->get(['transaction_journal_id'])->pluck('transaction_journal_id')->toArray();
|
||||||
$set = array_unique($set);
|
$set = array_unique($set);
|
||||||
$journals = TransactionJournal::whereIn('id', $set)->get();
|
$journals = TransactionJournal::whereIn('id', $set)->get();
|
||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
foreach ($journals as $journal) {
|
foreach ($journals as $journal) {
|
||||||
$this->info(sprintf('Deleted transaction journal #%d because the amount is zero (0.00).', $journal->id));
|
$this->friendlyWarning(sprintf('Deleted transaction journal #%d because the amount is zero (0.00).', $journal->id));
|
||||||
$journal->delete();
|
$journal->delete();
|
||||||
|
|
||||||
Transaction::where('transaction_journal_id', $journal->id)->delete();
|
Transaction::where('transaction_journal_id', $journal->id)->delete();
|
||||||
}
|
}
|
||||||
if (0 === $journals->count()) {
|
if (0 === $journals->count()) {
|
||||||
$this->info('No zero-amount transaction journals.');
|
$this->friendlyPositive('No zero-amount transaction journals.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->info(sprintf('Verified zero-amount integrity in %s seconds', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\AccountMeta;
|
use FireflyIII\Models\AccountMeta;
|
||||||
use FireflyIII\Models\BudgetLimit;
|
use FireflyIII\Models\BudgetLimit;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
@@ -30,24 +31,15 @@ use FireflyIII\Models\TransactionCurrency;
|
|||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class EnableCurrencies
|
* Class EnableCurrencies
|
||||||
*/
|
*/
|
||||||
class EnableCurrencies extends Command
|
class EnableCurrencies extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Enables all currencies in use.';
|
protected $description = 'Enables all currencies in use.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:enable-currencies';
|
protected $signature = 'firefly-iii:enable-currencies';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -57,7 +49,6 @@ class EnableCurrencies extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
$found = [];
|
$found = [];
|
||||||
// get all meta entries
|
// get all meta entries
|
||||||
/** @var Collection $meta */
|
/** @var Collection $meta */
|
||||||
@@ -94,22 +85,15 @@ class EnableCurrencies extends Command
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$message = sprintf('%d different currencies are currently in use.', count($found));
|
|
||||||
$this->info($message);
|
|
||||||
Log::debug($message, $found);
|
|
||||||
|
|
||||||
$disabled = TransactionCurrency::whereIn('id', $found)->where('enabled', false)->count();
|
$disabled = TransactionCurrency::whereIn('id', $found)->where('enabled', false)->count();
|
||||||
if ($disabled > 0) {
|
if ($disabled > 0) {
|
||||||
$this->info(sprintf('%d were (was) still disabled. This has been corrected.', $disabled));
|
$this->friendlyInfo(sprintf('%d currencies were (was) disabled while in use by transactions. This has been corrected.', $disabled));
|
||||||
}
|
}
|
||||||
if (0 === $disabled) {
|
if (0 === $disabled) {
|
||||||
$this->info('All currencies are correctly enabled or disabled.');
|
$this->friendlyPositive('All currencies are correctly enabled or disabled.');
|
||||||
}
|
}
|
||||||
TransactionCurrency::whereIn('id', $found)->update(['enabled' => true]);
|
TransactionCurrency::whereIn('id', $found)->update(['enabled' => true]);
|
||||||
|
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->info(sprintf('Verified currencies in %s seconds.', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
@@ -32,17 +33,9 @@ use Illuminate\Console\Command;
|
|||||||
*/
|
*/
|
||||||
class FixAccountOrder extends Command
|
class FixAccountOrder extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Make sure account order is correct.';
|
protected $description = 'Make sure account order is correct.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-account-order';
|
protected $signature = 'firefly-iii:fix-account-order';
|
||||||
|
|
||||||
private AccountRepositoryInterface $repository;
|
private AccountRepositoryInterface $repository;
|
||||||
@@ -55,7 +48,6 @@ class FixAccountOrder extends Command
|
|||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$this->stupidLaravel();
|
$this->stupidLaravel();
|
||||||
$start = microtime(true);
|
|
||||||
|
|
||||||
$users = User::get();
|
$users = User::get();
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
@@ -63,8 +55,7 @@ class FixAccountOrder extends Command
|
|||||||
$this->repository->resetAccountOrder();
|
$this->repository->resetAccountOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
$end = round(microtime(true) - $start, 2);
|
$this->friendlyPositive('All accounts are ordered correctly');
|
||||||
$this->info(sprintf('Verifying account order took %s seconds', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Factory\AccountFactory;
|
use FireflyIII\Factory\AccountFactory;
|
||||||
use FireflyIII\Models\AccountType;
|
use FireflyIII\Models\AccountType;
|
||||||
@@ -30,25 +31,17 @@ use FireflyIII\Models\Transaction;
|
|||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Models\TransactionType;
|
use FireflyIII\Models\TransactionType;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use JsonException;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use JsonException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class FixAccountTypes
|
* Class FixAccountTypes
|
||||||
*/
|
*/
|
||||||
class FixAccountTypes extends Command
|
class FixAccountTypes extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Make sure all journals have the correct from/to account types.';
|
protected $description = 'Make sure all journals have the correct from/to account types.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-account-types';
|
protected $signature = 'firefly-iii:fix-account-types';
|
||||||
private int $count;
|
private int $count;
|
||||||
private array $expected;
|
private array $expected;
|
||||||
@@ -63,27 +56,20 @@ class FixAccountTypes extends Command
|
|||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$this->stupidLaravel();
|
$this->stupidLaravel();
|
||||||
Log::debug('Now in fix-account-types');
|
|
||||||
$start = microtime(true);
|
|
||||||
$this->factory = app(AccountFactory::class);
|
$this->factory = app(AccountFactory::class);
|
||||||
$this->expected = config('firefly.source_dests');
|
$this->expected = config('firefly.source_dests');
|
||||||
$journals = TransactionJournal::with(['TransactionType', 'transactions', 'transactions.account', 'transactions.account.accounttype'])->get();
|
$journals = TransactionJournal::with(['TransactionType', 'transactions', 'transactions.account', 'transactions.account.accounttype'])->get();
|
||||||
Log::debug(sprintf('Found %d journals to inspect.', $journals->count()));
|
|
||||||
foreach ($journals as $journal) {
|
foreach ($journals as $journal) {
|
||||||
$this->inspectJournal($journal);
|
$this->inspectJournal($journal);
|
||||||
}
|
}
|
||||||
if (0 === $this->count) {
|
if (0 === $this->count) {
|
||||||
Log::debug('No journals had to be fixed.');
|
$this->friendlyPositive('All account types are OK');
|
||||||
$this->info('All account types are OK!');
|
|
||||||
}
|
}
|
||||||
if (0 !== $this->count) {
|
if (0 !== $this->count) {
|
||||||
Log::debug(sprintf('%d journals had to be fixed.', $this->count));
|
Log::debug(sprintf('%d journals had to be fixed.', $this->count));
|
||||||
$this->info(sprintf('Acted on %d transaction(s)!', $this->count));
|
$this->friendlyInfo(sprintf('Acted on %d transaction(s)', $this->count));
|
||||||
}
|
}
|
||||||
|
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->info(sprintf('Verifying account types took %s seconds', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +95,7 @@ class FixAccountTypes extends Command
|
|||||||
$transactions = $journal->transactions()->count();
|
$transactions = $journal->transactions()->count();
|
||||||
if (2 !== $transactions) {
|
if (2 !== $transactions) {
|
||||||
Log::debug(sprintf('Journal has %d transactions, so can\'t fix.', $transactions));
|
Log::debug(sprintf('Journal has %d transactions, so can\'t fix.', $transactions));
|
||||||
$this->info(sprintf('Cannot inspect transaction journal #%d because it has %d transaction(s) instead of 2.', $journal->id, $transactions));
|
$this->friendlyError(sprintf('Cannot inspect transaction journal #%d because it has %d transaction(s) instead of 2.', $journal->id, $transactions));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -123,7 +109,7 @@ class FixAccountTypes extends Command
|
|||||||
|
|
||||||
if (!array_key_exists($type, $this->expected)) {
|
if (!array_key_exists($type, $this->expected)) {
|
||||||
Log::info(sprintf('No source/destination info for transaction type %s.', $type));
|
Log::info(sprintf('No source/destination info for transaction type %s.', $type));
|
||||||
$this->info(sprintf('No source/destination info for transaction type %s.', $type));
|
$this->friendlyError(sprintf('No source/destination info for transaction type %s.', $type));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -184,7 +170,7 @@ class FixAccountTypes extends Command
|
|||||||
$journal->transactionType()->associate($withdrawal);
|
$journal->transactionType()->associate($withdrawal);
|
||||||
$journal->save();
|
$journal->save();
|
||||||
$message = sprintf('Converted transaction #%d from a transfer to a withdrawal.', $journal->id);
|
$message = sprintf('Converted transaction #%d from a transfer to a withdrawal.', $journal->id);
|
||||||
$this->info($message);
|
$this->friendlyInfo($message);
|
||||||
Log::debug($message);
|
Log::debug($message);
|
||||||
// check it again:
|
// check it again:
|
||||||
$this->inspectJournal($journal);
|
$this->inspectJournal($journal);
|
||||||
@@ -197,7 +183,7 @@ class FixAccountTypes extends Command
|
|||||||
$journal->transactionType()->associate($deposit);
|
$journal->transactionType()->associate($deposit);
|
||||||
$journal->save();
|
$journal->save();
|
||||||
$message = sprintf('Converted transaction #%d from a transfer to a deposit.', $journal->id);
|
$message = sprintf('Converted transaction #%d from a transfer to a deposit.', $journal->id);
|
||||||
$this->info($message);
|
$this->friendlyInfo($message);
|
||||||
Log::debug($message);
|
Log::debug($message);
|
||||||
// check it again:
|
// check it again:
|
||||||
$this->inspectJournal($journal);
|
$this->inspectJournal($journal);
|
||||||
@@ -218,7 +204,7 @@ class FixAccountTypes extends Command
|
|||||||
$result->id,
|
$result->id,
|
||||||
$result->name
|
$result->name
|
||||||
);
|
);
|
||||||
$this->info($message);
|
$this->friendlyWarning($message);
|
||||||
Log::debug($message);
|
Log::debug($message);
|
||||||
$this->inspectJournal($journal);
|
$this->inspectJournal($journal);
|
||||||
break;
|
break;
|
||||||
@@ -238,17 +224,17 @@ class FixAccountTypes extends Command
|
|||||||
$result->id,
|
$result->id,
|
||||||
$result->name
|
$result->name
|
||||||
);
|
);
|
||||||
$this->info($message);
|
$this->friendlyWarning($message);
|
||||||
Log::debug($message);
|
Log::debug($message);
|
||||||
$this->inspectJournal($journal);
|
$this->inspectJournal($journal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$message = sprintf('The source account of %s #%d cannot be of type "%s".', $type, $journal->id, $source->account->accountType->type);
|
$message = sprintf('The source account of %s #%d cannot be of type "%s".', $type, $journal->id, $source->account->accountType->type);
|
||||||
$this->info($message);
|
$this->friendlyError($message);
|
||||||
Log::debug($message);
|
Log::debug($message);
|
||||||
|
|
||||||
$message = sprintf('The destination account of %s #%d cannot be of type "%s".', $type, $journal->id, $dest->account->accountType->type);
|
$message = sprintf('The destination account of %s #%d cannot be of type "%s".', $type, $journal->id, $dest->account->accountType->type);
|
||||||
$this->info($message);
|
$this->friendlyError($message);
|
||||||
Log::debug($message);
|
Log::debug($message);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* FixBudgetLimits.php
|
|
||||||
* Copyright (c) 2022 james@firefly-iii.org
|
|
||||||
*
|
|
||||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
|
||||||
|
|
||||||
use DB;
|
|
||||||
use FireflyIII\Models\BudgetLimit;
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class CorrectionSkeleton
|
|
||||||
*/
|
|
||||||
class FixBudgetLimits extends Command
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Fixes negative budget limits';
|
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-negative-limits';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the console command.
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function handle(): int
|
|
||||||
{
|
|
||||||
$set = BudgetLimit::where('amount', '<', '0')->get();
|
|
||||||
if (0 === $set->count()) {
|
|
||||||
$this->info('All budget limits are OK.');
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
$count = BudgetLimit::where('amount', '<', '0')->update(['amount' => DB::raw('amount * -1')]);
|
|
||||||
|
|
||||||
$this->info(sprintf('Fixed %d budget limit(s)', $count));
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\AccountType;
|
use FireflyIII\Models\AccountType;
|
||||||
use FireflyIII\Models\Preference;
|
use FireflyIII\Models\Preference;
|
||||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
@@ -36,17 +37,9 @@ use Illuminate\Console\Command;
|
|||||||
*/
|
*/
|
||||||
class FixFrontpageAccounts extends Command
|
class FixFrontpageAccounts extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Fixes a preference that may include deleted accounts or accounts of another type.';
|
protected $description = 'Fixes a preference that may include deleted accounts or accounts of another type.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-frontpage-accounts';
|
protected $signature = 'firefly-iii:fix-frontpage-accounts';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,8 +49,6 @@ class FixFrontpageAccounts extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
|
|
||||||
$users = User::get();
|
$users = User::get();
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
@@ -66,8 +57,7 @@ class FixFrontpageAccounts extends Command
|
|||||||
$this->fixPreference($preference);
|
$this->fixPreference($preference);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$end = round(microtime(true) - $start, 2);
|
$this->friendlyPositive('Account preferences are OK');
|
||||||
$this->info(sprintf('Verifying account preferences took %s seconds', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
use DB;
|
use DB;
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Events\UpdatedTransactionGroup;
|
use FireflyIII\Events\UpdatedTransactionGroup;
|
||||||
use FireflyIII\Handlers\Events\UpdatedGroupEventHandler;
|
use FireflyIII\Handlers\Events\UpdatedGroupEventHandler;
|
||||||
use FireflyIII\Models\TransactionGroup;
|
use FireflyIII\Models\TransactionGroup;
|
||||||
@@ -36,17 +37,9 @@ use Illuminate\Console\Command;
|
|||||||
*/
|
*/
|
||||||
class FixGroupAccounts extends Command
|
class FixGroupAccounts extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Unify the source / destination accounts of split groups.';
|
protected $description = 'Unify the source / destination accounts of split groups.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:unify-group-accounts';
|
protected $signature = 'firefly-iii:unify-group-accounts';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -72,7 +65,7 @@ class FixGroupAccounts extends Command
|
|||||||
$handler->unifyAccounts($event);
|
$handler->unifyAccounts($event);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->line('Updated inconsistent transaction groups.');
|
$this->friendlyPositive('Updated possible inconsistent transaction groups.');
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,26 +24,22 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
|
use FireflyIII\Models\AccountType;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class FixIbans
|
* Class FixIbans
|
||||||
*/
|
*/
|
||||||
class FixIbans extends Command
|
class FixIbans extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Removes spaces from IBANs';
|
protected $description = 'Removes spaces from IBANs';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-ibans';
|
protected $signature = 'firefly-iii:fix-ibans';
|
||||||
|
private int $count = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
@@ -53,6 +49,22 @@ class FixIbans extends Command
|
|||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$accounts = Account::whereNotNull('iban')->get();
|
$accounts = Account::whereNotNull('iban')->get();
|
||||||
|
$this->filterIbans($accounts);
|
||||||
|
$this->countAndCorrectIbans($accounts);
|
||||||
|
if (0 === $this->count) {
|
||||||
|
$this->friendlyPositive('All IBANs are valid.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Collection $accounts
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function filterIbans(Collection $accounts): void
|
||||||
|
{
|
||||||
/** @var Account $account */
|
/** @var Account $account */
|
||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
$iban = $account->iban;
|
$iban = $account->iban;
|
||||||
@@ -61,11 +73,58 @@ class FixIbans extends Command
|
|||||||
if ('' !== $iban) {
|
if ('' !== $iban) {
|
||||||
$account->iban = $iban;
|
$account->iban = $iban;
|
||||||
$account->save();
|
$account->save();
|
||||||
$this->line(sprintf('Removed spaces from IBAN of account #%d', $account->id));
|
$this->friendlyInfo(sprintf('Removed spaces from IBAN of account #%d', $account->id));
|
||||||
|
$this->count++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
/**
|
||||||
|
* @param Collection $accounts
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function countAndCorrectIbans(Collection $accounts): void
|
||||||
|
{
|
||||||
|
$set = [];
|
||||||
|
/** @var Account $account */
|
||||||
|
foreach ($accounts as $account) {
|
||||||
|
$userId = (int)$account->user_id;
|
||||||
|
$set[$userId] = $set[$userId] ?? [];
|
||||||
|
$iban = (string)$account->iban;
|
||||||
|
if ('' === $iban) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$type = $account->accountType->type;
|
||||||
|
if (in_array($type, [AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE], true)) {
|
||||||
|
$type = 'liabilities';
|
||||||
|
}
|
||||||
|
if (array_key_exists($iban, $set[$userId])) {
|
||||||
|
// iban already in use! two exceptions exist:
|
||||||
|
if (
|
||||||
|
!(AccountType::EXPENSE === $set[$userId][$iban] && AccountType::REVENUE === $type)
|
||||||
|
&& // allowed combination
|
||||||
|
!(AccountType::REVENUE === $set[$userId][$iban] && AccountType::EXPENSE === $type) // also allowed combination.
|
||||||
|
) {
|
||||||
|
$this->friendlyWarning(
|
||||||
|
sprintf(
|
||||||
|
'IBAN "%s" is used more than once and will be removed from %s #%d ("%s")',
|
||||||
|
$iban,
|
||||||
|
$account->accountType->type,
|
||||||
|
$account->id,
|
||||||
|
$account->name
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$account->iban = null;
|
||||||
|
$account->save();
|
||||||
|
$this->count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!array_key_exists($iban, $set[$userId])) {
|
||||||
|
$set[$userId][$iban] = $type;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\TransactionGroup;
|
use FireflyIII\Models\TransactionGroup;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
@@ -33,18 +34,10 @@ use Illuminate\Console\Command;
|
|||||||
*/
|
*/
|
||||||
class FixLongDescriptions extends Command
|
class FixLongDescriptions extends Command
|
||||||
{
|
{
|
||||||
|
use ShowsFriendlyMessages;
|
||||||
|
|
||||||
private const MAX_LENGTH = 1000;
|
private const MAX_LENGTH = 1000;
|
||||||
/**
|
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Fixes long descriptions in journals and groups.';
|
protected $description = 'Fixes long descriptions in journals and groups.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-long-descriptions';
|
protected $signature = 'firefly-iii:fix-long-descriptions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -54,14 +47,15 @@ class FixLongDescriptions extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
$journals = TransactionJournal::get(['id', 'description']);
|
$journals = TransactionJournal::get(['id', 'description']);
|
||||||
|
$count = 0;
|
||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
foreach ($journals as $journal) {
|
foreach ($journals as $journal) {
|
||||||
if (strlen($journal->description) > self::MAX_LENGTH) {
|
if (strlen($journal->description) > self::MAX_LENGTH) {
|
||||||
$journal->description = substr($journal->description, 0, self::MAX_LENGTH);
|
$journal->description = substr($journal->description, 0, self::MAX_LENGTH);
|
||||||
$journal->save();
|
$journal->save();
|
||||||
$this->line(sprintf('Truncated description of transaction journal #%d', $journal->id));
|
$this->friendlyWarning(sprintf('Truncated description of transaction journal #%d', $journal->id));
|
||||||
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,12 +65,13 @@ class FixLongDescriptions extends Command
|
|||||||
if (strlen((string)$group->title) > self::MAX_LENGTH) {
|
if (strlen((string)$group->title) > self::MAX_LENGTH) {
|
||||||
$group->title = substr($group->title, 0, self::MAX_LENGTH);
|
$group->title = substr($group->title, 0, self::MAX_LENGTH);
|
||||||
$group->save();
|
$group->save();
|
||||||
$this->line(sprintf('Truncated description of transaction group #%d', $group->id));
|
$this->friendlyWarning(sprintf('Truncated description of transaction group #%d', $group->id));
|
||||||
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$end = round(microtime(true) - $start, 2);
|
if (0 === $count) {
|
||||||
$this->info('Verified all transaction group and journal title lengths.');
|
$this->friendlyPositive('All transaction group and journal title lengths are within bounds.');
|
||||||
$this->info(sprintf('Took %s seconds.', $end));
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,29 +23,21 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\PiggyBankEvent;
|
use FireflyIII\Models\PiggyBankEvent;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Models\TransactionType;
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report (and fix) piggy banks. Make sure there are only transfers linked to piggy bank events.
|
* Report (and fix) piggy banks.
|
||||||
*
|
*
|
||||||
* Class FixPiggies
|
* Class FixPiggies
|
||||||
*/
|
*/
|
||||||
class FixPiggies extends Command
|
class FixPiggies extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Fixes common issues with piggy banks.';
|
protected $description = 'Fixes common issues with piggy banks.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-piggies';
|
protected $signature = 'firefly-iii:fix-piggies';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,8 +48,7 @@ class FixPiggies extends Command
|
|||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$start = microtime(true);
|
$set = PiggyBankEvent::with(['PiggyBank', 'TransactionJournal'])->get();
|
||||||
$set = PiggyBankEvent::with(['PiggyBank', 'TransactionJournal', 'TransactionJournal.TransactionType'])->get();
|
|
||||||
|
|
||||||
/** @var PiggyBankEvent $event */
|
/** @var PiggyBankEvent $event */
|
||||||
foreach ($set as $event) {
|
foreach ($set as $event) {
|
||||||
@@ -73,26 +64,14 @@ class FixPiggies extends Command
|
|||||||
$count++;
|
$count++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$type = $journal->transactionType->type;
|
|
||||||
if (TransactionType::TRANSFER !== $type) {
|
|
||||||
$event->transaction_journal_id = null;
|
|
||||||
$event->save();
|
|
||||||
$this->line(sprintf('Piggy bank #%d was referenced by an invalid event. This has been fixed.', $event->piggy_bank_id));
|
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
$this->line('All piggy bank events are correct.');
|
$this->friendlyPositive('All piggy bank events are OK.');
|
||||||
}
|
}
|
||||||
if (0 !== $count) {
|
if (0 !== $count) {
|
||||||
$this->line(sprintf('Fixed %d piggy bank event(s).', $count));
|
$this->friendlyInfo(sprintf('Fixed %d piggy bank event(s).', $count));
|
||||||
}
|
}
|
||||||
|
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->line(sprintf('Verified the content of %d piggy bank events in %s seconds.', $set->count(), $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\Recurrence;
|
use FireflyIII\Models\Recurrence;
|
||||||
use FireflyIII\Models\RecurrenceTransaction;
|
use FireflyIII\Models\RecurrenceTransaction;
|
||||||
use FireflyIII\Models\TransactionType;
|
use FireflyIII\Models\TransactionType;
|
||||||
@@ -37,22 +38,13 @@ use Illuminate\Console\Command;
|
|||||||
*/
|
*/
|
||||||
class FixRecurringTransactions extends Command
|
class FixRecurringTransactions extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Fixes recurring transactions with the wrong transaction type.';
|
protected $description = 'Fixes recurring transactions with the wrong transaction type.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-recurring-transactions';
|
protected $signature = 'firefly-iii:fix-recurring-transactions';
|
||||||
/** @var RecurringRepositoryInterface */
|
private int $count = 0;
|
||||||
private $recurringRepos;
|
private RecurringRepositoryInterface $recurringRepos;
|
||||||
/** @var UserRepositoryInterface */
|
private UserRepositoryInterface $userRepos;
|
||||||
private $userRepos;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the console command.
|
* Execute the console command.
|
||||||
@@ -61,11 +53,11 @@ class FixRecurringTransactions extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
$this->stupidLaravel();
|
$this->stupidLaravel();
|
||||||
$this->correctTransactions();
|
$this->correctTransactions();
|
||||||
$end = round(microtime(true) - $start, 2);
|
if (0 === $this->count) {
|
||||||
$this->info(sprintf('Corrected recurring transactions in %s seconds.', $end));
|
$this->friendlyPositive('All recurring transactions are OK.');
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -130,13 +122,14 @@ class FixRecurringTransactions extends Command
|
|||||||
$type = $recurrence->transactionType;
|
$type = $recurrence->transactionType;
|
||||||
$link = config(sprintf('firefly.account_to_transaction.%s.%s', $source->accountType->type, $destination->accountType->type));
|
$link = config(sprintf('firefly.account_to_transaction.%s.%s', $source->accountType->type, $destination->accountType->type));
|
||||||
if (null !== $link && strtolower($type->type) !== strtolower($link)) {
|
if (null !== $link && strtolower($type->type) !== strtolower($link)) {
|
||||||
$this->warn(
|
$this->friendlyWarning(
|
||||||
sprintf('Recurring transaction #%d should be a "%s" but is a "%s" and will be corrected.', $recurrence->id, $link, $type->type)
|
sprintf('Recurring transaction #%d should be a "%s" but is a "%s" and will be corrected.', $recurrence->id, $link, $type->type)
|
||||||
);
|
);
|
||||||
$transactionType = TransactionType::whereType($link)->first();
|
$transactionType = TransactionType::whereType($link)->first();
|
||||||
if (null !== $transactionType) {
|
if (null !== $transactionType) {
|
||||||
$recurrence->transaction_type_id = $transactionType->id;
|
$recurrence->transaction_type_id = $transactionType->id;
|
||||||
$recurrence->save();
|
$recurrence->save();
|
||||||
|
$this->count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Exceptions\FireflyException;
|
use FireflyIII\Exceptions\FireflyException;
|
||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
@@ -37,17 +38,9 @@ use Illuminate\Support\Collection;
|
|||||||
*/
|
*/
|
||||||
class FixTransactionTypes extends Command
|
class FixTransactionTypes extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Make sure all transactions are of the correct type, based on source + dest.';
|
protected $description = 'Make sure all transactions are of the correct type, based on source + dest.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-transaction-types';
|
protected $signature = 'firefly-iii:fix-transaction-types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -57,7 +50,6 @@ class FixTransactionTypes extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$journals = $this->collectJournals();
|
$journals = $this->collectJournals();
|
||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
@@ -67,13 +59,12 @@ class FixTransactionTypes extends Command
|
|||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
$this->info(sprintf('Corrected transaction type of %d transaction journals in %s seconds.', $count, $end));
|
$this->friendlyInfo('Corrected transaction type of %d transaction journals.', $count);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
$this->line(sprintf('All transaction journals are of the correct transaction type (in %s seconds).', $end));
|
$this->friendlyPositive('All transaction journals are of the correct transaction type');
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -101,13 +92,13 @@ class FixTransactionTypes extends Command
|
|||||||
$source = $this->getSourceAccount($journal);
|
$source = $this->getSourceAccount($journal);
|
||||||
$destination = $this->getDestinationAccount($journal);
|
$destination = $this->getDestinationAccount($journal);
|
||||||
} catch (FireflyException $e) {
|
} catch (FireflyException $e) {
|
||||||
$this->error($e->getMessage());
|
$this->friendlyError($e->getMessage());
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$expectedType = (string)config(sprintf('firefly.account_to_transaction.%s.%s', $source->accountType->type, $destination->accountType->type));
|
$expectedType = (string)config(sprintf('firefly.account_to_transaction.%s.%s', $source->accountType->type, $destination->accountType->type));
|
||||||
if ($expectedType !== $type) {
|
if ($expectedType !== $type) {
|
||||||
$this->line(
|
$this->friendlyWarning(
|
||||||
sprintf(
|
sprintf(
|
||||||
'Transaction journal #%d was of type "%s" but is corrected to "%s" (%s -> %s)',
|
'Transaction journal #%d was of type "%s" but is corrected to "%s" (%s -> %s)',
|
||||||
$journal->id,
|
$journal->id,
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
use DB;
|
use DB;
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\Transaction;
|
use FireflyIII\Models\Transaction;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
use stdClass;
|
use stdClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,17 +35,9 @@ use stdClass;
|
|||||||
*/
|
*/
|
||||||
class FixUnevenAmount extends Command
|
class FixUnevenAmount extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Fix journals with uneven amounts.';
|
protected $description = 'Fix journals with uneven amounts.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-uneven-amount';
|
protected $signature = 'firefly-iii:fix-uneven-amount';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -55,31 +47,41 @@ class FixUnevenAmount extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
|
||||||
$start = microtime(true);
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
// get invalid journals
|
|
||||||
$journals = DB::table('transactions')
|
$journals = DB::table('transactions')
|
||||||
->groupBy('transaction_journal_id')
|
->groupBy('transaction_journal_id')
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')]);
|
->get(['transaction_journal_id', DB::raw('SUM(amount) AS the_sum')]);
|
||||||
/** @var stdClass $entry */
|
/** @var stdClass $entry */
|
||||||
foreach ($journals as $entry) {
|
foreach ($journals as $entry) {
|
||||||
|
$sum = (string)$entry->the_sum;
|
||||||
|
if (!is_numeric($sum) || '' === $sum || str_contains($sum, 'e') || str_contains($sum, ',')) {
|
||||||
|
$message = sprintf(
|
||||||
|
'Journal #%d has an invalid sum ("%s"). No sure what to do.',
|
||||||
|
$entry->transaction_journal_id,
|
||||||
|
$entry->the_sum
|
||||||
|
);
|
||||||
|
$this->friendlyWarning($message);
|
||||||
|
app('log')->warning($message);
|
||||||
|
$count++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (0 !== bccomp((string)$entry->the_sum, '0')) {
|
if (0 !== bccomp((string)$entry->the_sum, '0')) {
|
||||||
$message = sprintf('Sum of journal #%d is %s instead of zero.', $entry->transaction_journal_id, $entry->the_sum);
|
$message = sprintf(
|
||||||
$this->warn($message);
|
'Sum of journal #%d is %s instead of zero.',
|
||||||
|
$entry->transaction_journal_id,
|
||||||
|
$entry->the_sum
|
||||||
|
);
|
||||||
|
$this->friendlyWarning($message);
|
||||||
app('log')->warning($message);
|
app('log')->warning($message);
|
||||||
$this->fixJournal((int)$entry->transaction_journal_id);
|
$this->fixJournal((int)$entry->transaction_journal_id);
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
$this->info('Amount integrity OK!');
|
$this->friendlyPositive('Database amount integrity is OK');
|
||||||
}
|
}
|
||||||
|
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->info(sprintf('Verified amount integrity in %s seconds', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +99,7 @@ class FixUnevenAmount extends Command
|
|||||||
$source = $journal->transactions()->where('amount', '<', 0)->first();
|
$source = $journal->transactions()->where('amount', '<', 0)->first();
|
||||||
|
|
||||||
if (null === $source) {
|
if (null === $source) {
|
||||||
$this->error(
|
$this->friendlyError(
|
||||||
sprintf(
|
sprintf(
|
||||||
'Journal #%d ("%s") has no source transaction. It will be deleted to maintain database consistency.',
|
'Journal #%d ("%s") has no source transaction. It will be deleted to maintain database consistency.',
|
||||||
$journal->id ?? 0,
|
$journal->id ?? 0,
|
||||||
@@ -117,7 +119,7 @@ class FixUnevenAmount extends Command
|
|||||||
$destination = $journal->transactions()->where('amount', '>', 0)->first();
|
$destination = $journal->transactions()->where('amount', '>', 0)->first();
|
||||||
|
|
||||||
if (null === $destination) {
|
if (null === $destination) {
|
||||||
$this->error(
|
$this->friendlyError(
|
||||||
sprintf(
|
sprintf(
|
||||||
'Journal #%d ("%s") has no destination transaction. It will be deleted to maintain database consistency.',
|
'Journal #%d ("%s") has no destination transaction. It will be deleted to maintain database consistency.',
|
||||||
$journal->id ?? 0,
|
$journal->id ?? 0,
|
||||||
@@ -135,6 +137,6 @@ class FixUnevenAmount extends Command
|
|||||||
$destination->save();
|
$destination->save();
|
||||||
|
|
||||||
$message = sprintf('Corrected amount in transaction journal #%d', $param);
|
$message = sprintf('Corrected amount in transaction journal #%d', $param);
|
||||||
$this->line($message);
|
$this->friendlyInfo($message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Models\TransactionType;
|
use FireflyIII\Models\TransactionType;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
@@ -32,17 +33,9 @@ use Illuminate\Console\Command;
|
|||||||
*/
|
*/
|
||||||
class RemoveBills extends Command
|
class RemoveBills extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Remove bills from transactions that shouldn\'t have one.';
|
protected $description = 'Remove bills from transactions that shouldn\'t have one.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:remove-bills';
|
protected $signature = 'firefly-iii:remove-bills';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +45,6 @@ class RemoveBills extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
/** @var TransactionType|null $withdrawal */
|
/** @var TransactionType|null $withdrawal */
|
||||||
$withdrawal = TransactionType::where('type', TransactionType::WITHDRAWAL)->first();
|
$withdrawal = TransactionType::where('type', TransactionType::WITHDRAWAL)->first();
|
||||||
if (null === $withdrawal) {
|
if (null === $withdrawal) {
|
||||||
@@ -61,18 +53,14 @@ class RemoveBills extends Command
|
|||||||
$journals = TransactionJournal::whereNotNull('bill_id')->where('transaction_type_id', '!=', $withdrawal->id)->get();
|
$journals = TransactionJournal::whereNotNull('bill_id')->where('transaction_type_id', '!=', $withdrawal->id)->get();
|
||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
foreach ($journals as $journal) {
|
foreach ($journals as $journal) {
|
||||||
$this->line(sprintf('Transaction journal #%d should not be linked to bill #%d.', $journal->id, $journal->bill_id));
|
$this->friendlyWarning(sprintf('Transaction journal #%d will be unlinked from bill #%d.', $journal->id, $journal->bill_id));
|
||||||
$journal->bill_id = null;
|
$journal->bill_id = null;
|
||||||
$journal->save();
|
$journal->save();
|
||||||
}
|
}
|
||||||
if (0 === $journals->count()) {
|
|
||||||
$this->info('All transaction journals have correct bill information.');
|
|
||||||
}
|
|
||||||
if ($journals->count() > 0) {
|
if ($journals->count() > 0) {
|
||||||
$this->info('Fixed all transaction journals so they have correct bill information.');
|
$this->friendlyInfo('Fixed all transaction journals so they have correct bill information.');
|
||||||
}
|
}
|
||||||
$end = round(microtime(true) - $start, 2);
|
$this->friendlyPositive('All bills and journals are OK');
|
||||||
$this->info(sprintf('Verified bills / journals in %s seconds', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
use DB;
|
use DB;
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,17 +32,9 @@ use Illuminate\Console\Command;
|
|||||||
*/
|
*/
|
||||||
class RenameMetaFields extends Command
|
class RenameMetaFields extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Rename changed meta fields.';
|
protected $description = 'Rename changed meta fields.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:rename-meta-fields';
|
protected $signature = 'firefly-iii:rename-meta-fields';
|
||||||
|
|
||||||
private int $count;
|
private int $count;
|
||||||
@@ -54,7 +47,6 @@ class RenameMetaFields extends Command
|
|||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$this->count = 0;
|
$this->count = 0;
|
||||||
$start = microtime(true);
|
|
||||||
|
|
||||||
$changes = [
|
$changes = [
|
||||||
'original-source' => 'original_source',
|
'original-source' => 'original_source',
|
||||||
@@ -74,15 +66,11 @@ class RenameMetaFields extends Command
|
|||||||
$this->rename($original, $update);
|
$this->rename($original, $update);
|
||||||
}
|
}
|
||||||
if (0 === $this->count) {
|
if (0 === $this->count) {
|
||||||
$this->line('All meta fields are correct.');
|
$this->friendlyPositive('All meta fields are correct.');
|
||||||
}
|
}
|
||||||
if (0 !== $this->count) {
|
if (0 !== $this->count) {
|
||||||
$this->line(sprintf('Renamed %d meta field(s).', $this->count));
|
$this->friendlyInfo(sprintf('Renamed %d meta field(s).', $this->count));
|
||||||
}
|
}
|
||||||
|
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->info(sprintf('Renamed meta fields in %s seconds', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace FireflyIII\Console\Commands\Correction;
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||||
use FireflyIII\Models\TransactionJournal;
|
use FireflyIII\Models\TransactionJournal;
|
||||||
use FireflyIII\Models\TransactionType;
|
use FireflyIII\Models\TransactionType;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
@@ -33,17 +34,9 @@ use Illuminate\Support\Facades\Log;
|
|||||||
*/
|
*/
|
||||||
class TransferBudgets extends Command
|
class TransferBudgets extends Command
|
||||||
{
|
{
|
||||||
/**
|
use ShowsFriendlyMessages;
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Removes budgets from transfers.';
|
protected $description = 'Removes budgets from transfers.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:fix-transfer-budgets';
|
protected $signature = 'firefly-iii:fix-transfer-budgets';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,7 +46,6 @@ class TransferBudgets extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$start = microtime(true);
|
|
||||||
$set = TransactionJournal::distinct()
|
$set = TransactionJournal::distinct()
|
||||||
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
->leftJoin('transaction_types', 'transaction_types.id', '=', 'transaction_journals.transaction_type_id')
|
||||||
->leftJoin('budget_transaction_journal', 'transaction_journals.id', '=', 'budget_transaction_journal.transaction_journal_id')
|
->leftJoin('budget_transaction_journal', 'transaction_journals.id', '=', 'budget_transaction_journal.transaction_journal_id')
|
||||||
@@ -63,24 +55,20 @@ class TransferBudgets extends Command
|
|||||||
/** @var TransactionJournal $entry */
|
/** @var TransactionJournal $entry */
|
||||||
foreach ($set as $entry) {
|
foreach ($set as $entry) {
|
||||||
$message = sprintf('Transaction journal #%d is a %s, so has no longer a budget.', $entry->id, $entry->transactionType->type);
|
$message = sprintf('Transaction journal #%d is a %s, so has no longer a budget.', $entry->id, $entry->transactionType->type);
|
||||||
$this->info($message);
|
$this->friendlyInfo($message);
|
||||||
Log::debug($message);
|
Log::debug($message);
|
||||||
$entry->budgets()->sync([]);
|
$entry->budgets()->sync([]);
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
if (0 === $count) {
|
if (0 === $count) {
|
||||||
$message = 'No invalid budget/journal entries.';
|
$message = 'No invalid budget/journal entries.';
|
||||||
Log::debug($message);
|
$this->friendlyPositive($message);
|
||||||
$this->info($message);
|
|
||||||
}
|
}
|
||||||
if (0 !== $count) {
|
if (0 !== $count) {
|
||||||
$message = sprintf('Corrected %d invalid budget/journal entries (entry).', $count);
|
$message = sprintf('Corrected %d invalid budget/journal entries (entry).', $count);
|
||||||
Log::debug($message);
|
Log::debug($message);
|
||||||
$this->line($message);
|
$this->friendlyInfo($message);
|
||||||
}
|
}
|
||||||
$end = round(microtime(true) - $start, 2);
|
|
||||||
$this->info(sprintf('Verified budget/journals in %s seconds.', $end));
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ namespace FireflyIII\Console\Commands\Correction;
|
|||||||
use FireflyIII\Models\Account;
|
use FireflyIII\Models\Account;
|
||||||
use FireflyIII\Services\Internal\Support\CreditRecalculateService;
|
use FireflyIII\Services\Internal\Support\CreditRecalculateService;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CorrectionSkeleton
|
* Class CorrectionSkeleton
|
||||||
@@ -15,17 +14,7 @@ use Illuminate\Support\Facades\Log;
|
|||||||
*/
|
*/
|
||||||
class TriggerCreditCalculation extends Command
|
class TriggerCreditCalculation extends Command
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* The console command description.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $description = 'Triggers the credit recalculation service for liabilities.';
|
protected $description = 'Triggers the credit recalculation service for liabilities.';
|
||||||
/**
|
|
||||||
* The name and signature of the console command.
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $signature = 'firefly-iii:trigger-credit-recalculation';
|
protected $signature = 'firefly-iii:trigger-credit-recalculation';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,6 +25,7 @@ class TriggerCreditCalculation extends Command
|
|||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
$this->processAccounts();
|
$this->processAccounts();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,13 +35,13 @@ class TriggerCreditCalculation extends Command
|
|||||||
->whereIn('account_types.type', config('firefly.valid_liabilities'))
|
->whereIn('account_types.type', config('firefly.valid_liabilities'))
|
||||||
->get(['accounts.*']);
|
->get(['accounts.*']);
|
||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
Log::debug(sprintf('Processing account #%d ("%s")', $account->id, $account->name));
|
|
||||||
$this->processAccount($account);
|
$this->processAccount($account);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Account $account
|
* @param Account $account
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function processAccount(Account $account): void
|
private function processAccount(Account $account): void
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user