Compare commits

...

1041 Commits
4.2.2 ... 4.3.6

Author SHA1 Message Date
James Cole
56199f899f Merge branch 'release/4.3.6' 2017-02-20 05:43:34 +01:00
James Cole
ca5c845064 Update to 4.3.6 2017-02-20 05:43:05 +01:00
James Cole
a8ac69f008 Fix #578 [skip ci] 2017-02-20 05:41:43 +01:00
James Cole
b9309bc7b1 Stop Travis from building weird branches. 2017-02-19 17:01:29 +01:00
James Cole
41596feb56 Merge branch 'release/4.3.5' 2017-02-19 16:49:45 +01:00
James Cole
cf1813b413 Updated composer.lock 2017-02-19 16:48:49 +01:00
James Cole
5b267c0e95 Update to version 4.3.5 2017-02-19 16:36:03 +01:00
James Cole
3741f70c29 Merge pull request #576 from firefly-iii/l10n_develop
New Crowdin translations
2017-02-19 16:33:54 +01:00
James Cole
1f37ea3d3c Translated 2017-02-19 12:30:11 +01:00
James Cole
283ee076c7 Expand view [skip ci] 2017-02-19 12:19:30 +01:00
James Cole
b13a878927 Slightly expanded modifiers [skip ci] 2017-02-19 12:17:07 +01:00
James Cole
364eb2838e Translated 2017-02-19 12:12:59 +01:00
James Cole
94631ca8d7 Approved. Step name: Proofread 2017-02-19 12:12:58 +01:00
James Cole
2ed095d58f Approved. Step name: Proofread 2017-02-19 12:12:56 +01:00
James Cole
9c10e3970d Approved. Step name: Proofread 2017-02-19 12:12:55 +01:00
James Cole
0cf4f44e95 Approved. Step name: Proofread 2017-02-19 12:12:54 +01:00
James Cole
89638a0094 Approved. Step name: Proofread 2017-02-19 12:12:52 +01:00
James Cole
d7531cf4ff Approved. Step name: Proofread 2017-02-19 12:12:51 +01:00
James Cole
2c5acb8ecd Approved. Step name: Proofread 2017-02-19 12:12:50 +01:00
James Cole
824c317f74 Translated 2017-02-19 12:12:49 +01:00
James Cole
d208fd1772 New translations 2017-02-19 12:12:48 +01:00
James Cole
f145aaded9 New translations 2017-02-19 12:12:46 +01:00
James Cole
c7043478f6 New translations 2017-02-19 12:12:45 +01:00
James Cole
d16bb7f394 Approved. Step name: Proofread 2017-02-19 12:12:44 +01:00
James Cole
3ed314dbc6 New translations 2017-02-19 12:12:43 +01:00
James Cole
e8c5942e33 Approved. Step name: Proofread 2017-02-19 12:12:42 +01:00
James Cole
96c704760c Approved. Step name: Proofread 2017-02-19 12:12:40 +01:00
James Cole
70c99f18e1 New translations 2017-02-19 12:12:39 +01:00
James Cole
5e2bdb6356 Translated 2017-02-19 12:12:38 +01:00
James Cole
dd13285f04 Translated 2017-02-19 12:12:37 +01:00
James Cole
561a5bf699 New translations 2017-02-19 12:12:35 +01:00
James Cole
f2d794e372 New translations 2017-02-19 12:12:34 +01:00
James Cole
f0931b8438 New translations 2017-02-19 12:12:33 +01:00
James Cole
aadb9addd5 New translations 2017-02-19 12:12:31 +01:00
James Cole
66abb50d23 Translated 2017-02-19 12:12:30 +01:00
James Cole
4eca99b745 New translations 2017-02-19 12:12:29 +01:00
James Cole
a95a265d47 Translated 2017-02-19 12:12:27 +01:00
James Cole
b0e70c25d0 New translations 2017-02-19 12:12:26 +01:00
James Cole
8914bd6b9a New translations 2017-02-19 12:12:25 +01:00
James Cole
26751e10ee Expand modifiers 2017-02-19 12:12:24 +01:00
James Cole
579ee9f199 New translations 2017-02-19 12:12:22 +01:00
James Cole
48fcb76ba4 New translations 2017-02-19 12:12:21 +01:00
James Cole
b872bbbb42 New translations 2017-02-19 12:12:19 +01:00
James Cole
73c88aa11f Translated 2017-02-19 12:12:18 +01:00
James Cole
aa1700b7b4 New translations 2017-02-19 12:12:16 +01:00
James Cole
1aa8e43bdf New translations 2017-02-19 12:12:15 +01:00
James Cole
fa8200d3e2 New translations 2017-02-19 12:12:14 +01:00
James Cole
bd9fcc6e8d New translations 2017-02-19 12:12:12 +01:00
James Cole
6167667f9a Translated 2017-02-19 12:12:11 +01:00
James Cole
1081379689 New translations 2017-02-19 12:12:10 +01:00
James Cole
712526f1c3 New translations 2017-02-19 12:12:08 +01:00
James Cole
7c0cfc5596 Translated 2017-02-19 12:12:07 +01:00
James Cole
edd0dcbcef New translations 2017-02-19 12:12:06 +01:00
James Cole
b322d67ffc New translations 2017-02-19 12:12:05 +01:00
James Cole
38dbac199d Translated 2017-02-19 12:12:02 +01:00
James Cole
6eb695c5eb New translations 2017-02-19 12:12:00 +01:00
James Cole
b0fd5889aa New translations 2017-02-19 12:11:58 +01:00
James Cole
b181f2edf0 New translations 2017-02-19 12:11:57 +01:00
James Cole
376940e089 New translations 2017-02-19 12:11:56 +01:00
James Cole
1c0762a3df New translations 2017-02-19 12:11:55 +01:00
James Cole
df39f5ab98 New translations 2017-02-19 12:11:54 +01:00
James Cole
9cd1ae1220 New translations 2017-02-19 12:11:52 +01:00
James Cole
3ddef6fe78 New translations 2017-02-19 12:11:50 +01:00
James Cole
b8c78217e8 New translations 2017-02-19 12:11:49 +01:00
James Cole
3a1b514982 New translations 2017-02-19 12:11:47 +01:00
James Cole
5d34dab2ef New translations 2017-02-19 12:11:46 +01:00
James Cole
541ed1e764 New translations 2017-02-19 12:11:45 +01:00
James Cole
5e764a345e New translations 2017-02-19 12:11:42 +01:00
James Cole
33de51c4aa New translations 2017-02-19 12:11:41 +01:00
James Cole
5aa038e195 New translations 2017-02-19 12:11:40 +01:00
James Cole
0fe437c66b New translations 2017-02-19 12:11:38 +01:00
James Cole
790d156503 Translated 2017-02-19 12:11:37 +01:00
James Cole
9f515bea20 Translated 2017-02-19 12:11:36 +01:00
James Cole
1422adac3f New translations 2017-02-19 12:11:35 +01:00
James Cole
5f17e41190 New translations 2017-02-19 12:11:33 +01:00
James Cole
0d9daaffe8 New translations 2017-02-19 12:11:32 +01:00
James Cole
e1f3bf8d45 New translations 2017-02-19 12:11:31 +01:00
James Cole
20a7723e63 New translations 2017-02-19 12:11:30 +01:00
James Cole
5ffa6d9500 New translations 2017-02-19 12:11:29 +01:00
James Cole
86956969ce New translations 2017-02-19 12:11:28 +01:00
James Cole
13beb888c1 Translated 2017-02-19 12:11:26 +01:00
James Cole
c1d4caf1a9 New translations 2017-02-19 12:11:25 +01:00
James Cole
5e9a605ae4 New translations 2017-02-19 12:11:23 +01:00
James Cole
c79d0ed276 Translated 2017-02-19 12:11:22 +01:00
James Cole
6204e575a2 New translations 2017-02-19 12:11:21 +01:00
James Cole
19f181723a New translations 2017-02-19 12:11:18 +01:00
James Cole
4a49bf8799 New translations 2017-02-19 12:11:17 +01:00
James Cole
8128c6aed6 New translations 2017-02-19 12:11:16 +01:00
James Cole
45dfc74ab3 New translations 2017-02-19 12:11:14 +01:00
James Cole
72c4ecced7 New translations 2017-02-19 12:11:13 +01:00
James Cole
d21187df6a Approved. Step name: Proofread 2017-02-19 12:11:12 +01:00
James Cole
bf33025569 Translated 2017-02-19 12:11:09 +01:00
James Cole
065620aec9 Translated 2017-02-19 12:11:08 +01:00
James Cole
e8e0fbc988 New translations 2017-02-19 12:11:07 +01:00
James Cole
21e61d08dd New translations 2017-02-19 12:11:06 +01:00
James Cole
ca9cc50423 New translations 2017-02-19 12:11:05 +01:00
James Cole
0fde74883f New translations 2017-02-19 12:11:03 +01:00
James Cole
c1d12e5129 New translations 2017-02-19 12:11:02 +01:00
James Cole
8ee6cd6c41 New translations 2017-02-19 12:10:59 +01:00
James Cole
bb09ea5fa2 New translations 2017-02-19 12:10:57 +01:00
James Cole
6b92ef9d71 New translations 2017-02-19 12:10:56 +01:00
James Cole
a49f8a27e2 Translated 2017-02-19 12:10:55 +01:00
James Cole
d0b3b4b186 Translated 2017-02-19 12:10:54 +01:00
James Cole
0bd688962b New translations 2017-02-19 12:10:52 +01:00
James Cole
c737ceb63f New translations 2017-02-19 12:10:51 +01:00
James Cole
d24e5b9eca Translated 2017-02-19 12:10:50 +01:00
James Cole
d68c2b5b8f New translations 2017-02-19 12:10:49 +01:00
James Cole
6803707b1f Translated 2017-02-19 12:10:47 +01:00
James Cole
13574d812f Translated 2017-02-19 12:10:46 +01:00
James Cole
f4e95bdbca Translated 2017-02-19 12:10:45 +01:00
James Cole
eb83023864 Translated 2017-02-19 12:10:44 +01:00
James Cole
10c81fdfba Translated 2017-02-19 12:10:42 +01:00
James Cole
7c47723992 New translations 2017-02-19 12:10:41 +01:00
James Cole
0154183800 New translations 2017-02-19 12:10:38 +01:00
James Cole
a2b0ea9c5b Translated 2017-02-19 12:10:37 +01:00
James Cole
c49caf663c Translated 2017-02-19 12:10:35 +01:00
James Cole
17e6698133 New translations 2017-02-19 12:10:34 +01:00
James Cole
a7b99b1bb5 New translations 2017-02-19 12:10:33 +01:00
James Cole
8d6a217f22 Translated 2017-02-19 12:10:30 +01:00
James Cole
d5b1722c0c Translated 2017-02-19 12:10:28 +01:00
James Cole
0d9a81f0e4 New translations 2017-02-19 12:10:27 +01:00
James Cole
821a443e44 New translations 2017-02-19 12:10:24 +01:00
James Cole
9d8d54e5c8 New translations 2017-02-19 12:10:23 +01:00
James Cole
411739277d Translated 2017-02-19 12:10:21 +01:00
James Cole
fa71feb9fb Translated 2017-02-19 12:10:20 +01:00
James Cole
00f9194bfa New translations 2017-02-19 12:10:19 +01:00
James Cole
a3e955400f Translated 2017-02-19 12:10:17 +01:00
James Cole
05060cee5b New translations 2017-02-19 12:10:16 +01:00
James Cole
c10148753a New translations 2017-02-19 12:10:14 +01:00
James Cole
53bb64641b Translated 2017-02-19 12:10:13 +01:00
James Cole
9a124bb3b2 New translations 2017-02-19 12:10:12 +01:00
James Cole
91568cf919 Translated 2017-02-19 12:10:10 +01:00
James Cole
b149a816dd Make search work. [skip ci] 2017-02-19 09:36:51 +01:00
James Cole
bf35ecc07a Fixed tests 2017-02-19 09:17:02 +01:00
James Cole
711a1a1d4f Final modifiers. 2017-02-19 09:07:14 +01:00
James Cole
a27b686446 Add budget keyword. 2017-02-19 07:41:12 +01:00
James Cole
1f6180ce5d Updated search modifiers. 2017-02-19 07:38:51 +01:00
James Cole
b5032a7597 Added a new helper function. 2017-02-19 07:34:39 +01:00
James Cole
5073fd937c Expand search with a bunch of keywords for #510 2017-02-18 20:10:03 +01:00
James Cole
f0cb63fd48 Some small optimisations. 2017-02-18 09:32:10 +01:00
James Cole
f7642beb7c Better 2fa handling 2017-02-17 20:15:17 +01:00
James Cole
48c26c5837 Update test coverage 2017-02-17 20:14:38 +01:00
James Cole
65a899bf25 Clean up session code 2017-02-17 20:14:22 +01:00
James Cole
5d0cdc4ffa Various code cleanup. 2017-02-17 06:42:36 +01:00
James Cole
1d979778e8 Merge pull request #573 from firefly-iii/l10n_develop
New Crowdin translations
2017-02-16 22:42:35 +01:00
James Cole
917b8b40cf Merge branch 'develop' into l10n_develop 2017-02-16 22:42:24 +01:00
James Cole
466ec92492 Remove some commented code. 2017-02-16 22:34:37 +01:00
James Cole
4ff5f526ba Add new lines to files. 2017-02-16 22:33:32 +01:00
James Cole
8460ee2dc4 Small fix in read me [skip ci] 2017-02-16 22:30:57 +01:00
James Cole
fa39330ceb New change log [skip ci] 2017-02-16 22:30:46 +01:00
James Cole
1857bb17d9 Approved. Step name: Proofread 2017-02-16 22:30:14 +01:00
James Cole
fe54b2fa3a Names are now links [skip ci] 2017-02-16 22:13:04 +01:00
James Cole
4fbf0291e6 Updated composer things. 2017-02-16 21:06:31 +01:00
James Cole
8bfcc3315a This fixes #572 2017-02-16 21:01:22 +01:00
James Cole
c8f6b42ce6 Fix tests 2017-02-15 22:02:02 +01:00
James Cole
8f5289b7dc Fixed some transaction list filter issues. 2017-02-15 21:55:50 +01:00
James Cole
281e3f706b New translations 2017-02-15 20:12:02 +01:00
James Cole
6dfa027ae2 New translations 2017-02-15 20:11:48 +01:00
James Cole
623cd51b1c New translations 2017-02-15 20:11:39 +01:00
James Cole
3d9e723a0e New translations 2017-02-15 20:11:33 +01:00
James Cole
4a2b7cfc4e New translations 2017-02-15 20:11:15 +01:00
James Cole
c15bee4511 New translations 2017-02-15 20:11:05 +01:00
James Cole
f4afcd29e0 New translations 2017-02-15 20:10:56 +01:00
James Cole
770e77a862 New translations 2017-02-15 20:10:41 +01:00
James Cole
684d1dc432 New translations 2017-02-15 20:10:33 +01:00
James Cole
ec9ddb2bfb New translations 2017-02-15 20:10:27 +01:00
James Cole
a5f8aa914f Build code for tag report. 2017-02-15 20:07:10 +01:00
James Cole
ae06f1b8f0 Yeah never mind. [skip ci] 2017-02-15 18:16:07 +01:00
James Cole
e8f76d896b Expand code climate config [skip ci] 2017-02-15 17:25:36 +01:00
James Cole
07ecb3f0e8 Expand code climate config [skip ci] 2017-02-15 17:23:56 +01:00
James Cole
893f2d2c55 Include code climate config [skip ci] 2017-02-15 17:17:15 +01:00
James Cole
395a7bb33c This should fix the tests 2017-02-15 17:07:56 +01:00
James Cole
636b371b86 Fixes #553 2017-02-15 16:20:16 +01:00
James Cole
f0783df123 This should fix #566 2017-02-15 15:24:01 +01:00
James Cole
fa54763425 This fixes #570 2017-02-15 15:22:04 +01:00
James Cole
cf2cd9680b This fixes #569 2017-02-15 15:18:52 +01:00
James Cole
47aa996b6b This fixes #567 2017-02-15 15:12:46 +01:00
James Cole
6442887c1a Merge pull request #562 from patrickkostjens/develop
Use Docker volumes created by docker-compose to persist data
2017-02-13 20:54:22 +01:00
James Cole
7a34536c80 Fixes #565 2017-02-13 20:39:23 +01:00
Patrick Kostjens
e9a67b1c82 Bugfix: Mount app in app container instead of db container 2017-02-12 21:38:58 +01:00
Patrick Kostjens
bc4cf1a367 Incorporate comments: Use Docker storage instead of local folder for app storage 2017-02-12 21:04:15 +01:00
Patrick Kostjens
a1d40a5748 Mount local code base in development docker-compose 2017-02-12 20:52:26 +01:00
Patrick Kostjens
e42f858166 Incorporate review comment: Remove unneeded container name setting in docker-compose 2017-02-12 20:41:29 +01:00
Patrick Kostjens
75e0d19b4e Refactored docker-compose files to use base with dev/prod overrides 2017-02-12 19:37:37 +01:00
James Cole
5801eba22a Updated composer.lock file. 2017-02-12 18:47:17 +01:00
James Cole
fd3f756640 Restored most pre-5.4 tests. 2017-02-12 18:40:39 +01:00
Patrick Kostjens
bd1672fd7b Use Docker volume for mysql data storage 2017-02-12 18:07:48 +01:00
James Cole
2c36820622 New tests 2017-02-12 17:58:16 +01:00
Patrick Kostjens
ff1d1e5b8f Revert docker-compose to development version and create separate production file 2017-02-12 17:55:56 +01:00
James Cole
de0371dd1c New translations 2017-02-12 17:51:53 +01:00
James Cole
d6f4bbf4bc New translations 2017-02-12 17:51:44 +01:00
James Cole
5fc1e6ad64 New translations 2017-02-12 17:51:37 +01:00
James Cole
c37d772759 New translations 2017-02-12 17:51:32 +01:00
James Cole
fe2efd88cf New translations 2017-02-12 17:51:21 +01:00
James Cole
5a2f48f529 Approved. Step name: Proofread 2017-02-12 17:51:16 +01:00
James Cole
4459d09a90 New translations 2017-02-12 17:51:10 +01:00
James Cole
79fcd874f7 New translations 2017-02-12 17:51:00 +01:00
James Cole
643655a612 New translations 2017-02-12 17:50:54 +01:00
James Cole
adb0717ade New translations 2017-02-12 17:50:50 +01:00
Patrick Kostjens
1feae802c2 Use local folders in containers created by docker-compose to persist data 2017-02-12 17:30:24 +01:00
James Cole
ec146d4cbe Make sure the /javascript/ url’s are ignored. 2017-02-12 16:50:35 +01:00
James Cole
3399b133ae New user controller tests. 2017-02-12 13:23:08 +01:00
James Cole
1637190c27 Fix various tests. 2017-02-12 13:15:23 +01:00
James Cole
79f94771c3 Make tests compatible with laravel 5.4 2017-02-12 12:32:13 +01:00
James Cole
018af62826 First set of new tests. 2017-02-12 12:21:44 +01:00
James Cole
69bd292ed8 Initial set of empty controller tests 2017-02-12 12:00:11 +01:00
James Cole
ac63a082aa Update attachment controller test. 2017-02-12 11:53:04 +01:00
James Cole
e15bb05823 New test for attachments. 2017-02-12 11:47:22 +01:00
James Cole
5528663727 Re-implemented basic account controller tests. 2017-02-12 11:25:17 +01:00
James Cole
1a204d31e7 Small fix for opening balance issues in reports. 2017-02-12 10:58:37 +01:00
James Cole
0fe4273d4d Merge pull request #560 from elamperti/fix-smooth-curves
Fix smooth curves around data points in graphs
2017-02-12 08:42:51 +01:00
Enrico Lamperti
abf0fdcf35 Fix smooth curves in graphs 2017-02-11 17:38:04 -03:00
James Cole
78074a5a54 Code for #553 2017-02-11 18:38:38 +01:00
James Cole
dcc2b9c1cb This fixes #559 2017-02-11 18:35:16 +01:00
James Cole
b5a005dcc5 Better 404 page [skip ci] 2017-02-11 16:32:03 +01:00
James Cole
4c2d9e0eee Small code cleanup. 2017-02-11 15:52:55 +01:00
James Cole
fb73baca6a Merge pull request #558 from crash7/improve-docker
Improve docker support
2017-02-11 10:13:51 +01:00
James Cole
0be3dd4fe4 Add EOF 2017-02-11 10:12:11 +01:00
James Cole
8e89899070 Add EOF 2017-02-11 10:11:57 +01:00
James Cole
5e47492318 Clean up budget report partial 2017-02-11 10:05:58 +01:00
James Cole
aa2d78f36a Expand filter 2017-02-11 09:34:04 +01:00
Christian Musa
0cbed2d5d2 Improve docker support
- Add docker-compose file
- Add environment variable to initialize the database
- Add custom entrypoint that generates the .env file based on the environment variables
- Update Dockerfile (gettext-base package)
2017-02-11 00:36:38 -03:00
James Cole
3914796e4e Experimental new transfer filter. 2017-02-10 17:21:44 +01:00
James Cole
b9dac5ff55 Merge branch 'develop' of https://github.com/firefly-iii/firefly-iii into develop
* 'develop' of https://github.com/firefly-iii/firefly-iii:
  Update config.php, see #521
2017-02-08 22:24:20 +01:00
James Cole
1285a88660 Different value for title field [skip ci] 2017-02-08 22:07:47 +01:00
James Cole
96e0d4e29f Translated 2017-02-06 13:20:57 +01:00
James Cole
9bb8a9ccd1 New translations 2017-02-06 13:20:54 +01:00
James Cole
d9611bd84f New translations 2017-02-06 13:20:51 +01:00
James Cole
915afa4534 Translated 2017-02-06 13:20:47 +01:00
James Cole
5105c94233 New translations 2017-02-06 13:12:31 +01:00
James Cole
899d4fe611 New translations 2017-02-06 13:12:04 +01:00
James Cole
d45a12e544 New translations 2017-02-06 13:11:44 +01:00
James Cole
302fc876d9 Translated 2017-02-06 13:11:28 +01:00
James Cole
f6a25db17c New translations 2017-02-06 13:11:26 +01:00
James Cole
da11303539 New translations 2017-02-06 13:11:25 +01:00
James Cole
07ebe71839 New translations 2017-02-06 13:11:23 +01:00
James Cole
eba9c4e039 New translations 2017-02-06 13:11:12 +01:00
James Cole
7d80120611 Approved. Step name: Proofread 2017-02-06 08:32:09 +01:00
James Cole
f2ea5fb253 New translations 2017-02-06 08:31:57 +01:00
James Cole
451ab6c531 New translations 2017-02-06 08:31:48 +01:00
James Cole
796b63fcc5 New translations 2017-02-06 08:31:42 +01:00
James Cole
7d8b3e6513 New translations 2017-02-06 08:31:40 +01:00
James Cole
b2026106ec Update config.php, see #521 2017-02-06 08:29:18 +01:00
James Cole
dba92d73c4 Include new line at the end of the file. 2017-02-05 19:51:58 +01:00
James Cole
b09a250a03 Better link for issues. [skip ci] 2017-02-05 18:50:19 +01:00
James Cole
c6f69f63fc Friendly error message. [skip ci] 2017-02-05 18:49:13 +01:00
James Cole
3a7faa7368 Small fixes for laravel 5.4 2017-02-05 18:44:37 +01:00
James Cole
f863c01a1d Merge laravel 5.4 into develop. 2017-02-05 16:20:02 +01:00
James Cole
8a98204a69 Update app() calls 2017-02-05 16:16:15 +01:00
James Cole
77e52f42a6 Update export routine. 2017-02-05 16:14:23 +01:00
James Cole
704c0922e8 Update collector classes 2017-02-05 15:58:55 +01:00
James Cole
371ce37be4 Update export classes 2017-02-05 15:58:42 +01:00
James Cole
152fb3f885 Update the last providers. 2017-02-05 15:58:27 +01:00
James Cole
3ff83cd431 Remove speed trap. 2017-02-05 15:43:56 +01:00
James Cole
a9d5b6ef92 Update to laravel 5.4 style tests 2017-02-05 15:42:00 +01:00
James Cole
229f718754 Update Composer files. 2017-02-05 15:41:41 +01:00
James Cole
646b65918d Remove tests since they’ve been changed in Laravel 5.4. 2017-02-05 15:41:23 +01:00
James Cole
5e596a9cb7 Remove speedtrap from oh-unit file. 2017-02-05 08:47:37 +01:00
James Cole
353db6c4a5 Updated composer.lock file. 2017-02-05 08:35:17 +01:00
James Cole
959a1a08f0 Tell view whether we’re in Sandstorm.IO mode. 2017-02-05 08:27:23 +01:00
James Cole
3e510bd3f6 This fixes #549 2017-02-05 08:26:54 +01:00
James Cole
b68d5c4374 Include CSRF token for Sandstorm. 2017-02-04 09:02:07 +01:00
James Cole
dc348a72c8 Various new scripts to improve sandstorm.io experience. 2017-02-04 08:42:06 +01:00
James Cole
5e5d4eca4b Update some sandstorm.io files. 2017-02-04 03:22:19 +01:00
James Cole
96b5d174d1 Initial code base for Sandstorm.IO support. Very beta. 2017-02-04 03:04:55 +01:00
James Cole
df1da32745 Update composer [skip ci] 2017-02-04 02:26:16 +01:00
James Cole
a7c198048e Add app log method. [skip ci] 2017-02-04 02:20:17 +01:00
James Cole
e3599c002b Updated contribution instructions [skip ci] 2017-02-04 02:19:47 +01:00
James Cole
094f6a7476 Merge branch 'release/4.3.4' 2017-02-02 20:55:46 +01:00
James Cole
c3b4849fa0 Various updates for upcoming release 4.3.4 2017-02-02 20:55:01 +01:00
James Cole
dfd6c5379c Merge pull request #546 from firefly-iii/l10n_develop
New Crowdin translations
2017-02-02 20:41:47 +01:00
James Cole
9aa53c11e0 This fixes #550 2017-02-02 20:37:39 +01:00
James Cole
b0d93621a8 This fixes #551 2017-02-02 20:36:32 +01:00
James Cole
a337d9a599 New route for JS file, may fix #550 2017-02-02 07:36:57 +01:00
James Cole
615d90c8f4 Update various service providers. 2017-02-02 07:35:53 +01:00
James Cole
7ffd77dc76 Translated 2017-01-31 01:17:32 +01:00
James Cole
96fdf4fd93 Translated 2017-01-31 01:17:29 +01:00
James Cole
27b8ce0f7f Translated 2017-01-31 01:17:27 +01:00
James Cole
e057c4d79c Removed reference to crud service provider. 2017-01-30 17:29:18 +01:00
James Cole
8263fa41dd Rewrote currency and export/import job service provider 2017-01-30 17:29:05 +01:00
James Cole
eeae4d215d Removed old service provider. 2017-01-30 17:20:00 +01:00
James Cole
646ed0d4dd Rewrote attachment, budget and category service providers. 2017-01-30 17:19:51 +01:00
James Cole
ac54032f55 Need to call everything from collector to work. 2017-01-30 17:10:23 +01:00
James Cole
3aaf356054 Rewrote bill service provider 2017-01-30 17:10:08 +01:00
James Cole
2c786e6a38 Small fixes to collector because constructor is gone. 2017-01-30 17:09:44 +01:00
James Cole
355baa7fef Rewrote account service provider. 2017-01-30 16:59:55 +01:00
James Cole
01468c2663 Rewrote journal service provider 2017-01-30 16:58:10 +01:00
James Cole
c7341c9194 Also extend collector. 2017-01-30 16:57:00 +01:00
James Cole
1e947870a6 Remove all constructors. 2017-01-30 16:46:30 +01:00
James Cole
311c1a3c84 Implement all setUser methods. 2017-01-30 16:42:58 +01:00
James Cole
84e380e4d0 Give all repositories a new setUser function. 2017-01-30 16:40:49 +01:00
James Cole
4cad2eb0c4 Upgraded validator 2017-01-30 16:35:41 +01:00
James Cole
4bc3af7176 Updated composer.lock file for change to bread crumbs. 2017-01-30 16:35:31 +01:00
James Cole
e80298f815 Include laravel bread crumbs and custom repository. 2017-01-30 16:31:41 +01:00
James Cole
14971cf249 Overrule logging. 2017-01-30 16:30:35 +01:00
James Cole
b79dcd7f23 Disable ConfigureLogging class. 2017-01-30 16:27:33 +01:00
James Cole
395aaad9c6 New class name. 2017-01-30 16:21:01 +01:00
James Cole
29f763d4e4 Update composer files. 2017-01-30 16:20:23 +01:00
James Cole
2f943c91d2 New contributing guidelines [skip ci] 2017-01-30 14:13:52 +01:00
James Cole
91c96311de Expand contributing guidelines. [skip ci] 2017-01-30 11:41:39 +01:00
James Cole
0f929faa16 Merge branch 'release/4.3.3' 2017-01-30 11:18:29 +01:00
James Cole
7a40c34cf0 New change log. 2017-01-30 11:18:02 +01:00
James Cole
462d987de9 Merge pull request #532 from firefly-iii/l10n_develop
New Crowdin translations
2017-01-30 11:11:36 +01:00
James Cole
f64e8d8973 Composer update. [skip ci] 2017-01-30 11:10:34 +01:00
James Cole
21222eb697 Mention new version. 2017-01-30 10:33:44 +01:00
James Cole
e47d6fb3ac Move default option to bottom. 2017-01-30 10:33:18 +01:00
James Cole
c7fc10ac89 Remove debug statements. 2017-01-30 08:32:16 +01:00
James Cole
e8b528f520 New translations 2017-01-29 22:05:43 +01:00
James Cole
b22de7bf70 New translations 2017-01-29 22:05:38 +01:00
James Cole
ec119c8f6e Translated 2017-01-29 21:55:32 +01:00
James Cole
a20b38598e New translations 2017-01-29 21:45:32 +01:00
James Cole
aa0eb47205 New translations 2017-01-29 21:35:31 +01:00
James Cole
723db9d71e New translations 2017-01-29 13:36:21 +01:00
James Cole
1d8dc3d65d Approved. Step name: Proofread 2017-01-24 16:17:57 +01:00
James Cole
fe2716876a New translations 2017-01-24 15:44:55 +01:00
James Cole
fac0e97e5d New translations 2017-01-24 15:44:27 +01:00
James Cole
449d009c28 New translations 2017-01-24 15:43:49 +01:00
James Cole
55b2e6fe25 New translations 2017-01-24 15:43:36 +01:00
James Cole
9989b3b9da New translations 2017-01-24 15:43:27 +01:00
James Cole
7ab1cbfc1f New translations 2017-01-24 15:43:13 +01:00
James Cole
62d19c3902 New translations 2017-01-24 15:42:34 +01:00
James Cole
19700e7ee3 New translations 2017-01-24 15:42:08 +01:00
James Cole
de3e8edd6d New translations 2017-01-24 15:41:44 +01:00
James Cole
deda48af4a New translations 2017-01-24 15:41:32 +01:00
James Cole
7688d7c619 Include trigger that responds to tags 2017-01-24 15:38:41 +01:00
James Cole
76328b5c45 New translations 2017-01-24 15:11:51 +01:00
James Cole
1de17bf06f New translations 2017-01-24 15:11:31 +01:00
James Cole
6724daf995 New translations 2017-01-24 15:11:11 +01:00
James Cole
7caca053a1 New translations 2017-01-24 15:10:54 +01:00
James Cole
ae1bf8c017 New translations 2017-01-24 15:10:33 +01:00
James Cole
d20b0da438 Approved. Step name: Proofread 2017-01-24 15:10:11 +01:00
James Cole
a0218d7df1 New translations 2017-01-24 15:09:55 +01:00
James Cole
5ae5d67b91 New translations 2017-01-24 15:09:39 +01:00
James Cole
8493ed7603 New translations 2017-01-24 15:09:28 +01:00
James Cole
804b681d40 New translations 2017-01-24 15:09:18 +01:00
James Cole
e8303bd059 Expand the multi-select to various other fields. 2017-01-24 15:07:01 +01:00
James Cole
ac6c5d4e32 New translations 2017-01-24 13:57:08 +01:00
James Cole
90b0d0d52c New translations 2017-01-24 13:37:12 +01:00
James Cole
4093bdbd3e New translations 2017-01-24 13:37:08 +01:00
James Cole
a2097cf981 New translations 2017-01-24 13:27:14 +01:00
James Cole
6a33d0c9dc New translations 2017-01-24 13:27:07 +01:00
James Cole
525d5fb427 New translations 2017-01-24 13:17:40 +01:00
James Cole
e4946b8cd5 New translations 2017-01-24 13:17:35 +01:00
James Cole
76b32df622 Remove nightly. 2017-01-24 12:33:16 +01:00
James Cole
bc1079364d This should fix the nightly. No more hhvm. 2017-01-24 12:24:02 +01:00
James Cole
8602febe9d If/then thing for HHVM 2017-01-24 12:15:52 +01:00
James Cole
d55dfe27dc Updated test script 2017-01-24 12:08:06 +01:00
James Cole
90c16e2a07 Update travis.yml. 2017-01-24 11:49:05 +01:00
James Cole
149c1cd9b1 Approved. Step name: Proofread 2017-01-24 08:17:31 +01:00
James Cole
20f1a43369 Approved. Step name: Proofread 2017-01-24 08:17:20 +01:00
James Cole
e8fb8f993d Approved. Step name: Proofread 2017-01-24 08:07:14 +01:00
James Cole
f0c782dc01 New translations 2017-01-24 08:03:02 +01:00
James Cole
50c13e6d20 New translations 2017-01-24 08:02:44 +01:00
James Cole
69bedd035f New translations 2017-01-24 08:02:30 +01:00
James Cole
85337f0a31 New translations 2017-01-24 08:02:22 +01:00
James Cole
f8a7e2f98e New translations 2017-01-24 08:02:15 +01:00
James Cole
ec90a49d43 New translations 2017-01-24 08:02:07 +01:00
James Cole
5812b150c6 New translations 2017-01-24 08:01:45 +01:00
James Cole
c7ebc7273f Translated 2017-01-24 08:01:36 +01:00
James Cole
5226c87304 Translated 2017-01-24 08:01:35 +01:00
James Cole
25dd1c5d35 New translations 2017-01-24 08:01:31 +01:00
James Cole
c5a9e5e56d New translations 2017-01-24 08:01:26 +01:00
James Cole
47ed70d671 New translations 2017-01-24 08:01:20 +01:00
James Cole
cb5526f469 New translations 2017-01-24 08:01:14 +01:00
James Cole
a4f128077f New translations 2017-01-24 08:01:10 +01:00
James Cole
7140ba76d5 Small language things [skip ci] 2017-01-24 07:53:46 +01:00
James Cole
872e8f2de6 Hip new multi select. 2017-01-24 07:37:29 +01:00
James Cole
6c14e9d083 No sleep for the wicked [skip ci] 2017-01-24 07:26:06 +01:00
James Cole
e4b1812b46 Fix small layout thing [skip ci] 2017-01-23 18:03:17 +01:00
James Cole
1c2c6bb1d0 Various small changes. 2017-01-22 11:23:56 +01:00
James Cole
baefd4f93b Two new rule triggers 2017-01-22 11:23:40 +01:00
James Cole
4270fe07ab Rules now have auto-complete. 2017-01-22 09:15:53 +01:00
James Cole
e4ae925d2b Include typeahead [skip ci] 2017-01-21 13:34:41 +01:00
James Cole
dc599361a4 Removed unused method. 2017-01-21 09:15:33 +01:00
James Cole
738a311f49 Various code cleanup. 2017-01-21 09:07:10 +01:00
James Cole
71f6ba3418 Make request code more uniform. 2017-01-21 08:32:23 +01:00
James Cole
d1d573c408 Fix some tests. 2017-01-20 19:50:32 +01:00
James Cole
50e39a4a75 Update rule controller to have some auto complete functionality. 2017-01-20 19:50:22 +01:00
James Cole
8635fe7ebb Update requests to use uniform methods. 2017-01-20 19:49:35 +01:00
James Cole
6b57d4397a Try with “true” instead of “1”. 2017-01-20 16:27:30 +01:00
James Cole
8f2b898b2b Update some tests. 2017-01-20 16:22:19 +01:00
James Cole
0d1d360d18 Can now clone transaction #538. Wasn’t that difficult. 2017-01-20 12:23:52 +01:00
James Cole
def3b3a155 Fix for #539 2017-01-20 12:23:09 +01:00
James Cole
d344512743 Update update and installation instructions. 2017-01-20 10:08:38 +01:00
James Cole
19eef71133 Make sure all date fields have a fallback. 2017-01-20 08:18:52 +01:00
James Cole
61d58a354e Various code cleanup. 2017-01-20 08:03:26 +01:00
James Cole
be868d37f2 Fixed some issues with the monthly report and missing amounts. 2017-01-19 21:54:27 +01:00
James Cole
20bb151cf3 Add updated_at value. 2017-01-18 07:28:49 +01:00
James Cole
77f889aba6 Include a batch of naughty strings to see what happens to Firefly. 2017-01-16 20:10:47 +01:00
James Cole
1e69a54972 Small JS issue. [skip ci] 2017-01-15 20:18:32 +01:00
James Cole
6b7a47ca28 Clean up JS. 2017-01-15 20:10:34 +01:00
James Cole
c3fdd3b5f7 Allow date picker for browsers that do not support it natively. See issue #535 2017-01-15 20:05:40 +01:00
James Cole
e9f2121667 Fix menu in Firefox. 2017-01-15 19:45:57 +01:00
James Cole
161e9e1e11 Final JS cleanup. 2017-01-15 19:28:54 +01:00
James Cole
e336a45f79 Edit JS file for split transaction 2017-01-15 19:16:46 +01:00
James Cole
9c09f93908 Update views and JS for delete (single) transaction. 2017-01-15 19:08:16 +01:00
James Cole
582398e7f6 Update views and JS for create (single) transaction. 2017-01-15 19:07:31 +01:00
James Cole
b118635abd Update views and JS for edit single transaction. 2017-01-15 19:00:06 +01:00
James Cole
ac0d4a75b5 Removed forgotten twig comment [skip ci] 2017-01-15 15:46:58 +01:00
James Cole
c212d5c5ea Order by date does not matter in this context. 2017-01-14 21:00:43 +01:00
James Cole
08ac27cccf Fix some scrutiniser issues. 2017-01-14 19:43:33 +01:00
James Cole
0b5cab99cf Fix some scrutiniser issues. 2017-01-14 18:52:52 +01:00
James Cole
cc0057cc56 Rename command [skip ci] 2017-01-14 17:24:30 +01:00
James Cole
1ce49b814b Fix rounding. [skip ci] 2017-01-14 17:23:47 +01:00
James Cole
5bbaaece38 Encryption is optional (but on by default) and a command to switch from one to the other 2017-01-14 17:13:57 +01:00
James Cole
30bc4ccfa7 More date fixes [skip ci] 2017-01-13 21:16:54 +01:00
James Cole
4f64f1d754 Force order by. [skip ci] 2017-01-13 21:14:46 +01:00
James Cole
c0e578dd47 Fix bug found by persistent user who kept mailing me about broken charts. Which turned out to be broken indeed! 2017-01-13 21:12:59 +01:00
James Cole
2b82fca2cf Small various bugs. 2017-01-13 20:48:51 +01:00
James Cole
f0028b33e9 Double check that deleted transaction journals are not included. 2017-01-13 16:12:09 +01:00
James Cole
7ddea23375 Merge branch 'master' into develop
* master:
  add firefly locales to Dockerfile fixes #521 for docker environment
  Code for 4.1.6
2017-01-12 20:58:06 +01:00
James Cole
83edccacc6 Delete CONTRIBUTING 2017-01-12 09:40:12 +01:00
James Cole
75e95d6452 With markdown 2017-01-12 09:39:53 +01:00
James Cole
423bb4bbcd Better layout 2017-01-12 09:37:12 +01:00
James Cole
43585c563c Merge pull request #534 from elohmeier/master
add firefly locales to Dockerfile
2017-01-12 08:48:58 +01:00
Enno Lohmeier
2564a41d05 add firefly locales to Dockerfile
fixes #521 for docker environment
2017-01-12 00:30:33 +01:00
James Cole
a0bb1e3625 CSS fix for #533 2017-01-10 19:55:52 +01:00
James Cole
9b4fd57f51 Optimize new JS code. 2017-01-10 18:35:00 +01:00
James Cole
e67709e339 Make index significantly simpler. 2017-01-10 18:25:03 +01:00
James Cole
0c4e913f30 New translations 2017-01-10 13:06:37 +01:00
James Cole
c6de0e51c7 New translations 2017-01-10 13:06:29 +01:00
James Cole
69e85adadf New translations 2017-01-10 12:54:39 +01:00
James Cole
b34068207f New translations 2017-01-10 12:54:32 +01:00
James Cole
68b7b4b3a4 New translations 2017-01-10 12:45:24 +01:00
James Cole
5e3ee30e66 New translations 2017-01-10 12:45:15 +01:00
James Cole
aaf7d12b46 New translations 2017-01-10 12:45:12 +01:00
James Cole
729a348657 New translations 2017-01-10 12:36:17 +01:00
James Cole
0fca6eb810 Merge branch 'release/4.3.2' 2017-01-09 18:20:32 +01:00
James Cole
5a0ae8530c Update version info [skip ci] 2017-01-09 18:19:47 +01:00
James Cole
7949c9ad74 Updated composer.lock file 2017-01-09 18:19:18 +01:00
James Cole
6fb9362f7e Updated changelog [skip ci] 2017-01-09 18:17:03 +01:00
James Cole
3481d364cc Merge pull request #520 from firefly-iii/l10n_develop
New Crowdin translations
2017-01-09 18:05:25 +01:00
James Cole
373b9cdd9f A better tag overview as preparation for #525 2017-01-09 17:57:29 +01:00
James Cole
75af63e6ac New translations 2017-01-09 17:04:01 +01:00
James Cole
5aa62a1be4 New translations 2017-01-09 16:52:44 +01:00
James Cole
aede8bf0e0 New translations 2017-01-09 16:42:59 +01:00
James Cole
9ab7abcb95 New translations 2017-01-08 18:38:55 +01:00
James Cole
f87b28afd9 Translated 2017-01-08 18:38:45 +01:00
James Cole
8661f6d1ac New translations 2017-01-08 18:33:12 +01:00
James Cole
4536b4b2b4 New translations 2017-01-08 18:33:08 +01:00
James Cole
655f03940b Approved. Step name: Proofread 2017-01-08 18:33:02 +01:00
James Cole
4122de7823 New translations 2017-01-08 18:32:53 +01:00
James Cole
0f4c67d24e New translations 2017-01-08 18:32:50 +01:00
James Cole
20e8c45819 New translations 2017-01-08 18:32:45 +01:00
James Cole
2b8b844fb2 New translations 2017-01-08 18:32:32 +01:00
James Cole
3284b8764f New translations 2017-01-08 18:32:21 +01:00
James Cole
d19946336e New translations 2017-01-08 18:32:14 +01:00
James Cole
770a220808 New translations 2017-01-08 18:31:52 +01:00
James Cole
78b71e72f1 Fix amount remove from piggy bug. 2017-01-08 18:23:07 +01:00
James Cole
19990f49b0 Update amount thing, simpler code (I hope). Includes config for negative values. 2017-01-08 17:54:52 +01:00
James Cole
8208d44466 This should fix locale information for specific languages. It’s not perfect yet though. 2017-01-08 16:55:02 +01:00
James Cole
002b2b6dee New translations 2017-01-08 13:51:40 +01:00
James Cole
c207167b14 New translations 2017-01-08 13:41:43 +01:00
James Cole
cfc066e911 New translations 2017-01-08 13:41:41 +01:00
James Cole
3a1d011841 New translations 2017-01-08 13:41:40 +01:00
James Cole
7d05c0da9c New translations 2017-01-08 13:41:39 +01:00
James Cole
1d7f2ca9e4 New translations 2017-01-08 13:31:46 +01:00
James Cole
ea2e0d7546 New translations 2017-01-08 13:31:42 +01:00
James Cole
64b79ee64c New translations 2017-01-08 13:31:38 +01:00
James Cole
8a00101470 Fix tests, remove some logging. 2017-01-08 11:41:09 +01:00
James Cole
01aba73f5b Forgot “show all” link [skip ci] 2017-01-08 10:20:59 +01:00
James Cole
71e31346e8 Better views for #475 2017-01-08 10:19:10 +01:00
James Cole
483cce9880 New translations 2017-01-07 16:02:10 +01:00
James Cole
c8db39a91e New translations 2017-01-07 15:51:56 +01:00
James Cole
6d398a2edf Added shiny new loading styles. [skip ci] 2017-01-07 08:08:37 +01:00
James Cole
bd3c8119ba Update composer.json because Twig and Twigbridge aren’t playing nice. 2017-01-06 14:51:04 +01:00
James Cole
16aa78d13c These changes fix #528 2017-01-06 14:50:32 +01:00
James Cole
3be5cca60a Use Crypt in attachment repository [skip ci] 2017-01-06 13:54:55 +01:00
James Cole
bc3dfb96fd New translations 2017-01-06 13:42:32 +01:00
James Cole
e78e98a6cf New translations 2017-01-06 13:42:26 +01:00
James Cole
9db0e48f63 Fixes #526 2017-01-05 21:32:54 +01:00
James Cole
3de52b6bc1 Some new files for layout [skip ci] 2017-01-05 21:05:34 +01:00
James Cole
be52abbe3b Add no-print tag to options box. [skip ci] 2017-01-05 21:02:24 +01:00
James Cole
ac55b0fafb This should fix the print thing. [skip ci] 2017-01-05 21:01:16 +01:00
James Cole
887b6789fc Translated 2017-01-05 11:02:31 +01:00
James Cole
ff50fec112 New translations 2017-01-05 10:42:40 +01:00
James Cole
4538ef3cf9 Various small optimisations [skip ci] 2017-01-05 10:06:46 +01:00
James Cole
a872cf7061 Renamed the other method. 2017-01-05 09:10:04 +01:00
James Cole
2d8ca363db Gave method old name back. 2017-01-05 09:08:35 +01:00
James Cole
8e8b011587 Removed unused budget methods. 2017-01-05 09:07:56 +01:00
James Cole
4241ae035e Add two new “spentInPeriod” methods that use the collector and not big queries. 2017-01-05 09:07:04 +01:00
James Cole
3ef569d280 Respond to empty account collection #524 2017-01-05 09:04:12 +01:00
James Cole
6fe28b15df Add some phpdoc [skip ci] 2017-01-05 08:56:14 +01:00
James Cole
a609a47138 Fix tests. 2017-01-05 08:52:45 +01:00
James Cole
b575b87f77 Refactor method to original name #524 2017-01-05 08:48:16 +01:00
James Cole
7c5ee8a67d Refactor method to original name #524 2017-01-05 08:47:45 +01:00
James Cole
452c14bece Refactor method to original name #524 2017-01-05 08:47:09 +01:00
James Cole
57f63ba752 Clean up class #524 2017-01-05 08:45:10 +01:00
James Cole
5f153b8a01 Fix a test 2017-01-05 08:45:01 +01:00
James Cole
1be49876df Remove complicated no longer used methods #524 2017-01-05 08:41:37 +01:00
James Cole
a79b2a7773 Remove old method and another unused method #524 2017-01-05 08:41:11 +01:00
James Cole
cdf6e5a487 Remove old method #524 2017-01-05 08:40:26 +01:00
James Cole
7c82f45604 Refactor code to use new “earned in period” method. #524 2017-01-05 08:40:05 +01:00
James Cole
4d49701203 Add new “earned in period” method. #524 2017-01-05 08:39:46 +01:00
James Cole
d48cc69898 Removed old versions of methods #524 2017-01-05 08:34:22 +01:00
James Cole
af466a1d75 Refactor code to verify these methods work #524 2017-01-05 08:33:22 +01:00
James Cole
b9599d3aa1 Add two methods that have a different way of collecting information #524 2017-01-05 08:33:04 +01:00
James Cole
dbebfe7c07 Remove unused method. 2017-01-05 08:32:31 +01:00
James Cole
ddf54fdb83 New translations 2017-01-04 17:33:38 +01:00
James Cole
619138d294 New translations 2017-01-04 17:33:30 +01:00
James Cole
126b19bf2d New translations 2017-01-04 17:32:55 +01:00
James Cole
cc76adf7b6 New translations 2017-01-04 17:32:51 +01:00
James Cole
83bcb56a6a New translations 2017-01-04 17:32:46 +01:00
James Cole
6e88a70661 New translations 2017-01-04 17:32:37 +01:00
James Cole
6755a9878b New translations 2017-01-04 17:32:23 +01:00
James Cole
b8ef7593ee Approved. Step name: Proofread 2017-01-04 17:32:09 +01:00
James Cole
602cc26f0f Translated 2017-01-04 17:32:05 +01:00
James Cole
62271fe064 New translations 2017-01-04 17:32:00 +01:00
James Cole
83f5f776a6 Code for #522 2017-01-04 17:25:28 +01:00
James Cole
2a5566a820 New translations 2017-01-04 17:02:21 +01:00
James Cole
398e547d06 New translations 2017-01-04 14:52:14 +01:00
James Cole
ba957196da Make sure correct locale is used. Debug info. #521 [skip ci] 2017-01-04 13:14:06 +01:00
James Cole
b5c4a24133 Translated 2017-01-04 10:51:54 +01:00
James Cole
cc688dc112 New translations 2017-01-04 10:51:52 +01:00
James Cole
91b5eaff80 New translations 2017-01-04 10:51:50 +01:00
James Cole
4a52503cb3 New translations 2017-01-04 10:42:07 +01:00
James Cole
bcd7e7ea94 New translations 2017-01-04 10:31:48 +01:00
James Cole
ba9ae54fbb New translations 2017-01-04 10:31:46 +01:00
James Cole
39e05c9991 New translations 2017-01-04 10:31:42 +01:00
James Cole
8962f90bcc New translations 2017-01-04 10:22:15 +01:00
James Cole
daf3a95db0 Updated laravel, removed GitHub move announcement. 2017-01-04 09:28:49 +01:00
James Cole
1c9ebafe2b Fix password reset routine. 2017-01-04 09:15:41 +01:00
James Cole
00b3df4455 Approved. Step name: Proofread 2017-01-04 05:13:14 +01:00
James Cole
600c3e75bb Merge branch 'release/4.3.1' 2017-01-04 05:06:13 +01:00
James Cole
6349fccd0f Merge pull request #518 from firefly-iii/l10n_develop
New Crowdin translations
2017-01-04 05:05:26 +01:00
James Cole
6ececdad26 New translations 2017-01-04 05:04:11 +01:00
James Cole
c67f1a7b93 New translations 2017-01-04 05:04:05 +01:00
James Cole
8617ea760a Approved. Step name: Proofread 2017-01-04 05:03:56 +01:00
James Cole
41a2406f07 New translations 2017-01-04 05:03:46 +01:00
James Cole
adae8e45a9 New translations 2017-01-04 05:03:42 +01:00
James Cole
e346ae533d New translations 2017-01-04 05:03:35 +01:00
James Cole
31789255c9 New translations 2017-01-04 05:03:19 +01:00
James Cole
dbe6edd133 New translations 2017-01-04 05:03:09 +01:00
James Cole
7cfbcec56e New translations 2017-01-04 05:02:52 +01:00
James Cole
9f9a055f64 New translations 2017-01-04 05:02:28 +01:00
James Cole
d3614d3505 New strings for translation [skip ci] 2017-01-04 04:57:04 +01:00
James Cole
800f67908e New change log. 2017-01-04 04:49:07 +01:00
James Cole
e2c613c422 New config. 2017-01-04 04:48:58 +01:00
James Cole
457037ed99 Should not be a final class, dummy. 2017-01-03 20:05:20 +01:00
James Cole
f9f21efd36 Update config to fix #519 2017-01-03 20:02:48 +01:00
James Cole
2d59b6718d Various code style fixes. 2017-01-03 17:46:08 +01:00
James Cole
0c6d213296 Update scrutiniser configuration. 2017-01-03 17:26:31 +01:00
James Cole
c34fb7f037 Cleaned up the category and budget pie charts. 2017-01-03 17:02:17 +01:00
James Cole
796be319b7 Piggy banks for #511 [skip ci] 2017-01-03 08:27:48 +01:00
James Cole
d28fcdc6a5 Translated 2017-01-02 23:12:00 +01:00
James Cole
d0afcb6cfa New translations 2017-01-02 23:11:57 +01:00
James Cole
7bd4de937a New translations 2017-01-02 23:11:54 +01:00
James Cole
3025693178 New translations 2017-01-02 23:01:50 +01:00
James Cole
c9cc3bf3ff New translations 2017-01-02 22:51:33 +01:00
James Cole
1f670f7a05 New translations 2017-01-02 22:51:31 +01:00
James Cole
48d735b53b New translations 2017-01-02 22:41:29 +01:00
James Cole
b91f6c7ce6 More alignment for #511 2017-01-02 21:04:17 +01:00
James Cole
ad116d1959 Various code cleanup [skip ci] 2017-01-02 20:42:29 +01:00
James Cole
a0de10870d New translations 2017-01-02 20:12:12 +01:00
James Cole
eb0c00896f New translations 2017-01-02 20:01:56 +01:00
James Cole
deccd4e9fe New translations 2017-01-02 19:51:50 +01:00
James Cole
8be4ec08ad New translations 2017-01-02 19:41:48 +01:00
James Cole
59ad0624f2 New translations 2017-01-02 19:32:00 +01:00
James Cole
f0c69ca84f New translations 2017-01-02 19:31:58 +01:00
James Cole
3ba1c07f68 New translations 2017-01-02 19:31:56 +01:00
James Cole
14cd4aaac8 New translations 2017-01-02 19:31:54 +01:00
James Cole
8a1fae5d9d New translations 2017-01-02 19:31:51 +01:00
James Cole
e323f5a2d5 This should fix most amounts for #511 2017-01-02 19:27:27 +01:00
James Cole
c5c1cbd66f New translations 2017-01-02 19:21:45 +01:00
James Cole
4cc9dbbe6a New translations 2017-01-02 19:21:42 +01:00
James Cole
3649991ad6 New translations 2017-01-02 19:11:55 +01:00
James Cole
1d25691aa2 New translations 2017-01-02 19:02:01 +01:00
James Cole
235076b465 New translations 2017-01-02 19:02:00 +01:00
James Cole
c2670fa379 New translations 2017-01-02 19:01:58 +01:00
James Cole
a769a5391d New translations 2017-01-02 19:01:55 +01:00
James Cole
1f58c46f67 New translations 2017-01-02 18:51:46 +01:00
James Cole
f4c9f2d0e7 New translations 2017-01-02 18:51:43 +01:00
James Cole
851b9136fe New translations 2017-01-02 18:51:41 +01:00
James Cole
0fe10e470d New translations 2017-01-02 18:41:49 +01:00
James Cole
8c8ea17fac New translations 2017-01-02 18:41:46 +01:00
James Cole
7c546b8d3a New translations 2017-01-02 18:32:01 +01:00
James Cole
63334a61ad New translations 2017-01-02 18:31:59 +01:00
James Cole
f61e65cf54 New translations 2017-01-02 18:31:56 +01:00
James Cole
05bf752629 Translated 2017-01-02 18:21:54 +01:00
James Cole
5096a90e34 New translations 2017-01-02 18:21:52 +01:00
James Cole
03792b3905 New translations 2017-01-02 18:12:05 +01:00
James Cole
995b049a5f New translations 2017-01-02 18:12:03 +01:00
James Cole
bde37ec2c7 New translations 2017-01-02 18:12:00 +01:00
James Cole
d6b3fe7e1b New translations 2017-01-02 18:02:21 +01:00
James Cole
954b394987 New translations 2017-01-02 15:32:39 +01:00
James Cole
97dae6dde5 New translations 2017-01-02 15:32:37 +01:00
James Cole
fe039500d6 New translations 2017-01-02 15:32:36 +01:00
James Cole
6952957794 New translations 2017-01-02 15:32:34 +01:00
James Cole
01cc97ad55 New translations 2017-01-02 15:32:32 +01:00
James Cole
b5c8e005e2 New translations 2017-01-02 15:32:28 +01:00
James Cole
1c2602438f New translations 2017-01-02 15:32:19 +01:00
James Cole
33da756a2f New translations 2017-01-02 15:32:18 +01:00
James Cole
488d4a38b8 New translations 2017-01-02 15:32:04 +01:00
James Cole
e60f60b0f8 New translations 2017-01-02 15:32:03 +01:00
James Cole
8aa2e3d2f5 Various code cleanup. 2017-01-02 15:22:30 +01:00
James Cole
d5f65e5d07 New translations 2017-01-02 15:22:00 +01:00
James Cole
c8511a6e2a New translations 2017-01-02 15:12:14 +01:00
James Cole
379b15be1d New translations 2017-01-02 14:51:54 +01:00
James Cole
2ee1fea293 New translations 2017-01-02 14:41:48 +01:00
James Cole
4385d71c6f New translations 2017-01-02 14:31:56 +01:00
James Cole
cf6ea64aba New translations 2017-01-02 14:22:06 +01:00
James Cole
101317cb16 New translations 2017-01-02 14:22:04 +01:00
James Cole
5990a21c46 Translated 2017-01-02 14:22:02 +01:00
James Cole
a9bc007327 New translations 2017-01-02 14:22:00 +01:00
James Cole
0c71770b1d New translations 2017-01-02 12:41:57 +01:00
James Cole
5bae7e9bdb New translations 2017-01-02 12:31:51 +01:00
James Cole
1818a596fe Translated 2017-01-02 12:21:47 +01:00
James Cole
8f7541b841 New translations 2017-01-02 12:21:45 +01:00
James Cole
090546cda3 New translations 2017-01-02 12:21:43 +01:00
James Cole
dcd89d38e7 Small JS fixes [skip ci] 2017-01-02 12:18:29 +01:00
James Cole
800478d437 Add support for Polish #517 [skip ci] 2017-01-02 12:18:18 +01:00
James Cole
f797344106 Default values [skip ci] 2017-01-02 12:15:33 +01:00
James Cole
9352ee3e25 Various Javascript fixes. 2017-01-02 12:09:46 +01:00
James Cole
811026dc4a Merge pull request #512 from firefly-iii/l10n_develop
New Crowdin translations
2017-01-02 11:48:57 +01:00
James Cole
479a4dac7b Missing translations [skip ci] #517 2017-01-02 11:41:14 +01:00
James Cole
499fbbeb17 New translations 2017-01-02 11:31:45 +01:00
James Cole
a35bcf6415 New translations 2017-01-02 11:21:43 +01:00
James Cole
818ffdfc85 New translations 2017-01-02 11:02:27 +01:00
James Cole
d5e19c7ac0 New translations 2017-01-02 11:02:26 +01:00
James Cole
37639b0ff4 New translations 2017-01-02 11:02:25 +01:00
James Cole
740d89dce6 New translations 2017-01-02 11:02:23 +01:00
James Cole
4a7b08fc4e New translations 2017-01-02 11:02:21 +01:00
James Cole
48a5f83f00 New translations 2017-01-02 11:02:20 +01:00
James Cole
48819c928d New translations 2017-01-02 11:02:18 +01:00
James Cole
45a6866dd0 New translations 2017-01-02 11:02:16 +01:00
James Cole
6690586406 New translations 2017-01-02 11:02:15 +01:00
James Cole
909e54845c New translations 2017-01-02 11:02:13 +01:00
James Cole
a7204eb9fa New translations 2017-01-02 11:02:10 +01:00
James Cole
6463166c00 New translations 2017-01-02 11:02:07 +01:00
James Cole
f8268a864b This should fix most Javascript errors. 2017-01-02 10:34:01 +01:00
James Cole
721fff29b3 Approved. Step name: Proofread 2017-01-02 10:12:07 +01:00
James Cole
4cf312d3d4 Approved. Step name: Proofread 2017-01-02 10:12:04 +01:00
James Cole
36f1b6a834 New account tests. 2017-01-02 10:05:02 +01:00
James Cole
050d7e8f00 Remove specific commands from composer installation routine. 2017-01-02 09:53:22 +01:00
James Cole
7c5bed2bb5 Fix export controller tests. 2017-01-02 09:23:24 +01:00
James Cole
87316cf7c1 Include local JS directory. [skip ci] 2017-01-02 09:09:37 +01:00
James Cole
f7d61e5a9b Update scrutinizer config. 2017-01-02 09:02:58 +01:00
James Cole
b2030a72a0 Fix some javascript things [skip ci] 2017-01-02 08:46:45 +01:00
James Cole
533797fc9e Update javascript code. 2017-01-02 08:30:20 +01:00
James Cole
5688234b9d New translations 2017-01-02 08:23:00 +01:00
James Cole
9335789362 New translations 2017-01-02 08:22:55 +01:00
James Cole
9e6a2a3fa4 New translations 2017-01-02 08:22:49 +01:00
James Cole
122fc77357 New translations 2017-01-02 08:22:35 +01:00
James Cole
c978e7965f New translations 2017-01-02 08:22:30 +01:00
James Cole
b0e4e24603 New translations 2017-01-02 08:22:25 +01:00
James Cole
56de307a3e New translations 2017-01-02 08:22:18 +01:00
James Cole
e1dd9ed41b New translations 2017-01-02 08:21:54 +01:00
James Cole
17a64764d3 New translations 2017-01-02 08:21:49 +01:00
James Cole
3cd0540474 Missing language lines [skip ci] 2017-01-02 08:13:10 +01:00
James Cole
27cd9fac8a This fixes #513 [skip ci] 2017-01-02 08:07:28 +01:00
James Cole
1d2012cc23 New translations 2017-01-01 20:42:59 +01:00
James Cole
1b00835dd1 New translations 2017-01-01 20:42:54 +01:00
James Cole
413dcf8164 New translations 2017-01-01 20:42:48 +01:00
James Cole
7f17e8fb2f New translations 2017-01-01 20:42:36 +01:00
James Cole
254d8994d0 New translations 2017-01-01 20:42:30 +01:00
James Cole
4f72519ad9 New translations 2017-01-01 20:42:23 +01:00
James Cole
900b246183 New translations 2017-01-01 20:42:17 +01:00
James Cole
abddb29f37 New translations 2017-01-01 20:41:56 +01:00
James Cole
8d429ef753 New translations 2017-01-01 20:41:50 +01:00
James Cole
b7679b5c60 Updated composer.lock. 2017-01-01 20:33:38 +01:00
James Cole
49982d6eb1 Updated various links to reflect the new repository location [skip ci] 2017-01-01 20:32:39 +01:00
James Cole
3191a6c12b Update readme [skip ci] 2017-01-01 20:21:51 +01:00
James Cole
32f8747f2e Update read [skip ci] 2017-01-01 20:14:32 +01:00
James Cole
38e45a62cf New translations 2017-01-01 20:13:12 +01:00
James Cole
c0e2e78780 New translations 2017-01-01 20:13:06 +01:00
James Cole
3fe3ddbc49 New translations 2017-01-01 20:12:59 +01:00
James Cole
5ca532a54a New translations 2017-01-01 20:12:48 +01:00
James Cole
a120df090a New translations 2017-01-01 20:12:43 +01:00
James Cole
22d359503a New translations 2017-01-01 20:12:38 +01:00
James Cole
e8d84abe43 New translations 2017-01-01 20:12:32 +01:00
James Cole
98937cedaa New translations 2017-01-01 20:12:10 +01:00
James Cole
d592d6cd7a New translations 2017-01-01 20:12:04 +01:00
James Cole
0341a04ee3 Warning about locale. [skip ci] 2017-01-01 20:10:30 +01:00
James Cole
540fc4f924 Fix sort [skip ci] 2017-01-01 17:01:29 +01:00
James Cole
04290bf9b6 Fix small issue with piggy banks. 2017-01-01 16:55:18 +01:00
James Cole
ecbc0c1778 Speed up various tests. 2016-12-30 14:24:16 +01:00
James Cole
44b8e48c3a Fix tests. 2016-12-30 13:54:11 +01:00
James Cole
a5036c86dc Updated test database. 2016-12-30 13:47:23 +01:00
James Cole
ac86e75233 Updated various files for #506 2016-12-30 13:45:02 +01:00
James Cole
9ec3febbfa Do not round pie chart values. #506 2016-12-30 12:00:37 +01:00
James Cole
1c5dc6ab6d Don’t round amount when exporting #506 2016-12-30 11:58:23 +01:00
James Cole
abb8eafec2 Fix tests. 2016-12-30 11:57:21 +01:00
James Cole
eb8f5512c5 Charts will respect decimal places #506 2016-12-30 11:51:58 +01:00
James Cole
d146476c91 Sort a nasty bug in budget limit collection #508 2016-12-30 09:02:48 +01:00
James Cole
7a57670925 Fix small bug in database verifier. [skip ci] 2016-12-30 08:51:26 +01:00
James Cole
8a49e98246 Fix small bug in database verifier. [skip ci] 2016-12-30 08:49:27 +01:00
James Cole
cf0845d190 Reinstated limit repetitions call #508 [skip ci] 2016-12-30 08:44:48 +01:00
James Cole
02bbdcc251 Fix reports and charts for #508 2016-12-30 08:41:48 +01:00
James Cole
13f6bd759b Views must pick up on this #508 2016-12-30 07:39:42 +01:00
James Cole
497400587d Update budget limit #508 2016-12-29 20:52:02 +01:00
James Cole
a58cd83ea7 Fixed routes and budgets.index #508 2016-12-29 20:48:33 +01:00
James Cole
3f802fe27a Removed limit repetition events #508 2016-12-29 20:48:12 +01:00
James Cole
6a13dd317d Will also upgrade database. #508 2016-12-29 20:19:20 +01:00
James Cole
a442d3d952 Migration for #508 2016-12-29 19:35:27 +01:00
James Cole
0d4febff85 New test database just to be sure. 2016-12-29 18:20:49 +01:00
James Cole
ba222eaf77 No changes to budget limit for now. 2016-12-29 18:10:29 +01:00
James Cole
b14719464c No changes to budget limit for now. 2016-12-29 18:10:14 +01:00
James Cole
c756b80962 These are changes to budget limit. FF must work with them. 2016-12-29 18:01:06 +01:00
James Cole
a54a886bf0 Chart was negative. [skip ci] 2016-12-29 17:56:12 +01:00
James Cole
dbe9628cc5 Update to budget limits. 2016-12-29 17:43:11 +01:00
James Cole
7a3b39886e Changed to budget controller chart. 2016-12-29 17:42:46 +01:00
James Cole
fab511cc53 Merge branch 'develop' of https://github.com/JC5/firefly-iii into develop
* 'develop' of https://github.com/JC5/firefly-iii:
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  New translations
  Approved. Step name: Proofread
2016-12-29 10:30:16 +01:00
James Cole
4979d9d0bf Merge pull request #507 from JC5/l10n_develop
New Crowdin translations
2016-12-29 10:29:59 +01:00
James Cole
45914b2e9e First set of views will respect decimal places configuration. 2016-12-29 09:15:50 +01:00
James Cole
1e9aaf2d2a Code cleanup. [skip ci] 2016-12-29 09:05:02 +01:00
James Cole
de56c18c6e Clean up some money formatting routines. 2016-12-29 09:02:23 +01:00
James Cole
eaefb7136a Looks like somebody had to google how the decimal thing works. 2016-12-28 22:21:55 +01:00
James Cole
fe9344cd0a Round on max number of decimals #506 2016-12-28 21:55:46 +01:00
James Cole
f010c17ae6 Up the scales for #506 2016-12-28 21:55:09 +01:00
James Cole
f63cd74965 New translations 2016-12-28 21:52:46 +01:00
James Cole
9e8f8f76a4 New translations 2016-12-28 21:52:43 +01:00
James Cole
d88c6a82d0 New translations 2016-12-28 21:52:41 +01:00
James Cole
a8fdf7ffad New translations 2016-12-28 21:52:36 +01:00
James Cole
245389d74f New translations 2016-12-28 21:52:33 +01:00
James Cole
26933637dd New translations 2016-12-28 21:52:31 +01:00
James Cole
98312ac554 New translations 2016-12-28 21:52:25 +01:00
James Cole
1ba03088c9 New translations 2016-12-28 21:52:21 +01:00
James Cole
c0dfc554b3 New translations 2016-12-28 21:52:18 +01:00
James Cole
5c691491e8 New translations 2016-12-28 21:52:15 +01:00
James Cole
9731b59174 New translations 2016-12-28 21:52:12 +01:00
James Cole
52bf358978 New translations 2016-12-28 21:52:07 +01:00
James Cole
c92a56c980 New translations 2016-12-28 21:52:04 +01:00
James Cole
3142151fc3 New translations 2016-12-28 21:51:47 +01:00
James Cole
fb555f5b96 New translations 2016-12-28 21:51:44 +01:00
James Cole
8f1c693d3d New translations 2016-12-28 21:51:41 +01:00
James Cole
b8a8becd0c New translations 2016-12-28 21:51:39 +01:00
James Cole
b71abd3f6a Approved. Step name: Proofread 2016-12-28 21:51:33 +01:00
James Cole
9ae74b4278 Expand views to allow editing of currency decimals #506 2016-12-28 21:48:37 +01:00
James Cole
bdbf434006 Increase number of decimals. #506 2016-12-28 21:34:02 +01:00
James Cole
1a5e93c739 Merge pull request #505 from JC5/l10n_develop
New Crowdin translations
2016-12-28 19:59:52 +01:00
James Cole
8e42ba74c6 New translations 2016-12-28 19:03:10 +01:00
James Cole
42bb083e99 New translations 2016-12-28 19:03:05 +01:00
James Cole
ae4eecc7f2 New translations 2016-12-28 19:02:59 +01:00
James Cole
c4f25b6191 New translations 2016-12-28 19:02:49 +01:00
James Cole
29b200040f New translations 2016-12-28 19:02:44 +01:00
James Cole
7cb1598fb1 New translations 2016-12-28 19:02:39 +01:00
James Cole
65b6f162d8 New translations 2016-12-28 19:02:31 +01:00
James Cole
c56d2e08f4 New translations 2016-12-28 19:02:10 +01:00
James Cole
ca0a0886b1 New translations 2016-12-28 19:02:04 +01:00
James Cole
e9822ae1a3 Code cleanup. [skip ci] 2016-12-28 19:00:39 +01:00
James Cole
04b284f030 No longer able to manage blocked domains. 2016-12-28 18:57:15 +01:00
James Cole
9ef24c0a43 Registration process no longer cares about blocked domains or previously deleted users. 2016-12-28 18:54:15 +01:00
James Cole
7ee650ba7a Some code cleanup [skip ci] 2016-12-28 18:49:30 +01:00
James Cole
96cafed154 New translations 2016-12-28 18:33:05 +01:00
James Cole
f65c2ff4fb New translations 2016-12-28 18:33:01 +01:00
James Cole
121deec62f New translations 2016-12-28 18:32:56 +01:00
James Cole
838d0808c0 New translations 2016-12-28 18:32:42 +01:00
James Cole
974fbe9e5b New translations 2016-12-28 18:32:37 +01:00
James Cole
f26f94ad3b New translations 2016-12-28 18:32:32 +01:00
James Cole
7410f1944c New translations 2016-12-28 18:32:12 +01:00
James Cole
c34947f657 New translations 2016-12-28 18:32:06 +01:00
James Cole
54092118e1 Approved. Step name: Proofread 2016-12-28 18:31:57 +01:00
James Cole
866a7d7401 Add missing translation [skip ci] 2016-12-28 18:27:32 +01:00
James Cole
32ab916707 Remove debug text [skip ci] 2016-12-28 18:26:44 +01:00
James Cole
1a245f1303 Fix import command instruction [skip ci] #504 2016-12-28 18:22:20 +01:00
James Cole
a23c61ee3c Fix tests 2016-12-28 17:14:32 +01:00
James Cole
f44336f7aa Remove a lot of stuff that deals with user activation. 2016-12-28 17:07:44 +01:00
James Cole
98d4bc48b6 Users can no longer be required to activate their account. They are always activated. 2016-12-28 16:55:53 +01:00
James Cole
a3f1b72bac Admin area reports on less user details. 2016-12-28 16:46:57 +01:00
James Cole
a37f70947b Various code cleanup. 2016-12-28 16:45:44 +01:00
James Cole
71195aa789 Merge pull request #503 from JC5/l10n_develop
New Crowdin translations
2016-12-28 15:16:31 +01:00
James Cole
f6511bed32 Called the wrong method [skip ci] 2016-12-28 13:05:40 +01:00
James Cole
619500ca64 Various cod e clean up. 2016-12-28 13:02:56 +01:00
James Cole
986d290434 New translations 2016-12-28 13:01:42 +01:00
James Cole
878f8c58bb New translations 2016-12-28 12:11:53 +01:00
James Cole
e067da1fe9 Translated 2016-12-28 12:01:50 +01:00
James Cole
f340c636fe New translations 2016-12-28 12:01:48 +01:00
James Cole
ce260a1a1e New translations 2016-12-28 11:51:38 +01:00
James Cole
a21c9f15e3 New translations 2016-12-28 11:41:39 +01:00
James Cole
e64b778d13 Various small fixes. 2016-12-28 11:34:00 +01:00
James Cole
a1f139f62a Translated 2016-12-28 11:31:16 +01:00
James Cole
8ae1d1c963 New translations 2016-12-28 10:23:19 +01:00
James Cole
8f8016179b New translations 2016-12-28 10:23:17 +01:00
James Cole
2e32e994c3 New translations 2016-12-28 10:23:14 +01:00
James Cole
1575e3b045 New translations 2016-12-28 10:23:11 +01:00
James Cole
9ab5f68601 New translations 2016-12-28 10:23:06 +01:00
James Cole
7fcb806dfe New translations 2016-12-28 10:23:02 +01:00
James Cole
5ae736c7cc New translations 2016-12-28 10:22:50 +01:00
James Cole
d77ba9970b New translations 2016-12-28 10:22:46 +01:00
James Cole
49f97a2c7b New translations 2016-12-28 10:22:42 +01:00
James Cole
659ff89062 New translations 2016-12-28 10:22:38 +01:00
James Cole
5529641bea New translations 2016-12-28 10:22:32 +01:00
James Cole
b38f1d7b2a New translations 2016-12-28 10:22:28 +01:00
James Cole
53ba202b14 New translations 2016-12-28 10:22:08 +01:00
James Cole
11cc333de7 New translations 2016-12-28 10:22:04 +01:00
James Cole
70e47ab4d0 New translations 2016-12-28 10:22:00 +01:00
James Cole
1582b35ae2 New translations 2016-12-28 10:21:58 +01:00
James Cole
62c27cee6c Approved. Step name: Proofread 2016-12-28 10:21:50 +01:00
James Cole
81b8bc9e93 Approved. Step name: Proofread 2016-12-28 10:21:47 +01:00
James Cole
49758c4e72 Remove deprecated settings. 2016-12-28 10:16:20 +01:00
James Cole
001ef4fe1c Removed deprecated event and handlers. (store ip addresses) 2016-12-28 10:08:34 +01:00
James Cole
94d0401f4e Removed deprecated event and handlers. (block use of email and deleted user) 2016-12-28 10:07:36 +01:00
James Cole
2dbd9bd0b1 Removed deprecated event and handlers. (block use of domain) 2016-12-28 10:05:37 +01:00
James Cole
9168c97eb6 Removed deprecated event and handlers. (locked out user) 2016-12-28 10:04:09 +01:00
James Cole
758953b6e3 Removed deprecated event and handlers. (blocked user login) 2016-12-28 10:02:43 +01:00
James Cole
8ccdf9ea83 Removed deprecated event and handlers. 2016-12-28 10:00:58 +01:00
James Cole
9c6a3e4ad5 This fixes the tests. 2016-12-28 09:56:07 +01:00
James Cole
6151d4a0ec Flash info message [skip ci] 2016-12-28 09:45:08 +01:00
James Cole
61014d45f4 Optimize view [skip ci] 2016-12-28 06:19:18 +01:00
James Cole
05a93a2426 Add budget information. [skip ci] 2016-12-28 06:14:58 +01:00
James Cole
a4c7412220 Hide more from account overview [skip ci] 2016-12-28 06:12:21 +01:00
James Cole
94e51952f4 More fields for query. 2016-12-28 06:09:48 +01:00
James Cole
ebdd64f46f Fix small issues in the category overview and the journal collector. 2016-12-28 05:48:41 +01:00
James Cole
2dc70ece44 Some tweaks for #502 2016-12-28 05:25:58 +01:00
James Cole
c23ea5ea76 Start of new change log. 2016-12-28 05:17:07 +01:00
James Cole
6521a7c604 This fixes #501 2016-12-28 05:16:55 +01:00
James Cole
02e792148c Forgot sprintf call. 2016-12-27 22:11:29 +01:00
James Cole
69c350dcca Merge pull request #500 from JC5/l10n_develop
New Crowdin translations
2016-12-27 20:52:16 +01:00
James Cole
1aee3d8e2c Various code cleanup 2016-12-27 20:52:00 +01:00
James Cole
02695d852c Various code cleanup 2016-12-27 20:45:23 +01:00
James Cole
7405138489 Various code cleanup 2016-12-27 20:07:28 +01:00
James Cole
4804257fd1 Various code cleanup 2016-12-27 19:59:56 +01:00
James Cole
67f2e3a32a New translations 2016-12-27 19:42:47 +01:00
James Cole
8d709f9cf4 New translations 2016-12-27 19:42:45 +01:00
James Cole
4d3132f1c9 New translations 2016-12-27 19:42:43 +01:00
James Cole
36b44f1814 New translations 2016-12-27 19:42:42 +01:00
James Cole
32761aeda0 New translations 2016-12-27 19:42:40 +01:00
James Cole
851b05c110 New translations 2016-12-27 19:42:38 +01:00
James Cole
997e951aca New translations 2016-12-27 19:42:32 +01:00
James Cole
448dc6b7c6 New translations 2016-12-27 19:42:30 +01:00
James Cole
84458fa46f New translations 2016-12-27 19:42:29 +01:00
James Cole
50bb8a0d91 New translations 2016-12-27 19:42:27 +01:00
James Cole
997b3c3061 New translations 2016-12-27 19:42:26 +01:00
James Cole
4f240c004c New translations 2016-12-27 19:42:24 +01:00
James Cole
597a8d36af New translations 2016-12-27 19:42:22 +01:00
James Cole
cf52a4c5c2 New translations 2016-12-27 19:42:21 +01:00
James Cole
c29180a094 Add support for Russian [skip ci] 2016-12-27 19:39:39 +01:00
James Cole
10f4304559 New demo text for the import routine. 2016-12-27 19:37:05 +01:00
James Cole
30447bcf70 New stubs for demo user. 2016-12-27 19:34:39 +01:00
James Cole
9ff9385c47 Demo user is no longer capable of uploading files. 2016-12-27 19:34:27 +01:00
James Cole
6c5499e848 Small code cleanup. 2016-12-27 19:34:05 +01:00
James Cole
3bacbe8536 Merge pull request #499 from JC5/l10n_develop
New Crowdin translations
2016-12-27 19:12:53 +01:00
James Cole
09c7a69050 New translations 2016-12-27 17:51:54 +01:00
James Cole
5dc727580f New translations 2016-12-27 17:51:53 +01:00
James Cole
248a4ed527 New translations 2016-12-27 17:51:52 +01:00
James Cole
db95185eee New translations 2016-12-27 17:51:50 +01:00
James Cole
85dae15a0d New translations 2016-12-27 17:51:49 +01:00
James Cole
3e61a1e12b New translations 2016-12-27 17:51:45 +01:00
James Cole
6cd4186ac9 Merge pull request #497 from JC5/l10n_develop
New Crowdin translations
2016-12-27 16:00:47 +01:00
James Cole
cbbadc3d6d Less logging in often used class. 2016-12-27 15:54:49 +01:00
James Cole
fc0024faa2 Can now inform about the lack of certain charts [skip ci] 2016-12-27 15:54:36 +01:00
James Cole
0f3d4062d7 Translated 2016-12-27 15:51:14 +01:00
James Cole
7ba8a88989 Merge pull request #496 from JC5/l10n_develop
New Crowdin translations
2016-12-27 15:47:53 +01:00
James Cole
349d254193 This fixes the tests. 2016-12-27 15:46:52 +01:00
James Cole
be201e811d Clean up report code. 2016-12-27 15:31:17 +01:00
James Cole
84a032fbb4 New translations 2016-12-27 13:12:24 +01:00
James Cole
4815602558 New translations 2016-12-27 13:12:22 +01:00
James Cole
e4b83392be New translations 2016-12-27 13:12:21 +01:00
James Cole
0658c17adb New translations 2016-12-27 13:12:20 +01:00
James Cole
bdc72aee42 New translations 2016-12-27 13:12:18 +01:00
James Cole
689d91e30f New translations 2016-12-27 13:12:17 +01:00
James Cole
6b785e4318 New translations 2016-12-27 13:12:14 +01:00
James Cole
f46cf55912 New translations 2016-12-27 13:12:13 +01:00
James Cole
d520849ce1 Some more demo text [skip ci] 2016-12-27 13:06:41 +01:00
James Cole
50661bbb3b Some more demo text [skip ci] 2016-12-27 13:05:31 +01:00
James Cole
d2d5b1ac76 More subtle currency warning [skip ci] 2016-12-27 11:08:52 +01:00
James Cole
244972e0f8 Better category overview [skip ci] 2016-12-27 11:02:14 +01:00
James Cole
f80e6c2efa New translations 2016-12-27 10:52:55 +01:00
James Cole
e9e32eda3c New translations 2016-12-27 10:52:50 +01:00
James Cole
73844e223f New translations 2016-12-27 10:52:46 +01:00
James Cole
6583a6d9c6 New translations 2016-12-27 10:52:36 +01:00
James Cole
ca4824adcd New translations 2016-12-27 10:52:27 +01:00
James Cole
80b5cc08bb New translations 2016-12-27 10:52:21 +01:00
James Cole
afbcc79a06 New translations 2016-12-27 10:52:12 +01:00
James Cole
3371bd2e04 New translations 2016-12-27 10:52:01 +01:00
James Cole
5efdf53c06 ShowAll method for category 2016-12-27 10:46:11 +01:00
James Cole
c9112de8ba New translations 2016-12-27 10:03:05 +01:00
James Cole
fd4b589a13 New translations 2016-12-27 10:03:00 +01:00
James Cole
df813dbac9 New translations 2016-12-27 10:02:50 +01:00
James Cole
004fb362ec New translations 2016-12-27 10:02:42 +01:00
James Cole
3cd749753a New translations 2016-12-27 10:02:37 +01:00
James Cole
c7964f7693 New translations 2016-12-27 10:02:30 +01:00
James Cole
57bba2fd3f New translations 2016-12-27 10:02:21 +01:00
James Cole
04c9b2a7a8 Approved. Step name: Proofread 2016-12-27 10:02:05 +01:00
James Cole
b9d142c2b7 Small view updates [skip ci] 2016-12-27 09:56:30 +01:00
James Cole
6ab52e282f Merge pull request #495 from JC5/l10n_develop
New Crowdin translations
2016-12-26 15:04:15 +01:00
James Cole
b14adf8c3f New translations 2016-12-26 12:42:09 +01:00
James Cole
4e0b162f5f New translations 2016-12-26 12:42:08 +01:00
James Cole
62d47ff7f0 New translations 2016-12-26 12:42:07 +01:00
James Cole
7f025380f0 New translations 2016-12-26 12:42:06 +01:00
James Cole
7d1e981bca New translations 2016-12-26 12:42:04 +01:00
James Cole
a08103f996 New translations 2016-12-26 12:42:03 +01:00
James Cole
dd4991a4f8 New translations 2016-12-26 12:42:00 +01:00
James Cole
5442292d23 New translations 2016-12-26 12:41:59 +01:00
James Cole
3f050d3d03 Some demo page text [skip ci] 2016-12-26 12:32:48 +01:00
James Cole
ad1e9c27e9 Merge branch 'release/4.3.0' 2016-12-26 10:46:22 +01:00
James Cole
ab761696bf New version indicator. 2016-12-26 10:45:45 +01:00
James Cole
0713273a99 New composer file. 2016-12-26 10:45:19 +01:00
James Cole
5668a3271b Updated change log. 2016-12-26 10:40:28 +01:00
James Cole
1eca105a91 Merge pull request #494 from JC5/l10n_develop
New Crowdin translations
2016-12-26 10:34:00 +01:00
James Cole
3883b99c24 New translations 2016-12-26 10:31:51 +01:00
James Cole
d6adbc697a New translations 2016-12-26 10:31:49 +01:00
James Cole
a5789b1085 New translations 2016-12-26 10:31:48 +01:00
James Cole
a6ccbcb795 New translations 2016-12-26 10:31:47 +01:00
James Cole
1a6067f7ae New translations 2016-12-26 10:31:46 +01:00
James Cole
cb735b18a9 New translations 2016-12-26 10:31:45 +01:00
James Cole
909bd11147 New translations 2016-12-26 10:31:42 +01:00
James Cole
1a76c606ed New translations 2016-12-26 10:31:41 +01:00
James Cole
8c9b6796a1 Approved. Step name: Proofread 2016-12-26 10:31:38 +01:00
James Cole
844ab608d4 More demo text [skip ci] 2016-12-26 10:23:47 +01:00
James Cole
dc39094975 New translations 2016-12-26 10:12:11 +01:00
James Cole
b32184d525 New translations 2016-12-26 10:12:09 +01:00
James Cole
d95ae53ce2 New translations 2016-12-26 10:12:07 +01:00
James Cole
5e3147ddeb New translations 2016-12-26 10:12:06 +01:00
James Cole
9e594c6075 New translations 2016-12-26 10:12:04 +01:00
James Cole
c0058c51ea New translations 2016-12-26 10:12:03 +01:00
James Cole
b0b68d4243 New translations 2016-12-26 10:12:00 +01:00
James Cole
22eb90212d New translations 2016-12-26 10:11:59 +01:00
James Cole
94e264b6ce Expand demo text [skip ci] 2016-12-26 10:00:40 +01:00
James Cole
7ea15761a6 Fix tests. 2016-12-26 09:50:37 +01:00
James Cole
1ced4a089d Update read me [skip ci] 2016-12-26 09:50:28 +01:00
James Cole
648e63628c Extra code for demo site. 2016-12-26 09:33:52 +01:00
James Cole
2847e2aff5 Code for the demo features. 2016-12-26 09:18:45 +01:00
James Cole
9dfaabb5d0 New translations 2016-12-26 09:12:28 +01:00
James Cole
6a21f98ea4 New translations 2016-12-26 09:12:22 +01:00
James Cole
4d5f4cc1c0 New translations 2016-12-26 09:12:14 +01:00
James Cole
970ce6cb0d New translations 2016-12-26 09:12:10 +01:00
James Cole
31cad5de00 New translations 2016-12-26 09:12:05 +01:00
James Cole
e06db9e620 New translations 2016-12-26 09:11:59 +01:00
James Cole
f57ac64dc2 New translations 2016-12-26 09:11:54 +01:00
James Cole
57d7c1623f New translations 2016-12-26 09:11:36 +01:00
James Cole
c86aa9cb3f Can no longer reset the demo user’s password. 2016-12-26 09:08:59 +01:00
James Cole
48209d0d22 Demo user cannot enable two factor auth. 2016-12-26 08:57:07 +01:00
James Cole
8f6a271cc0 Add the ability to prefix cache differently. 2016-12-25 13:38:30 +01:00
James Cole
a9b610f367 New translations 2016-12-25 13:12:12 +01:00
James Cole
1046930f29 New translations 2016-12-25 13:12:00 +01:00
James Cole
1b16e5e216 New translations 2016-12-25 13:11:56 +01:00
James Cole
e16ba9ac70 New translations 2016-12-25 13:11:53 +01:00
James Cole
71ac676b83 New translations 2016-12-25 13:11:47 +01:00
James Cole
1b6c0d5d86 New translations 2016-12-25 13:11:43 +01:00
James Cole
14db016e98 New translations 2016-12-25 13:11:27 +01:00
James Cole
7e2e1626ac Approved. Step name: Proofread 2016-12-25 13:11:15 +01:00
James Cole
bce4e7e2bf Add restrictions for demo accounts. 2016-12-25 13:09:29 +01:00
James Cole
ede327f3d3 Merge pull request #493 from JC5/l10n_develop
New Crowdin translations
2016-12-25 12:59:27 +01:00
James Cole
82718a74dc Fix tests 2016-12-25 12:55:22 +01:00
James Cole
eefd6141a1 Translated 2016-12-25 12:31:05 +01:00
James Cole
7894f1871e Make sure the attachment tests work. 2016-12-25 12:23:36 +01:00
James Cole
0ef9b5b462 Make sure database is present in tests. 2016-12-25 12:06:17 +01:00
James Cole
9ca75d134e This is the test database required to run the tests. 2016-12-25 12:03:21 +01:00
James Cole
b78776e1f7 This generates a lot of logging, let’s remove it. 2016-12-25 11:52:01 +01:00
James Cole
f2f9f8fbab Various bug fixes and extensions to test routine. 2016-12-25 11:50:42 +01:00
James Cole
5b5acba816 Clean up lots of models. 2016-12-24 17:36:51 +01:00
James Cole
9f2729d0ff Removed Firefly’s ability to generate test data. 2016-12-24 14:48:14 +01:00
James Cole
afe98cda9f Various code cleanup things and preparation for a new demo user. 2016-12-24 14:43:42 +01:00
James Cole
9c4d2e8791 Mention $other in chart cache. [skip ci] 2016-12-23 18:48:21 +01:00
James Cole
cea170359f Budget chart. 2016-12-23 18:34:58 +01:00
James Cole
70bb8fbc89 New translations 2016-12-23 17:53:16 +01:00
James Cole
82cd0adca6 New translations 2016-12-23 17:52:57 +01:00
James Cole
e821f5b2b6 New translations 2016-12-23 17:52:51 +01:00
James Cole
4cade467c6 New translations 2016-12-23 17:52:46 +01:00
James Cole
b6c9639948 New translations 2016-12-23 17:52:39 +01:00
James Cole
ca9319db34 New translations 2016-12-23 17:52:33 +01:00
James Cole
beaec9a4c1 New translations 2016-12-23 17:52:11 +01:00
James Cole
cbc44e8200 Approved. Step name: Proofread 2016-12-23 17:51:54 +01:00
James Cole
017b1a481a Committed bad code. 2016-12-23 17:51:33 +01:00
James Cole
e15932fe4a Make budget report actually more useful. 2016-12-23 17:50:26 +01:00
James Cole
08c044fe52 Merge pull request #491 from JC5/l10n_develop
New Crowdin translations
2016-12-23 15:52:34 +01:00
James Cole
0e11245cb4 Fix tests. 2016-12-23 15:52:12 +01:00
James Cole
cde494d3ef Fixed missing chart data. 2016-12-23 15:52:05 +01:00
James Cole
9a15decdff Translated 2016-12-23 15:02:25 +01:00
James Cole
186b986e02 New translations 2016-12-23 07:32:48 +01:00
James Cole
cdbf5653ac New translations 2016-12-23 07:32:34 +01:00
James Cole
c403dd7490 New translations 2016-12-23 07:32:28 +01:00
James Cole
d15d9fdf2a New translations 2016-12-23 07:32:24 +01:00
James Cole
0b618de44c New translations 2016-12-23 07:32:16 +01:00
James Cole
875f19f728 New translations 2016-12-23 07:32:11 +01:00
James Cole
7bb549732c New translations 2016-12-23 07:31:50 +01:00
James Cole
b9baa93ae4 Approved. Step name: Proofread 2016-12-23 07:31:36 +01:00
James Cole
315479fcd3 New translations [skip ci] 2016-12-23 07:24:38 +01:00
James Cole
1f1334a1fc Update chart to show sum 2016-12-23 07:20:47 +01:00
James Cole
bf0744e03a Updated some copyright notices [skip ci] 2016-12-23 07:02:45 +01:00
James Cole
8fb9577660 Add some debug, fix balance report bug. 2016-12-22 21:45:04 +01:00
James Cole
90d58c5c39 Update test scripts [skip ci] 2016-12-22 19:51:49 +01:00
James Cole
b6aa79bb38 Various code cleanup. Removed executable flags, added newlines. 2016-12-22 19:42:45 +01:00
James Cole
14a0de6b6a This should fix account-number. 2016-12-22 19:18:35 +01:00
James Cole
13e56b7249 Can handle account number, but do nothing with it. 2016-12-22 19:17:33 +01:00
James Cole
3753901e38 Expand flush routine because of issues. [skip ci] 2016-12-22 18:26:16 +01:00
James Cole
e76075e29f Various small fixes. 2016-12-22 18:19:50 +01:00
James Cole
284db7f90b Fixed some small display issues. 2016-12-22 17:04:41 +01:00
James Cole
cabdf4e380 This might fix the missing stack trace. [skip ci] 2016-12-22 16:55:27 +01:00
James Cole
9859052c4d Code for issue #489 2016-12-22 16:36:56 +01:00
James Cole
0feeac9160 Removed some unused imports [skip ci] 2016-12-22 15:24:16 +01:00
James Cole
54b33a0b69 Removed views no longer used. 2016-12-22 07:13:49 +01:00
James Cole
e08e7b2c9b Speed up some tests. 2016-12-22 07:13:37 +01:00
James Cole
782e2add88 Fix sort URI, smaller view [skip ci] 2016-12-21 20:34:47 +01:00
James Cole
f18a5a6f1b This fixes the broken tests. 2016-12-21 20:32:02 +01:00
James Cole
6fc971c4cb This is a fix for #487 2016-12-21 20:31:44 +01:00
James Cole
3250c4830d New seeds plus the preparation for some extended testing. 2016-12-21 19:56:06 +01:00
James Cole
9e1a69217d This fixes #484. 2016-12-21 17:50:00 +01:00
James Cole
46c26a64d8 Update import storage routine for issue #483, as suggested by @zjean 2016-12-21 17:21:36 +01:00
James Cole
2f12a70647 Add support for Spanish. [skip ci] 2016-12-20 17:21:16 +01:00
James Cole
be190d1fa0 Update favicon information. 2016-12-20 17:19:16 +01:00
James Cole
1e4888209b Fixed #479 2016-12-20 17:14:43 +01:00
James Cole
8aa2961c19 This should fix #482 2016-12-20 17:10:30 +01:00
James Cole
304cdabc96 Merge pull request #481 from JC5/l10n_develop
New Crowdin translations
2016-12-20 14:16:39 +01:00
James Cole
c60e272eb3 New translations 2016-12-20 10:42:06 +01:00
James Cole
c074f55cb2 New translations 2016-12-20 10:42:05 +01:00
James Cole
e6af29646e New translations 2016-12-20 10:42:03 +01:00
James Cole
b4213328fe New translations 2016-12-20 10:42:02 +01:00
James Cole
8a7628c9dc New translations 2016-12-20 10:42:00 +01:00
James Cole
d52c146e12 New translations 2016-12-20 10:41:58 +01:00
James Cole
1910a4bd4b New translations 2016-12-20 10:41:57 +01:00
James Cole
bd0c552f54 New translations 2016-12-20 10:41:55 +01:00
James Cole
b29ea98de4 New translations 2016-12-20 10:41:53 +01:00
James Cole
dd1db87806 New translations 2016-12-20 10:41:50 +01:00
James Cole
6f9e446577 New translations 2016-12-20 10:41:45 +01:00
James Cole
664230dca8 This fixes #478, again 2016-12-20 10:25:11 +01:00
James Cole
1a24e7e0aa Merge pull request #476 from JC5/l10n_develop
New Crowdin translations
2016-12-19 21:10:53 +01:00
James Cole
9239815ce6 Tiny view update. 2016-12-19 21:07:38 +01:00
James Cole
116e19ec06 These routines fix #477 2016-12-19 21:07:22 +01:00
James Cole
fc0ad622eb Clarify chart details [skip ci] 2016-12-19 20:47:26 +01:00
James Cole
2c5cdb8780 Clarify chart details [skip ci] 2016-12-19 20:46:24 +01:00
James Cole
9a309f32fa This fixes #478 2016-12-19 20:36:28 +01:00
James Cole
e2e54d342a This completes all controller acceptance tests 2016-12-19 20:21:14 +01:00
James Cole
42f7529495 Approved. Step name: Proofread 2016-12-19 20:01:50 +01:00
James Cole
f172151252 Expand read me [skip ci] 2016-12-19 17:31:23 +01:00
James Cole
e2ad38d3e0 Expand read me [skip ci] 2016-12-19 17:24:15 +01:00
James Cole
40cc32fc5a Updated favicon. 2016-12-19 17:15:31 +01:00
James Cole
436c034fdd New translations 2016-12-19 11:51:37 +01:00
James Cole
286b1848d9 New translations 2016-12-19 10:31:15 +01:00
James Cole
7fffebf6df New translations 2016-12-19 10:21:22 +01:00
James Cole
b1764478ec Translated 2016-12-19 10:11:53 +01:00
James Cole
6b6a799206 Translated 2016-12-18 21:41:01 +01:00
James Cole
0a82ed901e New translations 2016-12-18 21:12:00 +01:00
James Cole
d733c9ed14 New translations 2016-12-18 21:11:57 +01:00
James Cole
a752ea489c New translations 2016-12-18 21:11:51 +01:00
James Cole
876a24586f New translations 2016-12-18 21:11:47 +01:00
James Cole
ea2779cf9a New translations 2016-12-18 21:11:41 +01:00
James Cole
77aa36163d New translations 2016-12-18 21:11:38 +01:00
James Cole
b581d8ecb7 New translations 2016-12-18 21:11:18 +01:00
James Cole
83b404d01e More tests. 2016-12-18 21:04:53 +01:00
James Cole
8deb92c3e5 More tests. 2016-12-18 19:34:03 +01:00
James Cole
20a6e0170c New translations 2016-12-18 18:22:10 +01:00
James Cole
944a78807c New translations 2016-12-18 18:22:05 +01:00
James Cole
0b02d294f4 New translations 2016-12-18 18:22:00 +01:00
James Cole
a5d86536c3 New translations 2016-12-18 18:21:52 +01:00
James Cole
71c08cfe0c New translations 2016-12-18 18:21:48 +01:00
James Cole
8ab0d5fc48 New translations 2016-12-18 18:21:40 +01:00
James Cole
57f81ee4c8 Approved. Step name: Proofread 2016-12-18 18:21:29 +01:00
James Cole
5c28adf266 New tests. [skip ci] 2016-12-18 18:16:41 +01:00
James Cole
5a57398f81 New tests. 2016-12-18 17:54:11 +01:00
772 changed files with 29474 additions and 17284 deletions

55
.env.docker Normal file
View File

@@ -0,0 +1,55 @@
APP_ENV=${FF_APP_ENV}
APP_DEBUG=false
APP_FORCE_SSL=false
APP_FORCE_ROOT=
APP_KEY=${FF_APP_KEY}
APP_LOG=daily
APP_LOG_LEVEL=warning
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=${FF_DB_HOST}
DB_PORT=3306
DB_DATABASE=${FF_DB_NAME}
DB_USERNAME=${FF_DB_USER}
DB_PASSWORD=${FF_DB_PASSWORD}
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
COOKIE_PATH="/"
COOKIE_DOMAIN=
COOKIE_SECURE=false
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_FROM=changeme@example.com
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
SEND_REGISTRATION_MAIL=true
SEND_ERROR_MESSAGE=true
SHOW_INCOMPLETE_TRANSLATIONS=false
CACHE_PREFIX=firefly
GOOGLE_MAPS_API_KEY=
ANALYTICS_ID=
SITE_OWNER=mail@example.com
USE_ENCRYPTION=true
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_APP_ID=
DEMO_USERNAME=
DEMO_PASSWORD=

View File

@@ -3,6 +3,7 @@ APP_DEBUG=false
APP_FORCE_SSL=false
APP_FORCE_ROOT=
APP_KEY=SomeRandomStringOf32CharsExactly
APP_LOG=daily
APP_LOG_LEVEL=warning
APP_URL=http://localhost
@@ -38,9 +39,17 @@ SEND_REGISTRATION_MAIL=true
SEND_ERROR_MESSAGE=true
SHOW_INCOMPLETE_TRANSLATIONS=false
CACHE_PREFIX=firefly
GOOGLE_MAPS_API_KEY=
ANALYTICS_ID=
SITE_OWNER=mail@example.com
USE_ENCRYPTION=true
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_APP_ID=
DEMO_USERNAME=
DEMO_PASSWORD=

55
.env.sandstorm Executable file
View File

@@ -0,0 +1,55 @@
APP_ENV=production
APP_DEBUG=true
APP_FORCE_SSL=false
APP_FORCE_ROOT=
APP_KEY=SomeRandomStringOf32CharsExactly
APP_LOG=syslog
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=firefly
DB_USERNAME=firefly
DB_PASSWORD=firefly
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
COOKIE_PATH="/"
COOKIE_DOMAIN=
COOKIE_SECURE=false
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_FROM=changeme@example.com
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
SEND_REGISTRATION_MAIL=true
SEND_ERROR_MESSAGE=true
SHOW_INCOMPLETE_TRANSLATIONS=false
CACHE_PREFIX=firefly
GOOGLE_MAPS_API_KEY=
ANALYTICS_ID=
SITE_OWNER=mail@example.com
USE_ENCRYPTION=true
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_APP_ID=
DEMO_USERNAME=
DEMO_PASSWORD=

19
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,19 @@
# Welcome to Firefly III on Github!
:+1::tada: Thank you for taking the time to contribute something to Firefly III!
## Feature requests
If you are requesting a new feature, please check out the list of [often requested features](https://firefly-iii.github.io/requested-features/).
## Bugs
If you find a bug, please take the time and see if the [demo site](https://firefly-iii.nder.be/) is also suffering from this bug. Include as many log files and details as you think are necessary.
## Installation problems
Take the time to read the [installation guide FAQ](https://firefly-iii.github.io/installation-guide-faq/) and make sure you search through closed issues for the problems other people have had. Your problem may be among them!
## Pull requests
I can only accept pull requests against the `develop` branch, never the `master` branch.

5
.sandstorm/.gitattributes vendored Normal file
View File

@@ -0,0 +1,5 @@
# vagrant-spk creates shell scripts, which must end in \n, even on a \r\n system.
*.sh text eol=lf

5
.sandstorm/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
# This file stores a list of sub-paths of .sandstorm/ that should be ignored by git.
.vagrant

103
.sandstorm/Vagrantfile vendored Normal file
View File

@@ -0,0 +1,103 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Guess at a reasonable name for the VM based on the folder vagrant-spk is
# run from. The timestamp is there to avoid conflicts if you have multiple
# folders with the same name.
VM_NAME = File.basename(File.dirname(File.dirname(__FILE__))) + "_sandstorm_#{Time.now.utc.to_i}"
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Base on the Sandstorm snapshots of the official Debian 8 (jessie) box.
config.vm.box = "sandstorm/debian-jessie64"
if Vagrant.has_plugin?("vagrant-vbguest") then
# vagrant-vbguest is a Vagrant plugin that upgrades
# the version of VirtualBox Guest Additions within each
# guest. If you have the vagrant-vbguest plugin, then it
# needs to know how to compile kernel modules, etc., and so
# we give it this hint about operating system type.
config.vm.guest = "debian"
end
# We forward port 6080, the Sandstorm web port, so that developers can
# visit their sandstorm app from their browser as local.sandstorm.io:6080
# (aka 127.0.0.1:6080).
config.vm.network :forwarded_port, guest: 6080, host: 6080
# Use a shell script to "provision" the box. This installs Sandstorm using
# the bundled installer.
config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/global-setup.sh", keep_color: true
# Then, do stack-specific and app-specific setup.
config.vm.provision "shell", inline: "sudo bash /opt/app/.sandstorm/setup.sh", keep_color: true
# Shared folders are configured per-provider since vboxsf can't handle >4096 open files,
# NFS requires privilege escalation every time you bring a VM up,
# and 9p is only available on libvirt.
# Calculate the number of CPUs and the amount of RAM the system has,
# in a platform-dependent way; further logic below.
cpus = nil
total_kB_ram = nil
host = RbConfig::CONFIG['host_os']
if host =~ /darwin/
cpus = `sysctl -n hw.ncpu`.to_i
total_kB_ram = `sysctl -n hw.memsize`.to_i / 1024
elsif host =~ /linux/
cpus = `nproc`.to_i
total_kB_ram = `grep MemTotal /proc/meminfo | awk '{print $2}'`.to_i
elsif host =~ /mingw/
# powershell may not be available on Windows XP and Vista, so wrap this in a rescue block
begin
cpus = `powershell -Command "(Get-WmiObject Win32_Processor -Property NumberOfLogicalProcessors | Select-Object -Property NumberOfLogicalProcessors | Measure-Object NumberOfLogicalProcessors -Sum).Sum"`.to_i
total_kB_ram = `powershell -Command "Get-CimInstance -class cim_physicalmemory | % $_.Capacity}"`.to_i / 1024
rescue
end
end
# Use the same number of CPUs within Vagrant as the system, with 1
# as a default.
#
# Use at least 512MB of RAM, and if the system has more than 2GB of
# RAM, use 1/4 of the system RAM. This seems a reasonable compromise
# between having the Vagrant guest operating system not run out of
# RAM entirely (which it basically would if we went much lower than
# 512MB) and also allowing it to use up a healthily large amount of
# RAM so it can run faster on systems that can afford it.
if cpus.nil? or cpus.zero?
cpus = 1
end
if total_kB_ram.nil? or total_kB_ram < 2048000
assign_ram_mb = 512
else
assign_ram_mb = (total_kB_ram / 1024 / 4)
end
# Actually apply these CPU/memory values to the providers.
config.vm.provider :virtualbox do |vb, override|
vb.cpus = cpus
vb.memory = assign_ram_mb
vb.name = VM_NAME
vb.customize ["modifyvm", :id, "--nictype1", "Am79C973"]
# /opt/app and /host-dot-sandstorm are used by vagrant-spk
override.vm.synced_folder "..", "/opt/app"
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm"
# /vagrant is not used by vagrant-spk; we need this line so it gets disabled; if we removed the
# line, vagrant would automatically insert a synced folder in /vagrant, which is not what we want.
override.vm.synced_folder "..", "/vagrant", disabled: true
end
config.vm.provider :libvirt do |libvirt, override|
libvirt.cpus = cpus
libvirt.memory = assign_ram_mb
libvirt.default_prefix = VM_NAME
# /opt/app and /host-dot-sandstorm are used by vagrant-spk
override.vm.synced_folder "..", "/opt/app", type: "9p", accessmode: "passthrough"
override.vm.synced_folder ENV["HOME"] + "/.sandstorm", "/host-dot-sandstorm", type: "9p", accessmode: "passthrough"
# /vagrant is not used by vagrant-spk; we need this line so it gets disabled; if we removed the
# line, vagrant would automatically insert a synced folder in /vagrant, which is not what we want.
override.vm.synced_folder "..", "/vagrant", type: "9p", accessmode: "passthrough", disabled: true
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

21
.sandstorm/build.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
# Checks if there's a composer.json, and if so, installs/runs composer.
# This script only runs once, when the app connects to sandstorm.
set -euo pipefail
cd /opt/app
cp .env.sandstorm .env
if [ -f /opt/app/composer.json ] ; then
if [ ! -f composer.phar ] ; then
curl -sS https://getcomposer.org/installer | php
fi
php composer.phar install --no-dev --no-suggest
fi
# link storage folder
rm -rf /opt/app/storage
ln -s /var/storage /opt/app

3
.sandstorm/changelog.md Normal file
View File

@@ -0,0 +1,3 @@
# 3.4.3
* Initial release on Sandstorm.io

View File

@@ -0,0 +1,3 @@
"Firefly III" is a financial manager. It can help you keep track of expenses, income, budgets and everything in between. It even supports credit cards, shared household accounts and savings accounts! Its pretty fancy. You should use it to save and organise money.
Firefly works on the principle that if you know where youre money is going, you can stop it from going there.

44
.sandstorm/global-setup.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
set -euo pipefail
# Set options for curl. Since we only want to show errors from these curl commands, we also use
# 'cat' to buffer the output; for more information:
# https://github.com/sandstorm-io/vagrant-spk/issues/158
CURL_OPTS="--silent --show-error"
echo localhost > /etc/hostname
hostname localhost
# The following line copies stderr through stderr to cat without accidentally leaving it in the
# output file. Be careful when changing. See: https://github.com/sandstorm-io/vagrant-spk/pull/159
curl $CURL_OPTS https://install.sandstorm.io/ 2>&1 > /host-dot-sandstorm/caches/install.sh | cat
SANDSTORM_CURRENT_VERSION=$(curl $CURL_OPTS -f "https://install.sandstorm.io/dev?from=0&type=install")
SANDSTORM_PACKAGE="sandstorm-$SANDSTORM_CURRENT_VERSION.tar.xz"
if [[ ! -f /host-dot-sandstorm/caches/$SANDSTORM_PACKAGE ]] ; then
echo -n "Downloading Sandstorm version ${SANDSTORM_CURRENT_VERSION}..."
curl $CURL_OPTS --output "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE.partial" "https://dl.sandstorm.io/$SANDSTORM_PACKAGE" 2>&1 | cat
mv "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE.partial" "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE"
echo "...done."
fi
if [ ! -e /opt/sandstorm/latest/sandstorm ] ; then
echo -n "Installing Sandstorm version ${SANDSTORM_CURRENT_VERSION}..."
bash /host-dot-sandstorm/caches/install.sh -d -e "/host-dot-sandstorm/caches/$SANDSTORM_PACKAGE" >/dev/null
echo "...done."
fi
modprobe ip_tables
# Make the vagrant user part of the sandstorm group so that commands like
# `spk dev` work.
usermod -a -G 'sandstorm' 'vagrant'
# Bind to all addresses, so the vagrant port-forward works.
sudo sed --in-place='' \
--expression='s/^BIND_IP=.*/BIND_IP=0.0.0.0/' \
/opt/sandstorm/sandstorm.conf
sudo service sandstorm restart
# Enable apt-cacher-ng proxy to make things faster if one appears to be running on the gateway IP
GATEWAY_IP=$(ip route | grep ^default | cut -d ' ' -f 3)
if nc -z "$GATEWAY_IP" 3142 ; then
echo "Acquire::http::Proxy \"http://$GATEWAY_IP:3142\";" > /etc/apt/apt.conf.d/80httpproxy
fi
# Configure apt to retry fetching things that fail to download.
echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80sandstorm-retry

62
.sandstorm/launcher.sh Executable file
View File

@@ -0,0 +1,62 @@
#!/bin/bash
# Runs every time we create a new grain!
# Create a bunch of folders under the clean /var that php, nginx, and mysql expect to exist
mkdir -p /var/lib/mysql
mkdir -p /var/lib/nginx
mkdir -p /var/lib/php/sessions/
mkdir -p /var/log
mkdir -p /var/log/mysql
mkdir -p /var/log/nginx
# Wipe /var/run, since pidfiles and socket files from previous launches should go away
# TODO someday: I'd prefer a tmpfs for these.
rm -rf /var/run
mkdir -p /var/run
rm -rf /var/tmp
mkdir -p /var/tmp
mkdir -p /var/run/mysqld
# make storage directories
rm -rf /var/storage
mkdir -p /var/storage/app/public
mkdir -p /var/storage/build
mkdir -p /var/storage/database
mkdir -p /var/storage/debugbar
mkdir -p /var/storage/export
mkdir -p /var/storage/framework/cache
mkdir -p /var/storage/framework/sessions
mkdir -p /var/storage/framework/views
mkdir -p /var/storage/logs
mkdir -p /var/storage/upload
# Ensure mysql tables created
HOME=/etc/mysql /usr/bin/mysql_install_db --force
# Spawn mysqld, php
HOME=/etc/mysql /usr/sbin/mysqld &
/usr/sbin/php-fpm7.0 --nodaemonize --fpm-config /etc/php/7.0/fpm/php-fpm.conf &
# Wait until mysql and php have bound their sockets, indicating readiness
while [ ! -e /var/run/mysqld/mysqld.sock ] ; do
echo "waiting for mysql to be available at /var/run/mysqld/mysqld.sock"
sleep .5
done
while [ ! -e /var/run/php7.0-fpm.sock ] ; do
echo "waiting for php7.0-fpm to be available at /var/run/php7.0-fpm.sock"
sleep .5
done
echo "Installing database.."
# Install database for Firefly III
echo "CREATE DATABASE IF NOT EXISTS firefly; GRANT ALL on firefly.* TO 'firefly'@'localhost' IDENTIFIED BY 'firefly';" | mysql -uroot
echo "Done!"
echo "Migrating..."
php /opt/app/artisan migrate --seed --force
echo "Done!"
# Start nginx.
/usr/sbin/nginx -c /opt/app/.sandstorm/service-config/nginx.conf -g "daemon off;"

BIN
.sandstorm/pgp-keyring Normal file

Binary file not shown.

BIN
.sandstorm/pgp-signature Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,188 @@
@0x9411e6c8b3c8a4b6;
using Spk = import "/sandstorm/package.capnp";
# This imports:
# $SANDSTORM_HOME/latest/usr/include/sandstorm/package.capnp
# Check out that file to see the full, documented package definition format.
const pkgdef :Spk.PackageDefinition = (
# The package definition. Note that the spk tool looks specifically for the
# "pkgdef" constant.
id = "uws252ya9mep4t77tevn85333xzsgrpgth8q4y1rhknn1hammw70",
# Your app ID is actually its public key. The private key was placed in
# your keyring. All updates must be signed with the same key.
manifest = (
appTitle = (defaultText = "Firefly III"),
appVersion = 1,
appMarketingVersion = (defaultText = "3.4.3"),
actions = [
# Define your "new document" handlers here.
( nounPhrase = (defaultText = "administration"),
command = .myCommand
# The command to run when starting for the first time. (".myCommand"
# is just a constant defined at the bottom of the file.)
)
],
continueCommand = .myCommand,
# This is the command called to start your app back up after it has been
# shut down for inactivity. Here we're using the same command as for
# starting a new instance, but you could use different commands for each
# case.
metadata = (
icons = (
appGrid = (png = (dpi1x = embed "app-graphics/firefly-iii-128.png")),
grain = (png = (dpi1x = embed "app-graphics/firefly-iii-24.png",
dpi2x = embed "app-graphics/firefly-iii-48.png")),
market = (png = (dpi1x = embed "app-graphics/firefly-iii-150.png"))
),
website = "https://firefly-iii.github.io/",
codeUrl = "https://github.com/firefly-iii/firefly-iii",
#license = (openSource = mit),
license = (proprietary = (defaultText = embed "../LICENSE")),
# The license this package is distributed under. See
# https://docs.sandstorm.io/en/latest/developing/publishing-apps/#license
categories = [productivity],
# A list of categories/genres to which this app belongs, sorted with best fit first.
# See the list of categories at
# https://docs.sandstorm.io/en/latest/developing/publishing-apps/#categories
author = (
contactEmail = "thegrumpydictator@gmail.com",
upstreamAuthor = "James Cole",
pgpSignature = embed "pgp-signature",
),
pgpKeyring = embed "pgp-keyring",
description = (defaultText = embed "description.md"),
shortDescription = (defaultText = "Financial management"),
screenshots = [
# Screenshots to use for marketing purposes. Examples below.
# Sizes are given in device-independent pixels, so if you took these
# screenshots on a Retina-style high DPI screen, divide each dimension by two.
(width = 1200, height = 1000, png = embed "screenshots/screenshot-1.png"),
(width = 1200, height = 1000, png = embed "screenshots/screenshot-2.png"),
(width = 1200, height = 1518, png = embed "screenshots/screenshot-3.png"),
],
changeLog = (defaultText = embed "changelog.md"),
),
),
sourceMap = (
# Here we defined where to look for files to copy into your package. The
# `spk dev` command actually figures out what files your app needs
# automatically by running it on a FUSE filesystem. So, the mappings
# here are only to tell it where to find files that the app wants.
searchPath = [
( sourcePath = "." ), # Search this directory first.
( sourcePath = "/", # Then search the system root directory.
hidePaths = [ "home", "proc", "sys",
"etc/passwd", "etc/hosts", "etc/host.conf",
"etc/nsswitch.conf", "etc/resolv.conf" ]
# You probably don't want the app pulling files from these places,
# so we hide them. Note that /dev, /var, and /tmp are implicitly
# hidden because Sandstorm itself provides them.
)
]
),
fileList = "sandstorm-files.list",
# `spk dev` will write a list of all the files your app uses to this file.
# You should review it later, before shipping your app.
alwaysInclude = [],
# Fill this list with more names of files or directories that should be
# included in your package, even if not listed in sandstorm-files.list.
# Use this to force-include stuff that you know you need but which may
# not have been detected as a dependency during `spk dev`. If you list
# a directory here, its entire contents will be included recursively.
#bridgeConfig = (
# # Used for integrating permissions and roles into the Sandstorm shell
# # and for sandstorm-http-bridge to pass to your app.
# # Uncomment this block and adjust the permissions and roles to make
# # sense for your app.
# # For more information, see high-level documentation at
# # https://docs.sandstorm.io/en/latest/developing/auth/
# # and advanced details in the "BridgeConfig" section of
# # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/package.capnp
# viewInfo = (
# # For details on the viewInfo field, consult "ViewInfo" in
# # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/grain.capnp
#
# permissions = [
# # Permissions which a user may or may not possess. A user's current
# # permissions are passed to the app as a comma-separated list of `name`
# # fields in the X-Sandstorm-Permissions header with each request.
# #
# # IMPORTANT: only ever append to this list! Reordering or removing fields
# # will change behavior and permissions for existing grains! To deprecate a
# # permission, or for more information, see "PermissionDef" in
# # https://github.com/sandstorm-io/sandstorm/blob/master/src/sandstorm/grain.capnp
# (
# name = "editor",
# # Name of the permission, used as an identifier for the permission in cases where string
# # names are preferred. Used in sandstorm-http-bridge's X-Sandstorm-Permissions HTTP header.
#
# title = (defaultText = "editor"),
# # Display name of the permission, e.g. to display in a checklist of permissions
# # that may be assigned when sharing.
#
# description = (defaultText = "grants ability to modify data"),
# # Prose describing what this role means, suitable for a tool tip or similar help text.
# ),
# ],
# roles = [
# # Roles are logical collections of permissions. For instance, your app may have
# # a "viewer" role and an "editor" role
# (
# title = (defaultText = "editor"),
# # Name of the role. Shown in the Sandstorm UI to indicate which users have which roles.
#
# permissions = [true],
# # An array indicating which permissions this role carries.
# # It should be the same length as the permissions array in
# # viewInfo, and the order of the lists must match.
#
# verbPhrase = (defaultText = "can make changes to the document"),
# # Brief explanatory text to show in the sharing UI indicating
# # what a user assigned this role will be able to do with the grain.
#
# description = (defaultText = "editors may view all site data and change settings."),
# # Prose describing what this role means, suitable for a tool tip or similar help text.
# ),
# (
# title = (defaultText = "viewer"),
# permissions = [false],
# verbPhrase = (defaultText = "can view the document"),
# description = (defaultText = "viewers may view what other users have written."),
# ),
# ],
# ),
# #apiPath = "/api",
# # Apps can export an API to the world. The API is to be used primarily by Javascript
# # code and native apps, so it can't serve out regular HTML to browsers. If a request
# # comes in to your app's API, sandstorm-http-bridge will prefix the request's path with
# # this string, if specified.
#),
);
const myCommand :Spk.Manifest.Command = (
# Here we define the command used to start up your server.
argv = ["/sandstorm-http-bridge", "8000", "--", "/opt/app/.sandstorm/launcher.sh"],
environ = [
# Note that this defines the *entire* environment seen by your app.
(key = "PATH", value = "/usr/local/bin:/usr/bin:/bin"),
(key = "SANDSTORM", value = "1"),
# Export SANDSTORM=1 into the environment, so that apps running within Sandstorm
# can detect if $SANDSTORM="1" at runtime, switching UI and/or backend to use
# the app's Sandstorm-specific integration code.
]
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

View File

@@ -0,0 +1,89 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
image/svg+xml svg svgz;
image/webp webp;
application/font-woff woff;
application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.apple.mpegurl m3u8;
application/vnd.ms-excel xls;
application/vnd.ms-fontobject eot;
application/vnd.ms-powerpoint ppt;
application/vnd.wap.wmlc wmlc;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/xspf+xml xspf;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp2t ts;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}

View File

@@ -0,0 +1,87 @@
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
# Basic Settings
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_names_hash_bucket_size 64;
server_tokens off;
server_name_in_redirect off;
include mime.types;
default_type application/octet-stream;
# Logging
access_log off;
error_log stderr;
# Prevent nginx from adding compression; this interacts badly with Sandstorm
# WebSession due to https://github.com/sandstorm-io/sandstorm/issues/289
gzip off;
# Trust the sandstorm-http-bridge's X-Forwarded-Proto.
map $http_x_forwarded_proto $fe_https {
default "";
https on;
}
server {
listen 8000 default_server;
listen [::]:8000 default_server ipv6only=on;
# Allow arbitrarily large bodies - Sandstorm can handle them, and requests
# are authenticated already, so there's no reason for apps to add additional
# limits by default.
client_max_body_size 0;
server_name localhost;
root /opt/app/public;
location / {
index index.php;
try_files $uri $uri/ /index.php?$query_string;
autoindex on;
sendfile off;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param HTTPS $fe_https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
#fastcgi_param REDIRECT_STATUS 200;
}
}
}

61
.sandstorm/setup.sh Executable file
View File

@@ -0,0 +1,61 @@
#!/bin/bash
# When you change this file, you must take manual action. Read this doc:
# - https://docs.sandstorm.io/en/latest/vagrant-spk/customizing/#setupsh
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
# install packages so we can install apt-add-repository.
apt-get update
apt-get install -y python-software-properties software-properties-common
# actually add repository
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E9C74FEEA2098A6E
add-apt-repository "deb http://packages.dotdeb.org jessie all"
# install packages.
apt-get update
apt-get install -y nginx php7.0-fpm php7.0-mysql php7.0-cli php7.0-curl git php7.0-dev php7.0-intl php7.0-dom php7.0-mbstring php7.0-bcmath mysql-server
service nginx stop
service php7.0-fpm stop
service mysql stop
systemctl disable nginx
systemctl disable php7.0-fpm
systemctl disable mysql
# patch /etc/php/7.0/fpm/pool.d/www.conf to not change uid/gid to www-data
sed --in-place='' \
--expression='s/^listen.owner = www-data/;listen.owner = www-data/' \
--expression='s/^listen.group = www-data/;listen.group = www-data/' \
/etc/php/7.0/fpm/pool.d/www.conf
# patch /etc/php/7.0/fpm/php-fpm.conf to not have a pidfile
sed --in-place='' \
--expression='s/^pid =/;pid =/' \
/etc/php/7.0/fpm/php-fpm.conf
# move sock file to better dir:
sed --in-place='' \
--expression='s/^listen = \/run\/php\/php7.0-fpm.sock/listen = \/var\/run\/php7.0-fpm.sock/' \
/etc/php/7.0/fpm/pool.d/www.conf
# patch /etc/php/7.0/fpm/pool.d/www.conf to no clear environment variables
# so we can pass in SANDSTORM=1 to apps
sed --in-place='' \
--expression='s/^;clear_env = no/clear_env=no/' \
/etc/php/7.0/fpm/pool.d/www.conf
# patch mysql conf to not change uid, and to use /var/tmp over /tmp
# for secure-file-priv see https://github.com/sandstorm-io/vagrant-spk/issues/195
sed --in-place='' \
--expression='s/^user\t\t= mysql/#user\t\t= mysql/' \
--expression='s,^tmpdir\t\t= /tmp,tmpdir\t\t= /var/tmp,' \
--expression='/\[mysqld]/ a\ secure-file-priv = ""\' \
/etc/mysql/my.cnf
# patch mysql conf to use smaller transaction logs to save disk space
cat <<EOF > /etc/mysql/conf.d/sandstorm.cnf
[mysqld]
# Set the transaction log file to the minimum allowed size to save disk space.
# innodb_log_file_size = 1048576
# Set the main data file to grow by 1MB at a time, rather than 8MB at a time.
innodb_autoextend_increment = 1
EOF

1
.sandstorm/stack Normal file
View File

@@ -0,0 +1 @@
lemp

View File

@@ -2,7 +2,50 @@
tools:
external_code_coverage: false
filter:
excluded_paths:
- app/Support/Migration/*
- app/database/migrations/*
- database/migrations/*
paths:
- app/*
- public/js/ff/*
excluded_paths:
- "database/migrations/*"
- "bootstrap/*"
- "config/*"
- "docker/*"
- "public/js/lib/*"
- "public/lib/adminlte/js/*"
- "public/lib/bootstrap/js/*"
- "resources/*"
- "routes/*"
- "storage/*"
checks:
php:
use_self_instead_of_fqcn: true
uppercase_constants: true
return_doc_comments: true
return_doc_comment_if_not_inferrable: true
remove_extra_empty_lines: true
parameter_doc_comments: true
optional_parameters_at_the_end: true
no_short_variable_names:
minimum: '3'
no_short_method_names:
minimum: '3'
no_long_variable_names:
maximum: '20'
no_goto: true
newline_at_end_of_file: true
encourage_single_quotes: true
avoid_todo_comments: true
avoid_perl_style_comments: true
avoid_fixme_comments: true
avoid_multiple_statements_on_same_line: true
align_assignments: true
duplication: false
javascript: true
coding_style:
php:
spaces:
around_operators:
concatenation: true
other:
after_type_cast: false

View File

@@ -1,18 +1,29 @@
language: php
sudo: false
php:
- '7.0'
- 7.0
- 7.1
cache:
directories:
- vendor
- $HOME/.composer/cache
install:
- phpenv config-rm xdebug.ini
- composer selfupdate
- if [[ "$(php -v | grep 'PHP 7')" ]]; then phpenv config-rm xdebug.ini; fi
- rm composer.lock
- composer update --no-scripts
- cp .env.testing .env
- php artisan clear-compiled
- php artisan optimize
- php artisan env
- ./test.sh -r
- php artisan env
- cp .env.testing .env
- mv storage/database/databasecopy.sqlite storage/database/database.sqlite
script:
- phpunit
- phpunit
# safelist
branches:
only:
- develop
- master

View File

@@ -2,6 +2,128 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [4.3.6] - 2017-02-20
### Fixed
- #578, reported by [xpfgsyb](https://github.com/xpfgsyb).
## [4.3.5] - 2017-02-19
### Added
- Beta support for Sandstorm.IO
- Docker support by [@schoentoon](https://github.com/schoentoon), [@elohmeier](https://github.com/elohmeier), [@patrickkostjens](https://github.com/patrickkostjens) and [@crash7](https://github.com/crash7)!
- Can now use special keywords in the search to search for specic dates, categories, etc.
### Changed
- Updated to laravel 5.4!
- User friendly error message
- Updated locales to support more operating systems, first reported in #536 by [dabenzel](https://github.com/dabenzel)
- Updated budget report
- Improved 404 page
- Smooth curves, improved by [elamperti](https://github.com/elamperti).
### Fixed
- #549
- #553
- Fixed #559 reported by [elamperti](https://github.com/elamperti).
- #565, as reported by a user over the mail
- #566, as reported by [dspeckmann](https://github.com/dspeckmann)
- #567, as reported by [winsomniak](https://github.com/winsomniak)
- #569, as reported by [winsomniak](https://github.com/winsomniak)
- #572, as reported by [zjean](https://github.com/zjean)
- Many issues with the transaction filters which will fix reports (they tended to display the wrong amount).
## [4.3.4] - 2017-02-02
### Fixed
- Fixed bug #550, reported by [worldworm](https://github.com/worldworm)!
- Fixed bug #551, reported by [t-me](https://github.com/t-me)!
## [4.3.3] - 2017-01-30
_The 100th release of Firefly!_
### Added
- Add locales to Docker (#534) by [elohmeier](https://github.com/elohmeier).
- Optional database encryption. On by default.
- Datepicker for Firefox and other browsers.
- New instruction block for updating and installing.
- Ability to clone transactions.
- Use multi-select Bootstrap thing instead of massive lists of checkboxes.
### Removed
- Lots of old Javascript
### Fixed
- Missing sort broke various charts
- Bug in reports that made amounts behave weird
- Various bug fixes
### Security
- Tested FF against the naughty string list.
## [4.3.2] - 2017-01-09
An intermediate release because something in the Twig and Twigbridge libraries is broken and I have to make sure it doesn't affect you guys. But some cool features were on their way so there's that oo.
### Added
- Some code for issue #475, consistent overviews.
- Better currency display. Make sure you have locale packages installed.
### Changed
- Uses a new version of Laravel.
### Fixed
- The password reset routine was broken.
- Issue #522, thanks to [xpfgsyb](https://github.com/xpfgsyb)
- Issue #524, thanks to [worldworm](https://github.com/worldworm)
- Issue #526, thanks to [worldworm](https://github.com/worldworm)
- Issue #528, thanks to [skibbipl](https://github.com/skibbipl)
- Various other fixes.
## [4.3.1] - 2017-01-04
### Added
- Support for Russian and Polish.
- Support for a proper demo website.
- Support for custom decimal places in currencies (#506, suggested by [xpfgsyb](https://github.com/xpfgsyb)).
- Most amounts are now right-aligned (#511, suggested by [xpfgsyb](https://github.com/xpfgsyb)).
- German is now a "complete" language, more than 75% translated!
### Changed
- **[New Github repository!](github.com/firefly-iii/firefly-iii)**
- Better category overview.
- #502, thanks to [zjean](https://github.com/zjean)
### Removed
- Removed a lot of administration functions.
- Removed ability to activate users.
### Fixed
- #501, thanks to [zjean](https://github.com/zjean)
- #513, thanks to [skibbipl](https://github.com/skibbipl)
### Security
- #519, thanks to [xpfgsyb](https://github.com/xpfgsyb)
## [4.3.0] - 2015-12-26
### Added
- New method of keeping track of available budget, see issue #489
- Support for Spanish
- Firefly III now has an extended demo mode. Will expand further in the future.
### Changed
- New favicon
- Import routine no longer gives transactions a description #483
### Removed
- All test data generation code.
### Fixed
- Removed import accounts from search results #478
- Redirect after delete will no longer go back to deleted item #477
- Cannot math #482
- Fixed bug in virtual balance field #479
## [4.2.2] - 2016-12-18
### Added
- New budget report (still a bit of a beta)
@@ -12,7 +134,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Various bugs
- Issue #472 thanks to @zjean
- Issue #472 thanks to [zjean](https://github.com/zjean)
## [4.2.1] - 2016-12-09
### Added
@@ -47,10 +169,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Issue #408
- Various issues with split journals
- Issue #414, thx @zjean
- Issue #419, thx @schwalberich
- Issue #422, thx @xzaz
- Various import bugs, such as #416 (@zjean)
- Issue #414, thx [zjean](https://github.com/zjean)
- Issue #419, thx [schwalberich](https://github.com/schwalberich)
- Issue #422, thx [xzaz](https://github.com/xzaz)
- Various import bugs, such as #416 ([zjean](https://github.com/zjean))
### Security
@@ -72,9 +194,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Made all pages more mobile friendly.
- Fixed #395 found by @marcoveeneman.
- Fixed #398 found by @marcoveeneman.
- Fixed #401 found by @marcoveeneman.
- Fixed #395 found by [marcoveeneman](https://github.com/marcoveeneman).
- Fixed #398 found by [marcoveeneman](https://github.com/marcoveeneman).
- Fixed #401 found by [marcoveeneman](https://github.com/marcoveeneman).
- Many optimizations.
- Updated many libraries.
- Various bugs found by myself.
@@ -86,13 +208,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- Greatly expanded help pages and their function.
- Built a new transaction collector, which I think was the idea of @roberthorlings originally.
- Built a new transaction collector, which I think was the idea of [roberthorlings](https://github.com/roberthorlings) originally.
- Rebuilt seach engine.
### Fixed
- #375, thanks to @schoentoon which made it impossible to resurrect currencies.
- #370 thanks to @ksmolder
- #378, thanks to @HomelessAvatar
- #375, thanks to [schoentoon](https://github.com/schoentoon) which made it impossible to resurrect currencies.
- #370 thanks to [ksmolder](https://github.com/ksmolder)
- #378, thanks to [HomelessAvatar](https://github.com/HomelessAvatar)
## [4.1.5] - 2016-11-01
### Changed
@@ -105,7 +227,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [4.1.4] - 2016-10-30
### Added
- New Dockerfile thanks to @schoentoon
- New Dockerfile thanks to [schoentoon](https://github.com/schoentoon)
- Added changing the destination account as rule action.
- Added changing the source account as rule action.
- Can convert transactions into different types.
@@ -118,10 +240,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Change error message to refer to solution.
### Fixed
- #367 thanks to @HungryFeline
- #366 thanks to @3mz3t
- #362 and #341 thanks to @bnw
- #355 thanks to @roberthorlings
- #367 thanks to [HungryFeline](https://github.com/HungryFeline)
- #366 thanks to [3mz3t](https://github.com/3mz3t)
- #362 and #341 thanks to [bnw](https://github.com/bnw)
- #355 thanks to [roberthorlings](https://github.com/roberthorlings)
## [4.1.3] - 2016-10-22
### Fixed
@@ -153,29 +275,29 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- #357, where non utf-8 files would break Firefly.
- Tab delimiter is not properly loaded from import configuration (@roberthorlings)
- Tab delimiter is not properly loaded from import configuration ([roberthorlings](https://github.com/roberthorlings))
- System response to yearly bills
## [4.0.2] - 2016-10-14
### Added
- Added ``intl`` dependency to composer file to ease installation (thanks @telyn)
- Added ``intl`` dependency to composer file to ease installation (thanks [telyn](https://github.com/telyn))
- Added support for Croatian.
### Changed
- Updated all copyright notices to refer to the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/)
- Fixed #344
- Fixed #346, thanks to @SanderKleykens
- Fixed #346, thanks to [SanderKleykens](https://github.com/SanderKleykens)
- #351
- Did some internal remodelling.
### Fixed
- PostgreSQL compatibility thanks to @SanderKleykens
- @RobertHorlings fixed a bug in the ABN Amro import specific.
- PostgreSQL compatibility thanks to [SanderKleykens](https://github.com/SanderKleykens)
- [roberthorlings](https://github.com/roberthorlings) fixed a bug in the ABN Amro import specific.
## [4.0.1] - 2016-10-04
### Added
- New ING import specific by @tomwerf
- New ING import specific by [tomwerf](https://github.com/tomwerf)
- New Presidents Choice specific to fix #307
- Added some trimming (#335)
@@ -190,10 +312,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Fixed a bug where incoming transactions would not be properly filtered in several reports.
- #334 by @cyberkov
- #334 by [cyberkov](https://github.com/cyberkov)
- #337
- #336
- #338 found by @roberthorlings
- #338 found by [roberthorlings](https://github.com/roberthorlings)
### Security
- Initial release.
@@ -204,29 +326,29 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [4.0.0] - 2015-09-26
### Added
- Upgraded to Laravel 5.3, most other libraries upgraded as well.
- Added GBP as currency, thanks to @Mortalife
- Added GBP as currency, thanks to [Mortalife](https://github.com/Mortalife)
### Changed
- Jump to version 4.0.0.
- Firefly III is now subject to a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/) license. Previous versions of this software are still MIT licensed.
### Fixed
- Support for specific decimal places, thanks to @Mortalife
- Support for specific decimal places, thanks to [Mortalife](https://github.com/Mortalife)
- Various CSS fixes
- Various bugs, thanks to @fuf, @sandermulders and @vissert
- Various bugs, thanks to [fuf](https://github.com/fuf), [sandermulders](https://github.com/sandermulders) and [vissert](https://github.com/vissert)
- Various queries optimized for MySQL 5.7
## [3.10.4] - 2015-09-14
### Fixed
- Migration fix by @sandermulders
- Tricky import bug fix thanks to @vissert
- Currency preference will be correctly pulled from user settings, thanks to @fuf
- Migration fix by [sandermulders](https://github.com/sandermulders)
- Tricky import bug fix thanks to [vissert](https://github.com/vissert)
- Currency preference will be correctly pulled from user settings, thanks to [fuf](https://github.com/fuf)
- Simplified code for upgrade instructions.
## [3.10.3] - 2016-08-29
### Added
- More fields for mass-edit, thanks to @Vissert (#282)
- More fields for mass-edit, thanks to [vissert](https://github.com/vissert) (#282)
- First start of German translation
### Changed
@@ -237,7 +359,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- A bug in the translation routine broke the import.
- It was possible to destroy your Firefly installation by removing all currencies. Thanks @mondjef
- It was possible to destroy your Firefly installation by removing all currencies. Thanks [mondjef](https://github.com/mondjef)
- Translation bugs.
- Import bug.
@@ -257,8 +379,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Bug in the mass edit routines.
- Firefly III over a proxy will now work (see [issue #290](https://github.com/JC5/firefly-iii/issues/290)), thanks @dfiel for reporting.
- Sneaky bug in the import routine, fixed by @Bonno
- Firefly III over a proxy will now work (see [issue #290](https://github.com/firefly-iii/firefly-iii/issues/290)), thanks [dfiel](https://github.com/dfiel) for reporting.
- Sneaky bug in the import routine, fixed by [Bonno](https://github.com/Bonno)
## [3.10.1] - 2016-08-25
### Added
@@ -278,7 +400,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Fixed a bug where a migration would check an empty table name.
- Fixed various bugs in the import routine.
- Fixed various bugs in the piggy banks pages.
- Fixed a bug in the ``firefly:verify`` routine
- Fixed a bug in the `firefly:verify` routine
## [3.10] - 2015-05-25
### Added
@@ -296,25 +418,25 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Issue #264
- Issue #265
- Fixed amount calculation problems, #266, thanks @xzaz
- Fixed amount calculation problems, #266, thanks [xzaz](https://github.com/xzaz)
- Issue #271
- Issue #278, #273, thanks @StevenReitsma and @rubella
- Issue #278, #273, thanks [StevenReitsma](https://github.com/StevenReitsma) and [rubella](https://github.com/rubella)
- Bug in attachment download routine would report the wrong size to the user's browser.
- Various NULL errors fixed.
- Various strict typing errors fixed.
- Fixed pagination problems, #276, thanks @xzaz
- Fixed pagination problems, #276, thanks [xzaz](https://github.com/xzaz)
- Fixed a bug where an expense would be assigned to a piggy bank if you created a transfer first.
- Bulk update problems, #280, thanks @stickgrinder
- Bulk update problems, #280, thanks [stickgrinder](https://github.com/stickgrinder)
- Fixed various problems with amount reporting of split transactions.
[3.9.1]
## [3.9.1]
### Fixed
- Fixed a bug where removing money from a piggy bank would not work. See issue #265 and #269
[3.9.0]
## [3.9.0]
### Added
- @zjean has added code that allows you to force "https://"-URL's.
- @tonicospinelli has added Portuguese (Brazil) translations.
- [zjean](https://github.com/zjean) has added code that allows you to force "https://"-URL's.
- [tonicospinelli](https://github.com/tonicospinelli) has added Portuguese (Brazil) translations.
- Firefly III supports the *splitting* of transactions:
- A withdrawal (expense) can be split into multiple sub-transactions (with multiple destinations)
- Likewise for deposits (incomes). You can set multiple sources.
@@ -345,7 +467,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
- Several CSV related bugs.
- Several other bugs.
- Bugs fixed by @Bonno.
- Bugs fixed by [Bonno](https://github.com/Bonno).
## [3.8.3] - 2016-04-17
### Added
@@ -392,7 +514,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Two factor authentication, thanks to the excellent work of [zjean](https://github.com/zjean).
- A new chart showing your net worth in year and multi-year reports.
- You can now see if your current or future rules actually match any transactions, thanks to the excellent work of @roberthorlings.
- You can now see if your current or future rules actually match any transactions, thanks to the excellent work of [roberthorlings](https://github.com/roberthorlings).
- New date fields for transactions. They are not used yet in reports or anything, but they can be filled in.
- New routine to export your data.
- Firefly III will mail the site owner when blocked users try to login, or when blocked domains are used in registrations.

View File

@@ -11,12 +11,17 @@ RUN apt-get update -y && \
libtidy-dev \
libxml2-dev \
libsqlite3-dev \
libbz2-dev && \
libbz2-dev \
gettext-base \
locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install -j$(nproc) curl gd intl json mcrypt readline tidy zip bcmath xml mbstring pdo_sqlite pdo_mysql bz2
# Generate locales supported by firefly
RUN echo "en_US.UTF-8 UTF-8\nde_DE.UTF-8 UTF-8\nnl_NL.UTF-8 UTF-8\npt_BR.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
# Enable apache mod rewrite..
RUN a2enmod rewrite
@@ -40,3 +45,5 @@ WORKDIR /var/www/firefly-iii
RUN composer install --no-scripts --no-dev
USER root
ENTRYPOINT ["/var/www/firefly-iii/docker/entrypoint.sh"]

View File

@@ -1,17 +1,17 @@
# Firefly III [![Requires PHP7](https://img.shields.io/badge/php-7.0-red.svg)](https://secure.php.net/downloads.php#v7.0.4) [![Latest Stable Version](https://poser.pugx.org/grumpydictator/firefly-iii/v/stable)](https://packagist.org/packages/grumpydictator/firefly-iii) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/JC5/firefly-iii/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/JC5/firefly-iii/?branch=master)
# Firefly III: A personal finances manager
[![Build Status](https://travis-ci.org/JC5/firefly-iii.svg?branch=master)](https://travis-ci.org/JC5/firefly-iii)
## A personal finances manager
[![Requires PHP7](https://img.shields.io/badge/php-7.0-red.svg)](https://secure.php.net/downloads.php#v7.0.4) [![Latest Stable Version](https://poser.pugx.org/grumpydictator/firefly-iii/v/stable)](https://packagist.org/packages/grumpydictator/firefly-iii) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/firefly-iii/firefly-iii/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/firefly-iii/firefly-iii/?branch=master) [![Build Status](https://travis-ci.org/firefly-iii/firefly-iii.svg?branch=master)](https://travis-ci.org/firefly-iii/firefly-iii) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=44UKUT455HUFA)
[![The index of Firefly III](https://i.nder.be/hurdhgyg/400)](https://i.nder.be/h2b37243) [![The account overview of Firefly III](https://i.nder.be/hnkfkdpr/400)](https://i.nder.be/hv70pbwc)
[![The useful financial reports of Firefly III](https://i.nder.be/h7sk6nb7/400)](https://i.nder.be/ccn0u2mp) [![Even more useful reports in Firefly III](https://i.nder.be/g237hr35/400)](https://i.nder.be/gm8hbh7z)
_(You can click on the images for a better view)_
"Firefly III" is a financial manager. It can help you keep track of expenses, income, budgets and everything in between. It even supports credit cards, shared household accounts and savings accounts! It's pretty fancy. You should use it to save and organise money.
## Try it out!
Try out Firefly III on the [demo site](https://firefly-iii.nder.be/).
## Installation
To install Firefly III, you'll need a web server (preferrably on Linux) and access to the command line. Then, please read the [installation guide](https://firefly-iii.github.io/installation-guide/).
@@ -26,9 +26,11 @@ Firefly works on the principle that if you know where you're money is going, you
- Firefly can import any CSV file, so migrating from other systems is easy.
- Firefly runs on your own server, so you are fully in control of your data. Remember, there is no such thing as "the cloud", its just somebody elses computer!
- Firefly has lots of features without becoming fancy or bloated.
- Firefly has lots of features without being fancy or bloated.
- If you feel you're missing something you can just ask me and I'll add it!
Firefly is pretty awesome. [You can read more about Firefly III, and its features, on the Github Pages](https://firefly-iii.github.io/).
If you like Firefly and if it helps you save lots of money, why not send me [a dime for every dollar saved](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=44UKUT455HUFA) (this is a joke, although the Paypal form works just fine, try it!)
If you want to contact me, please open an issue or [email me](mailto:thegrumpydictator@gmail.com).

View File

@@ -50,11 +50,10 @@ class CreateImport extends Command
}
/**
*
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) // cannot be helped
*/
public function handle()
{
// find the file
/** @var UserRepositoryInterface $userRepository */
$userRepository = app(UserRepositoryInterface::class);
$file = $this->argument('file');
@@ -67,7 +66,6 @@ class CreateImport extends Command
return;
}
// try to parse configuration data:
$configurationData = json_decode(file_get_contents($configuration));
if (is_null($configurationData)) {
$this->error(sprintf('Firefly III cannot read the contents of configuration file "%s" (working directory: "%s").', $configuration, $cwd));
@@ -81,22 +79,19 @@ class CreateImport extends Command
$this->info(sprintf('Type of import: %s', $type));
/** @var ImportJobRepositoryInterface $jobRepository */
$jobRepository = app(ImportJobRepositoryInterface::class, [$user]);
$jobRepository = app(ImportJobRepositoryInterface::class);
$jobRepository->setUser($user);
$job = $jobRepository->create($type);
$this->line(sprintf('Created job "%s"...', $job->key));
// put the file in the proper place:
Artisan::call('firefly:encrypt', ['file' => $file, 'key' => $job->key]);
$this->line('Stored import data...');
// store the configuration in the job:
$job->configuration = $configurationData;
$job->status = 'settings_complete';
$job->save();
$this->line('Stored configuration...');
// if user wants to run it, do!
if ($this->option('start') === true) {
$this->line('The import will start in a moment. This process is not visible...');
Log::debug('Go for import!');
@@ -109,10 +104,10 @@ class CreateImport extends Command
/**
* @return bool
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five exactly.
*/
private function validArguments(): bool
{
// find the file
/** @var UserRepositoryInterface $userRepository */
$userRepository = app(UserRepositoryInterface::class);
$file = $this->argument('file');

View File

@@ -35,7 +35,7 @@ class EncryptFile extends Command
*
* @var string
*/
protected $signature = 'firefly:encrypt {file} {key}';
protected $signature = 'firefly:encrypt-file {file} {key}';
/**
* Create a new command instance.

View File

@@ -18,6 +18,7 @@ use FireflyIII\Import\Logging\CommandHandler;
use FireflyIII\Models\ImportJob;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
use Log;
/**
@@ -69,32 +70,15 @@ class Import extends Command
$monolog = Log::getMonolog();
$handler = new CommandHandler($this);
$monolog->pushHandler($handler);
$importProcedure = new ImportProcedure;
$result = $importProcedure->runImport($job);
$result = ImportProcedure::runImport($job);
/**
* @var int $index
* @var TransactionJournal $journal
*/
foreach ($result as $index => $journal) {
if (!is_null($journal->id)) {
$this->line(sprintf('Line #%d has been imported as transaction #%d.', $index, $journal->id));
continue;
}
$this->error(sprintf('Could not store line #%d', $index));
}
// display result to user:
$this->presentResults($result);
$this->line('The import has completed.');
// get any errors from the importer:
$extendedStatus = $job->extended_status;
if (isset($extendedStatus['errors']) && count($extendedStatus['errors']) > 0) {
$this->line(sprintf('The following %d error(s) occured during the import:', count($extendedStatus['errors'])));
foreach ($extendedStatus['errors'] as $error) {
$this->error($error);
}
}
$this->presentErrors($job);
return;
}
@@ -120,4 +104,36 @@ class Import extends Command
return true;
}
/**
* @param ImportJob $job
*/
private function presentErrors(ImportJob $job)
{
$extendedStatus = $job->extended_status;
if (isset($extendedStatus['errors']) && count($extendedStatus['errors']) > 0) {
$this->line(sprintf('The following %d error(s) occured during the import:', count($extendedStatus['errors'])));
foreach ($extendedStatus['errors'] as $error) {
$this->error($error);
}
}
}
/**
* @param Collection $result
*/
private function presentResults(Collection $result)
{
/**
* @var int $index
* @var TransactionJournal $journal
*/
foreach ($result as $index => $journal) {
if (!is_null($journal->id)) {
$this->line(sprintf('Line #%d has been imported as transaction #%d.', $index, $journal->id));
continue;
}
$this->error(sprintf('Could not store line #%d', $index));
}
}
}

View File

@@ -1,86 +0,0 @@
<?php
/**
* MoveRepository.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Console\Commands;
use Carbon\Carbon;
use Illuminate\Console\Command;
/**
* Class MoveRepository
*
* @package FireflyIII\Console\Commands
*/
class MoveRepository extends Command
{
/**
* The console command description.
*
* @var string
*/
protected $description = 'Alerts the user that the Github repository will move, if they are interested to know this.';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly:github-move';
/**
* Create a new command instance.
*
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
$moveDate = new Carbon('2017-01-01');
$final = new Carbon('2017-03-01');
$now = new Carbon;
// display message before 2017-01-01
if ($moveDate > $now) {
$this->line('+------------------------------------------------------------------------------+');
$this->line('');
$this->line('The Github repository for Firefly III will MOVE');
$this->line('This move will be on January 1st 2017');
$this->line('');
$this->error('READ THIS WIKI PAGE FOR MORE INFORMATION');
$this->line('');
$this->info('https://github.com/firefly-iii/help/wiki/New-Github-repository');
$this->line('');
$this->line('+------------------------------------------------------------------------------+');
}
// display message after 2017-01-01 but before 2017-03-01
if ($moveDate <= $now && $now <= $final) {
$this->line('+------------------------------------------------------------------------------+');
$this->line('');
$this->line('The Github repository for Firefly III has MOVED');
$this->line('This move was on January 1st 2017!');
$this->line('');
$this->error('READ THIS WIKI PAGE FOR MORE INFORMATION');
$this->line('');
$this->info('https://github.com/firefly-iii/help/wiki/New-Github-repository');
$this->line('');
$this->line('+------------------------------------------------------------------------------+');
}
}
}

View File

@@ -60,42 +60,26 @@ class ScanAttachments extends Command
/** @var Attachment $attachment */
foreach ($attachments as $attachment) {
$fileName = $attachment->fileName();
// try to grab file content:
try {
$content = $disk->get($fileName);
} catch (FileNotFoundException $e) {
$this->error(sprintf('Could not find data for attachment #%d', $attachment->id));
continue;
}
// try to decrypt content.
try {
$decrypted = Crypt::decrypt($content);
} catch (DecryptException $e) {
$this->error(sprintf('Could not decrypt data of attachment #%d', $attachment->id));
continue;
}
// make temp file:
$tmpfname = tempnam(sys_get_temp_dir(), 'FireflyIII');
// store content in temp file:
file_put_contents($tmpfname, $decrypted);
// get md5 and mime
$md5 = md5_file($tmpfname);
$mime = mime_content_type($tmpfname);
// update attachment:
$md5 = md5_file($tmpfname);
$mime = mime_content_type($tmpfname);
$attachment->md5 = $md5;
$attachment->mime = $mime;
$attachment->save();
$this->line(sprintf('Fixed attachment #%d', $attachment->id));
// find file:
}
}
}

View File

@@ -15,6 +15,8 @@ namespace FireflyIII\Console\Commands;
use DB;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionJournal;
use Illuminate\Console\Command;
@@ -57,8 +59,29 @@ class UpgradeDatabase extends Command
public function handle()
{
$this->setTransactionIdentifier();
$this->migrateRepetitions();
}
private function migrateRepetitions()
{
if (!Schema::hasTable('budget_limits')) {
return;
}
// get all budget limits with end_date NULL
$set = BudgetLimit::whereNull('end_date')->get();
$this->line(sprintf('Found %d budget limit(s) to update', $set->count()));
/** @var BudgetLimit $budgetLimit */
foreach ($set as $budgetLimit) {
// get limit repetition (should be just one):
/** @var LimitRepetition $repetition */
$repetition = $budgetLimit->limitrepetitions()->first();
if (!is_null($repetition)) {
$budgetLimit->end_date = $repetition->enddate;
$budgetLimit->save();
$this->line(sprintf('Updated budget limit #%d', $budgetLimit->id));
$repetition->delete();
}
}
}
/**
@@ -85,42 +108,52 @@ class UpgradeDatabase extends Command
$journalIds = array_unique($result->pluck('id')->toArray());
foreach ($journalIds as $journalId) {
// grab all positive transactiosn from this journal that are not deleted.
// for each one, grab the negative opposing one which has 0 as an identifier and give it the same identifier.
$identifier = 0;
$processed = [];
$transactions = Transaction::where('transaction_journal_id', $journalId)->where('amount', '>', 0)->get();
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
// find opposing:
$amount = bcmul(strval($transaction->amount), '-1');
$this->updateJournal(intval($journalId));
}
}
try {
/** @var Transaction $opposing */
$opposing = Transaction::where('transaction_journal_id', $journalId)
->where('amount', $amount)->where('identifier', '=', 0)
->whereNotIn('id', $processed)
->first();
} catch (QueryException $e) {
Log::error($e->getMessage());
$this->error('Firefly III could not find the "identifier" field in the "transactions" table.');
$this->error(sprintf('This field is required for Firefly III version %s to run.', config('firefly.version')));
$this->error('Please run "php artisan migrate" to add this field to the table.');
$this->info('Then, run "php artisan firefly:upgrade-database" to try again.');
break 2;
}
if (!is_null($opposing)) {
// give both a new identifier:
$transaction->identifier = $identifier;
$transaction->save();
$opposing->identifier = $identifier;
$opposing->save();
$processed[] = $transaction->id;
$processed[] = $opposing->id;
$this->line(sprintf('Database upgrade for journal #%d, transactions #%d and #%d', $journalId, $transaction->id, $opposing->id));
}
$identifier++;
/**
* grab all positive transactiosn from this journal that are not deleted. for each one, grab the negative opposing one
* which has 0 as an identifier and give it the same identifier.
*
* @param int $journalId
*/
private function updateJournal(int $journalId)
{
$identifier = 0;
$processed = [];
$transactions = Transaction::where('transaction_journal_id', $journalId)->where('amount', '>', 0)->get();
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
// find opposing:
$amount = bcmul(strval($transaction->amount), '-1');
try {
/** @var Transaction $opposing */
$opposing = Transaction::where('transaction_journal_id', $journalId)
->where('amount', $amount)->where('identifier', '=', 0)
->whereNotIn('id', $processed)
->first();
} catch (QueryException $e) {
Log::error($e->getMessage());
$this->error('Firefly III could not find the "identifier" field in the "transactions" table.');
$this->error(sprintf('This field is required for Firefly III version %s to run.', config('firefly.version')));
$this->error('Please run "php artisan migrate" to add this field to the table.');
$this->info('Then, run "php artisan firefly:upgrade-database" to try again.');
return;
}
if (!is_null($opposing)) {
// give both a new identifier:
$transaction->identifier = $identifier;
$transaction->save();
$opposing->identifier = $identifier;
$opposing->save();
$processed[] = $transaction->id;
$processed[] = $opposing->id;
$this->line(sprintf('Database upgrade for journal #%d, transactions #%d and #%d', $journalId, $transaction->id, $opposing->id));
}
$identifier++;
}
}
}

View File

@@ -33,7 +33,7 @@ class UpgradeFireflyInstructions extends Command
*
* @var string
*/
protected $signature = 'firefly:upgrade-instructions';
protected $signature = 'firefly:instructions {task}';
/**
* Create a new command instance.
@@ -49,11 +49,47 @@ class UpgradeFireflyInstructions extends Command
*/
public function handle()
{
//
if ($this->argument('task') == 'update') {
$this->updateInstructions();
}
if ($this->argument('task') == 'install') {
$this->installInstructions();
}
}
/**
* Show a nice box
*
* @param string $text
*/
private function boxed(string $text)
{
$parts = explode("\n", wordwrap($text));
foreach ($parts as $string) {
$this->line('| ' . sprintf('%-77s', $string) . '|');
}
}
/**
* Show a nice info box
*
* @param string $text
*/
private function boxedInfo(string $text)
{
$parts = explode("\n", wordwrap($text));
foreach ($parts as $string) {
$this->info('| ' . sprintf('%-77s', $string) . '|');
}
}
private function installInstructions()
{
/** @var string $version */
$version = config('firefly.version');
$config = config('upgrade.text');
$text = null;
$config = config('upgrade.text.install');
$text = '';
foreach (array_keys($config) as $compare) {
// if string starts with:
$len = strlen($compare);
@@ -62,21 +98,69 @@ class UpgradeFireflyInstructions extends Command
}
}
$this->showLine();
$this->boxed('');
if (is_null($text)) {
$this->line(sprintf('Thank you for installing Firefly III, v%s', $version));
$this->info('There are no extra upgrade instructions.');
$this->line('Firefly III should be ready for use.');
} else {
$this->line('+------------------------------------------------------------------------------+');
$this->line('');
$this->line(sprintf('Thank you for installing Firefly III, v%s', $version));
$this->info(wordwrap($text));
$this->line('');
$this->line('+------------------------------------------------------------------------------+');
$this->boxed(sprintf('Thank you for installin Firefly III, v%s!', $version));
$this->boxedInfo('There are no extra installation instructions.');
$this->boxed('Firefly III should be ready for use.');
$this->boxed('');
$this->showLine();
return;
}
$this->boxed(sprintf('Thank you for installing Firefly III, v%s!', $version));
$this->boxedInfo($text);
$this->boxed('');
$this->showLine();
}
/**
* Show a line
*/
private function showLine()
{
$line = '+';
for ($i = 0; $i < 78; $i++) {
$line .= '-';
}
$line .= '+';
$this->line($line);
}
private function updateInstructions()
{
/** @var string $version */
$version = config('firefly.version');
$config = config('upgrade.text.upgrade');
$text = '';
foreach (array_keys($config) as $compare) {
// if string starts with:
$len = strlen($compare);
if (substr($version, 0, $len) === $compare) {
$text = $config[$compare];
}
}
$this->showLine();
$this->boxed('');
if (is_null($text)) {
$this->boxed(sprintf('Thank you for updating to Firefly III, v%s', $version));
$this->boxedInfo('There are no extra upgrade instructions.');
$this->boxed('Firefly III should be ready for use.');
$this->boxed('');
$this->showLine();
return;
}
$this->boxed(sprintf('Thank you for updating to Firefly III, v%s!', $version));
$this->boxedInfo($text);
$this->boxed('');
$this->showLine();
}
}

View File

@@ -0,0 +1,66 @@
<?php
namespace FireflyIII\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
class UseEncryption extends Command
{
/**
* The console command description.
*
* @var string
*/
protected $description = 'This command will make sure that entries in the database will be encrypted (or not) according to the settings in .env';
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly:use-encryption';
/**
* Create a new command instance.
*
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*/
public function handle()
{
//
$this->handleObjects('Account', 'name', 'encrypted');
$this->handleObjects('Bill', 'name', 'name_encrypted');
$this->handleObjects('Bill', 'match', 'match_encrypted');
$this->handleObjects('Budget', 'name', 'encrypted');
$this->handleObjects('Category', 'name', 'encrypted');
$this->handleObjects('PiggyBank', 'name', 'encrypted');
$this->handleObjects('TransactionJournal', 'description', 'encrypted');
}
/**
* @param string $class
* @param string $field
* @param string $indicator
*/
public function handleObjects(string $class, string $field, string $indicator)
{
$fqn = sprintf('FireflyIII\Models\%s', $class);
$encrypt = config('firefly.encryption') ? 0 : 1;
$set = $fqn::where($indicator, $encrypt)->get();
foreach ($set as $entry) {
$newName = $entry->$field;
$entry->$field = $newName;
$entry->save();
}
$this->line(sprintf('Updated %d %s.', $set->count(), strtolower(Str::plural($class))));
}
}

View File

@@ -124,16 +124,15 @@ class VerifyDatabase extends Command
{
$set = Budget::leftJoin('budget_limits', 'budget_limits.budget_id', '=', 'budgets.id')
->leftJoin('users', 'budgets.user_id', '=', 'users.id')
->groupBy(['budgets.id', 'budgets.name', 'budgets.user_id', 'users.email'])
->groupBy(['budgets.id', 'budgets.name', 'budgets.encrypted', 'budgets.user_id', 'users.email'])
->whereNull('budget_limits.id')
->get(['budgets.id', 'budgets.name', 'budgets.user_id', 'users.email']);
->get(['budgets.id', 'budgets.name', 'budgets.user_id', 'budgets.encrypted', 'users.email']);
/** @var stdClass $entry */
/** @var Budget $entry */
foreach ($set as $entry) {
$line = sprintf(
'Notice: User #%d (%s) has budget #%d ("%s") which has no budget limits.',
$entry->user_id, $entry->email, $entry->id, Crypt::decrypt($entry->name)
$entry->user_id, $entry->email, $entry->id, $entry->name
);
$this->line($line);
}
@@ -174,10 +173,8 @@ class VerifyDatabase extends Command
$configuration = [
// a withdrawal can not have revenue account:
TransactionType::WITHDRAWAL => [AccountType::REVENUE],
// deposit cannot have an expense account:
TransactionType::DEPOSIT => [AccountType::EXPENSE],
// transfer cannot have either:
TransactionType::TRANSFER => [AccountType::EXPENSE, AccountType::REVENUE],
];

20
app/Console/Kernel.php Executable file → Normal file
View File

@@ -16,12 +16,11 @@ namespace FireflyIII\Console;
use FireflyIII\Console\Commands\CreateImport;
use FireflyIII\Console\Commands\EncryptFile;
use FireflyIII\Console\Commands\Import;
use FireflyIII\Console\Commands\MoveRepository;
use FireflyIII\Console\Commands\ScanAttachments;
use FireflyIII\Console\Commands\UpgradeDatabase;
use FireflyIII\Console\Commands\UpgradeFireflyInstructions;
use FireflyIII\Console\Commands\UseEncryption;
use FireflyIII\Console\Commands\VerifyDatabase;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
/**
@@ -40,9 +39,9 @@ class Kernel extends ConsoleKernel
*/
protected $bootstrappers
= [
'Illuminate\Foundation\Bootstrap\DetectEnvironment',
'Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables',
'Illuminate\Foundation\Bootstrap\LoadConfiguration',
'FireflyIII\Bootstrap\ConfigureLogging',
//'FireflyIII\Bootstrap\ConfigureLogging',
'Illuminate\Foundation\Bootstrap\HandleExceptions',
'Illuminate\Foundation\Bootstrap\RegisterFacades',
'Illuminate\Foundation\Bootstrap\SetRequestForConsole',
@@ -64,7 +63,7 @@ class Kernel extends ConsoleKernel
EncryptFile::class,
ScanAttachments::class,
UpgradeDatabase::class,
MoveRepository::class,
UseEncryption::class,
];
/**
@@ -76,15 +75,4 @@ class Kernel extends ConsoleKernel
{
require base_path('routes/console.php');
}
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
*
* @return void
*/
protected function schedule(Schedule $schedule)
{
}
}

View File

@@ -1,41 +0,0 @@
<?php
/**
* BlockedBadLogin.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Events;
use Illuminate\Queue\SerializesModels;
/**
* Class LockedOutUser
*
* @package FireflyIII\Events
*/
class BlockedBadLogin extends Event
{
use SerializesModels;
public $email;
public $ipAddress;
/**
* Create a new event instance. This event is triggered when a user gets themselves locked out.
*
* @param string $email
* @param string $ipAddress
*/
public function __construct(string $email, string $ipAddress)
{
$this->email = $email;
$this->ipAddress = $ipAddress;
}
}

View File

@@ -1,42 +0,0 @@
<?php
/**
* BlockedUseOfDomain.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Events;
use Illuminate\Queue\SerializesModels;
/**
* Class BlockedUseOfDomain
*
* @package FireflyIII\Events
*/
class BlockedUseOfDomain extends Event
{
use SerializesModels;
public $email;
public $ipAddress;
/**
* Create a new event instance. This event is triggered when a user tries to register with a banned domain (on blocked domain list).
*
* @param string $email
* @param string $ipAddress
*/
public function __construct(string $email, string $ipAddress)
{
$this->email = $email;
$this->ipAddress = $ipAddress;
}
}

View File

@@ -1,42 +0,0 @@
<?php
/**
* BlockedUseOfEmail.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Events;
use Illuminate\Queue\SerializesModels;
/**
* Class BlockedUseOfEmail
*
* @package FireflyIII\Events
*/
class BlockedUseOfEmail extends Event
{
use SerializesModels;
public $email;
public $ipAddress;
/**
* Create a new event instance. This event is triggered when a user tries to register with a banned email address (already used before).
*
* @param string $email
* @param string $ipAddress
*/
public function __construct(string $email, string $ipAddress)
{
$this->email = $email;
$this->ipAddress = $ipAddress;
}
}

View File

@@ -1,42 +0,0 @@
<?php
/**
* BlockedUserLogin.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Events;
use FireflyIII\User;
use Illuminate\Queue\SerializesModels;
/**
* Class BlockedUserLogin
*
* @package FireflyIII\Events
*/
class BlockedUserLogin extends Event
{
use SerializesModels;
public $ipAddress;
public $user;
/**
* Create a new event instance. This event is triggered when a blocked user logs in.
*
* @param User $user
* @param string $ipAddress
*/
public function __construct(User $user, string $ipAddress)
{
$this->user = $user;
$this->ipAddress = $ipAddress;
}
}

View File

@@ -1,42 +0,0 @@
<?php
/**
* ConfirmedUser.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Events;
use FireflyIII\User;
use Illuminate\Queue\SerializesModels;
/**
* Class ConfirmedUser
*
* @package FireflyIII\Events
*/
class ConfirmedUser extends Event
{
use SerializesModels;
public $ipAddress;
public $user;
/**
* Create a new event instance. This event is triggered when a user confirms their new account.
*
* @param User $user
* @param string $ipAddress
*/
public function __construct(User $user, string $ipAddress)
{
$this->user = $user;
$this->ipAddress = $ipAddress;
}
}

View File

@@ -1,38 +0,0 @@
<?php
/**
* DeletedUser.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Events;
use Illuminate\Queue\SerializesModels;
/**
* Class DeletedUser
*
* @package FireflyIII\Events
*/
class DeletedUser extends Event
{
use SerializesModels;
public $email;
/**
* Create a new event instance. This event is triggered when a user deletes themselves.
*
* @param string $email
*/
public function __construct(string $email)
{
$this->email = $email;
}
}

View File

@@ -1,41 +0,0 @@
<?php
/**
* LockedOutUser.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Events;
use Illuminate\Queue\SerializesModels;
/**
* Class LockedOutUser
*
* @package FireflyIII\Events
*/
class LockedOutUser extends Event
{
use SerializesModels;
public $email;
public $ipAddress;
/**
* Create a new event instance. This event is triggered when a user gets themselves locked out.
*
* @param string $email
* @param string $ipAddress
*/
public function __construct(string $email, string $ipAddress)
{
$this->email = $email;
$this->ipAddress = $ipAddress;
}
}

View File

@@ -43,4 +43,4 @@ class RequestedNewPassword extends Event
$this->ipAddress = $ipAddress;
}
}
}

View File

@@ -1,42 +0,0 @@
<?php
/**
* ResentConfirmation.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Events;
use FireflyIII\User;
use Illuminate\Queue\SerializesModels;
/**
* Class ResentConfirmation
*
* @package FireflyIII\Events
*/
class ResentConfirmation extends Event
{
use SerializesModels;
public $ipAddress;
public $user;
/**
* Create a new event instance. This event is triggered when a users wants a new confirmation.
*
* @param User $user
* @param string $ipAddress
*/
public function __construct(User $user, string $ipAddress)
{
$this->user = $user;
$this->ipAddress = $ipAddress;
}
}

View File

@@ -1,50 +0,0 @@
<?php
/**
* StoredBudgetLimit.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Events;
use Carbon\Carbon;
use FireflyIII\Models\BudgetLimit;
use Illuminate\Queue\SerializesModels;
/**
* Class StoredBudgetLimit
*
* @package FireflyIII\Events
*/
class StoredBudgetLimit extends Event
{
use SerializesModels;
/** @var BudgetLimit */
public $budgetLimit;
/** @var Carbon */
public $end; // the only variable we can't get from the budget limit (if necessary).
/**
* BudgetLimitEvents constructor.
*
* @param BudgetLimit $budgetLimit
* @param Carbon $end
*/
public function __construct(BudgetLimit $budgetLimit, Carbon $end)
{
//
$this->budgetLimit = $budgetLimit;
$this->end = $end;
}
}

View File

@@ -1,50 +0,0 @@
<?php
/**
* UpdatedBudgetLimit.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Events;
use Carbon\Carbon;
use FireflyIII\Models\BudgetLimit;
use Illuminate\Queue\SerializesModels;
/**
* Class UpdatedBudgetLimit
*
* @package FireflyIII\Events
*/
class UpdatedBudgetLimit extends Event
{
use SerializesModels;
/** @var BudgetLimit */
public $budgetLimit;
/** @var Carbon */
public $end; // the only variable we can't get from the budget limit (if necessary).
/**
* BudgetLimitEvents constructor.
*
* @param BudgetLimit $budgetLimit
* @param Carbon $end
*/
public function __construct(BudgetLimit $budgetLimit, Carbon $end)
{
//
$this->budgetLimit = $budgetLimit;
$this->end = $end;
}
}

10
app/Exceptions/Handler.php Executable file → Normal file
View File

@@ -21,6 +21,7 @@ use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Validation\ValidationException as ValException;
use Request;
use Symfony\Component\HttpKernel\Exception\HttpException;
/**
@@ -72,6 +73,7 @@ class Handler extends ExceptionHandler
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param Exception $exception
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five.
*
* @return void
*/
@@ -98,8 +100,8 @@ class Handler extends ExceptionHandler
];
// create job that will mail.
$ip = $_SERVER['REMOTE_ADDR'] ?? '0.0.0.0';
$job = new MailError($userData, env('SITE_OWNER', ''), $ip, $data);
$ipAddress = Request::ip() ?? '0.0.0.0';
$job = new MailError($userData, env('SITE_OWNER', ''), $ipAddress, $data);
dispatch($job);
}
@@ -109,9 +111,9 @@ class Handler extends ExceptionHandler
/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param $request
*
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
*/
protected function unauthenticated($request)
{

View File

@@ -16,7 +16,6 @@ namespace FireflyIII\Export\Collector;
use Carbon\Carbon;
use Crypt;
use FireflyIII\Models\Attachment;
use FireflyIII\Models\ExportJob;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use Illuminate\Contracts\Encryption\DecryptException;
use Illuminate\Support\Collection;
@@ -43,10 +42,8 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
/**
* AttachmentCollector constructor.
*
* @param ExportJob $job
*/
public function __construct(ExportJob $job)
public function __construct()
{
/** @var AttachmentRepositoryInterface repository */
$this->repository = app(AttachmentRepositoryInterface::class);
@@ -54,7 +51,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface
$this->uploadDisk = Storage::disk('upload');
$this->exportDisk = Storage::disk('export');
parent::__construct($job);
parent::__construct();
}
/**

View File

@@ -31,13 +31,10 @@ class BasicCollector
/**
* BasicCollector constructor.
*
* @param ExportJob $job
*/
public function __construct(ExportJob $job)
public function __construct()
{
$this->entries = new Collection;
$this->job = $job;
}
/**
@@ -56,5 +53,13 @@ class BasicCollector
$this->entries = $entries;
}
/**
* @param ExportJob $job
*/
public function setJob(ExportJob $job)
{
$this->job = $job;
}
}

View File

@@ -13,6 +13,7 @@ declare(strict_types = 1);
namespace FireflyIII\Export\Collector;
use FireflyIII\Models\ExportJob;
use Illuminate\Support\Collection;
/**
@@ -35,7 +36,16 @@ interface CollectorInterface
/**
* @param Collection $entries
*
* @return void
*
*/
public function setEntries(Collection $entries);
/**
* @param ExportJob $job
*
* @return mixed
*/
public function setJob(ExportJob $job);
}

View File

@@ -19,6 +19,7 @@ use DB;
use FireflyIII\Models\Transaction;
use Illuminate\Database\Query\JoinClause;
use Illuminate\Support\Collection;
use Steam;
/**
* Class JournalExportCollector
@@ -118,7 +119,7 @@ class JournalExportCollector extends BasicCollector implements CollectorInterfac
);
$set->each(
function ($obj) {
$obj->name = $obj->encrypted === 1 ? Crypt::decrypt($obj->name) : $obj->name;
$obj->name = Steam::decrypt(intval($obj->encrypted), $obj->name);
}
);
$array = [];
@@ -159,7 +160,7 @@ class JournalExportCollector extends BasicCollector implements CollectorInterfac
);
$set->each(
function ($obj) {
$obj->name = $obj->encrypted === 1 ? Crypt::decrypt($obj->name) : $obj->name;
$obj->name = Steam::decrypt(intval($obj->encrypted), $obj->name);
}
);
$array = [];
@@ -202,7 +203,7 @@ class JournalExportCollector extends BasicCollector implements CollectorInterfac
);
$set->each(
function ($obj) {
$obj->name = $obj->encrypted === 1 ? Crypt::decrypt($obj->name) : $obj->name;
$obj->name = Steam::decrypt(intval($obj->encrypted), $obj->name);
}
);
$array = [];
@@ -243,7 +244,7 @@ class JournalExportCollector extends BasicCollector implements CollectorInterfac
);
$set->each(
function ($obj) {
$obj->name = $obj->encrypted === 1 ? Crypt::decrypt($obj->name) : $obj->name;
$obj->name = Steam::decrypt(intval($obj->encrypted), $obj->name);
}
);
$array = [];
@@ -287,7 +288,7 @@ class JournalExportCollector extends BasicCollector implements CollectorInterfac
}
/**
*
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
private function getWorkSet()
{

View File

@@ -14,7 +14,6 @@ declare(strict_types = 1);
namespace FireflyIII\Export\Collector;
use Crypt;
use FireflyIII\Models\ExportJob;
use Illuminate\Contracts\Encryption\DecryptException;
use Log;
use Storage;
@@ -35,22 +34,12 @@ class UploadCollector extends BasicCollector implements CollectorInterface
/**
* AttachmentCollector constructor.
*
* @param ExportJob $job
*/
public function __construct(ExportJob $job)
public function __construct()
{
parent::__construct($job);
Log::debug('Going to collect attachments', ['key' => $job->key]);
// make storage:
parent::__construct();
$this->uploadDisk = Storage::disk('upload');
$this->exportDisk = Storage::disk('export');
// file names associated with the old import routine.
$this->vintageFormat = sprintf('csv-upload-%d-', auth()->user()->id);
}
/**
@@ -60,6 +49,11 @@ class UploadCollector extends BasicCollector implements CollectorInterface
*/
public function run(): bool
{
Log::debug('Going to collect attachments', ['key' => $this->job->key]);
// file names associated with the old import routine.
$this->vintageFormat = sprintf('csv-upload-%d-', $this->job->user->id);
// collect old upload files (names beginning with "csv-upload".
$this->collectVintageUploads();

View File

@@ -14,6 +14,7 @@ declare(strict_types = 1);
namespace FireflyIII\Export\Entry;
use Crypt;
use Steam;
/**
* To extend the exported object, in case of new features in Firefly III for example,
@@ -29,6 +30,7 @@ use Crypt;
*
*
* Class Entry
* @SuppressWarnings(PHPMD.LongVariable)
*
* @package FireflyIII\Export\Entry
*/
@@ -50,7 +52,6 @@ final class Entry
public $destination_account_id;
public $destination_account_name;
public $budget_id;
public $budget_name;
public $category_id;
@@ -71,33 +72,21 @@ final class Entry
*/
public static function fromObject($object): Entry
{
$entry = new self;
// journal information:
$entry->journal_id = $object->transaction_journal_id;
$entry->description = $object->journal_encrypted === 1 ? Crypt::decrypt($object->journal_description) : $object->journal_description;
$entry->amount = round($object->amount, 2); // always positive
$entry->date = $object->date;
$entry->transaction_type = $object->transaction_type;
$entry->currency_code = $object->transaction_currency_code;
// source information:
$entry->source_account_id = $object->account_id;
$entry->source_account_name = $object->account_name_encrypted === 1 ? Crypt::decrypt($object->account_name) : $object->account_name;
// destination information
$entry = new self;
$entry->journal_id = $object->transaction_journal_id;
$entry->description = Steam::decrypt(intval($object->journal_encrypted), $object->journal_description);
$entry->amount = $object->amount;
$entry->date = $object->date;
$entry->transaction_type = $object->transaction_type;
$entry->currency_code = $object->transaction_currency_code;
$entry->source_account_id = $object->account_id;
$entry->source_account_name = Steam::decrypt(intval($object->account_name_encrypted), $object->account_name);
$entry->destination_account_id = $object->opposing_account_id;
$entry->destination_account_name = $object->opposing_account_encrypted === 1 ? Crypt::decrypt($object->opposing_account_name)
: $object->opposing_account_name;
// category and budget
$entry->category_id = $object->category_id ?? '';
$entry->category_name = $object->category_name ?? '';
$entry->budget_id = $object->budget_id ?? '';
$entry->budget_name = $object->budget_name ?? '';
$entry->destination_account_name = Steam::decrypt(intval($object->opposing_account_encrypted), $object->opposing_account_name);
$entry->category_id = $object->category_id ?? '';
$entry->category_name = $object->category_name ?? '';
$entry->budget_id = $object->budget_id ?? '';
$entry->budget_name = $object->budget_name ?? '';
// update description when transaction description is different:
if (!is_null($object->description) && $object->description != $entry->description) {
@@ -107,4 +96,5 @@ final class Entry
return $entry;
}
}

View File

@@ -26,17 +26,15 @@ class BasicExporter
{
/** @var ExportJob */
protected $job;
private $entries;
/** @var Collection */
private $entries;
/**
* BasicExporter constructor.
*
* @param ExportJob $job
*/
public function __construct(ExportJob $job)
public function __construct()
{
$this->entries = new Collection;
$this->job = $job;
}
/**
@@ -55,5 +53,13 @@ class BasicExporter
$this->entries = $entries;
}
/**
* @param ExportJob $job
*/
public function setJob(ExportJob $job)
{
$this->job = $job;
}
}

View File

@@ -14,7 +14,6 @@ declare(strict_types = 1);
namespace FireflyIII\Export\Exporter;
use FireflyIII\Export\Entry\Entry;
use FireflyIII\Models\ExportJob;
use League\Csv\Writer;
use SplFileObject;
@@ -30,13 +29,10 @@ class CsvExporter extends BasicExporter implements ExporterInterface
/**
* CsvExporter constructor.
*
* @param ExportJob $job
*/
public function __construct(ExportJob $job)
public function __construct()
{
parent::__construct($job);
parent::__construct();
}
/**

View File

@@ -13,6 +13,7 @@ declare(strict_types = 1);
namespace FireflyIII\Export\Exporter;
use FireflyIII\Models\ExportJob;
use Illuminate\Support\Collection;
/**
@@ -40,7 +41,14 @@ interface ExporterInterface
/**
* @param Collection $entries
*
* @return void
*
*/
public function setEntries(Collection $entries);
/**
* @param ExportJob $job
*/
public function setJob(ExportJob $job);
}

View File

@@ -19,7 +19,6 @@ use FireflyIII\Export\Collector\JournalExportCollector;
use FireflyIII\Export\Collector\UploadCollector;
use FireflyIII\Export\Entry\Entry;
use FireflyIII\Models\ExportJob;
use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Collection;
use Log;
use Storage;
@@ -54,21 +53,12 @@ class Processor implements ProcessorInterface
/**
* Processor constructor.
*
* @param array $settings
*/
public function __construct(array $settings)
public function __construct()
{
// save settings
$this->settings = $settings;
$this->accounts = $settings['accounts'];
$this->exportFormat = $settings['exportFormat'];
$this->includeAttachments = $settings['includeAttachments'];
$this->includeOldUploads = $settings['includeOldUploads'];
$this->job = $settings['job'];
$this->journals = new Collection;
$this->exportEntries = new Collection;
$this->files = new Collection;
$this->journals = new Collection;
$this->exportEntries = new Collection;
$this->files = new Collection;
}
@@ -78,7 +68,8 @@ class Processor implements ProcessorInterface
public function collectAttachments(): bool
{
/** @var AttachmentCollector $attachmentCollector */
$attachmentCollector = app(AttachmentCollector::class, [$this->job]);
$attachmentCollector = app(AttachmentCollector::class);
$attachmentCollector->setJob($this->job);
$attachmentCollector->setDates($this->settings['startDate'], $this->settings['endDate']);
$attachmentCollector->run();
$this->files = $this->files->merge($attachmentCollector->getEntries());
@@ -92,7 +83,8 @@ class Processor implements ProcessorInterface
public function collectJournals(): bool
{
/** @var JournalExportCollector $collector */
$collector = app(JournalExportCollector::class, [$this->job]);
$collector = app(JournalExportCollector::class);
$collector->setJob($this->job);
$collector->setDates($this->settings['startDate'], $this->settings['endDate']);
$collector->setAccounts($this->settings['accounts']);
$collector->run();
@@ -108,7 +100,8 @@ class Processor implements ProcessorInterface
public function collectOldUploads(): bool
{
/** @var UploadCollector $uploadCollector */
$uploadCollector = app(UploadCollector::class, [$this->job]);
$uploadCollector = app(UploadCollector::class);
$uploadCollector->setJob($this->job);
$uploadCollector->run();
$this->files = $this->files->merge($uploadCollector->getEntries());
@@ -155,7 +148,7 @@ class Processor implements ProcessorInterface
$zip->close();
// delete the files:
$this->deleteFiles($disk);
$this->deleteFiles();
return true;
}
@@ -166,7 +159,8 @@ class Processor implements ProcessorInterface
public function exportJournals(): bool
{
$exporterClass = config('firefly.export_formats.' . $this->exportFormat);
$exporter = app($exporterClass, [$this->job]);
$exporter = app($exporterClass);
$exporter->setJob($this->job);
$exporter->setEntries($this->exportEntries);
$exporter->run();
$this->files->push($exporter->getFileName());
@@ -183,10 +177,25 @@ class Processor implements ProcessorInterface
}
/**
* @param FilesystemAdapter $disk
* @param array $settings
*/
private function deleteFiles(FilesystemAdapter $disk)
public function setSettings(array $settings)
{
// save settings
$this->settings = $settings;
$this->accounts = $settings['accounts'];
$this->exportFormat = $settings['exportFormat'];
$this->includeAttachments = $settings['includeAttachments'];
$this->includeOldUploads = $settings['includeOldUploads'];
$this->job = $settings['job'];
}
/**
*
*/
private function deleteFiles()
{
$disk = Storage::disk('export');
foreach ($this->getFiles() as $file) {
$disk->delete($file);
}

View File

@@ -25,10 +25,8 @@ interface ProcessorInterface
/**
* Processor constructor.
*
* @param array $settings
*/
public function __construct(array $settings);
public function __construct();
/**
* @return bool
@@ -64,4 +62,9 @@ interface ProcessorInterface
* @return Collection
*/
public function getFiles(): Collection;
}
/**
* @param array $settings
*/
public function setSettings(array $settings);
}

View File

@@ -14,6 +14,7 @@ declare(strict_types = 1);
namespace FireflyIII\Generator\Chart\Basic;
use FireflyIII\Support\ChartColour;
use Steam;
/**
* Class ChartJsGenerator
@@ -31,6 +32,8 @@ class ChartJsGenerator implements GeneratorInterface
* 0: [
* 'label' => 'label of set',
* 'type' => bar or line, optional
* 'yAxisID' => ID of yAxis, optional, will not be included when unused.
* 'fill' => if to fill a line? optional, will not be included when unused.
* 'entries' =>
* [
* 'label-of-entry' => 'value'
@@ -39,12 +42,15 @@ class ChartJsGenerator implements GeneratorInterface
* 1: [
* 'label' => 'label of another set',
* 'type' => bar or line, optional
* 'yAxisID' => ID of yAxis, optional, will not be included when unused.
* 'fill' => if to fill a line? optional, will not be included when unused.
* 'entries' =>
* [
* 'label-of-entry' => 'value'
* ]
* ]
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's five.
*
* @param array $data
*
@@ -54,7 +60,7 @@ class ChartJsGenerator implements GeneratorInterface
{
reset($data);
$first = current($data);
$labels = array_keys($first['entries']);
$labels = is_array($first['entries']) ? array_keys($first['entries']) : [];
$chartData = [
'count' => count($data),
@@ -64,11 +70,19 @@ class ChartJsGenerator implements GeneratorInterface
unset($first, $labels);
foreach ($data as $set) {
$chartData['datasets'][] = [
$currentSet = [
'label' => $set['label'],
'type' => $set['type'] ?? 'line',
'data' => array_values($set['entries']),
];
if (isset($set['yAxisID'])) {
$currentSet['yAxisID'] = $set['yAxisID'];
}
if (isset($set['fill'])) {
$currentSet['fill'] = $set['fill'];
}
$chartData['datasets'][] = $currentSet;
}
return $chartData;
@@ -95,11 +109,7 @@ class ChartJsGenerator implements GeneratorInterface
foreach ($data as $key => $value) {
// make larger than 0
if (bccomp($value, '0') === -1) {
$value = bcmul($value, '-1');
}
$chartData['datasets'][0]['data'][] = round($value, 2);
$chartData['datasets'][0]['data'][] = floatval(Steam::positive($value));
$chartData['datasets'][0]['backgroundColor'][] = ChartColour::getColour($index);
$chartData['labels'][] = $key;
$index++;
@@ -134,4 +144,4 @@ class ChartJsGenerator implements GeneratorInterface
return $chartData;
}
}
}

View File

@@ -70,4 +70,4 @@ interface GeneratorInterface
*/
public function singleSet(string $setLabel, array $data): array;
}
}

View File

@@ -16,7 +16,7 @@ namespace FireflyIII\Generator\Report\Audit;
use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface;
use FireflyIII\Helpers\Collector\JournalCollector;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Models\Account;
use FireflyIII\Models\Transaction;
use Illuminate\Support\Collection;
@@ -49,33 +49,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
/** @var Account $account */
foreach ($this->accounts as $account) {
// balance the day before:
$id = $account->id;
$dayBeforeBalance = Steam::balance($account, $dayBefore);
$collector = new JournalCollector(auth()->user());
$collector->setAccounts(new Collection([$account]))->setRange($this->start, $this->end);
$journals = $collector->getJournals();
$journals = $journals->reverse();
$startBalance = $dayBeforeBalance;
/** @var Transaction $journal */
foreach ($journals as $transaction) {
$transaction->before = $startBalance;
$transactionAmount = $transaction->transaction_amount;
$newBalance = bcadd($startBalance, $transactionAmount);
$transaction->after = $newBalance;
$startBalance = $newBalance;
}
/*
* Reverse set again.
*/
$auditData[$id]['journals'] = $journals->reverse();
$auditData[$id]['exists'] = $journals->count() > 0;
$auditData[$id]['end'] = $this->end->formatLocalized(strval(trans('config.month_and_day')));
$auditData[$id]['endBalance'] = Steam::balance($account, $this->end);
$auditData[$id]['dayBefore'] = $dayBefore->formatLocalized(strval(trans('config.month_and_day')));
$auditData[$id]['dayBeforeBalance'] = $dayBeforeBalance;
$id = $account->id;
$auditData[$id] = $this->getAuditReport($account, $dayBefore);
}
$defaultShow = ['icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'to'];
@@ -153,4 +128,56 @@ class MonthReportGenerator implements ReportGeneratorInterface
return $this;
}
}
/**
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/
public function setTags(Collection $tags): ReportGeneratorInterface
{
return $this;
}
/**
* @param Account $account
* @param Carbon $date
*
* @return array
*/
private function getAuditReport(Account $account, Carbon $date): array
{
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAccounts(new Collection([$account]))->setRange($this->start, $this->end);
$journals = $collector->getJournals();
$journals = $journals->reverse();
$dayBeforeBalance = Steam::balance($account, $date);
$startBalance = $dayBeforeBalance;
/** @var Transaction $journal */
foreach ($journals as $transaction) {
$transaction->before = $startBalance;
$transactionAmount = $transaction->transaction_amount;
$newBalance = bcadd($startBalance, $transactionAmount);
$transaction->after = $newBalance;
$startBalance = $newBalance;
}
/*
* Reverse set again.
*/
$return = [
'journals' => $journals->reverse(),
'exists' => $journals->count() > 0,
'end' => $this->end->formatLocalized(strval(trans('config.month_and_day'))),
'endBalance' => Steam::balance($account, $this->end),
'dayBefore' => $date->formatLocalized(strval(trans('config.month_and_day'))),
'dayBeforeBalance' => $dayBeforeBalance,
];
return $return;
}
}

View File

@@ -24,4 +24,4 @@ class MultiYearReportGenerator extends MonthReportGenerator
/**
* Doesn't do anything different.
*/
}
}

View File

@@ -25,4 +25,4 @@ class YearReportGenerator extends MonthReportGenerator
/**
* Doesn't do anything different.
*/
}
}

View File

@@ -17,7 +17,7 @@ namespace FireflyIII\Generator\Report\Budget;
use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface;
use FireflyIII\Generator\Report\Support;
use FireflyIII\Helpers\Collector\JournalCollector;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionType;
use Illuminate\Support\Collection;
@@ -131,6 +131,16 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
return $this;
}
/**
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/
public function setTags(Collection $tags): ReportGeneratorInterface
{
return $this;
}
/**
* @param Collection $collection
* @param int $sortFlag
@@ -184,7 +194,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
return $this->expenses;
}
$collector = new JournalCollector(auth()->user());
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
->setTypes([TransactionType::WITHDRAWAL])
->setBudgets($this->budgets)->withOpposingAccount()->disableFilter();
@@ -244,4 +255,4 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
return $result;
}
}
}

View File

@@ -24,4 +24,4 @@ class MultiYearReportGenerator extends MonthReportGenerator
/**
* Doesn't do anything different.
*/
}
}

View File

@@ -25,4 +25,4 @@ class YearReportGenerator extends MonthReportGenerator
/**
* Doesn't do anything different.
*/
}
}

View File

@@ -17,7 +17,7 @@ namespace FireflyIII\Generator\Report\Category;
use Carbon\Carbon;
use FireflyIII\Generator\Report\ReportGeneratorInterface;
use FireflyIII\Generator\Report\Support;
use FireflyIII\Helpers\Collector\JournalCollector;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionType;
use Illuminate\Support\Collection;
@@ -141,6 +141,16 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
return $this;
}
/**
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/
public function setTags(Collection $tags): ReportGeneratorInterface
{
return $this;
}
/**
* @param Collection $collection
* @param int $sortFlag
@@ -194,7 +204,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
return $this->expenses;
}
$collector = new JournalCollector(auth()->user());
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
->setTypes([TransactionType::WITHDRAWAL, TransactionType::TRANSFER])
->setCategories($this->categories)->withOpposingAccount()->disableFilter();
@@ -216,7 +227,8 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
return $this->income;
}
$collector = new JournalCollector(auth()->user());
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)
->setTypes([TransactionType::DEPOSIT, TransactionType::TRANSFER])
->setCategories($this->categories)->withOpposingAccount();
@@ -229,6 +241,7 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
}
/**
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly five.
* @param array $spent
* @param array $earned
*
@@ -325,4 +338,4 @@ class MonthReportGenerator extends Support implements ReportGeneratorInterface
return $result;
}
}
}

View File

@@ -24,4 +24,4 @@ class MultiYearReportGenerator extends MonthReportGenerator
/**
* Doesn't do anything different.
*/
}
}

View File

@@ -25,4 +25,4 @@ class YearReportGenerator extends MonthReportGenerator
/**
* Doesn't do anything different.
*/
}
}

View File

@@ -57,4 +57,4 @@ class ReportGeneratorFactory
}
throw new FireflyException(sprintf('Cannot generate report. There is no "%s"-report for period "%s".', $type, $period));
}
}
}

View File

@@ -64,4 +64,11 @@ interface ReportGeneratorInterface
*/
public function setStartDate(Carbon $date): ReportGeneratorInterface;
}
/**
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/
public function setTags(Collection $tags): ReportGeneratorInterface;
}

View File

@@ -106,4 +106,14 @@ class MonthReportGenerator implements ReportGeneratorInterface
return $this;
}
}
/**
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/
public function setTags(Collection $tags): ReportGeneratorInterface
{
return $this;
}
}

View File

@@ -103,4 +103,14 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
return $this;
}
}
/**
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/
public function setTags(Collection $tags): ReportGeneratorInterface
{
return $this;
}
}

View File

@@ -103,4 +103,14 @@ class YearReportGenerator implements ReportGeneratorInterface
return $this;
}
}
/**
* @param Collection $tags
*
* @return ReportGeneratorInterface
*/
public function setTags(Collection $tags): ReportGeneratorInterface
{
return $this;
}
}

View File

@@ -34,27 +34,7 @@ class Support
*/
public static function filterExpenses(Collection $collection, array $accounts): Collection
{
$result = $collection->filter(
function (Transaction $transaction) use ($accounts) {
$opposing = $transaction->opposing_account_id;
// remove internal transfer
if (in_array($opposing, $accounts)) {
Log::debug(sprintf('Filtered #%d because its opposite is in accounts.', $transaction->id));
return null;
}
// remove positive amount
if (bccomp($transaction->transaction_amount, '0') === 1) {
Log::debug(sprintf('Filtered #%d because amount is %f.', $transaction->id, $transaction->transaction_amount));
return null;
}
return $transaction;
}
);
return $result;
return self::filterTransactions($collection, $accounts, 1);
}
/**
@@ -64,9 +44,21 @@ class Support
* @return Collection
*/
public static function filterIncome(Collection $collection, array $accounts): Collection
{
return self::filterTransactions($collection, $accounts, -1);
}
/**
* @param Collection $collection
* @param array $accounts
* @param int $modifier
*
* @return Collection
*/
public static function filterTransactions(Collection $collection, array $accounts, int $modifier): Collection
{
$result = $collection->filter(
function (Transaction $transaction) use ($accounts) {
function (Transaction $transaction) use ($accounts, $modifier) {
$opposing = $transaction->opposing_account_id;
// remove internal transfer
if (in_array($opposing, $accounts)) {
@@ -75,7 +67,7 @@ class Support
return null;
}
// remove positive amount
if (bccomp($transaction->transaction_amount, '0') === -1) {
if (bccomp($transaction->transaction_amount, '0') === $modifier) {
Log::debug(sprintf('Filtered #%d because amount is %f.', $transaction->id, $transaction->transaction_amount));
return null;
@@ -88,4 +80,4 @@ class Support
return $result;
}
}
}

View File

@@ -1,93 +0,0 @@
<?php
/**
* BudgetEventHandler.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Handlers\Events;
use Carbon\Carbon;
use FireflyIII\Events\StoredBudgetLimit;
use FireflyIII\Events\UpdatedBudgetLimit;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Models\LimitRepetition;
use Illuminate\Database\QueryException;
use Log;
/**
* Handles budget related events.
*
* Class BudgetEventHandler
*
* @package FireflyIII\Handlers\Events
*/
class BudgetEventHandler
{
/**
* This method creates a new budget limit repetition when a new budget limit has been created.
*
* @param StoredBudgetLimit $budgetLimitEvent
*
* @return bool
*/
public function storeRepetition(StoredBudgetLimit $budgetLimitEvent): bool
{
return $this->processRepetitionChange($budgetLimitEvent->budgetLimit, $budgetLimitEvent->end);
}
/**
* Updates, if present the budget limit repetition part of a budget limit.
*
* @param UpdatedBudgetLimit $budgetLimitEvent
*
* @return bool
*/
public function updateRepetition(UpdatedBudgetLimit $budgetLimitEvent): bool
{
return $this->processRepetitionChange($budgetLimitEvent->budgetLimit, $budgetLimitEvent->end);
}
/**
* @param BudgetLimit $budgetLimit
* @param Carbon $date
*
* @return bool
*/
private function processRepetitionChange(BudgetLimit $budgetLimit, Carbon $date): bool
{
$set = $budgetLimit->limitrepetitions()
->where('startdate', $budgetLimit->startdate->format('Y-m-d 00:00:00'))
->where('enddate', $date->format('Y-m-d 00:00:00'))
->get();
if ($set->count() == 0) {
$repetition = new LimitRepetition;
$repetition->startdate = $budgetLimit->startdate;
$repetition->enddate = $date;
$repetition->amount = $budgetLimit->amount;
$repetition->budgetLimit()->associate($budgetLimit);
try {
$repetition->save();
} catch (QueryException $e) {
Log::error('Trying to save new LimitRepetition failed: ' . $e->getMessage());
}
}
if ($set->count() == 1) {
$repetition = $set->first();
$repetition->amount = $budgetLimit->amount;
$repetition->save();
}
return true;
}
}

View File

@@ -16,6 +16,7 @@ namespace FireflyIII\Handlers\Events;
use FireflyIII\Events\StoredTransactionJournal;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\PiggyBankEvent;
use FireflyIII\Models\PiggyBankRepetition;
use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleGroup;
use FireflyIII\Models\TransactionJournal;
@@ -33,79 +34,40 @@ class StoredJournalEventHandler
/**
* This method connects a new transfer to a piggy bank.
*
* @param StoredTransactionJournal $storedJournalEvent
* @param StoredTransactionJournal $event
*
* @return bool
*/
public function connectToPiggyBank(StoredTransactionJournal $storedJournalEvent): bool
public function connectToPiggyBank(StoredTransactionJournal $event): bool
{
/** @var TransactionJournal $journal */
$journal = $storedJournalEvent->journal;
$piggyBankId = $storedJournalEvent->piggyBankId;
$journal = $event->journal;
$piggyBankId = $event->piggyBankId;
Log::debug(sprintf('Trying to connect journal %d to piggy bank %d.', $journal->id, $piggyBankId));
/** @var PiggyBank $piggyBank */
$piggyBank = $journal->user->piggyBanks()->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']);
if (is_null($piggyBank)) {
Log::error('No such piggy bank!');
return true;
}
Log::debug(sprintf('Found piggy bank #%d: "%s"', $piggyBank->id, $piggyBank->name));
// update piggy bank rep for date of transaction journal.
$repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($journal->date)->first();
if (is_null($repetition)) {
Log::error(sprintf('No piggy bank repetition on %s!', $journal->date->format('Y-m-d')));
/*
* Verify existence of piggy bank:
*/
if (!$this->verifyExistence($event)) {
Log::error(sprintf('No such piggy bank or no repetition on %s', $journal->date->format('Y-m-d')));
return true;
}
$amount = TransactionJournal::amountPositive($journal);
Log::debug(sprintf('Will add/remove %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name));
// if piggy account matches source account, the amount is positive
$sources = TransactionJournal::sourceAccountList($journal)->pluck('id')->toArray();
if (in_array($piggyBank->account_id, $sources)) {
$amount = bcmul($amount, '-1');
Log::debug(sprintf('Account #%d is the source, so will remove amount from piggy bank.', $piggyBank->account_id));
}
// if the amount is positive:
// make sure it fits in piggy bank:
if (bccomp($amount, '0') === 1) {
// amount is positive
$room = bcsub(strval($piggyBank->targetamount), strval($repetition->currentamount));
Log::debug(sprintf('Room in piggy bank for extra money is %f', $room));
if (bccomp($room, $amount) === -1) {
// $room is smaller than $amount
Log::debug(sprintf('There is NO room to add %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name));
Log::debug(sprintf('New amount is %f', $room));
$amount = $room;
}
}
if (bccomp($amount, '0') === -1) {
// amount is negative
Log::debug(sprintf('Max amount to remove is %f', $repetition->currentamount));
$compare = bcmul($repetition->currentamount, '-1');
if (bccomp($compare, $amount) === 1) {
// $currentamount is smaller than $amount
Log::debug(sprintf('Cannot remove %f from piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name));
Log::debug(sprintf('New amount is %f', $compare));
$amount = $compare;
}
}
/*
* Get relevant data:
*/
$piggyBank = $journal->user->piggyBanks()->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']);
$repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($journal->date)->first();
$amount = $this->getExactAmount($journal, $piggyBank, $repetition);
$repetition->currentamount = bcadd($repetition->currentamount, $amount);
$repetition->save();
/** @var PiggyBankEvent $storedJournalEvent */
$storedJournalEvent = PiggyBankEvent::create(
/** @var PiggyBankEvent $event */
$event = PiggyBankEvent::create(
['piggy_bank_id' => $piggyBank->id, 'transaction_journal_id' => $journal->id, 'date' => $journal->date, 'amount' => $amount]
);
Log::debug(sprintf('Created piggy bank event #%d', $storedJournalEvent->id));
Log::debug(sprintf('Created piggy bank event #%d', $event->id));
return true;
}
@@ -161,4 +123,81 @@ class StoredJournalEventHandler
return true;
}
/**
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's 6 but I can live with it.
* @param TransactionJournal $journal
* @param PiggyBank $piggyBank
* @param PiggyBankRepetition $repetition
*
* @return string
*/
private function getExactAmount(TransactionJournal $journal, PiggyBank $piggyBank, PiggyBankRepetition $repetition): string
{
$amount = TransactionJournal::amountPositive($journal);
$sources = TransactionJournal::sourceAccountList($journal)->pluck('id')->toArray();
$room = bcsub(strval($piggyBank->targetamount), strval($repetition->currentamount));
$compare = bcmul($repetition->currentamount, '-1');
Log::debug(sprintf('Will add/remove %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name));
// if piggy account matches source account, the amount is positive
if (in_array($piggyBank->account_id, $sources)) {
$amount = bcmul($amount, '-1');
Log::debug(sprintf('Account #%d is the source, so will remove amount from piggy bank.', $piggyBank->account_id));
}
// if the amount is positive, make sure it fits in piggy bank:
if (bccomp($amount, '0') === 1 && bccomp($room, $amount) === -1) {
// amount is positive and $room is smaller than $amount
Log::debug(sprintf('Room in piggy bank for extra money is %f', $room));
Log::debug(sprintf('There is NO room to add %f to piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name));
Log::debug(sprintf('New amount is %f', $room));
return $room;
}
// amount is negative and $currentamount is smaller than $amount
if (bccomp($amount, '0') === -1 && bccomp($compare, $amount) === 1) {
Log::debug(sprintf('Max amount to remove is %f', $repetition->currentamount));
Log::debug(sprintf('Cannot remove %f from piggy bank #%d ("%s")', $amount, $piggyBank->id, $piggyBank->name));
Log::debug(sprintf('New amount is %f', $compare));
return $compare;
}
return $amount;
}
/**
* @param StoredTransactionJournal $event
*
* @return bool
*/
private function verifyExistence(StoredTransactionJournal $event): bool
{
/** @var TransactionJournal $journal */
$journal = $event->journal;
$piggyBankId = $event->piggyBankId;
/** @var PiggyBank $piggyBank */
$piggyBank = $journal->user->piggyBanks()->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']);
if (is_null($piggyBank)) {
Log::error('No such piggy bank!');
return false;
}
Log::debug(sprintf('Found piggy bank #%d: "%s"', $piggyBank->id, $piggyBank->name));
// update piggy bank rep for date of transaction journal.
$repetition = $piggyBank->piggyBankRepetitions()->relevantOnDate($journal->date)->first();
if (is_null($repetition)) {
Log::error(sprintf('No piggy bank repetition on %s!', $journal->date->format('Y-m-d')));
return false;
}
return true;
}
}

View File

@@ -13,26 +13,12 @@ declare(strict_types = 1);
namespace FireflyIII\Handlers\Events;
use Exception;
use FireflyConfig;
use FireflyIII\Events\BlockedBadLogin;
use FireflyIII\Events\BlockedUseOfDomain;
use FireflyIII\Events\BlockedUseOfEmail;
use FireflyIII\Events\BlockedUserLogin;
use FireflyIII\Events\ConfirmedUser;
use FireflyIII\Events\DeletedUser;
use FireflyIII\Events\LockedOutUser;
use FireflyIII\Events\RegisteredUser;
use FireflyIII\Events\RequestedNewPassword;
use FireflyIII\Events\ResentConfirmation;
use FireflyIII\Models\Configuration;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\User;
use Illuminate\Mail\Message;
use Log;
use Mail;
use Preferences;
use Session;
use Swift_TransportException;
/**
@@ -42,7 +28,6 @@ use Swift_TransportException;
*
* The method name reflects what is being done. This is in the present tense.
*
*
* @package FireflyIII\Handlers\Events
*/
class UserEventHandler
@@ -68,251 +53,6 @@ class UserEventHandler
return true;
}
/**
* Handle user logout events.
*
* @return bool
*/
public function logoutUser(): bool
{
// dump stuff from the session:
Session::forget('twofactor-authenticated');
Session::forget('twofactor-authenticated-date');
return true;
}
/**
* @param BlockedBadLogin $event
*
* @return bool
*/
public function reportBadLogin(BlockedBadLogin $event)
{
$email = $event->email;
$owner = env('SITE_OWNER');
$ipAddress = $event->ipAddress;
/** @var Configuration $sendmail */
$sendmail = FireflyConfig::get('mail_for_bad_login', config('firefly.configuration.mail_for_bad_login'));
Log::debug(sprintf('Now in reportBadLogin for email address %s', $email));
Log::error(sprintf('User %s tried to login with bad credentials.', $email));
if (is_null($sendmail) || (!is_null($sendmail) && $sendmail->data === false)) {
return true;
}
try {
Mail::send(
['emails.blocked-bad-creds-html', 'emails.blocked-bad-creds-text'], ['email' => $email, 'ip' => $ipAddress],
function (Message $message) use ($owner) {
$message->to($owner, $owner)->subject('Blocked login attempt with bad credentials');
}
);
} catch (Swift_TransportException $e) {
Log::error($e->getMessage());
}
return true;
}
/**
* @param BlockedUserLogin $event
*
* @return bool
*/
public function reportBlockedUser(BlockedUserLogin $event): bool
{
$user = $event->user;
$owner = env('SITE_OWNER');
$email = $user->email;
$ipAddress = $event->ipAddress;
/** @var Configuration $sendmail */
$sendmail = FireflyConfig::get('mail_for_blocked_login', config('firefly.configuration.mail_for_blocked_login'));
Log::debug(sprintf('Now in reportBlockedUser for email address %s', $email));
Log::error(sprintf('User #%d (%s) has their accout blocked (blocked_code is "%s") but tried to login.', $user->id, $email, $user->blocked_code));
if (is_null($sendmail) || (!is_null($sendmail) && $sendmail->data === false)) {
return true;
}
// send email message:
try {
Mail::send(
['emails.blocked-login-html', 'emails.blocked-login-text'],
[
'user_id' => $user->id,
'user_address' => $email,
'ip' => $ipAddress,
'code' => $user->blocked_code,
], function (Message $message) use ($owner, $user) {
$message->to($owner, $owner)->subject('Blocked login attempt of blocked user');
}
);
} catch (Swift_TransportException $e) {
Log::error($e->getMessage());
}
return true;
}
/**
* @param LockedOutUser $event
*
* @return bool
*/
public function reportLockout(LockedOutUser $event): bool
{
$email = $event->email;
$owner = env('SITE_OWNER');
$ipAddress = $event->ipAddress;
/** @var Configuration $sendmail */
$sendmail = FireflyConfig::get('mail_for_lockout', config('firefly.configuration.mail_for_lockout'));
Log::debug(sprintf('Now in respondToLockout for email address %s', $email));
Log::error(sprintf('User %s was locked out after too many invalid login attempts.', $email));
if (is_null($sendmail) || (!is_null($sendmail) && $sendmail->data === false)) {
return true;
}
// send email message:
try {
Mail::send(
['emails.locked-out-html', 'emails.locked-out-text'], ['email' => $email, 'ip' => $ipAddress], function (Message $message) use ($owner) {
$message->to($owner, $owner)->subject('User was locked out');
}
);
} catch (Swift_TransportException $e) {
Log::error($e->getMessage());
}
return true;
}
/**
* @param BlockedUseOfDomain $event
*
* @return bool
*/
public function reportUseBlockedDomain(BlockedUseOfDomain $event): bool
{
$email = $event->email;
$owner = env('SITE_OWNER');
$ipAddress = $event->ipAddress;
$parts = explode('@', $email);
/** @var Configuration $sendmail */
$sendmail = FireflyConfig::get('mail_for_blocked_domain', config('firefly.configuration.mail_for_blocked_domain'));
Log::debug(sprintf('Now in reportUseBlockedDomain for email address %s', $email));
Log::error(sprintf('Somebody tried to register using an email address (%s) connected to a banned domain (%s).', $email, $parts[1]));
if (is_null($sendmail) || (!is_null($sendmail) && $sendmail->data === false)) {
return true;
}
// send email message:
try {
Mail::send(
['emails.blocked-registration-html', 'emails.blocked-registration-text'],
[
'email_address' => $email,
'blocked_domain' => $parts[1],
'ip' => $ipAddress,
], function (Message $message) use ($owner) {
$message->to($owner, $owner)->subject('Blocked registration attempt with blocked domain');
}
);
} catch (Swift_TransportException $e) {
Log::error($e->getMessage());
}
return true;
}
/**
* @param BlockedUseOfEmail $event
*
* @return bool
*/
public function reportUseOfBlockedEmail(BlockedUseOfEmail $event): bool
{
$email = $event->email;
$owner = env('SITE_OWNER');
$ipAddress = $event->ipAddress;
/** @var Configuration $sendmail */
$sendmail = FireflyConfig::get('mail_for_blocked_email', config('firefly.configuration.mail_for_blocked_email'));
Log::debug(sprintf('Now in reportUseOfBlockedEmail for email address %s', $email));
Log::error(sprintf('Somebody tried to register using email address %s which is blocked (SHA2 hash).', $email));
if (is_null($sendmail) || (!is_null($sendmail) && $sendmail->data === false)) {
return true;
}
// send email message:
try {
Mail::send(
['emails.blocked-email-html', 'emails.blocked-email-text'],
[
'user_address' => $email,
'ip' => $ipAddress,
], function (Message $message) use ($owner) {
$message->to($owner, $owner)->subject('Blocked registration attempt with blocked email address');
}
);
} catch (Swift_TransportException $e) {
Log::error($e->getMessage());
}
return true;
}
/**
* @param DeletedUser $event
*
* @return bool
*/
public function saveEmailAddress(DeletedUser $event): bool
{
Preferences::mark();
$email = hash('sha256', $event->email);
Log::debug(sprintf('Hash of email is %s', $email));
/** @var Configuration $configuration */
$configuration = FireflyConfig::get('deleted_users', []);
$content = $configuration->data;
if (!is_array($content)) {
$content = [];
}
$content[] = $email;
$configuration->data = $content;
Log::debug('New content of deleted_users is ', $content);
FireflyConfig::set('deleted_users', $content);
Preferences::mark();
return true;
}
/**
* This method will send a newly registered user a confirmation message, urging him or her to activate their account.
*
* @param RegisteredUser $event
*
* @return bool
*/
public function sendConfirmationMessage(RegisteredUser $event): bool
{
return $this->sendConfirmation($event->user, $event->ipAddress);
}
/**
* If the user has somehow lost his or her confirmation message, this event will send it to the user again.
*
* At the moment, this method is exactly the same as the ::sendConfirmationMessage method, but that will change.
*
* @param ResentConfirmation $event
*
* @return bool
*/
function sendConfirmationMessageAgain(ResentConfirmation $event): bool
{
return $this->sendConfirmation($event->user, $event->ipAddress);
}
/**
* @param RequestedNewPassword $event
*
@@ -372,75 +112,4 @@ class UserEventHandler
return true;
}
/**
* When the user is confirmed, this method stores the IP address of the user
* as a preference. Since this preference cannot be edited, it is effectively hidden
* from the user yet stored conveniently.
*
* @param ConfirmedUser $event
*
* @return bool
*/
public function storeConfirmationIpAddress(ConfirmedUser $event): bool
{
Preferences::setForUser($event->user, 'confirmation_ip_address', $event->ipAddress);
return true;
}
/**
* This message stores the users IP address on registration, in much the same
* fashion as the previous method.
*
* @param RegisteredUser $event
*
* @return bool
*/
public function storeRegistrationIpAddress(RegisteredUser $event): bool
{
Preferences::setForUser($event->user, 'registration_ip_address', $event->ipAddress);
return true;
}
/**
* @param User $user
* @param string $ipAddress
*
* @return bool
*/
private function sendConfirmation(User $user, string $ipAddress): bool
{
$mustConfirmAccount = FireflyConfig::get('must_confirm_account', config('firefly.configuration.must_confirm_account'))->data;
if ($mustConfirmAccount === false) {
Preferences::setForUser($user, 'user_confirmed', true);
Preferences::setForUser($user, 'user_confirmed_last_mail', 0);
Preferences::mark();
return true;
}
$email = $user->email;
$code = str_random(16);
$route = route('do_confirm_account', [$code]);
Preferences::setForUser($user, 'user_confirmed', false);
Preferences::setForUser($user, 'user_confirmed_last_mail', time());
Preferences::setForUser($user, 'user_confirmed_code', $code);
try {
Mail::send(
['emails.confirm-account-html', 'emails.confirm-account-text'], ['route' => $route, 'ip' => $ipAddress],
function (Message $message) use ($email) {
$message->to($email, $email)->subject('Please confirm your Firefly III account');
}
);
} catch (Swift_TransportException $e) {
Log::error($e->getMessage());
} catch (Exception $e) {
Log::error($e->getMessage());
}
return true;
}
}

View File

@@ -16,7 +16,6 @@ use Crypt;
use FireflyIII\Models\Attachment;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\MessageBag;
use Input;
use Storage;
use Symfony\Component\HttpFoundation\File\UploadedFile;
@@ -33,9 +32,9 @@ class AttachmentHelper implements AttachmentHelperInterface
/** @var MessageBag */
public $messages;
/** @var array */
protected $allowedMimes;
protected $allowedMimes = [];
/** @var int */
protected $maxUploadSize;
protected $maxUploadSize = 0;
/** @var \Illuminate\Contracts\Filesystem\Filesystem */
protected $uploadDisk;
@@ -45,8 +44,8 @@ class AttachmentHelper implements AttachmentHelperInterface
*/
public function __construct()
{
$this->maxUploadSize = config('firefly.maxUploadSize');
$this->allowedMimes = config('firefly.allowedMimes');
$this->maxUploadSize = intval(config('firefly.maxUploadSize'));
$this->allowedMimes = (array)config('firefly.allowedMimes');
$this->errors = new MessageBag;
$this->messages = new MessageBag;
$this->uploadDisk = Storage::disk('upload');
@@ -81,20 +80,19 @@ class AttachmentHelper implements AttachmentHelperInterface
}
/**
* @param Model $model
* @param Model $model
* @param array|null $files
*
* @return bool
*/
public function saveAttachmentsForModel(Model $model): bool
public function saveAttachmentsForModel(Model $model, array $files = null): bool
{
$files = $this->getFiles();
if (!is_null($files) && !is_array($files)) {
$this->processFile($files, $model);
}
if (is_array($files)) {
$this->processFiles($files, $model);
foreach ($files as $entry) {
if (!is_null($entry)) {
$this->processFile($entry, $model);
}
}
}
return true;
@@ -227,37 +225,4 @@ class AttachmentHelper implements AttachmentHelperInterface
return true;
}
/**
* @return array|null|UploadedFile
*/
private function getFiles()
{
$files = null;
if (Input::hasFile('attachments')) {
$files = Input::file('attachments');
}
return $files;
}
/**
* @param array $files
*
* @param Model $model
*
* @return bool
*/
private function processFiles(array $files, Model $model): bool
{
foreach ($files as $entry) {
if (!is_null($entry)) {
$this->processFile($entry, $model);
}
}
return true;
}
}

View File

@@ -46,6 +46,6 @@ interface AttachmentHelperInterface
*
* @return bool
*/
public function saveAttachmentsForModel(Model $model): bool;
public function saveAttachmentsForModel(Model $model, array $files = null): bool;
}

View File

@@ -0,0 +1,277 @@
<?php
/**
* MetaPieChart.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
* This software may be modified and distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Helpers\Chart;
use Carbon\Carbon;
use FireflyIII\Generator\Report\Support;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\User;
use Illuminate\Support\Collection;
use Steam;
/**
* Class MetaPieChart
*
* @package FireflyIII\Helpers\Chart
*/
class MetaPieChart implements MetaPieChartInterface
{
/** @var Collection */
protected $accounts;
/** @var Collection */
protected $budgets;
/** @var Collection */
protected $categories;
/** @var bool */
protected $collectOtherObjects = false;
/** @var Carbon */
protected $end;
/** @var array */
protected $grouping
= [
'account' => ['opposing_account_id'],
'budget' => ['transaction_journal_budget_id', 'transaction_budget_id'],
'category' => ['transaction_journal_category_id', 'transaction_category_id'],
];
/** @var array */
protected $repositories
= [
'account' => AccountRepositoryInterface::class,
'budget' => BudgetRepositoryInterface::class,
'category' => CategoryRepositoryInterface::class,
];
/** @var Carbon */
protected $start;
/** @var string */
protected $total = '0';
/** @var User */
protected $user;
public function __construct()
{
$this->accounts = new Collection;
$this->budgets = new Collection;
$this->categories = new Collection;
}
/**
* @param string $direction
* @param string $group
*
* @return array
*/
public function generate(string $direction, string $group): array
{
$transactions = $this->getTransactions($direction);
$grouped = $this->groupByFields($transactions, $this->grouping[$group]);
$chartData = $this->organizeByType($group, $grouped);
// also collect all other transactions
if ($this->collectOtherObjects && $direction === 'expense') {
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setUser($this->user);
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::WITHDRAWAL]);
$journals = $collector->getJournals();
$sum = strval($journals->sum('transaction_amount'));
$sum = bcmul($sum, '-1');
$sum = bcsub($sum, $this->total);
$chartData[strval(trans('firefly.everything_else'))] = $sum;
}
if ($this->collectOtherObjects && $direction === 'income') {
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAccounts($this->accounts)->setRange($this->start, $this->end)->setTypes([TransactionType::DEPOSIT]);
$journals = $collector->getJournals();
$sum = strval($journals->sum('transaction_amount'));
$sum = bcsub($sum, $this->total);
$chartData[strval(trans('firefly.everything_else'))] = $sum;
}
return $chartData;
}
/**
* @param Collection $accounts
*
* @return MetaPieChartInterface
*/
public function setAccounts(Collection $accounts): MetaPieChartInterface
{
$this->accounts = $accounts;
return $this;
}
/**
* @param Collection $budgets
*
* @return MetaPieChartInterface
*/
public function setBudgets(Collection $budgets): MetaPieChartInterface
{
$this->budgets = $budgets;
return $this;
}
/**
* @param Collection $categories
*
* @return MetaPieChartInterface
*/
public function setCategories(Collection $categories): MetaPieChartInterface
{
$this->categories = $categories;
return $this;
}
/**
* @param bool $collectOtherObjects
*
* @return MetaPieChartInterface
*/
public function setCollectOtherObjects(bool $collectOtherObjects): MetaPieChartInterface
{
$this->collectOtherObjects = $collectOtherObjects;
return $this;
}
/**
* @param Carbon $end
*
* @return MetaPieChartInterface
*/
public function setEnd(Carbon $end): MetaPieChartInterface
{
$this->end = $end;
return $this;
}
/**
* @param Carbon $start
*
* @return MetaPieChartInterface
*/
public function setStart(Carbon $start): MetaPieChartInterface
{
$this->start = $start;
return $this;
}
/**
* @param User $user
*
* @return MetaPieChartInterface
*/
public function setUser(User $user): MetaPieChartInterface
{
$this->user = $user;
return $this;
}
protected function getTransactions(string $direction)
{
$types = [TransactionType::DEPOSIT, TransactionType::TRANSFER];
$modifier = -1;
if ($direction === 'expense') {
$types = [TransactionType::WITHDRAWAL, TransactionType::TRANSFER];
$modifier = 1;
}
/** @var JournalCollectorInterface $collector */
$collector = app(JournalCollectorInterface::class);
$collector->setAccounts($this->accounts);
$collector->setRange($this->start, $this->end);
$collector->setTypes($types);
$collector->withOpposingAccount();
if ($direction === 'income') {
$collector->disableFilter();
}
if ($this->budgets->count() > 0) {
$collector->setBudgets($this->budgets);
}
if ($this->categories->count() > 0) {
$collector->setCategories($this->categories);
}
$accountIds = $this->accounts->pluck('id')->toArray();
$transactions = $collector->getJournals();
$set = Support::filterTransactions($transactions, $accountIds, $modifier);
return $set;
}
/**
* @param Collection $set
* @param array $fields
*
* @return array
*/
protected function groupByFields(Collection $set, array $fields)
{
$grouped = [];
/** @var Transaction $transaction */
foreach ($set as $transaction) {
$values = [];
foreach ($fields as $field) {
$values[] = intval($transaction->$field);
}
$value = max($values);
$grouped[$value] = $grouped[$value] ?? '0';
$grouped[$value] = bcadd($transaction->transaction_amount, $grouped[$value]);
}
return $grouped;
}
/**
* @param string $type
* @param array $array
*
* @return array
*/
protected function organizeByType(string $type, array $array): array
{
$chartData = [];
$names = [];
$repository = app($this->repositories[$type]);
foreach ($array as $objectId => $amount) {
if (!isset($names[$objectId])) {
$object = $repository->find(intval($objectId));
$names[$objectId] = $object->name;
}
$amount = Steam::positive($amount);
$this->total = bcadd($this->total, $amount);
$chartData[$names[$objectId]] = $amount;
}
return $chartData;
}
}

View File

@@ -0,0 +1,82 @@
<?php
/**
* MetaPieChartInterface.php
* Copyright (c) 2017 thegrumpydictator@gmail.com
* This software may be modified and distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Helpers\Chart;
use Carbon\Carbon;
use FireflyIII\User;
use Illuminate\Support\Collection;
/**
* Interface MetaPieChartInterface
*
* @package FireflyIII\Helpers\Chart
*/
interface MetaPieChartInterface
{
/**
* @param string $direction
* @param string $group
*
* @return array
*/
public function generate(string $direction, string $group): array;
/**
* @param Collection $accounts
*
* @return MetaPieChartInterface
*/
public function setAccounts(Collection $accounts): MetaPieChartInterface;
/**
* @param Collection $budgets
*
* @return MetaPieChartInterface
*/
public function setBudgets(Collection $budgets): MetaPieChartInterface;
/**
* @param Collection $categories
*
* @return MetaPieChartInterface
*/
public function setCategories(Collection $categories): MetaPieChartInterface;
/**
* @param bool $collectOtherObjects
*
* @return MetaPieChartInterface
*/
public function setCollectOtherObjects(bool $collectOtherObjects): MetaPieChartInterface;
/**
* @param Carbon $end
*
* @return MetaPieChartInterface
*/
public function setEnd(Carbon $end): MetaPieChartInterface;
/**
* @param Carbon $start
*
* @return MetaPieChartInterface
*/
public function setStart(Carbon $start): MetaPieChartInterface;
/**
* @param User $user
*
* @return MetaPieChartInterface
*/
public function setUser(User $user): MetaPieChartInterface;
}

View File

@@ -1,107 +0,0 @@
<?php
/**
* Account.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Helpers\Collection;
use Illuminate\Support\Collection;
/**
* Class Account
*
* @package FireflyIII\Helpers\Collection
*/
class Account
{
/** @var Collection */
protected $accounts;
/** @var string */
protected $difference = '';
/** @var string */
protected $end = '';
/** @var string */
protected $start = '';
/**
* Account constructor.
*/
public function __construct()
{
$this->accounts = new Collection;
}
/**
* @return Collection
*/
public function getAccounts(): Collection
{
return $this->accounts;
}
/**
* @param Collection $accounts
*/
public function setAccounts(Collection $accounts)
{
$this->accounts = $accounts;
}
/**
* @return string
*/
public function getDifference(): string
{
return $this->difference;
}
/**
* @param string $difference
*/
public function setDifference(string $difference)
{
$this->difference = $difference;
}
/**
* @return string
*/
public function getEnd(): string
{
return $this->end;
}
/**
* @param string $end
*/
public function setEnd(string $end)
{
$this->end = $end;
}
/**
* @return string
*/
public function getStart(): string
{
return $this->start;
}
/**
* @param string $start
*/
public function setStart(string $start)
{
$this->start = $start;
}
}

View File

@@ -14,6 +14,7 @@ namespace FireflyIII\Helpers\Collection;
use Carbon\Carbon;
use FireflyIII\Models\Budget as BudgetModel;
use FireflyIII\Models\BudgetLimit;
use Illuminate\Support\Collection;
/**
@@ -34,12 +35,10 @@ class BalanceLine
/** @var BudgetModel */
protected $budget;
/** @var Carbon */
protected $endDate;
/** @var BudgetLimit */
protected $budgetLimit;
/** @var int */
protected $role = self::ROLE_DEFAULTROLE;
/** @var Carbon */
protected $startDate;
/**
*
@@ -90,20 +89,28 @@ class BalanceLine
$this->budget = $budget;
}
/**
* @return BudgetLimit
*/
public function getBudgetLimit(): BudgetLimit
{
return $this->budgetLimit;
}
/**
* @param BudgetLimit $budgetLimit
*/
public function setBudgetLimit(BudgetLimit $budgetLimit)
{
$this->budgetLimit = $budgetLimit;
}
/**
* @return Carbon
*/
public function getEndDate()
{
return $this->endDate;
}
/**
* @param Carbon $endDate
*/
public function setEndDate($endDate)
{
$this->endDate = $endDate;
return $this->budgetLimit->end_date ?? new Carbon;
}
/**
@@ -127,18 +134,11 @@ class BalanceLine
*/
public function getStartDate()
{
return $this->startDate;
}
/**
* @param Carbon $startDate
*/
public function setStartDate($startDate)
{
$this->startDate = $startDate;
return $this->budgetLimit->start_date ?? new Carbon;
}
/**
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @return string
*/
public function getTitle(): string
@@ -147,13 +147,13 @@ class BalanceLine
return $this->getBudget()->name;
}
if ($this->getRole() == self::ROLE_DEFAULTROLE) {
return trans('firefly.no_budget');
return strval(trans('firefly.no_budget'));
}
if ($this->getRole() == self::ROLE_TAGROLE) {
return trans('firefly.coveredWithTags');
return strval(trans('firefly.coveredWithTags'));
}
if ($this->getRole() == self::ROLE_DIFFROLE) {
return trans('firefly.leftUnbalanced');
return strval(trans('firefly.leftUnbalanced'));
}
return '';
@@ -169,7 +169,7 @@ class BalanceLine
*/
public function leftOfRepetition(): string
{
$start = $this->budget->amount ?? '0';
$start = $this->budgetLimit->amount ?? '0';
/** @var BalanceEntry $balanceEntry */
foreach ($this->getBalanceEntries() as $balanceEntry) {
$start = bcadd($balanceEntry->getSpent(), $start);

View File

@@ -1,197 +0,0 @@
<?php
/**
* Budget.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Helpers\Collection;
use Illuminate\Support\Collection;
/**
*
* Class Budget
*
* @package FireflyIII\Helpers\Collection
*/
class Budget
{
/** @var Collection */
protected $budgetLines;
/** @var string */
protected $budgeted = '0';
/** @var string */
protected $left = '0';
/** @var string */
protected $overspent = '0';
/** @var string */
protected $spent = '0';
/**
*
*/
public function __construct()
{
$this->budgetLines = new Collection;
}
/**
* @param BudgetLine $budgetLine
*
* @return Budget
*/
public function addBudgetLine(BudgetLine $budgetLine): Budget
{
$this->budgetLines->push($budgetLine);
return $this;
}
/**
* @param string $add
*
* @return Budget
*/
public function addBudgeted(string $add): Budget
{
$add = strval(round($add, 2));
$this->budgeted = bcadd($this->budgeted, $add);
return $this;
}
/**
* @param string $add
*
* @return Budget
*/
public function addLeft(string $add): Budget
{
$add = strval(round($add, 2));
$this->left = bcadd($this->left, $add);
return $this;
}
/**
* @param string $add
*
* @return Budget
*/
public function addOverspent(string $add): Budget
{
$add = strval(round($add, 2));
$this->overspent = bcadd($this->overspent, $add);
return $this;
}
/**
* @param string $add
*
* @return Budget
*/
public function addSpent(string $add): Budget
{
$add = strval(round($add, 2));
$this->spent = bcadd($this->spent, $add);
return $this;
}
/**
* @return \Illuminate\Support\Collection
*/
public function getBudgetLines(): Collection
{
return $this->budgetLines;
}
/**
* @return string
*/
public function getBudgeted(): string
{
return $this->budgeted;
}
/**
* @param string $budgeted
*
* @return Budget
*/
public function setBudgeted(string $budgeted): Budget
{
$this->budgeted = $budgeted;
return $this;
}
/**
* @return string
*/
public function getLeft(): string
{
return $this->left;
}
/**
* @param string $left
*
* @return Budget
*/
public function setLeft(string $left): Budget
{
$this->left = $left;
return $this;
}
/**
* @return string
*/
public function getOverspent(): string
{
return $this->overspent;
}
/**
* @param string $overspent
*
* @return Budget
*/
public function setOverspent(string $overspent): Budget
{
$this->overspent = strval(round($overspent, 2));
return $this;
}
/**
* @return string
*/
public function getSpent(): string
{
return $this->spent;
}
/**
* @param string $spent
*
* @return Budget
*/
public function setSpent(string $spent): Budget
{
$this->spent = strval(round($spent, 2));
return $this;
}
}

View File

@@ -1,161 +0,0 @@
<?php
/**
* BudgetLine.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types = 1);
namespace FireflyIII\Helpers\Collection;
use FireflyIII\Models\Budget as BudgetModel;
use FireflyIII\Models\LimitRepetition;
/**
*
* Class BudgetLine
*
* @package FireflyIII\Helpers\Collection
*/
class BudgetLine
{
/** @var BudgetModel */
protected $budget;
/** @var string */
protected $budgeted = '0';
/** @var string */
protected $left = '0';
/** @var string */
protected $overspent = '0';
/** @var LimitRepetition */
protected $repetition;
/** @var string */
protected $spent = '0';
/**
* @return BudgetModel
*/
public function getBudget(): BudgetModel
{
return $this->budget ?? new BudgetModel;
}
/**
* @param BudgetModel $budget
*
* @return BudgetLine
*/
public function setBudget(BudgetModel $budget): BudgetLine
{
$this->budget = $budget;
return $this;
}
/**
* @return string
*/
public function getBudgeted(): string
{
return $this->budgeted;
}
/**
* @param string $budgeted
*
* @return BudgetLine
*/
public function setBudgeted(string $budgeted): BudgetLine
{
$this->budgeted = $budgeted;
return $this;
}
/**
* @return string
*/
public function getLeft(): string
{
return $this->left;
}
/**
* @param string $left
*
* @return BudgetLine
*/
public function setLeft(string $left): BudgetLine
{
$this->left = $left;
return $this;
}
/**
* @return string
*/
public function getOverspent(): string
{
return $this->overspent;
}
/**
* @param string $overspent
*
* @return BudgetLine
*/
public function setOverspent(string $overspent): BudgetLine
{
$this->overspent = $overspent;
return $this;
}
/**
* @return LimitRepetition
*/
public function getRepetition(): LimitRepetition
{
return $this->repetition ?? new LimitRepetition;
}
/**
* @param LimitRepetition $repetition
*
* @return BudgetLine
*/
public function setRepetition(LimitRepetition $repetition): BudgetLine
{
$this->repetition = $repetition;
return $this;
}
/**
* @return string
*/
public function getSpent(): string
{
return $this->spent;
}
/**
* @param string $spent
*
* @return BudgetLine
*/
public function setSpent(string $spent): BudgetLine
{
$this->spent = $spent;
return $this;
}
}

View File

@@ -55,7 +55,6 @@ class Category
*/
public function addTotal(string $add)
{
$add = strval(round($add, 2));
$this->total = bcadd($this->total, $add);
}
@@ -79,7 +78,7 @@ class Category
*/
public function getTotal(): string
{
return strval(round($this->total, 2));
return $this->total;
}

View File

@@ -32,6 +32,7 @@ use Illuminate\Database\Query\JoinClause;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
use Log;
use Steam;
/**
* Maybe this is a good idea after all...
@@ -54,12 +55,11 @@ class JournalCollector implements JournalCollectorInterface
'transaction_journals.description',
'transaction_journals.date',
'transaction_journals.encrypted',
//'transaction_journals.transaction_currency_id',
'transaction_currencies.code as transaction_currency_code',
//'transaction_currencies.symbol as transaction_currency_symbol',
'transaction_types.type as transaction_type_type',
'transaction_journals.bill_id',
'bills.name as bill_name',
'bills.name_encrypted as bill_name_encrypted',
'transactions.id as id',
'transactions.amount as transaction_amount',
'transactions.description as transaction_description',
@@ -95,17 +95,6 @@ class JournalCollector implements JournalCollectorInterface
/** @var User */
private $user;
/**
* JournalCollector constructor.
*
* @param User $user
*/
public function __construct(User $user)
{
$this->user = $user;
$this->query = $this->startQuery();
}
/**
* @return int
* @throws FireflyException
@@ -166,7 +155,8 @@ class JournalCollector implements JournalCollectorInterface
public function getJournals(): Collection
{
$this->run = true;
$set = $this->query->get(array_values($this->fields));
/** @var Collection $set */
$set = $this->query->get(array_values($this->fields));
Log::debug(sprintf('Count of set is %d', $set->count()));
$set = $this->filterTransfers($set);
Log::debug(sprintf('Count of set after filterTransfers() is %d', $set->count()));
@@ -180,10 +170,12 @@ class JournalCollector implements JournalCollectorInterface
$set->each(
function (Transaction $transaction) {
$transaction->date = new Carbon($transaction->date);
$transaction->description = intval($transaction->encrypted) === 1 ? Crypt::decrypt($transaction->description) : $transaction->description;
$transaction->bill_name = !is_null($transaction->bill_name) ? Crypt::decrypt($transaction->bill_name) : '';
$transaction->description = Steam::decrypt(intval($transaction->encrypted), $transaction->description);
if (!is_null($transaction->bill_name)) {
$transaction->bill_name = Steam::decrypt(intval($transaction->bill_name_encrypted), $transaction->bill_name);
}
// optionally decrypted:
try {
$transaction->opposing_account_name = Crypt::decrypt($transaction->opposing_account_name);
} catch (DecryptException $e) {
@@ -240,8 +232,9 @@ class JournalCollector implements JournalCollectorInterface
public function setAllAssetAccounts(): JournalCollectorInterface
{
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class, [$this->user]);
$accounts = $repository->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT]);
$repository = app(AccountRepositoryInterface::class);
$repository->setUser($this->user);
$accounts = $repository->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT]);
if ($accounts->count() > 0) {
$accountIds = $accounts->pluck('id')->toArray();
$this->query->whereIn('transactions.account_id', $accountIds);
@@ -452,6 +445,37 @@ class JournalCollector implements JournalCollectorInterface
return $this;
}
/**
* @param User $user
*/
public function setUser(User $user)
{
$this->user = $user;
}
/**
*
*/
public function startQuery()
{
/** @var EloquentBuilder $query */
$query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
->leftJoin('transaction_currencies', 'transaction_currencies.id', 'transaction_journals.transaction_currency_id')
->leftJoin('transaction_types', 'transaction_types.id', 'transaction_journals.transaction_type_id')
->leftJoin('bills', 'bills.id', 'transaction_journals.bill_id')
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
->leftJoin('account_types', 'accounts.account_type_id', 'account_types.id')
->whereNull('transactions.deleted_at')
->whereNull('transaction_journals.deleted_at')
->where('transaction_journals.user_id', $this->user->id)
->orderBy('transaction_journals.date', 'DESC')
->orderBy('transaction_journals.order', 'ASC')
->orderBy('transaction_journals.id', 'DESC');
$this->query = $query;
}
/**
* @return JournalCollectorInterface
*/
@@ -480,36 +504,6 @@ class JournalCollector implements JournalCollectorInterface
{
$this->joinOpposingTables();
$accountIds = $this->accountIds;
$this->query->where(
function (EloquentBuilder $q1) use ($accountIds) {
// set 1:
// where source is in the set of $accounts
// but destination is not.
$q1->where(
function (EloquentBuilder $q2) use ($accountIds) {
// transactions.account_id in set
$q2->whereIn('transactions.account_id', $accountIds);
// opposing.account_id not in set
$q2->whereNotIn('opposing.account_id', $accountIds);
}
);
// set 1:
// where source is not in the set of $accounts
// but destination is.
$q1->orWhere(
function (EloquentBuilder $q3) use ($accountIds) {
// transactions.account_id not in set
$q3->whereNotIn('transactions.account_id', $accountIds);
// B in set
// opposing.account_id not in set
$q3->whereIn('opposing.account_id', $accountIds);
}
);
}
);
return $this;
}
@@ -560,7 +554,7 @@ class JournalCollector implements JournalCollectorInterface
return $set;
}
if ($this->joinedOpposing === false) {
Log::error('Cannot filter internal transfers because no opposing information is present.');
Log::info('Cannot filter internal transfers because no opposing information is present.');
return $set;
}
@@ -593,7 +587,7 @@ class JournalCollector implements JournalCollectorInterface
* account, chances are the set include double entries: transfers get selected
* on both the source, and then again on the destination account.
*
* This method filters them out.
* This method filters them out by removing transfers that have been selected twice.
*
* @param Collection $set
*
@@ -602,36 +596,29 @@ class JournalCollector implements JournalCollectorInterface
private function filterTransfers(Collection $set): Collection
{
if ($this->filterTransfers) {
$set = $set->filter(
function (Transaction $transaction) {
if (!($transaction->transaction_type_type === TransactionType::TRANSFER && bccomp($transaction->transaction_amount, '0') === -1)) {
Log::debug(
sprintf(
'Included journal #%d (transaction #%d) because its a %s with amount %f',
$transaction->transaction_journal_id,
$transaction->id,
$transaction->transaction_type_type,
$transaction->transaction_amount
)
);
return $transaction;
}
Log::debug(
sprintf(
'Removed journal #%d (transaction #%d) because its a %s with amount %f',
$transaction->transaction_journal_id,
$transaction->id,
$transaction->transaction_type_type,
$transaction->transaction_amount
)
);
return false;
$count = [];
$new = new Collection;
/** @var Transaction $transaction */
foreach ($set as $transaction) {
if ($transaction->transaction_type_type !== TransactionType::TRANSFER) {
$new->push($transaction);
continue;
}
);
// make property string:
$journalId = $transaction->transaction_journal_id;
$amount = Steam::positive($transaction->transaction_amount);
$accountIds = [intval($transaction->account_id), intval($transaction->opposing_account_id)];
sort($accountIds);
$key = $journalId . '-' . join(',', $accountIds) . '-' . $amount;
Log::debug(sprintf('Key is %s', $key));
if (!isset($count[$key])) {
// not yet counted? add to new set and count it:
$new->push($transaction);
$count[$key] = 1;
}
}
return $new;
}
return $set;
@@ -646,9 +633,17 @@ class JournalCollector implements JournalCollectorInterface
// join some extra tables:
$this->joinedBudget = true;
$this->query->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id');
$this->query->leftJoin('budgets as transaction_journal_budgets', 'transaction_journal_budgets.id', '=', 'budget_transaction_journal.budget_id');
$this->query->leftJoin('budget_transaction', 'budget_transaction.transaction_id', '=', 'transactions.id');
$this->query->leftJoin('budgets as transaction_budgets', 'transaction_budgets.id', '=', 'budget_transaction.budget_id');
$this->fields[] = 'budget_transaction_journal.budget_id as transaction_journal_budget_id';
$this->fields[] = 'transaction_journal_budgets.encrypted as transaction_journal_budget_encrypted';
$this->fields[] = 'transaction_journal_budgets.name as transaction_journal_budget_name';
$this->fields[] = 'budget_transaction.budget_id as transaction_budget_id';
$this->fields[] = 'transaction_budgets.encrypted as transaction_budget_encrypted';
$this->fields[] = 'transaction_budgets.name as transaction_budget_name';
}
}
@@ -661,12 +656,26 @@ class JournalCollector implements JournalCollectorInterface
// join some extra tables:
$this->joinedCategory = true;
$this->query->leftJoin('category_transaction_journal', 'category_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id');
$this->query->leftJoin(
'categories as transaction_journal_categories', 'transaction_journal_categories.id', '=', 'category_transaction_journal.category_id'
);
$this->query->leftJoin('category_transaction', 'category_transaction.transaction_id', '=', 'transactions.id');
$this->query->leftJoin('categories as transaction_categories', 'transaction_categories.id', '=', 'category_transaction.category_id');
$this->fields[] = 'category_transaction_journal.category_id as transaction_journal_category_id';
$this->fields[] = 'transaction_journal_categories.encrypted as transaction_journal_category_encrypted';
$this->fields[] = 'transaction_journal_categories.name as transaction_journal_category_name';
$this->fields[] = 'category_transaction.category_id as transaction_category_id';
$this->fields[] = 'transaction_categories.encrypted as transaction_category_encrypted';
$this->fields[] = 'transaction_categories.name as transaction_category_name';
}
}
/**
*
*/
private function joinOpposingTables()
{
if (!$this->joinedOpposing) {
@@ -703,27 +712,4 @@ class JournalCollector implements JournalCollectorInterface
$this->query->leftJoin('tag_transaction_journal', 'tag_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id');
}
}
/**
* @return EloquentBuilder
*/
private function startQuery(): EloquentBuilder
{
/** @var EloquentBuilder $query */
$query = Transaction::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id')
->leftJoin('transaction_currencies', 'transaction_currencies.id', 'transaction_journals.transaction_currency_id')
->leftJoin('transaction_types', 'transaction_types.id', 'transaction_journals.transaction_type_id')
->leftJoin('bills', 'bills.id', 'transaction_journals.bill_id')
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
->leftJoin('account_types', 'accounts.account_type_id', 'account_types.id')
->whereNull('transactions.deleted_at')
->whereNull('transaction_journals.deleted_at')
->where('transaction_journals.user_id', $this->user->id)
->orderBy('transaction_journals.date', 'DESC')
->orderBy('transaction_journals.order', 'ASC')
->orderBy('transaction_journals.id', 'DESC');
return $query;
}
}
}

View File

@@ -17,6 +17,7 @@ use Carbon\Carbon;
use FireflyIII\Models\Budget;
use FireflyIII\Models\Category;
use FireflyIII\Models\Tag;
use FireflyIII\User;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
@@ -27,7 +28,6 @@ use Illuminate\Support\Collection;
*/
interface JournalCollectorInterface
{
/**
* @return int
*/
@@ -84,7 +84,6 @@ interface JournalCollectorInterface
*/
public function setBudget(Budget $budget): JournalCollectorInterface;
/**
* @param Collection $budgets
*
@@ -149,6 +148,13 @@ interface JournalCollectorInterface
*/
public function setTypes(array $types): JournalCollectorInterface;
public function setUser(User $user);
/**
*
*/
public function startQuery();
/**
* @return JournalCollectorInterface
*/
@@ -173,4 +179,4 @@ interface JournalCollectorInterface
* @return JournalCollectorInterface
*/
public function withoutCategory(): JournalCollectorInterface;
}
}

View File

@@ -74,12 +74,8 @@ class Help implements HelpInterface
$converter = new CommonMarkConverter();
$content = $converter->convertToHtml($content);
}
if (strlen($content) === 0) {
Log::warning('Raw content length is zero.');
}
return $content;
}
/**

View File

@@ -19,17 +19,18 @@ use FireflyIII\Helpers\Collection\Balance;
use FireflyIII\Helpers\Collection\BalanceEntry;
use FireflyIII\Helpers\Collection\BalanceHeader;
use FireflyIII\Helpers\Collection\BalanceLine;
use FireflyIII\Models\Budget;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Models\Tag;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Database\Query\JoinClause;
use Illuminate\Support\Collection;
use Log;
/**
* Class BalanceReportHelper
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) // I can't really help it.
* @package FireflyIII\Helpers\Report
*/
class BalanceReportHelper implements BalanceReportHelperInterface
@@ -59,19 +60,21 @@ class BalanceReportHelper implements BalanceReportHelperInterface
*/
public function getBalanceReport(Collection $accounts, Carbon $start, Carbon $end): Balance
{
$balance = new Balance;
$header = new BalanceHeader;
$limitRepetitions = $this->budgetRepository->getAllBudgetLimitRepetitions($start, $end);
Log::debug('Start of balance report');
$balance = new Balance;
$header = new BalanceHeader;
$budgetLimits = $this->budgetRepository->getAllBudgetLimits($start, $end);
foreach ($accounts as $account) {
Log::debug(sprintf('Add account %s to headers.', $account->name));
$header->addAccount($account);
}
/** @var LimitRepetition $repetition */
foreach ($limitRepetitions as $repetition) {
$budget = $this->budgetRepository->find($repetition->budget_id);
$line = $this->createBalanceLine($budget, $repetition, $accounts);
/** @var BudgetLimit $budgetLimit */
foreach ($budgetLimits as $budgetLimit) {
$line = $this->createBalanceLine($budgetLimit, $accounts);
$balance->addBalanceLine($line);
}
Log::debug('Create rest of the things.');
$noBudgetLine = $this->createNoBudgetLine($accounts, $start, $end);
$coveredByTagLine = $this->createTagsBalanceLine($accounts, $start, $end);
$leftUnbalancedLine = $this->createLeftUnbalancedLine($noBudgetLine, $coveredByTagLine);
@@ -81,9 +84,12 @@ class BalanceReportHelper implements BalanceReportHelperInterface
$balance->addBalanceLine($leftUnbalancedLine);
$balance->setBalanceHeader($header);
Log::debug('Clear unused budgets.');
// remove budgets without expenses from balance lines:
$balance = $this->removeUnusedBudgets($balance);
Log::debug('Return report.');
return $balance;
}
@@ -137,26 +143,23 @@ class BalanceReportHelper implements BalanceReportHelperInterface
/**
* @param Budget $budget
* @param LimitRepetition $repetition
* @param Collection $accounts
* @param BudgetLimit $budgetLimit
* @param Collection $accounts
*
* @return BalanceLine
*/
private function createBalanceLine(Budget $budget, LimitRepetition $repetition, Collection $accounts): BalanceLine
private function createBalanceLine(BudgetLimit $budgetLimit, Collection $accounts): BalanceLine
{
$line = new BalanceLine;
$budget->amount = $repetition->amount;
$line->setBudget($budget);
$line->setStartDate($repetition->startdate);
$line->setEndDate($repetition->enddate);
$line = new BalanceLine;
$line->setBudget($budgetLimit->budget);
$line->setBudgetLimit($budgetLimit);
// loop accounts:
foreach ($accounts as $account) {
$balanceEntry = new BalanceEntry;
$balanceEntry->setAccount($account);
$spent = $this->budgetRepository->spentInPeriod(
new Collection([$budget]), new Collection([$account]), $repetition->startdate, $repetition->enddate
new Collection([$budgetLimit->budget]), new Collection([$account]), $budgetLimit->start_date, $budgetLimit->end_date
);
$balanceEntry->setSpent($spent);
$line->addBalanceEntry($balanceEntry);
@@ -212,7 +215,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface
$empty = new BalanceLine;
foreach ($accounts as $account) {
$spent = $this->budgetRepository->spentInPeriodWithoutBudget(new Collection([$account]), $start, $end);
$spent = $this->budgetRepository->spentInPeriodWoBudget(new Collection([$account]), $start, $end);
// budget
$budgetEntry = new BalanceEntry;
$budgetEntry->setAccount($account);

View File

@@ -15,10 +15,8 @@ namespace FireflyIII\Helpers\Report;
use Carbon\Carbon;
use FireflyIII\Helpers\Collection\Budget as BudgetCollection;
use FireflyIII\Helpers\Collection\BudgetLine;
use FireflyIII\Models\Budget;
use FireflyIII\Models\LimitRepetition;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Support\Collection;
@@ -43,58 +41,68 @@ class BudgetReportHelper implements BudgetReportHelperInterface
}
/**
* @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5.
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return BudgetCollection
* @return array
*/
public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts): BudgetCollection
public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts): array
{
$object = new BudgetCollection;
$set = $this->repository->getBudgets();
$set = $this->repository->getBudgets();
$array = [];
/** @var Budget $budget */
foreach ($set as $budget) {
$repetitions = $budget->limitrepetitions()->before($end)->after($start)->get();
$budgetLimits = $this->repository->getBudgetLimits($budget, $start, $end);
if ($budgetLimits->count() == 0) { // no budget limit(s) for this budget
// no repetition(s) for this budget:
if ($repetitions->count() == 0) {
// spent for budget in time range:
$spent = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $start, $end);
if ($spent > 0) {
$budgetLine = new BudgetLine;
$budgetLine->setBudget($budget)->setOverspent($spent);
$object->addOverspent($spent)->addBudgetLine($budgetLine);
$spent = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $start, $end);// spent for budget in time range
if (bccomp($spent, '0') === -1) {
$line = [
'type' => 'budget',
'id' => $budget->id,
'name' => $budget->name,
'budgeted' => '0',
'spent' => $spent,
'left' => '0',
'overspent' => '0',
];
$array[] = $line;
}
continue;
}
// one or more repetitions for budget:
/** @var LimitRepetition $repetition */
foreach ($repetitions as $repetition) {
$data = $this->calculateExpenses($budget, $repetition, $accounts);
$budgetLine = new BudgetLine;
$budgetLine->setBudget($budget)->setRepetition($repetition)
->setLeft($data['left'])->setSpent($data['expenses'])->setOverspent($data['overspent'])
->setBudgeted(strval($repetition->amount));
$object->addBudgeted(strval($repetition->amount))->addSpent($data['spent'])
->addLeft($data['left'])->addOverspent($data['overspent'])->addBudgetLine($budgetLine);
/** @var BudgetLimit $budgetLimit */
foreach ($budgetLimits as $budgetLimit) { // one or more repetitions for budget
$data = $this->calculateExpenses($budget, $budgetLimit, $accounts);
$line = [
'type' => 'budget-line',
'start' => $budgetLimit->start_date,
'end' => $budgetLimit->end_date,
'limit' => $budgetLimit->id,
'id' => $budget->id,
'name' => $budget->name,
'budgeted' => strval($budgetLimit->amount),
'spent' => $data['expenses'],
'left' => $data['left'],
'overspent' => $data['overspent'],
];
$array[] = $line;
}
}
$noBudget = $this->repository->spentInPeriodWoBudget($accounts, $start, $end); // stuff outside of budgets
$line = [
'type' => 'no-budget',
'budgeted' => '0',
'spent' => $noBudget,
'left' => '0',
'overspent' => '0',
];
$array[] = $line;
// stuff outside of budgets:
$noBudget = $this->repository->spentInPeriodWithoutBudget($accounts, $start, $end);
$budgetLine = new BudgetLine;
$budgetLine->setOverspent($noBudget)->setSpent($noBudget);
$object->addOverspent($noBudget)->addBudgetLine($budgetLine);
return $object;
return $array;
}
/**
@@ -128,19 +136,19 @@ class BudgetReportHelper implements BudgetReportHelperInterface
}
/**
* @param Budget $budget
* @param LimitRepetition $repetition
* @param Collection $accounts
* @param Budget $budget
* @param BudgetLimit $budgetLimit
* @param Collection $accounts
*
* @return array
*/
private function calculateExpenses(Budget $budget, LimitRepetition $repetition, Collection $accounts): array
private function calculateExpenses(Budget $budget, BudgetLimit $budgetLimit, Collection $accounts): array
{
$array = [];
$expenses = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $repetition->startdate, $repetition->enddate);
$array['left'] = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? bcadd($repetition->amount, $expenses) : '0';
$array['spent'] = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? $expenses : '0';
$array['overspent'] = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? '0' : bcadd($expenses, $repetition->amount);
$expenses = $this->repository->spentInPeriod(new Collection([$budget]), $accounts, $budgetLimit->start_date, $budgetLimit->end_date);
$array['left'] = bccomp(bcadd($budgetLimit->amount, $expenses), '0') === 1 ? bcadd($budgetLimit->amount, $expenses) : '0';
$array['spent'] = bccomp(bcadd($budgetLimit->amount, $expenses), '0') === 1 ? $expenses : '0';
$array['overspent'] = bccomp(bcadd($budgetLimit->amount, $expenses), '0') === 1 ? '0' : bcadd($expenses, $budgetLimit->amount);
$array['expenses'] = $expenses;
return $array;

View File

@@ -15,7 +15,6 @@ namespace FireflyIII\Helpers\Report;
use Carbon\Carbon;
use FireflyIII\Helpers\Collection\Budget as BudgetCollection;
use Illuminate\Support\Collection;
/**
@@ -31,9 +30,9 @@ interface BudgetReportHelperInterface
* @param Carbon $end
* @param Collection $accounts
*
* @return BudgetCollection
* @return array
*/
public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts): BudgetCollection;
public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts): array;
/**
* @param Carbon $start

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