Compare commits

...

1723 Commits
5.2.6 ... 5.5.6

Author SHA1 Message Date
James Cole
34dc1f9f53 Merge branch 'release/5.5.6' into main 2021-04-09 06:20:39 +02:00
James Cole
b9d949d259 Changelog and version. 2021-04-09 06:20:10 +02:00
James Cole
3376e1e663 Fix issue in date format. 2021-04-09 06:19:43 +02:00
James Cole
ea98c2631f Merge branch 'release/5.5.5' into main 2021-04-09 06:07:05 +02:00
James Cole
50b9fe649d Merge tag '5.5.5' into develop
5.5.5
2021-04-09 06:07:05 +02:00
James Cole
56054531a3 Jump to 5.5.5 2021-04-09 06:06:41 +02:00
James Cole
1912e46113 Remove strict CSP header for #4622 2021-04-09 06:05:27 +02:00
James Cole
075f951cfe Merge tag '5.5.4' into develop
5.5.4
2021-04-09 03:06:18 +02:00
James Cole
26aad765ae Merge branch 'release/5.5.4' into main 2021-04-09 03:06:16 +02:00
James Cole
73ba78d46d Update libraries for new release. 2021-04-09 03:05:37 +02:00
James Cole
0d5dd40134 Updated changelog. 2021-04-09 02:59:23 +02:00
James Cole
f0d84ad142 Update readme. 2021-04-09 02:55:57 +02:00
James Cole
0b4ebf644d Rebuild frontend 2021-04-09 02:07:34 +02:00
James Cole
5b60db120f Submit was broken. 2021-04-08 17:49:25 +02:00
James Cole
f2073a4494 Fix various issues in forms. 2021-04-08 17:41:19 +02:00
James Cole
3e12d26afd Disable almost all things. 2021-04-08 16:47:16 +02:00
James Cole
e458208966 Rebuild frontend 2021-04-08 16:09:09 +02:00
James Cole
e28a77dc87 Add nonce to build. 2021-04-08 12:30:21 +02:00
James Cole
a709596ccb Add headers. 2021-04-08 12:27:54 +02:00
James Cole
849c7dfe02 Strict headers and CSS nonce 2021-04-08 12:10:04 +02:00
James Cole
e580093a34 Weird headers. 2021-04-08 12:05:08 +02:00
James Cole
4fa7a5c1bc Update headers 2021-04-08 11:58:21 +02:00
James Cole
d668007fee Remove style thing 2021-04-08 11:55:10 +02:00
James Cole
6cbccf3be6 Small change in headers 2021-04-08 11:50:59 +02:00
James Cole
9cd75dda1a Link to issue. 2021-04-08 11:34:24 +02:00
James Cole
56dff7ea67 Rebuild new layout. 2021-04-08 11:21:20 +02:00
James Cole
6160f99e92 Update transactions. 2021-04-08 10:23:35 +02:00
James Cole
115639a004 Clean up some code. 2021-04-08 10:13:35 +02:00
James Cole
a0c98c7d9f Update packages. 2021-04-08 09:54:05 +02:00
James Cole
7842700bf1 Do not report specific error. 2021-04-08 06:50:00 +02:00
James Cole
4ecda4d4e0 Add some special headers. 2021-04-07 20:47:40 +02:00
James Cole
c76d140d0b Allow a new config var 2021-04-07 18:24:06 +02:00
James Cole
4f42eb1796 Fix nullpointers. 2021-04-07 14:18:43 +02:00
James Cole
c67b10e38d Fix nullpointer. 2021-04-07 14:17:03 +02:00
James Cole
614ceabd45 Fix #4593 2021-04-07 11:35:53 +02:00
James Cole
a94b2e8806 Extra if 2021-04-07 10:52:38 +02:00
James Cole
732616984b Fix nullpointer. 2021-04-07 09:32:12 +02:00
James Cole
eddf0c1200 Various code cleanup. 2021-04-07 07:53:05 +02:00
James Cole
49013264d5 Various code cleanup. 2021-04-07 07:32:54 +02:00
James Cole
f12744ad8c Various code cleanup. 2021-04-07 07:28:43 +02:00
James Cole
4ddcb0c965 Do not report on OAuth exceptions. 2021-04-07 05:56:50 +02:00
James Cole
0846d4898f Various code cleanup. 2021-04-07 05:55:51 +02:00
James Cole
cb746200fa Various code cleanup. 2021-04-06 18:48:02 +02:00
James Cole
fe06a1f7a0 Various code cleanup. 2021-04-06 18:36:37 +02:00
James Cole
9c1cee738d Update translations. 2021-04-06 17:12:58 +02:00
James Cole
7cc778673a Various code cleanup. 2021-04-06 17:12:31 +02:00
James Cole
38d0f0427f Various code cleanup. 2021-04-06 17:00:16 +02:00
James Cole
8572280b7b Update CI scripts. 2021-04-06 17:00:00 +02:00
James Cole
69b1769f22 Refactor old methods. 2021-04-06 13:30:09 +02:00
James Cole
5ceef2e9c3 Various code cleanup. 2021-04-06 08:51:27 +02:00
James Cole
d32446b171 Various code cleanup. 2021-04-05 22:12:57 +02:00
James Cole
d8ca39ffea Code for #4607 2021-04-05 22:12:11 +02:00
James Cole
d47bddde62 Change code for #4607 2021-04-05 21:53:28 +02:00
James Cole
e4802ec958 Clean up some code. 2021-04-05 21:52:55 +02:00
James Cole
6d855e119d Update frontend. 2021-04-05 14:18:49 +02:00
James Cole
7ab81e493a Delete accounts. 2021-04-05 12:49:02 +02:00
James Cole
fa0397e431 Fix #4603 2021-04-05 12:42:34 +02:00
James Cole
aba3b361be Update composer. 2021-04-05 12:42:20 +02:00
James Cole
1cf188ee08 Add some if-statements to the migrations. 2021-04-05 10:56:56 +02:00
James Cole
f5983f08fd Rename parameter 2021-04-05 10:56:41 +02:00
James Cole
b812c2e09f Simplify account creation. 2021-04-05 10:56:08 +02:00
James Cole
d7466efbe1 Merge pull request #4602 from firefly-iii/dependabot/composer/develop/predis/predis-1.1.7
Bump predis/predis from 1.1.6 to 1.1.7
2021-04-05 07:19:25 +02:00
dependabot[bot]
dff30af9f2 Bump predis/predis from 1.1.6 to 1.1.7
Bumps [predis/predis](https://github.com/predis/predis) from 1.1.6 to 1.1.7.
- [Release notes](https://github.com/predis/predis/releases)
- [Changelog](https://github.com/predis/predis/blob/v1.1.7/CHANGELOG.md)
- [Commits](https://github.com/predis/predis/compare/v1.1.6...v1.1.7)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-05 05:06:58 +00:00
James Cole
25dcb73e27 Fix #4600 2021-04-05 06:14:13 +02:00
James Cole
63ed3d09d5 Increase digits in bcscale. 2021-04-04 18:01:16 +02:00
James Cole
caf1e6010b Add browser TZ to debug page. 2021-04-04 17:57:46 +02:00
James Cole
2d97408c1f Move debug view so it can be made universal. 2021-04-04 17:54:11 +02:00
James Cole
01c0d76c5a Add info about reset. 2021-04-04 16:05:35 +02:00
James Cole
7c7032d951 Add info about reset. 2021-04-04 16:04:39 +02:00
James Cole
6e722f5833 Ignore 404's. 2021-04-04 15:53:17 +02:00
James Cole
d3502c56d3 Fix #4593 2021-04-04 12:48:44 +02:00
James Cole
1b8eb3cd68 Move some views. 2021-04-04 08:43:33 +02:00
James Cole
bc7bd84221 Add missing library 2021-04-04 08:33:10 +02:00
James Cole
85b22341a4 Various updates. 2021-04-04 08:31:15 +02:00
James Cole
f8c725e5b2 Merge branch 'feature/api-bulk-transaction-move' into develop 2021-04-04 07:28:54 +02:00
James Cole
e6344e4f51 Update changelog. 2021-04-04 07:28:35 +02:00
James Cole
8eac10bf89 Simplify routine. 2021-04-04 07:25:52 +02:00
James Cole
c1da0eeced Update chart to include time. 2021-04-04 07:25:42 +02:00
James Cole
0a6d5b1766 Fix error views. 2021-04-03 20:51:19 +02:00
James Cole
4035ac09ce Clean up error display. 2021-04-03 20:46:37 +02:00
James Cole
f81a7cfac0 Merge tag '5.5.3' into develop
5.5.3
2021-04-03 18:50:37 +02:00
James Cole
2b086879cc Merge branch 'release/5.5.3' into main 2021-04-03 18:50:36 +02:00
James Cole
a3091f7509 Final code for 5.3.3 2021-04-03 18:48:21 +02:00
James Cole
70a6ac0038 Make it easier to login for demo users. 2021-04-03 14:03:54 +02:00
James Cole
468a53d587 Add API route to move transactions from one account to another. 2021-04-03 13:56:45 +02:00
James Cole
51f3b17ad2 Clean up handler. 2021-04-03 13:19:11 +02:00
James Cole
a864d3bd56 Rebuild frontend 2021-04-03 12:52:50 +02:00
James Cole
a4d5aa0d10 Do not report on authentication exceptions. 2021-04-03 12:46:50 +02:00
James Cole
aff5ac2c0a Update changelog and version. 2021-04-03 12:39:01 +02:00
James Cole
effe92a05c Make sure the email error mails everything. 2021-04-03 12:32:29 +02:00
James Cole
a4ca6dfd38 Update email message paths for #4586 2021-04-03 12:30:34 +02:00
James Cole
e6012e1ca2 Fix email templates and handler for #4586 2021-04-03 12:25:35 +02:00
James Cole
472497cafd Fix #4586 2021-04-03 12:16:29 +02:00
James Cole
34f4b16a63 Rebuild frontend. 2021-04-03 10:40:31 +02:00
James Cole
7f55a870d9 Merge tag '5.5.2' into develop
5.5.2
2021-04-03 07:40:01 +02:00
James Cole
6a37ad7c15 Merge branch 'release/5.5.2' into main 2021-04-03 07:40:00 +02:00
James Cole
788981d170 Expand changelog and readme. 2021-04-03 07:39:23 +02:00
James Cole
f377c92d8a Fix percentage call. 2021-04-03 07:32:48 +02:00
James Cole
0dc3068f7f Rebuild frontend and update packages. 2021-04-03 07:22:21 +02:00
James Cole
1ad8ec6dd1 Update transactions. 2021-04-03 07:17:42 +02:00
James Cole
18a80f3519 Update code for API 2021-04-03 07:16:43 +02:00
James Cole
82f8b091c1 Do not run auto budgets for inactive budgets #4582 2021-04-03 06:04:17 +02:00
James Cole
71785bae57 Upgrade frontend. 2021-04-02 22:33:31 +02:00
James Cole
6d979a68f2 Fix missing first_date 2021-04-02 16:31:24 +02:00
James Cole
ef852ef963 Update changelog 2021-04-02 07:06:39 +02:00
James Cole
00b0ce6c6e Add dates for #4575, fiddle with comments for #4578 2021-04-02 06:59:55 +02:00
James Cole
5750087d37 Fix nullpointer in bill transformer. 2021-04-02 06:57:31 +02:00
James Cole
a2ae977550 Tag and recurrence as date-time string 2021-04-02 06:18:04 +02:00
James Cole
b893651223 Turn dates into date-times. 2021-04-01 21:06:40 +02:00
James Cole
e221d37d2b Convert dates into date-times for #4571 2021-04-01 20:56:11 +02:00
James Cole
f0acab21a3 Add timezone to template for #4571 2021-04-01 06:48:06 +02:00
James Cole
93dc5fae09 Fix #4571 2021-04-01 06:47:56 +02:00
James Cole
40746db53e Add timezone to debug for #4571 2021-04-01 06:47:33 +02:00
James Cole
4404db650c Fix #4574 2021-04-01 06:19:01 +02:00
James Cole
ab968a56e6 Fix #4572 2021-04-01 06:15:50 +02:00
James Cole
246a3d000a Make sure admin page is not empty. 2021-04-01 06:15:32 +02:00
James Cole
cbcf251bb3 Fix #4570 2021-03-31 19:36:08 +02:00
James Cole
0756054690 Sort expenses and revenue by percentage. 2021-03-31 08:10:46 +02:00
James Cole
b6109ca93e Update some translations. 2021-03-31 07:03:15 +02:00
James Cole
823ee2cea0 Clean up operations repository for #4566 2021-03-31 06:54:32 +02:00
James Cole
18f6052681 Part of #4566 2021-03-31 06:29:08 +02:00
James Cole
4f2ab72567 Ref #4567 2021-03-31 06:08:02 +02:00
James Cole
bc6a2c2cca Fix #4562 2021-03-30 08:12:48 +02:00
James Cole
7a6a911f7f Fix #4560 2021-03-30 06:32:42 +02:00
James Cole
abeff39829 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2021-03-30 06:11:04 +02:00
James Cole
4d18c1bf83 Add if statement for DB migration issue. 2021-03-29 18:53:31 +02:00
James Cole
8a818059f2 Merge pull request #4554 from firefly-iii/dependabot/composer/develop/vimeo/psalm-4.7.0
Bump vimeo/psalm from 4.6.4 to 4.7.0
2021-03-29 08:37:56 +00:00
James Cole
3768262224 Merge pull request #4553 from firefly-iii/dependabot/composer/develop/league/commonmark-1.5.8
Bump league/commonmark from 1.5.7 to 1.5.8
2021-03-29 08:25:22 +00:00
dependabot[bot]
b790a0731e Bump vimeo/psalm from 4.6.4 to 4.7.0
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 4.6.4 to 4.7.0.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/4.6.4...4.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-29 05:09:49 +00:00
dependabot[bot]
c38b9eeb08 Bump league/commonmark from 1.5.7 to 1.5.8
Bumps [league/commonmark](https://github.com/thephpleague/commonmark) from 1.5.7 to 1.5.8.
- [Release notes](https://github.com/thephpleague/commonmark/releases)
- [Changelog](https://github.com/thephpleague/commonmark/blob/latest/CHANGELOG-1.x.md)
- [Commits](https://github.com/thephpleague/commonmark/compare/1.5.7...1.5.8)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-29 05:09:20 +00:00
James Cole
22b376da71 Regenerate frontend. 2021-03-29 06:54:53 +02:00
James Cole
fde53abb1a Enable edit function 2021-03-29 06:53:51 +02:00
James Cole
c32e09a2b3 Fix #4551 2021-03-29 06:53:30 +02:00
James Cole
a243f3d7c2 Call to bad function breaks several reports, fix #4547 2021-03-28 20:42:03 +02:00
James Cole
3586c76b95 Parse improvements for budget overview. 2021-03-28 14:34:02 +02:00
James Cole
c9d9840235 Merge branch 'release/5.5.1' into main 2021-03-28 12:06:08 +02:00
James Cole
10390953fe Merge tag '5.5.1' into develop
5.5.1
2021-03-28 12:06:08 +02:00
James Cole
d6c6bc05ad Set correct version :( 2021-03-28 12:05:56 +02:00
James Cole
a17601e2a8 Update meta files and build. 2021-03-28 11:59:25 +02:00
James Cole
93d481b515 Merge branch 'release/5.5.0' into main
# Conflicts:
#	config/firefly.php
#	frontend/src/scss/_variables.scss
#	frontend/yarn.lock
#	public/v2/css/app.css
#	public/v2/css/app.css.map
#	public/v2/js/transactions/edit.js
#	public/v2/js/transactions/edit.js.map
#	public/v2/js/vendor.js
#	public/v2/js/vendor.js.map
2021-03-28 11:56:01 +02:00
James Cole
13b8ba3746 Rebuild frontend, final files for 5.5.0 2021-03-28 11:53:27 +02:00
James Cole
e6fbd9259d Remove some newlines 2021-03-28 11:47:34 +02:00
James Cole
b5eeacc128 Code cleanup. 2021-03-28 11:46:23 +02:00
James Cole
2c575f3ca5 Code cleanup. 2021-03-28 11:43:07 +02:00
James Cole
5abbb8a807 Code cleanup. 2021-03-28 11:39:26 +02:00
James Cole
6401b5c9eb Clean up readme and old code. 2021-03-28 10:37:01 +02:00
James Cole
7edc1a2571 Files for new release. 2021-03-27 20:10:05 +01:00
James Cole
f489add855 Update releases.md 2021-03-27 20:03:24 +01:00
James Cole
adfdcdb9c6 Files for new reelase. 2021-03-27 20:01:28 +01:00
James Cole
922050a79b Should be enough to fix order issues. 2021-03-27 15:28:11 +01:00
James Cole
436bef01da Always reset order. 2021-03-27 15:13:48 +01:00
James Cole
b7ba6f81da Option for showing active/inactive accounts. 2021-03-27 15:06:40 +01:00
James Cole
381b09d68b Sortable account list. 2021-03-27 10:19:22 +01:00
James Cole
fbed65d464 Fix broken preference 2021-03-26 06:31:25 +01:00
James Cole
bcd612d42f First frontend with working account lists. No sorting. 2021-03-26 06:14:35 +01:00
James Cole
eac2293778 Remove some debug info. 2021-03-24 19:28:07 +01:00
James Cole
72deff81f9 Fix some alignments and a translation. 2021-03-24 06:28:32 +01:00
James Cole
a8e9ba3041 Fix #4520 2021-03-24 06:06:18 +01:00
James Cole
3e73641378 Rebuild CSS 2021-03-23 18:45:27 +01:00
James Cole
7cf44a604a Rebuild frontpage. 2021-03-23 18:39:01 +01:00
James Cole
9003db6eba Fix #4529 2021-03-23 18:38:24 +01:00
James Cole
d1c87e1c21 Fix issues where rule action would use old data. 2021-03-23 06:42:26 +01:00
James Cole
ccaadd1f52 Update php7/8 detection code. 2021-03-23 06:23:30 +01:00
James Cole
e64653eaff Update firefly.php 2021-03-22 05:46:20 +00:00
James Cole
abb0f3d2be Whoops. 2021-03-22 06:45:13 +01:00
James Cole
7f48a1b6ee Fix validation, update version. 2021-03-22 06:40:36 +01:00
James Cole
4affed8f68 Rebuild frontend, first working edit form (with feedback) 2021-03-21 20:38:44 +01:00
James Cole
1088a43866 Rebuild frontend, first working edit form (no feedback) 2021-03-21 18:48:47 +01:00
James Cole
e0d0f49bfd Merge branch 'release/5.5.0-beta.3' into main
# Conflicts:
#	frontend/yarn.lock
2021-03-21 11:11:25 +01:00
James Cole
ee5b4d6a03 Update packages. 2021-03-21 11:10:11 +01:00
James Cole
7062294419 Rebuild front 2021-03-21 11:09:12 +01:00
James Cole
97a687e40a Final things. 2021-03-21 11:06:08 +01:00
James Cole
206845575c Code cleanup 2021-03-21 09:15:40 +01:00
James Cole
da1751940e Add flame 2021-03-21 09:03:49 +01:00
James Cole
9502544abf Update icons and favicons. 2021-03-21 08:56:51 +01:00
James Cole
b975ed87a0 Remove old Firefly III favicon 2021-03-21 08:54:56 +01:00
James Cole
cbf3118b8a Fix tests 2021-03-21 08:13:19 +01:00
James Cole
657726e667 First run of all tests 2021-03-21 07:30:44 +01:00
James Cole
eb90dac89d Transaction tests work. 2021-03-21 07:09:39 +01:00
James Cole
4c2f758f69 Tests also validate existing data. 2021-03-20 19:17:22 +01:00
James Cole
e577db4635 Catch for RSA 2021-03-20 18:42:38 +01:00
James Cole
b1023cdfda Update test routine. 2021-03-20 15:40:20 +01:00
James Cole
f15da8e4b3 Update test routine. 2021-03-20 15:39:49 +01:00
James Cole
5df6135a0e Make sure expectations work. 2021-03-20 15:28:44 +01:00
James Cole
186cbed777 Refactor available budget test 2021-03-20 08:00:58 +01:00
James Cole
bc5aa4b4cd Update test code. 2021-03-20 07:21:13 +01:00
James Cole
836f0ecf3f Fix tests for account 2021-03-20 07:02:06 +01:00
James Cole
e32f14578c Update frontend. 2021-03-19 09:19:37 +01:00
James Cole
03d3ede036 Expand test code. 2021-03-19 06:12:28 +01:00
James Cole
b4d44fdd2b Fix #4514 2021-03-16 17:39:21 +01:00
James Cole
a93da2a912 Expand some test helpers. 2021-03-16 17:20:41 +01:00
James Cole
df86c89acc Some test scripts. 2021-03-16 14:34:11 +01:00
James Cole
690edb8fcc Some notes in code. 2021-03-16 07:23:53 +01:00
James Cole
a43bd745d1 make sure all forms work as expected for b3. 2021-03-16 06:42:58 +01:00
James Cole
d5ee87ddee Fix some edge cases in recurrences. 2021-03-15 19:51:55 +01:00
James Cole
a0b46d9d8a Fix meta services for recurrences. 2021-03-15 10:31:11 +01:00
James Cole
1783f0beb1 Extra content to fix recurrences. 2021-03-15 08:51:21 +01:00
James Cole
8d84dfb3aa Small bugfixes for issues in beta 2 2021-03-15 07:45:46 +01:00
James Cole
b9bf5c9856 Merge pull request #4510 from firefly-iii/dependabot/composer/develop/vimeo/psalm-4.6.3
Bump vimeo/psalm from 4.6.2 to 4.6.3
2021-03-15 06:43:45 +00:00
dependabot[bot]
83be7c1886 Bump vimeo/psalm from 4.6.2 to 4.6.3
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 4.6.2 to 4.6.3.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/4.6.2...4.6.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-15 05:09:48 +00:00
James Cole
81404d934c Fix RSA token creation. 2021-03-14 20:14:51 +01:00
James Cole
1a73b6d20d 5.5.0-beta.2 2021-03-14 20:05:06 +01:00
James Cole
1817160d48 Update meta data for new release. 2021-03-14 20:03:27 +01:00
James Cole
5eb1f93851 Most model tests now working. 2021-03-14 16:42:10 +01:00
James Cole
beece4dcbb Fix tests for transaction storage. 2021-03-14 16:08:49 +01:00
James Cole
288052905e Expand all test models. 2021-03-14 10:41:17 +01:00
James Cole
40a463d62a Expand test cases. 2021-03-14 06:20:23 +01:00
James Cole
d82fe2ab4c Max out the number of iterations 2021-03-14 04:55:48 +01:00
James Cole
fc4d4a455b Rebuild frontend 2021-03-13 21:32:24 +01:00
James Cole
e113225b37 Merge pull request #4503 from Aethiran/develop
Fixed amountPerPeriod not respecting bill skips
2021-03-13 19:39:52 +00:00
James Cole
07f62b0d5c Fix budget limit tests 2021-03-13 20:01:42 +01:00
James Cole
25bc0b0b78 Expand test cases. 2021-03-13 19:47:19 +01:00
James Cole
1f50f65bb7 Finish budget tests. 2021-03-13 19:03:08 +01:00
Mirko Berger
2a4486a8dc Fixed typecast 2021-03-13 17:25:04 +01:00
James Cole
fdcd6befb6 Completed bill tests. 2021-03-13 17:16:38 +01:00
James Cole
c9f7f877c0 Expand API test to bill store. 2021-03-13 16:47:29 +01:00
Mirko Berger
5ab156c7ad Fixed amountPerPeriod not respecting bill skips 2021-03-13 15:43:45 +01:00
James Cole
bdb298740a Also test attachments. 2021-03-13 14:33:48 +01:00
James Cole
bd040c80b2 Fix account API tests. 2021-03-13 13:26:45 +01:00
James Cole
7118abe28d Fix some tests for account API 2021-03-13 12:01:01 +01:00
James Cole
668b169a5e Fix parsing of bill ID. 2021-03-13 06:25:25 +01:00
James Cole
a03e000af1 Small code cleanup. 2021-03-12 20:25:15 +01:00
James Cole
81f5224b11 Clean up old tests. 2021-03-12 18:31:19 +01:00
James Cole
a05d006fa7 Update installation commands. 2021-03-12 06:30:40 +01:00
James Cole
748d61fb8f Various code reshuffelling. 2021-03-12 06:20:01 +01:00
James Cole
97561ab9c9 Some code cleanup and a new migration. 2021-03-12 06:17:50 +01:00
James Cole
aec70cf6a0 Add invalid transaction type. 2021-03-12 06:11:50 +01:00
James Cole
b0c9745982 Make sure rules respect active flag. 2021-03-12 06:11:34 +01:00
James Cole
ab5df484e8 Merge pull request #4491 from firefly-iii/dependabot/npm_and_yarn/frontend/elliptic-6.5.4
Bump elliptic from 6.5.3 to 6.5.4 in /frontend
2021-03-11 08:31:30 +00:00
dependabot[bot]
cecef98d7d Bump elliptic from 6.5.3 to 6.5.4 in /frontend
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-11 07:48:16 +00:00
James Cole
625e31d053 Fix tags and rule groups. 2021-03-11 06:29:07 +01:00
James Cole
75c8ec7c0a Merge pull request #4488 from KaihatsuOnline/patch-1
Set Japanese Yen decimal places to zero in the TransactionCurrencySeeder
2021-03-10 14:58:17 +00:00
KaihatsuOnline
31df959935 Set Japanese Yen decimal places to zero in the TransactionCurrencySeeder. 2021-03-10 23:54:42 +09:00
James Cole
238a582d8a Update validators so they can handle one field at a time. 2021-03-10 06:34:03 +01:00
James Cole
5f4b025be5 Store location correctly. 2021-03-08 18:21:49 +01:00
James Cole
e0c3c91bf2 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2021-03-08 17:56:27 +01:00
James Cole
2a975c302f Fix some stuff in account API calls. still need to solve location. 2021-03-08 17:56:21 +01:00
James Cole
9369d908c8 Merge pull request #4480 from firefly-iii/dependabot/npm_and_yarn/develop/postcss-8.2.7
Bump postcss from 8.2.6 to 8.2.7
2021-03-08 12:55:50 +01:00
James Cole
83f38eb8c8 Merge pull request #4481 from firefly-iii/dependabot/npm_and_yarn/develop/jquery-3.6.0
Bump jquery from 3.5.1 to 3.6.0
2021-03-08 12:55:36 +01:00
James Cole
4d34160ede Verify sorting 2021-03-08 09:56:40 +01:00
dependabot[bot]
ddaec93550 Bump jquery from 3.5.1 to 3.6.0
Bumps [jquery](https://github.com/jquery/jquery) from 3.5.1 to 3.6.0.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.5.1...3.6.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-08 05:07:55 +00:00
dependabot[bot]
66e0cea18d Bump postcss from 8.2.6 to 8.2.7
Bumps [postcss](https://github.com/postcss/postcss) from 8.2.6 to 8.2.7.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.2.6...8.2.7)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-08 05:07:42 +00:00
James Cole
e3161a8b9c Can now update order of accounts efficiently. 2021-03-07 16:19:14 +01:00
James Cole
91394553c3 Add some routes for transfers. 2021-03-07 15:26:42 +01:00
James Cole
414c99489c Final patches in API 2021-03-07 12:16:03 +01:00
James Cole
ba163f82d1 Webhook API 2021-03-07 12:13:22 +01:00
James Cole
c4882231d1 Submit user preferences. 2021-03-07 09:46:12 +01:00
James Cole
d6dd6795fe Can again destroy data. 2021-03-07 08:16:33 +01:00
James Cole
f2e5e7d182 Fix config routes. 2021-03-07 07:43:18 +01:00
James Cole
7606757d78 Add "about" paths. 2021-03-07 06:30:59 +01:00
James Cole
ea07b831f2 Fix reference to recurrence update 2021-03-07 06:15:13 +01:00
James Cole
9cc20bbea7 All model API things done! 2021-03-06 22:22:51 +01:00
James Cole
9632f69b15 Recreate routes for transaction links. 2021-03-06 22:15:17 +01:00
James Cole
b11e3145c5 Implement currency routes. 2021-03-06 21:39:29 +01:00
James Cole
fa5d33caf5 Add routes for transactions. 2021-03-06 20:52:42 +01:00
James Cole
93a31337fc Add transaction API, untested. 2021-03-06 20:05:17 +01:00
James Cole
a8a1eca89e Add tags 2021-03-06 19:04:09 +01:00
James Cole
4ba713e553 Fix rule group API 2021-03-06 18:00:49 +01:00
James Cole
cfa9e8b318 Set up and manage rule endpoints. 2021-03-06 17:43:06 +01:00
James Cole
2437759368 Recurring transactions. 2021-03-06 16:15:39 +01:00
James Cole
b43ea5c108 Add bills and piggy banks 2021-03-06 15:00:34 +01:00
James Cole
84263b9ee8 API routes for object groups. 2021-03-06 14:50:48 +01:00
James Cole
2b2d10d1f1 Reformat API routes. 2021-03-06 12:45:49 +01:00
James Cole
1c041b9543 Clean up budget and limit routes. 2021-03-06 08:40:51 +01:00
James Cole
c53f8b6dfc Refer to the correct model. 2021-03-06 07:22:13 +01:00
James Cole
1c661a86b6 Temporary reshuffeling to fix API 2021-03-06 07:20:49 +01:00
James Cole
0afebb26e0 Expend API. 2021-03-05 20:17:39 +01:00
James Cole
0cb0a628e3 Added new API routes. 2021-03-05 16:28:59 +01:00
James Cole
30d653faee Updated API code. 2021-03-05 07:03:28 +01:00
James Cole
b0d4ebbf4b Different logo 2021-03-04 16:19:19 +01:00
James Cole
711999f589 Export data in API. 2021-03-04 06:28:16 +01:00
James Cole
fcf578784f Some API route cleanup. 2021-03-03 17:06:18 +01:00
James Cole
4f76ea560d First edit that works locally. Rebuilt CSS. 2021-03-03 07:03:44 +01:00
James Cole
df9c9ce044 Clean up some API endpoints. 2021-03-03 07:02:57 +01:00
James Cole
1f12d81008 Merged. 2021-03-01 15:31:16 +01:00
James Cole
736f7963d1 Make sure components are edit-ready. 2021-03-01 15:27:27 +01:00
James Cole
b38e2a994d Merge pull request #4458 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/popperjs/core-2.8.6
Bump @popperjs/core from 2.8.4 to 2.8.6 in /frontend
2021-03-01 07:43:38 +00:00
James Cole
b8bd232622 Merge pull request #4457 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/v-calendar-2.2.4
Bump v-calendar from 2.2.3 to 2.2.4 in /frontend
2021-03-01 07:43:30 +00:00
James Cole
27bc33add3 Merge pull request #4452 from firefly-iii/dependabot/composer/develop/vimeo/psalm-4.6.2
Bump vimeo/psalm from 4.6.1 to 4.6.2
2021-03-01 07:43:22 +00:00
James Cole
0703343748 Merge pull request #4453 from firefly-iii/dependabot/npm_and_yarn/develop/vue-i18n-8.23.0
Bump vue-i18n from 8.22.4 to 8.23.0
2021-03-01 07:43:14 +00:00
James Cole
584963f360 Merge pull request #4451 from firefly-iii/dependabot/npm_and_yarn/develop/laravel-mix-6.0.13
Bump laravel-mix from 6.0.11 to 6.0.13
2021-03-01 07:43:05 +00:00
James Cole
054e563c59 Merge pull request #4450 from firefly-iii/dependabot/composer/develop/laravel/passport-10.1.1
Bump laravel/passport from 10.1.0 to 10.1.1
2021-03-01 07:42:32 +00:00
dependabot[bot]
fd1dc9ca04 Bump @popperjs/core from 2.8.4 to 2.8.6 in /frontend
Bumps [@popperjs/core](https://github.com/popperjs/popper-core) from 2.8.4 to 2.8.6.
- [Release notes](https://github.com/popperjs/popper-core/releases)
- [Commits](https://github.com/popperjs/popper-core/compare/v2.8.4...v2.8.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 05:41:40 +00:00
dependabot[bot]
e5669fcfab Bump v-calendar from 2.2.3 to 2.2.4 in /frontend
Bumps [v-calendar](https://github.com/nathanreyes/v-calendar) from 2.2.3 to 2.2.4.
- [Release notes](https://github.com/nathanreyes/v-calendar/releases)
- [Commits](https://github.com/nathanreyes/v-calendar/compare/v2.2.3...v2.2.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 05:41:20 +00:00
James Cole
a7f57e10eb Merge pull request #4454 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.80
Bump phpstan/phpstan from 0.12.78 to 0.12.80
2021-03-01 05:24:10 +00:00
James Cole
c9dea3f531 Merge pull request #4455 from firefly-iii/dependabot/composer/develop/mockery/mockery-1.4.3
Bump mockery/mockery from 1.4.2 to 1.4.3
2021-03-01 05:23:42 +00:00
James Cole
ef74016a13 Merge pull request #4456 from firefly-iii/dependabot/composer/develop/laravel/framework-8.29.0
Bump laravel/framework from 8.28.1 to 8.29.0
2021-03-01 05:23:32 +00:00
dependabot[bot]
ff6a0d2cb5 Bump laravel/framework from 8.28.1 to 8.29.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.28.1 to 8.29.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.28.1...v8.29.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 05:09:08 +00:00
dependabot[bot]
4af923ac78 Bump mockery/mockery from 1.4.2 to 1.4.3
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.4.2 to 1.4.3.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mockery/mockery/compare/1.4.2...1.4.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 05:08:40 +00:00
dependabot[bot]
34f1e8a56b Bump phpstan/phpstan from 0.12.78 to 0.12.80
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.78 to 0.12.80.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.78...0.12.80)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 05:08:22 +00:00
dependabot[bot]
968ff30058 Bump vue-i18n from 8.22.4 to 8.23.0
Bumps [vue-i18n](https://github.com/kazupon/vue-i18n) from 8.22.4 to 8.23.0.
- [Release notes](https://github.com/kazupon/vue-i18n/releases)
- [Changelog](https://github.com/kazupon/vue-i18n/blob/v8.x/CHANGELOG.md)
- [Commits](https://github.com/kazupon/vue-i18n/compare/v8.22.4...v8.23.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 05:08:08 +00:00
dependabot[bot]
aaf0c5d276 Bump vimeo/psalm from 4.6.1 to 4.6.2
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 4.6.1 to 4.6.2.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/4.6.1...4.6.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 05:08:02 +00:00
dependabot[bot]
4b2392c966 Bump laravel-mix from 6.0.11 to 6.0.13
Bumps [laravel-mix](https://github.com/JeffreyWay/laravel-mix) from 6.0.11 to 6.0.13.
- [Release notes](https://github.com/JeffreyWay/laravel-mix/releases)
- [Changelog](https://github.com/JeffreyWay/laravel-mix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JeffreyWay/laravel-mix/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 05:07:51 +00:00
dependabot[bot]
9bcf56157d Bump laravel/passport from 10.1.0 to 10.1.1
Bumps [laravel/passport](https://github.com/laravel/passport) from 10.1.0 to 10.1.1.
- [Release notes](https://github.com/laravel/passport/releases)
- [Changelog](https://github.com/laravel/passport/blob/10.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/passport/compare/v10.1.0...v10.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 05:07:42 +00:00
James Cole
43e8779e3b Fix #4435 2021-02-27 05:59:40 +01:00
James Cole
2287339781 Split controllers 2021-02-27 05:53:27 +01:00
James Cole
4d9aafbeaf Go to end of day. 2021-02-26 18:09:48 +01:00
James Cole
5944cda03a Rebuild frontend. 2021-02-26 06:39:20 +01:00
James Cole
9aa743b31b Update frontend. 2021-02-25 06:27:43 +01:00
James Cole
6bd6b1eb95 Fix https://github.com/firefly-iii/firefly-iii/issues/4426 2021-02-24 06:01:43 +01:00
James Cole
fc0202eb74 Fix performance issues in budget controller. 2021-02-23 18:49:54 +01:00
James Cole
fd0dc3d289 Experimental fix for https://github.com/firefly-iii/firefly-iii/issues/4424 2021-02-23 17:43:34 +01:00
James Cole
aa4695bbbf Recreate frontend. 2021-02-23 06:50:57 +01:00
James Cole
09d751076e Single event 2021-02-23 06:45:09 +01:00
James Cole
419c1a75dd Better event. 2021-02-23 06:42:04 +01:00
James Cole
fb821ea63e Better event. 2021-02-23 06:39:25 +01:00
James Cole
f1be63e8bf Better event. 2021-02-23 06:38:46 +01:00
James Cole
7725b2a723 Better event. 2021-02-23 06:37:56 +01:00
James Cole
f5a83fa84f Better event. 2021-02-23 06:36:44 +01:00
James Cole
c1d090db67 Better event. 2021-02-23 06:33:00 +01:00
James Cole
7aaec92ae6 Better event. 2021-02-23 06:31:51 +01:00
James Cole
afe6f07e61 Better event. 2021-02-23 06:31:07 +01:00
James Cole
b151ec0c85 Better event. 2021-02-23 06:30:08 +01:00
James Cole
978c56b16b Better event. 2021-02-23 06:28:12 +01:00
James Cole
fbbf002451 Better event. 2021-02-23 06:27:07 +01:00
James Cole
13cd9312f8 Add some extra text. 2021-02-23 06:26:46 +01:00
James Cole
a534c142c1 Extra debug for https://github.com/firefly-iii/firefly-iii/issues/4424 2021-02-23 06:20:17 +01:00
James Cole
89ece0ce78 Clean up events from account 2021-02-22 19:58:10 +01:00
James Cole
9b65f468a0 Better event for location. 2021-02-22 19:41:54 +01:00
James Cole
e1826cdfb2 Simplify description field. 2021-02-22 19:38:21 +01:00
James Cole
97d12cd77a Remove logs. 2021-02-22 18:50:12 +01:00
James Cole
5b5c988aa3 Rebuild frontend, do not use store in components. 2021-02-22 18:43:26 +01:00
James Cole
6d9acd1dc2 Event for clone 2021-02-22 18:41:03 +01:00
James Cole
860fc507b7 Remove comments 2021-02-22 18:40:46 +01:00
James Cole
5f1d4292ad Merge pull request #4422 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/popperjs/core-2.8.2
Bump @popperjs/core from 2.7.0 to 2.8.2 in /frontend
2021-02-22 13:07:52 +00:00
James Cole
7e2cda7f41 Merge pull request #4421 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-1.32.8
Bump sass from 1.32.7 to 1.32.8 in /frontend
2021-02-22 13:07:42 +00:00
James Cole
ef394e1024 Merge pull request #4420 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/lodash-4.17.21
Bump lodash from 4.17.20 to 4.17.21 in /frontend
2021-02-22 05:48:06 +00:00
dependabot[bot]
f2f0d82f89 Bump @popperjs/core from 2.7.0 to 2.8.2 in /frontend
Bumps [@popperjs/core](https://github.com/popperjs/popper-core) from 2.7.0 to 2.8.2.
- [Release notes](https://github.com/popperjs/popper-core/releases)
- [Commits](https://github.com/popperjs/popper-core/compare/v2.7.0...v2.8.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-22 05:41:42 +00:00
dependabot[bot]
2032ef6662 Bump sass from 1.32.7 to 1.32.8 in /frontend
Bumps [sass](https://github.com/sass/dart-sass) from 1.32.7 to 1.32.8.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.32.7...1.32.8)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-22 05:41:22 +00:00
dependabot[bot]
7b5c41d541 Bump lodash from 4.17.20 to 4.17.21 in /frontend
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-22 05:38:21 +00:00
James Cole
f844197954 Merge pull request #4416 from firefly-iii/dependabot/composer/develop/vimeo/psalm-4.6.1
Bump vimeo/psalm from 4.5.2 to 4.6.1
2021-02-22 05:28:50 +00:00
James Cole
0353e4aa95 Merge pull request #4417 from firefly-iii/dependabot/composer/develop/laravel/framework-8.28.1
Bump laravel/framework from 8.27.0 to 8.28.1
2021-02-22 05:28:43 +00:00
James Cole
3ee93de280 Merge pull request #4418 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.78
Bump phpstan/phpstan from 0.12.76 to 0.12.78
2021-02-22 05:28:33 +00:00
dependabot[bot]
1175c1d676 Bump phpstan/phpstan from 0.12.76 to 0.12.78
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.76 to 0.12.78.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.76...0.12.78)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-22 05:07:36 +00:00
dependabot[bot]
6d51d0cc79 Bump laravel/framework from 8.27.0 to 8.28.1
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.27.0 to 8.28.1.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.27.0...v8.28.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-22 05:07:25 +00:00
dependabot[bot]
12e19c0a70 Bump vimeo/psalm from 4.5.2 to 4.6.1
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 4.5.2 to 4.6.1.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/4.5.2...4.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-22 05:07:07 +00:00
James Cole
00f25836c0 Remove extra logging. 2021-02-19 16:25:36 +01:00
James Cole
c4669ade29 Fix #4412 2021-02-19 16:24:52 +01:00
James Cole
2b06279f05 Fix transaction submission. 2021-02-17 06:54:00 +01:00
James Cole
252ea7277b Drop table. 2021-02-17 06:51:03 +01:00
James Cole
20c45aa0e0 Rebuild frontend 2021-02-17 06:46:26 +01:00
James Cole
c34a5ed3e4 Location is submitted and added to the array through events. 2021-02-17 06:37:33 +01:00
James Cole
5ff7884596 Remove unused translation #4406 2021-02-17 06:19:49 +01:00
James Cole
e04245de96 Refactor some API routes. 2021-02-17 06:17:48 +01:00
James Cole
25e4d78119 API will display journal location. 2021-02-16 10:19:20 +01:00
James Cole
d5d0e6b4ba Give journals a location. 2021-02-16 09:53:28 +01:00
James Cole
2f14753405 Refactor API code. 2021-02-16 09:52:39 +01:00
James Cole
5e7c57744c Update frontend. 2021-02-15 20:32:29 +01:00
James Cole
0ac0dbc774 Merge pull request #4399 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-loader-11.0.1
Bump sass-loader from 10.1.1 to 11.0.1 in /frontend
2021-02-15 06:08:13 +00:00
James Cole
0b368edd97 Merge pull request #4396 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.76
Bump phpstan/phpstan from 0.12.73 to 0.12.76
2021-02-15 05:43:19 +00:00
James Cole
d0e7fe37bb Merge pull request #4397 from firefly-iii/dependabot/composer/develop/laravel/framework-8.27.0
Bump laravel/framework from 8.26.1 to 8.27.0
2021-02-15 05:43:11 +00:00
James Cole
c2d9dcf696 Merge pull request #4395 from firefly-iii/dependabot/composer/develop/vimeo/psalm-4.5.2
Bump vimeo/psalm from 4.4.1 to 4.5.2
2021-02-15 05:43:01 +00:00
James Cole
4efc0ffc6e Merge pull request #4398 from firefly-iii/dependabot/npm_and_yarn/develop/postcss-8.2.6
Bump postcss from 8.2.5 to 8.2.6
2021-02-15 05:42:53 +00:00
James Cole
e64b5dcf3a Fix https://github.com/firefly-iii/firefly-iii/issues/4394 2021-02-15 06:39:55 +01:00
dependabot[bot]
cb4b6f7023 Bump sass-loader from 10.1.1 to 11.0.1 in /frontend
Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 10.1.1 to 11.0.1.
- [Release notes](https://github.com/webpack-contrib/sass-loader/releases)
- [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/sass-loader/compare/v10.1.1...v11.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-15 05:39:11 +00:00
dependabot[bot]
784b24fe3c Bump postcss from 8.2.5 to 8.2.6
Bumps [postcss](https://github.com/postcss/postcss) from 8.2.5 to 8.2.6.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.2.5...8.2.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-15 05:07:38 +00:00
dependabot[bot]
fba23c927b Bump laravel/framework from 8.26.1 to 8.27.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.26.1 to 8.27.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.26.1...v8.27.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-15 05:07:29 +00:00
dependabot[bot]
5771b8c3c6 Bump phpstan/phpstan from 0.12.73 to 0.12.76
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.73 to 0.12.76.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.73...0.12.76)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-15 05:07:05 +00:00
dependabot[bot]
5c7ba4e065 Bump vimeo/psalm from 4.4.1 to 4.5.2
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 4.4.1 to 4.5.2.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/4.4.1...4.5.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-15 05:06:54 +00:00
James Cole
e51f593a2d Split components for future recycling. 2021-02-14 19:13:42 +01:00
James Cole
bfd925fbfe Rebuild frontend. 2021-02-14 10:43:58 +01:00
James Cole
993fe3ae0a Stop using window.sessionStart, start using smart code. 2021-02-14 07:54:05 +01:00
James Cole
70aaa67cfc Update frontend. 2021-02-14 07:53:20 +01:00
James Cole
45f918963e Rebuild frontend. 2021-02-13 20:04:18 +01:00
James Cole
1ecc454f70 Fix issue in rule engine. 2021-02-12 20:15:23 +01:00
James Cole
95966cdcd4 Update frontend 2021-02-12 20:15:07 +01:00
James Cole
b1f2780fb6 Update build script 2021-02-10 07:00:45 +01:00
James Cole
416f8e2855 Build frontend 2021-02-10 06:55:56 +01:00
James Cole
1558da60aa Fix #4007 2021-02-08 15:12:04 +01:00
James Cole
18a9d90d46 Merge pull request #4363 from firefly-iii/dependabot/npm_and_yarn/develop/postcss-8.2.5 2021-02-08 09:27:54 +01:00
dependabot[bot]
934ae994cc Bump postcss from 8.2.4 to 8.2.5
Bumps [postcss](https://github.com/postcss/postcss) from 8.2.4 to 8.2.5.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.2.4...8.2.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 08:22:24 +00:00
James Cole
ee4b38c279 Merge pull request #4362 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-loader-11.0.0
Bump sass-loader from 10.1.1 to 11.0.0 in /frontend
2021-02-08 06:44:31 +01:00
James Cole
2171ed7912 Merge pull request #4358 from firefly-iii/dependabot/npm_and_yarn/develop/uiv-1.2.3
Bump uiv from 1.2.2 to 1.2.3
2021-02-08 06:44:19 +01:00
James Cole
4e274e6a09 Merge pull request #4359 from firefly-iii/dependabot/composer/develop/phpunit/phpunit-9.5.2
Bump phpunit/phpunit from 9.5.1 to 9.5.2
2021-02-08 06:43:17 +01:00
James Cole
1be0cf99b9 Merge pull request #4357 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.73
Bump phpstan/phpstan from 0.12.70 to 0.12.73
2021-02-08 06:42:25 +01:00
dependabot[bot]
60a41887cb Bump sass-loader from 10.1.1 to 11.0.0 in /frontend
Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 10.1.1 to 11.0.0.
- [Release notes](https://github.com/webpack-contrib/sass-loader/releases)
- [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/sass-loader/compare/v10.1.1...v11.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 05:41:48 +00:00
James Cole
f9582cd4fe Merge pull request #4360 from firefly-iii/dependabot/composer/develop/nunomaduro/larastan-0.7.0
Bump nunomaduro/larastan from 0.6.13 to 0.7.0
2021-02-08 06:41:40 +01:00
James Cole
edcd5d56c9 Merge pull request #4361 from firefly-iii/dependabot/composer/develop/laravel/framework-8.26.1
Bump laravel/framework from 8.25.0 to 8.26.1
2021-02-08 06:41:31 +01:00
dependabot[bot]
14fa91d17f Bump laravel/framework from 8.25.0 to 8.26.1
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.25.0 to 8.26.1.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.25.0...v8.26.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 05:08:41 +00:00
dependabot[bot]
e411e629ce Bump nunomaduro/larastan from 0.6.13 to 0.7.0
Bumps [nunomaduro/larastan](https://github.com/nunomaduro/larastan) from 0.6.13 to 0.7.0.
- [Release notes](https://github.com/nunomaduro/larastan/releases)
- [Changelog](https://github.com/nunomaduro/larastan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nunomaduro/larastan/compare/v0.6.13...v0.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 05:07:55 +00:00
dependabot[bot]
5626b11b66 Bump phpunit/phpunit from 9.5.1 to 9.5.2
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.1 to 9.5.2.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.1...9.5.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 05:07:26 +00:00
dependabot[bot]
eee42a0f99 Bump uiv from 1.2.2 to 1.2.3
Bumps [uiv](https://github.com/uiv-lib/uiv) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/uiv-lib/uiv/releases)
- [Commits](https://github.com/uiv-lib/uiv/compare/v1.2.2...v1.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 05:07:11 +00:00
dependabot[bot]
03787e3d74 Bump phpstan/phpstan from 0.12.70 to 0.12.73
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.70 to 0.12.73.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.70...0.12.73)

Signed-off-by: dependabot[bot] <support@github.com>
2021-02-08 05:07:09 +00:00
James Cole
b9e7d99a87 Rebuil frontend. 2021-02-05 08:21:52 +01:00
James Cole
b0ac0ea0cf Catch undefined var 2021-02-05 06:57:12 +01:00
James Cole
8e42f25a1e Rebuild frontend 2021-02-05 06:45:27 +01:00
James Cole
d69843d4bc Rebuild frontend 2021-02-03 19:52:47 +01:00
James Cole
fdba28fad7 Experimental refactor of API code. 2021-02-03 14:57:37 +01:00
James Cole
3b2dd93316 Code to fix https://github.com/firefly-iii/firefly-iii/issues/4340 2021-02-03 10:41:41 +01:00
James Cole
2ad7336605 Fix #4340 2021-02-03 06:46:03 +01:00
James Cole
84ad8529df Fix #4339 2021-02-03 06:31:14 +01:00
James Cole
e441df367d Fix #4338 2021-02-03 06:25:58 +01:00
James Cole
08fcff2a98 Make it easier to switch between v1/v2 layout. 2021-02-03 06:25:46 +01:00
James Cole
957e34a57a Make it easier to switch between v1/v2 layout. 2021-02-02 19:20:44 +01:00
James Cole
71239dbf5b Fix #4334 2021-02-02 07:00:51 +01:00
James Cole
c5d27f0148 Make it easier to switch between v1/v2 layout. 2021-02-01 06:57:29 +01:00
James Cole
b8340ddb59 Make it easier to switch between v1/v2 layout. 2021-02-01 06:47:33 +01:00
James Cole
f16b7c4286 Make it easier to switch between v1/v2 layout. 2021-02-01 06:43:19 +01:00
James Cole
b126177546 Fix reference to pagination template. 2021-02-01 06:38:33 +01:00
James Cole
1121377d2d Make it easier to switch between v1/v2 layout. 2021-02-01 06:31:43 +01:00
James Cole
f9220b8999 Make it easier to switch between v1/v2 layout. 2021-02-01 06:29:45 +01:00
James Cole
be05513ecd Rename files so the old layout will take over. 2021-01-31 20:38:05 +01:00
James Cole
ffe18c63a5 Make it easier to switch between v1/v2 layout. 2021-01-31 20:35:54 +01:00
James Cole
fd8a59924d Make it easier to switch between v1/v2 layout. 2021-01-31 20:35:44 +01:00
James Cole
fdd9d81701 Make it easier to switch between v1/v2 layout. 2021-01-31 20:31:40 +01:00
James Cole
2dd2d0ef58 New frontend. 2021-01-31 20:31:27 +01:00
James Cole
329c3b14d5 Make it easier to switch between v1/v2 layout. 2021-01-31 20:31:13 +01:00
James Cole
27815d0311 Make it easier to switch between v1/v2 layout. 2021-01-31 20:29:17 +01:00
James Cole
21da959203 Make it easier to switch between v1/v2 layout. 2021-01-31 20:26:24 +01:00
James Cole
d60c5a26de New frontend. 2021-01-31 07:26:52 +01:00
James Cole
d4c9f53b10 Update some components. 2021-01-30 12:24:55 +01:00
James Cole
02cd0600ea Update some copyrights. 2021-01-29 18:50:35 +01:00
James Cole
7ffc621638 Merge tag '5.5.0-beta.1' into develop
5.5.0-beta.1
2021-01-29 18:21:08 +01:00
James Cole
3ed4d28c4a Merge branch 'release/5.5.0-beta.1' into main 2021-01-29 18:21:06 +01:00
James Cole
3a5abc3047 Update meta data for new release. 2021-01-29 18:19:50 +01:00
James Cole
ed06ec9a58 Merge branch 'main' into develop
# Conflicts:
#	.github/ISSUE_TEMPLATE/Custom.md
2021-01-26 19:58:30 +01:00
James Cole
fdb74a3dcd Continue work on new frontpage. 2021-01-26 19:57:20 +01:00
James Cole
fcea35ffa9 Update config.yml 2021-01-26 18:43:02 +00:00
James Cole
3c494a64f5 Create config.yml 2021-01-26 18:41:27 +00:00
James Cole
e75d9ccd0e Update issue templates 2021-01-26 18:40:30 +00:00
James Cole
ccaf9d31a6 Set upload size as "***MB" would give errors. 2021-01-26 19:28:35 +01:00
James Cole
cb6862b364 Update packages. 2021-01-26 19:28:06 +01:00
James Cole
e83416d84d Add rule for unique account number. 2021-01-26 19:27:49 +01:00
James Cole
2f8113db6b Add page limit to auto complete 2021-01-26 19:27:27 +01:00
James Cole
cbed5ce67b Merge pull request #4301 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/v-calendar-2.2.1
Bump v-calendar from 2.2.0 to 2.2.1 in /frontend
2021-01-25 08:13:12 +01:00
dependabot[bot]
c9fa1588df Bump v-calendar from 2.2.0 to 2.2.1 in /frontend
Bumps [v-calendar](https://github.com/nathanreyes/v-calendar) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/nathanreyes/v-calendar/releases)
- [Commits](https://github.com/nathanreyes/v-calendar/compare/v2.2.0...v2.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-25 05:49:39 +00:00
James Cole
22beea1a76 Merge pull request #4299 from firefly-iii/dependabot/composer/develop/filp/whoops-2.9.2 2021-01-25 06:18:44 +01:00
dependabot[bot]
b46e17667c Bump filp/whoops from 2.9.1 to 2.9.2
Bumps [filp/whoops](https://github.com/filp/whoops) from 2.9.1 to 2.9.2.
- [Release notes](https://github.com/filp/whoops/releases)
- [Changelog](https://github.com/filp/whoops/blob/master/CHANGELOG.md)
- [Commits](https://github.com/filp/whoops/compare/2.9.1...2.9.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-25 05:11:08 +00:00
James Cole
e3f174621c Update composer file. 2021-01-23 07:08:31 +01:00
James Cole
2ffb98aba8 Rebuild frontend 2021-01-20 18:44:28 +01:00
James Cole
d1e462e66d Update translations. 2021-01-20 18:42:31 +01:00
James Cole
29b5513b03 Fix bad sort in bill controller 2021-01-20 18:42:07 +01:00
James Cole
8918c3ed12 Add "id:xxx" search 2021-01-20 18:41:31 +01:00
James Cole
036e50c0b6 Merge pull request #4291 from firefly-iii/dependabot/composer/laravel/framework-8.22.1
Bump laravel/framework from 8.13.0 to 8.22.1
2021-01-20 06:21:02 +01:00
dependabot[bot]
47d9f5e470 Bump laravel/framework from 8.13.0 to 8.22.1
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.13.0 to 8.22.1.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.13.0...v8.22.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-19 20:15:35 +00:00
James Cole
8efc1df385 Merge pull request #4280 from firefly-iii/dependabot/composer/develop/laravel/ui-3.2.0
Bump laravel/ui from 3.1.0 to 3.2.0
2021-01-18 09:44:53 +01:00
James Cole
fbc6d4a002 Merge pull request #4281 from firefly-iii/dependabot/composer/develop/phpunit/phpunit-9.5.1
Bump phpunit/phpunit from 9.5.0 to 9.5.1
2021-01-18 09:44:38 +01:00
James Cole
fa2c2ff7ba Merge pull request #4284 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.67
Bump phpstan/phpstan from 0.12.65 to 0.12.67
2021-01-18 09:44:24 +01:00
James Cole
787f27102e Merge pull request #4282 from firefly-iii/dependabot/composer/develop/laravel/framework-8.22.1
Bump laravel/framework from 8.21.0 to 8.22.1
2021-01-18 09:44:12 +01:00
dependabot[bot]
80a4a26eae Bump phpunit/phpunit from 9.5.0 to 9.5.1
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.5.0 to 9.5.1.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.5.0...9.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-18 08:37:55 +00:00
dependabot[bot]
48f89a7448 Bump phpstan/phpstan from 0.12.65 to 0.12.67
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.65 to 0.12.67.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.65...0.12.67)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-18 08:36:56 +00:00
dependabot[bot]
32081fb07c Bump laravel/framework from 8.21.0 to 8.22.1
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.21.0 to 8.22.1.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.21.0...v8.22.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-18 08:34:45 +00:00
dependabot[bot]
b13d617863 Bump laravel/ui from 3.1.0 to 3.2.0
Bumps [laravel/ui](https://github.com/laravel/ui) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/laravel/ui/releases)
- [Changelog](https://github.com/laravel/ui/blob/3.x/CHANGELOG.md)
- [Commits](https://github.com/laravel/ui/compare/v3.1.0...v3.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-18 08:34:14 +00:00
James Cole
936ead8668 Merge pull request #4279 from firefly-iii/dependabot/npm_and_yarn/develop/laravel-mix-6.0.10 2021-01-18 06:33:45 +01:00
James Cole
c01f1aa788 Merge pull request #4283 from firefly-iii/dependabot/composer/develop/vimeo/psalm-4.4.1 2021-01-18 06:32:30 +01:00
James Cole
2b9c1e65aa Merge pull request #4278 from firefly-iii/dependabot/npm_and_yarn/develop/vue-i18n-8.22.4 2021-01-18 06:31:52 +01:00
dependabot[bot]
4cd7c528f2 Bump vimeo/psalm from 4.3.2 to 4.4.1
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 4.3.2 to 4.4.1.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/4.3.2...4.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-18 05:19:22 +00:00
dependabot[bot]
74db23a972 Bump laravel-mix from 6.0.9 to 6.0.10
Bumps [laravel-mix](https://github.com/JeffreyWay/laravel-mix) from 6.0.9 to 6.0.10.
- [Release notes](https://github.com/JeffreyWay/laravel-mix/releases)
- [Changelog](https://github.com/JeffreyWay/laravel-mix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/JeffreyWay/laravel-mix/compare/v6.0.9...v6.0.10)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-18 05:07:50 +00:00
dependabot[bot]
aa009d22fc Bump vue-i18n from 8.22.3 to 8.22.4
Bumps [vue-i18n](https://github.com/kazupon/vue-i18n) from 8.22.3 to 8.22.4.
- [Release notes](https://github.com/kazupon/vue-i18n/releases)
- [Changelog](https://github.com/kazupon/vue-i18n/blob/v8.x/CHANGELOG.md)
- [Commits](https://github.com/kazupon/vue-i18n/compare/v8.22.3...v8.22.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-18 05:07:35 +00:00
James Cole
79c00548df Frontend remembers state. 2021-01-17 19:52:53 +01:00
James Cole
c86791950d Rebuild frontpage. 2021-01-17 08:52:40 +01:00
James Cole
eb5d17d695 Accidentally committed debug code. 2021-01-17 08:50:20 +01:00
James Cole
ab31cade09 Rebuild frontend 2021-01-16 04:20:28 +01:00
James Cole
99f8ed7760 Fix some final webhook code. 2021-01-15 21:01:53 +01:00
James Cole
b4f929b325 Rebuild frontend with new libraries. 2021-01-14 19:07:04 +01:00
James Cole
ca1dcc8038 Merge pull request #4257 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/popperjs/core-2.6.0
Bump @popperjs/core from 2.5.4 to 2.6.0 in /frontend
2021-01-11 08:38:05 +01:00
James Cole
a545f1ef88 Merge pull request #4258 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/v-calendar-2.2.0
Bump v-calendar from 2.1.6 to 2.2.0 in /frontend
2021-01-11 08:37:55 +01:00
James Cole
4a64fea352 Merge pull request #4256 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-1.32.2
Bump sass from 1.29.0 to 1.32.2 in /frontend
2021-01-11 08:37:23 +01:00
James Cole
e4800851b0 Merge pull request #4255 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/cross-env-7.0.3
Bump cross-env from 7.0.2 to 7.0.3 in /frontend
2021-01-11 08:36:34 +01:00
James Cole
95681519a8 Merge pull request #4252 from firefly-iii/dependabot/composer/develop/doctrine/dbal-3.0.0
Bump doctrine/dbal from 2.12.1 to 3.0.0
2021-01-11 08:36:16 +01:00
James Cole
f1037c3616 Merge pull request #4254 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/overlayscrollbars-1.13.1
Bump overlayscrollbars from 1.13.0 to 1.13.1 in /frontend
2021-01-11 08:33:00 +01:00
James Cole
cfe83c7e00 Merge pull request #4253 from firefly-iii/dependabot/composer/develop/nunomaduro/larastan-0.6.12
Bump nunomaduro/larastan from 0.6.11 to 0.6.12
2021-01-11 08:30:07 +01:00
James Cole
157f0fc7b6 Merge pull request #4251 from firefly-iii/dependabot/composer/develop/barryvdh/laravel-debugbar-3.5.2
Bump barryvdh/laravel-debugbar from 3.5.1 to 3.5.2
2021-01-11 08:29:43 +01:00
James Cole
261ab7251c Merge pull request #4250 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.65
Bump phpstan/phpstan from 0.12.64 to 0.12.65
2021-01-11 08:29:31 +01:00
James Cole
61e673ea7b Merge pull request #4249 from firefly-iii/dependabot/composer/develop/laravel/framework-8.21.0
Bump laravel/framework from 8.20.1 to 8.21.0
2021-01-11 08:29:04 +01:00
James Cole
3fb3fc698a Merge pull request #4248 from firefly-iii/dependabot/npm_and_yarn/develop/uiv-1.2.1
Bump uiv from 1.2.0 to 1.2.1
2021-01-11 08:28:51 +01:00
James Cole
f3aabf6ab8 Merge pull request #4247 from firefly-iii/dependabot/npm_and_yarn/develop/vue-i18n-8.22.3
Bump vue-i18n from 8.22.2 to 8.22.3
2021-01-11 08:26:29 +01:00
dependabot[bot]
d752c38d3d Bump v-calendar from 2.1.6 to 2.2.0 in /frontend
Bumps [v-calendar](https://github.com/nathanreyes/v-calendar) from 2.1.6 to 2.2.0.
- [Release notes](https://github.com/nathanreyes/v-calendar/releases)
- [Commits](https://github.com/nathanreyes/v-calendar/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:54:42 +00:00
dependabot[bot]
48bfae99f4 Bump @popperjs/core from 2.5.4 to 2.6.0 in /frontend
Bumps [@popperjs/core](https://github.com/popperjs/popper-core) from 2.5.4 to 2.6.0.
- [Release notes](https://github.com/popperjs/popper-core/releases)
- [Commits](https://github.com/popperjs/popper-core/compare/v2.5.4...v2.6.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:54:01 +00:00
dependabot[bot]
116c772b1c Bump sass from 1.29.0 to 1.32.2 in /frontend
Bumps [sass](https://github.com/sass/dart-sass) from 1.29.0 to 1.32.2.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.29.0...1.32.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:53:20 +00:00
dependabot[bot]
e784dd2399 Bump cross-env from 7.0.2 to 7.0.3 in /frontend
Bumps [cross-env](https://github.com/kentcdodds/cross-env) from 7.0.2 to 7.0.3.
- [Release notes](https://github.com/kentcdodds/cross-env/releases)
- [Changelog](https://github.com/kentcdodds/cross-env/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kentcdodds/cross-env/compare/v7.0.2...v7.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:50:06 +00:00
dependabot[bot]
19aec7e6d6 Bump overlayscrollbars from 1.13.0 to 1.13.1 in /frontend
Bumps [overlayscrollbars](https://github.com/KingSora/OverlayScrollbars) from 1.13.0 to 1.13.1.
- [Release notes](https://github.com/KingSora/OverlayScrollbars/releases)
- [Commits](https://github.com/KingSora/OverlayScrollbars/compare/v1.13.0...1.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:49:22 +00:00
dependabot[bot]
0fdce6191b Bump nunomaduro/larastan from 0.6.11 to 0.6.12
Bumps [nunomaduro/larastan](https://github.com/nunomaduro/larastan) from 0.6.11 to 0.6.12.
- [Release notes](https://github.com/nunomaduro/larastan/releases)
- [Changelog](https://github.com/nunomaduro/larastan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nunomaduro/larastan/compare/v0.6.11...v0.6.12)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:14:14 +00:00
dependabot[bot]
ee3ad3e498 Bump doctrine/dbal from 2.12.1 to 3.0.0
Bumps [doctrine/dbal](https://github.com/doctrine/dbal) from 2.12.1 to 3.0.0.
- [Release notes](https://github.com/doctrine/dbal/releases)
- [Upgrade guide](https://github.com/doctrine/dbal/blob/2.12.x/UPGRADE.md)
- [Commits](https://github.com/doctrine/dbal/compare/2.12.1...3.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:13:45 +00:00
dependabot[bot]
7b4b6a2356 Bump barryvdh/laravel-debugbar from 3.5.1 to 3.5.2
Bumps [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar) from 3.5.1 to 3.5.2.
- [Release notes](https://github.com/barryvdh/laravel-debugbar/releases)
- [Changelog](https://github.com/barryvdh/laravel-debugbar/blob/master/changelog.md)
- [Commits](https://github.com/barryvdh/laravel-debugbar/compare/v3.5.1...v3.5.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:13:28 +00:00
dependabot[bot]
b4f47e793b Bump phpstan/phpstan from 0.12.64 to 0.12.65
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.64 to 0.12.65.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.64...0.12.65)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:13:04 +00:00
dependabot[bot]
aff7651697 Bump laravel/framework from 8.20.1 to 8.21.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.20.1 to 8.21.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.20.1...v8.21.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:12:05 +00:00
dependabot[bot]
27003f15e7 Bump uiv from 1.2.0 to 1.2.1
Bumps [uiv](https://github.com/uiv-lib/uiv) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/uiv-lib/uiv/releases)
- [Commits](https://github.com/uiv-lib/uiv/compare/v1.2.0...v1.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:11:50 +00:00
dependabot[bot]
b501cd4555 Bump vue-i18n from 8.22.2 to 8.22.3
Bumps [vue-i18n](https://github.com/kazupon/vue-i18n) from 8.22.2 to 8.22.3.
- [Release notes](https://github.com/kazupon/vue-i18n/releases)
- [Changelog](https://github.com/kazupon/vue-i18n/blob/v8.x/CHANGELOG.md)
- [Commits](https://github.com/kazupon/vue-i18n/compare/v8.22.2...v8.22.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-11 05:11:30 +00:00
James Cole
b40581919c Merge branch 'main' into develop
# Conflicts:
#	frontend/package-lock.json
2021-01-08 20:16:16 +01:00
James Cole
b2fce4d487 Fix #4241 2021-01-08 20:15:28 +01:00
James Cole
24b7543f72 Fix #4235 2021-01-07 20:31:48 +01:00
James Cole
b040db7976 Merge pull request #4231 from MihataBG/patch-3
Update bills.twig
2021-01-06 08:28:08 +01:00
MihataBG
405c487518 Update bills.twig 2021-01-06 09:15:54 +02:00
MihataBG
84b0e344fe Update bills.twig
Hidden column names in mobile web page of "Default financial report" -> Bills table.
2021-01-05 22:06:23 +02:00
James Cole
48cae87ed0 Merge pull request #4229 from firefly-iii/dependabot/npm_and_yarn/frontend/axios-0.21.1
Bump axios from 0.21.0 to 0.21.1 in /frontend
2021-01-05 17:41:30 +01:00
dependabot[bot]
cd5ce36b5d Bump axios from 0.21.0 to 0.21.1 in /frontend
Bumps [axios](https://github.com/axios/axios) from 0.21.0 to 0.21.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.21.0...v0.21.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-05 16:27:25 +00:00
James Cole
3d71c924fd Merge pull request #4226 from firefly-iii/dependabot/npm_and_yarn/axios-0.21.1
Bump axios from 0.21.0 to 0.21.1
2021-01-05 17:26:33 +01:00
dependabot[bot]
e6a44706a3 Bump axios from 0.21.0 to 0.21.1
Bumps [axios](https://github.com/axios/axios) from 0.21.0 to 0.21.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.21.0...v0.21.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-05 08:06:20 +00:00
James Cole
1353f684b5 Merge pull request #4218 from firefly-iii/dependabot/composer/develop/barryvdh/laravel-ide-helper-2.9.0
Bump barryvdh/laravel-ide-helper from 2.8.2 to 2.9.0
2021-01-04 20:50:19 +01:00
James Cole
dd5119f49a Merge pull request #4217 from firefly-iii/dependabot/npm_and_yarn/develop/uiv-1.2.0
Bump uiv from 1.1.5 to 1.2.0
2021-01-04 20:47:12 +01:00
James Cole
83c036e33e Merge pull request #4219 from firefly-iii/dependabot/composer/develop/vimeo/psalm-4.3.2
Bump vimeo/psalm from 4.3.1 to 4.3.2
2021-01-04 20:05:09 +01:00
dependabot[bot]
3e1c16d9a9 Bump vimeo/psalm from 4.3.1 to 4.3.2
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 4.3.1 to 4.3.2.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/4.3.1...4.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-04 05:11:29 +00:00
dependabot[bot]
42adbfa9f4 Bump barryvdh/laravel-ide-helper from 2.8.2 to 2.9.0
Bumps [barryvdh/laravel-ide-helper](https://github.com/barryvdh/laravel-ide-helper) from 2.8.2 to 2.9.0.
- [Release notes](https://github.com/barryvdh/laravel-ide-helper/releases)
- [Changelog](https://github.com/barryvdh/laravel-ide-helper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/barryvdh/laravel-ide-helper/compare/v2.8.2...v2.9.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-04 05:10:58 +00:00
dependabot[bot]
b3068b7a66 Bump uiv from 1.1.5 to 1.2.0
Bumps [uiv](https://github.com/uiv-lib/uiv) from 1.1.5 to 1.2.0.
- [Release notes](https://github.com/uiv-lib/uiv/releases)
- [Commits](https://github.com/uiv-lib/uiv/compare/v1.1.5...v1.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-04 05:10:48 +00:00
James Cole
d24a046570 Rebuild frontend. 2021-01-03 07:11:44 +01:00
James Cole
ff2640276c Add currency symbol to API 2021-01-03 07:09:36 +01:00
James Cole
459d57befa Merge pull request #4207 from sephrat/develop
Fix 'spent per day' budget box
2021-01-02 20:03:12 +01:00
Florian Dupret
5dddb5e0df Fix 'spent per day' budget box 2021-01-02 14:33:19 +01:00
Florian Dupret
e848c7372c Fix 'spent per day' budget box 2021-01-02 14:24:31 +01:00
Florian Dupret
1884746233 Fix 'spent per day' budget box 2021-01-02 14:09:02 +01:00
James Cole
321bb33255 Fix #4186 2020-12-30 19:27:09 +01:00
James Cole
e6fd8324e2 Fix #4175 2020-12-30 19:25:53 +01:00
James Cole
fc4f35d6ba Fix #4195 2020-12-30 19:25:02 +01:00
James Cole
ef42d89d55 Update languages. 2020-12-30 18:43:37 +01:00
James Cole
2a0af839f9 Rebuild frontend 2020-12-30 18:43:16 +01:00
James Cole
a19e116a15 Error code for #4200 2020-12-30 11:59:10 +01:00
James Cole
9325b628fd Fix #4199 2020-12-30 11:53:00 +01:00
James Cole
02237d9efe Rebuilt frontend 2020-12-29 08:34:31 +01:00
James Cole
f2e6f03f8c First components for new transaction form. 2020-12-29 08:33:46 +01:00
James Cole
e2330d9bfe Log warning in cron controller 2020-12-29 08:33:25 +01:00
James Cole
bbc131b52c Merge pull request #4192 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/v-calendar-2.1.5
Bump v-calendar from 2.1.3 to 2.1.5 in /frontend
2020-12-28 09:58:49 +01:00
James Cole
7812613d54 Merge pull request #4191 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.64
Bump phpstan/phpstan from 0.12.63 to 0.12.64
2020-12-28 09:58:00 +01:00
James Cole
f9ce8b0bd9 Merge pull request #4190 from firefly-iii/dependabot/composer/develop/laravel/framework-8.20.1
Bump laravel/framework from 8.19.0 to 8.20.1
2020-12-28 08:53:12 +01:00
James Cole
b4da9096d5 Merge pull request #4189 from firefly-iii/dependabot/npm_and_yarn/develop/axios-0.21.1
Bump axios from 0.21.0 to 0.21.1
2020-12-28 08:46:20 +01:00
dependabot[bot]
85880a1974 Bump v-calendar from 2.1.3 to 2.1.5 in /frontend
Bumps [v-calendar](https://github.com/nathanreyes/v-calendar) from 2.1.3 to 2.1.5.
- [Release notes](https://github.com/nathanreyes/v-calendar/releases)
- [Commits](https://github.com/nathanreyes/v-calendar/compare/v2.1.3...v2.1.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-28 05:47:44 +00:00
dependabot[bot]
6b9b7fdeb3 Bump phpstan/phpstan from 0.12.63 to 0.12.64
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.63 to 0.12.64.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.63...0.12.64)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-28 05:09:49 +00:00
dependabot[bot]
7c1cb9ac5d Bump laravel/framework from 8.19.0 to 8.20.1
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.19.0 to 8.20.1.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.19.0...v8.20.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-28 05:09:23 +00:00
dependabot[bot]
24070c3cb9 Bump axios from 0.21.0 to 0.21.1
Bumps [axios](https://github.com/axios/axios) from 0.21.0 to 0.21.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v0.21.1/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.21.0...v0.21.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-28 05:07:45 +00:00
James Cole
6c18c7fb9f Update version. 2020-12-26 07:43:08 +01:00
James Cole
9d05d26aa4 Rebuild FP 2020-12-25 12:49:28 +01:00
James Cole
b34f16535c Fix cast error in PHP 8.0 2020-12-25 12:45:34 +01:00
James Cole
232cc39325 Rebuild FP 2020-12-24 18:48:00 +01:00
James Cole
6be1f5819f Rebuild FP 2020-12-22 19:29:44 +01:00
James Cole
1a8fd25ec3 Rebuild front with some vuex storage. 2020-12-22 17:22:50 +01:00
James Cole
7530effcaa Fix PHP 8 related errors. 2020-12-22 17:16:55 +01:00
James Cole
e9cab814d3 Rebuild frontend v2 2020-12-22 06:28:09 +01:00
James Cole
40f2c9bd27 Clean up languages 2020-12-22 06:27:36 +01:00
James Cole
cb243e6295 Update local translations. 2020-12-22 06:17:23 +01:00
James Cole
b263120c8f Add newlines and strict types check. 2020-12-22 05:35:06 +01:00
James Cole
c7cf55b831 Merge pull request #4171 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/v-calendar-2.1.3
Bump v-calendar from 2.1.2 to 2.1.3 in /frontend
2020-12-21 09:52:55 +01:00
James Cole
235ef06386 Merge pull request #4170 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/popperjs/core-2.6.0
Bump @popperjs/core from 2.5.4 to 2.6.0 in /frontend
2020-12-21 09:52:22 +01:00
dependabot[bot]
925fd3bd3c Bump v-calendar from 2.1.2 to 2.1.3 in /frontend
Bumps [v-calendar](https://github.com/nathanreyes/v-calendar) from 2.1.2 to 2.1.3.
- [Release notes](https://github.com/nathanreyes/v-calendar/releases)
- [Commits](https://github.com/nathanreyes/v-calendar/compare/v2.1.2...v2.1.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 08:47:08 +00:00
James Cole
4559d3e4c5 Merge pull request #4172 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/overlayscrollbars-1.13.1
Bump overlayscrollbars from 1.13.0 to 1.13.1 in /frontend
2020-12-21 09:42:20 +01:00
James Cole
670bf26510 Fix round() calls for PHP 8.0 2020-12-21 09:02:24 +01:00
dependabot[bot]
f3c9ee5a54 Bump overlayscrollbars from 1.13.0 to 1.13.1 in /frontend
Bumps [overlayscrollbars](https://github.com/KingSora/OverlayScrollbars) from 1.13.0 to 1.13.1.
- [Release notes](https://github.com/KingSora/OverlayScrollbars/releases)
- [Commits](https://github.com/KingSora/OverlayScrollbars/compare/v1.13.0...1.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 05:53:01 +00:00
dependabot[bot]
ee237bfc3f Bump @popperjs/core from 2.5.4 to 2.6.0 in /frontend
Bumps [@popperjs/core](https://github.com/popperjs/popper-core) from 2.5.4 to 2.6.0.
- [Release notes](https://github.com/popperjs/popper-core/releases)
- [Commits](https://github.com/popperjs/popper-core/compare/v2.5.4...v2.6.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-21 05:48:46 +00:00
James Cole
fe66bb1984 Fix #4169 2020-12-21 06:18:59 +01:00
James Cole
9971d95605 Update composer. 2020-12-21 06:18:37 +01:00
James Cole
4ebfc33b39 Let's do this in a separate branch 2020-12-20 10:41:55 +01:00
James Cole
bb86ef5683 Prep for LDAP upgrade 2020-12-20 10:32:23 +01:00
James Cole
69edc66509 Fix missing index. 2020-12-20 06:58:35 +01:00
James Cole
d3f4a06d89 Support subqueries in search. 2020-12-20 06:56:27 +01:00
James Cole
dac961a732 Code to fix #4162 2020-12-18 19:16:56 +01:00
James Cole
21619544f5 Fix round() call for PHP 8.0 2020-12-17 17:11:56 +01:00
James Cole
4a8183e5cc Update lock file. 2020-12-17 06:37:42 +01:00
James Cole
da198fb073 Add new language, as yet disabled. 2020-12-17 06:32:05 +01:00
James Cole
b1ed1f878b Add new language, as yet disabled. 2020-12-17 06:31:45 +01:00
James Cole
2a3a89a6ed Remove log 2020-12-17 06:31:32 +01:00
James Cole
013ebbf039 Initial effort to make code 8.0 compatible. 2020-12-17 06:31:23 +01:00
James Cole
07fa1b301f Remove some "strtolower"-references https://github.com/firefly-iii/firefly-iii/pull/4158 2020-12-16 08:42:18 +01:00
James Cole
c9893d0fda Merge pull request #4146 from firefly-iii/dependabot/composer/develop/nunomaduro/larastan-0.6.11
Bump nunomaduro/larastan from 0.6.10 to 0.6.11
2020-12-14 15:02:39 +01:00
James Cole
78c936cd1e Merge pull request #4148 from firefly-iii/dependabot/composer/develop/laravel/framework-8.18.1
Bump laravel/framework from 8.17.2 to 8.18.1
2020-12-14 15:02:13 +01:00
James Cole
c0ae7b6987 Merge pull request #4149 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.62
Bump phpstan/phpstan from 0.12.58 to 0.12.62
2020-12-14 15:01:44 +01:00
James Cole
83e4bc774a Merge pull request #4147 from firefly-iii/dependabot/composer/develop/barryvdh/laravel-ide-helper-2.8.2
Bump barryvdh/laravel-ide-helper from 2.8.1 to 2.8.2
2020-12-14 15:01:29 +01:00
dependabot[bot]
9d8fe1d917 Bump nunomaduro/larastan from 0.6.10 to 0.6.11
Bumps [nunomaduro/larastan](https://github.com/nunomaduro/larastan) from 0.6.10 to 0.6.11.
- [Release notes](https://github.com/nunomaduro/larastan/releases)
- [Changelog](https://github.com/nunomaduro/larastan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nunomaduro/larastan/compare/v0.6.10...v0.6.11)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 08:27:22 +00:00
dependabot[bot]
b78913ee0f Bump laravel/framework from 8.17.2 to 8.18.1
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.17.2 to 8.18.1.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.17.2...v8.18.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 08:25:47 +00:00
dependabot[bot]
ac0d173cfd Bump phpstan/phpstan from 0.12.58 to 0.12.62
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.58 to 0.12.62.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.58...0.12.62)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 08:24:42 +00:00
dependabot[bot]
bd7c5423e6 Bump barryvdh/laravel-ide-helper from 2.8.1 to 2.8.2
Bumps [barryvdh/laravel-ide-helper](https://github.com/barryvdh/laravel-ide-helper) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/barryvdh/laravel-ide-helper/releases)
- [Changelog](https://github.com/barryvdh/laravel-ide-helper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/barryvdh/laravel-ide-helper/compare/v2.8.1...v2.8.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 08:22:56 +00:00
James Cole
839c077e8f Merge pull request #4151 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-loader-10.1.0
Bump sass-loader from 10.0.5 to 10.1.0 in /frontend
2020-12-14 08:49:54 +01:00
James Cole
325d74ff6b Merge pull request #4152 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/cross-env-7.0.3
Bump cross-env from 7.0.2 to 7.0.3 in /frontend
2020-12-14 08:49:41 +01:00
James Cole
cf2390a02e Merge pull request #4153 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/v-calendar-2.1.2
Bump v-calendar from 2.1.1 to 2.1.2 in /frontend
2020-12-14 08:48:13 +01:00
James Cole
abbd04b487 Merge pull request #4154 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-1.30.0
Bump sass from 1.29.0 to 1.30.0 in /frontend
2020-12-14 08:48:01 +01:00
James Cole
9f8fbd67e7 Merge pull request #4155 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/vue-i18n-8.22.2
Bump vue-i18n from 8.22.1 to 8.22.2 in /frontend
2020-12-14 08:47:39 +01:00
dependabot[bot]
1d287c5d0d Bump vue-i18n from 8.22.1 to 8.22.2 in /frontend
Bumps [vue-i18n](https://github.com/kazupon/vue-i18n) from 8.22.1 to 8.22.2.
- [Release notes](https://github.com/kazupon/vue-i18n/releases)
- [Changelog](https://github.com/kazupon/vue-i18n/blob/v8.x/CHANGELOG.md)
- [Commits](https://github.com/kazupon/vue-i18n/compare/v8.22.1...v8.22.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 05:57:06 +00:00
dependabot[bot]
b2d42d590c Bump sass from 1.29.0 to 1.30.0 in /frontend
Bumps [sass](https://github.com/sass/dart-sass) from 1.29.0 to 1.30.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.29.0...1.30.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 05:56:17 +00:00
dependabot[bot]
2a4d10c7c7 Bump v-calendar from 2.1.1 to 2.1.2 in /frontend
Bumps [v-calendar](https://github.com/nathanreyes/v-calendar) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/nathanreyes/v-calendar/releases)
- [Commits](https://github.com/nathanreyes/v-calendar/compare/v2.1.1...v2.1.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 05:55:24 +00:00
dependabot[bot]
65329b84b9 Bump cross-env from 7.0.2 to 7.0.3 in /frontend
Bumps [cross-env](https://github.com/kentcdodds/cross-env) from 7.0.2 to 7.0.3.
- [Release notes](https://github.com/kentcdodds/cross-env/releases)
- [Changelog](https://github.com/kentcdodds/cross-env/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kentcdodds/cross-env/compare/v7.0.2...v7.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 05:54:33 +00:00
dependabot[bot]
8a58215f45 Bump sass-loader from 10.0.5 to 10.1.0 in /frontend
Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 10.0.5 to 10.1.0.
- [Release notes](https://github.com/webpack-contrib/sass-loader/releases)
- [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/sass-loader/compare/v10.0.5...v10.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 05:53:38 +00:00
James Cole
a9a41f31e3 Merge pull request #4150 from firefly-iii/dependabot/composer/develop/fakerphp/faker-1.12.1
Bump fakerphp/faker from 1.12.0 to 1.12.1
2020-12-14 06:41:39 +01:00
dependabot[bot]
dcabaf380f Bump fakerphp/faker from 1.12.0 to 1.12.1
Bumps [fakerphp/faker](https://github.com/FakerPHP/Faker) from 1.12.0 to 1.12.1.
- [Release notes](https://github.com/FakerPHP/Faker/releases)
- [Changelog](https://github.com/FakerPHP/Faker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/FakerPHP/Faker/compare/v1.12.0...v1.12.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-14 05:20:01 +00:00
James Cole
29e3eedef5 Merge some main changes into dev. 2020-12-12 06:53:26 +01:00
James Cole
c9322cf69f First changelog 2020-12-12 06:52:28 +01:00
James Cole
cb7b2cd53c Merge pull request #4140 from firefly-iii/dependabot/npm_and_yarn/frontend/ini-1.3.7
Bump ini from 1.3.5 to 1.3.7 in /frontend
2020-12-11 12:01:16 +01:00
dependabot[bot]
61ac8f6ab8 Bump ini from 1.3.5 to 1.3.7 in /frontend
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-11 10:19:51 +00:00
James Cole
61ff1330df Merge pull request #4139 from firefly-iii/dependabot/npm_and_yarn/ini-1.3.7
Bump ini from 1.3.5 to 1.3.7
2020-12-11 11:17:23 +01:00
dependabot[bot]
008b9c1191 Bump ini from 1.3.5 to 1.3.7
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-11 07:29:57 +00:00
James Cole
be33f6c987 Fix pagination. 2020-12-11 05:17:32 +01:00
James Cole
ee6bd0a0fa Merge pull request #4130 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-1.30.0
Bump sass from 1.29.0 to 1.30.0 in /frontend
2020-12-07 08:29:18 +01:00
James Cole
f41145fe56 Merge pull request #4129 from firefly-iii/dependabot/npm_and_yarn/develop/cross-env-7.0.3
Bump cross-env from 7.0.2 to 7.0.3
2020-12-07 07:41:21 +01:00
dependabot[bot]
21dc8df0bf Bump sass from 1.29.0 to 1.30.0 in /frontend
Bumps [sass](https://github.com/sass/dart-sass) from 1.29.0 to 1.30.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.29.0...1.30.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 05:56:36 +00:00
dependabot[bot]
858f8c63e6 Bump cross-env from 7.0.2 to 7.0.3
Bumps [cross-env](https://github.com/kentcdodds/cross-env) from 7.0.2 to 7.0.3.
- [Release notes](https://github.com/kentcdodds/cross-env/releases)
- [Changelog](https://github.com/kentcdodds/cross-env/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kentcdodds/cross-env/compare/v7.0.2...v7.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-07 05:10:48 +00:00
James Cole
80f9e0e396 Trigger on delete. 2020-12-05 14:53:14 +01:00
James Cole
81a3e23b4e Update contributing guidelines. 2020-12-05 14:52:55 +01:00
James Cole
58f97a163f Also drop attempts DB 2020-12-05 07:09:05 +01:00
James Cole
9576806765 Message sending is now a job 2020-12-05 07:01:26 +01:00
James Cole
deb829dfdb Make sure webhooks are generated in a generic way for future expansion. 2020-12-05 06:47:16 +01:00
James Cole
4a7e185c44 Fix #4122 2020-12-04 20:37:15 +01:00
James Cole
ce5cabd903 Rebuild frontend. 2020-12-04 20:27:40 +01:00
James Cole
172d2297f1 Update packages. 2020-12-04 20:25:27 +01:00
James Cole
48d1d5c90b Make sure webhook messages can be versionised later. 2020-12-04 20:19:52 +01:00
James Cole
7ee9b51b3f Split webhook message sending into different models. 2020-12-04 06:21:22 +01:00
James Cole
888f5896ff Update model phpdoc [skip ci] 2020-12-04 06:20:44 +01:00
James Cole
a539cfe4f2 Webhooks have titles now. 2020-12-03 06:54:42 +01:00
James Cole
eb80578e30 Can now send webhook messages. 2020-12-02 19:30:09 +01:00
James Cole
35c9367819 New method for consistent data collection. 2020-12-02 17:12:58 +01:00
James Cole
cbe046ba07 Can generate webhook messages for creating transactions. 2020-12-02 06:54:13 +01:00
James Cole
e27e0a97a7 Fix #4113 2020-12-02 06:41:42 +01:00
James Cole
822432712b Fix #4112 2020-12-02 06:28:34 +01:00
James Cole
1f5ac4d9cc Fix #4108 2020-12-01 18:29:21 +01:00
James Cole
d66b03166f Fix #4070 2020-12-01 18:11:31 +01:00
James Cole
c563340532 Fix comma parsing when users search for amount:12,34 2020-12-01 12:24:23 +01:00
James Cole
dd85b8d46a Merge pull request #4102 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.58
Bump phpstan/phpstan from 0.12.57 to 0.12.58
2020-11-30 06:37:36 +01:00
dependabot[bot]
182cd6c100 Bump phpstan/phpstan from 0.12.57 to 0.12.58
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.57 to 0.12.58.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.57...0.12.58)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-30 05:19:11 +00:00
James Cole
59962005db API ability to manage webhooks. 2020-11-29 18:35:49 +01:00
James Cole
6ecbc5e013 Create stale.yml 2020-11-29 13:03:13 +00:00
James Cole
f42bd19c1c Add some stuff for webhooks. 2020-11-29 11:36:29 +01:00
James Cole
c68d7c5aad First attempt at webhooks table. 2020-11-29 09:29:38 +01:00
James Cole
0e5e2fcef7 Config for webhooks. 2020-11-29 09:15:27 +01:00
James Cole
d8344d8d45 Export meta data, fix #3717 2020-11-29 07:58:24 +01:00
James Cole
1ad5f5c759 Fix #4098 2020-11-29 07:07:08 +01:00
James Cole
b38e7cbb1a Rebuild front 2020-11-29 07:06:55 +01:00
James Cole
a5b6bf5797 Make OAuth visible for users. 2020-11-28 05:52:39 +01:00
James Cole
29d1c950ec Update composer to catch some passport related problems. 2020-11-28 05:36:56 +01:00
James Cole
b16d23460e Expand frontend. 2020-11-27 06:14:10 +01:00
James Cole
1b27f6143c Expand API with still undocumented features 2020-11-27 06:13:46 +01:00
James Cole
11e6410d7c Fix layout call. 2020-11-26 06:32:07 +01:00
James Cole
a78d7b9fec Small change in dashboard. 2020-11-26 06:23:02 +01:00
James Cole
68bbadb99a Hardcode v2 2020-11-25 19:54:02 +01:00
James Cole
7211ea5b9b Small test to see if moment isn't null 2020-11-25 19:43:42 +01:00
James Cole
825be42c4e Variables fix. 2020-11-25 19:31:30 +01:00
James Cole
e12c4197f6 Variables fix. 2020-11-25 19:25:07 +01:00
James Cole
6c14742ce0 Rebuild frontend. 2020-11-25 06:32:30 +01:00
James Cole
16018109c8 Minor changes in kernel code. 2020-11-25 06:25:08 +01:00
James Cole
9a658b60fb Merge pull request #4085 from firefly-iii/dependabot/composer/develop/phpunit/phpunit-9.4.3
Bump phpunit/phpunit from 9.4.2 to 9.4.3
2020-11-23 07:49:26 +01:00
James Cole
a13dc20e51 Merge pull request #4084 from firefly-iii/dependabot/composer/develop/laravel/framework-8.15.0
Bump laravel/framework from 8.14.0 to 8.15.0
2020-11-23 07:49:16 +01:00
James Cole
9f1fb62d21 Merge pull request #4083 from firefly-iii/dependabot/composer/develop/diglactic/laravel-breadcrumbs-6.0.3
Bump diglactic/laravel-breadcrumbs from 6.0.2 to 6.0.3
2020-11-23 07:49:06 +01:00
James Cole
a41dc220ca Merge pull request #4082 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.57
Bump phpstan/phpstan from 0.12.55 to 0.12.57
2020-11-23 07:48:55 +01:00
James Cole
6388bdc946 Merge pull request #4081 from firefly-iii/dependabot/composer/develop/vimeo/psalm-4.2.1
Bump vimeo/psalm from 4.1.1 to 4.2.1
2020-11-23 07:48:44 +01:00
dependabot[bot]
5ea5622ead Bump phpunit/phpunit from 9.4.2 to 9.4.3
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.4.2 to 9.4.3.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.4.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.4.2...9.4.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-23 05:29:39 +00:00
dependabot[bot]
bcfbb232c0 Bump laravel/framework from 8.14.0 to 8.15.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.14.0 to 8.15.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.14.0...v8.15.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-23 05:26:36 +00:00
dependabot[bot]
b7f73cdc0e Bump diglactic/laravel-breadcrumbs from 6.0.2 to 6.0.3
Bumps [diglactic/laravel-breadcrumbs](https://github.com/diglactic/laravel-breadcrumbs) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/diglactic/laravel-breadcrumbs/releases)
- [Commits](https://github.com/diglactic/laravel-breadcrumbs/compare/v6.0.2...v6.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-23 05:22:56 +00:00
dependabot[bot]
4c84a14ee2 Bump phpstan/phpstan from 0.12.55 to 0.12.57
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.55 to 0.12.57.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.55...0.12.57)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-23 05:20:28 +00:00
dependabot[bot]
e5201d6127 Bump vimeo/psalm from 4.1.1 to 4.2.1
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 4.1.1 to 4.2.1.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/4.1.1...4.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-23 05:17:59 +00:00
James Cole
ce7bc723ac Rebuild new frontend. 2020-11-22 07:50:55 +01:00
James Cole
4a54f484aa Remove code comment. 2020-11-22 07:50:26 +01:00
James Cole
e1c242326a Rebuild frontend 2020-11-21 12:06:43 +01:00
James Cole
2eee4cfcf8 Configurable audit logging for #4074 2020-11-20 15:44:17 +01:00
James Cole
729a6130be Rebuild frontend. 2020-11-20 06:28:14 +01:00
James Cole
b8c73aa0d9 Create event manually 2020-11-20 06:25:08 +01:00
James Cole
c659d67172 Budget limit now has period. 2020-11-20 06:24:08 +01:00
James Cole
3dbc74b040 Fix #4071 2020-11-20 06:22:43 +01:00
James Cole
5e703c6e7f Extra instructions in GitHub templates. 2020-11-19 06:31:09 +01:00
James Cole
30817cba9f Merge pull request #4066 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.55
Bump phpstan/phpstan from 0.12.54 to 0.12.55
2020-11-16 11:15:01 +01:00
James Cole
38170ba614 Merge pull request #4065 from firefly-iii/dependabot/composer/develop/fakerphp/faker-1.11.0
Bump fakerphp/faker from 1.10.1 to 1.11.0
2020-11-16 11:10:13 +01:00
James Cole
369e92f0ad Merge pull request #4064 from firefly-iii/dependabot/composer/develop/adldap2/adldap2-laravel-6.1.4
Bump adldap2/adldap2-laravel from 6.1.2 to 6.1.4
2020-11-16 09:31:58 +01:00
James Cole
f8f407aac5 Merge pull request #4067 from firefly-iii/dependabot/composer/develop/doctrine/dbal-2.12.1
Bump doctrine/dbal from 2.12.0 to 2.12.1
2020-11-16 09:31:42 +01:00
dependabot[bot]
f9ce04744b Bump fakerphp/faker from 1.10.1 to 1.11.0
Bumps [fakerphp/faker](https://github.com/FakerPHP/Faker) from 1.10.1 to 1.11.0.
- [Release notes](https://github.com/FakerPHP/Faker/releases)
- [Changelog](https://github.com/FakerPHP/Faker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/FakerPHP/Faker/compare/v1.10.1...v1.11.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-16 07:55:22 +00:00
dependabot[bot]
6ba421e867 Bump phpstan/phpstan from 0.12.54 to 0.12.55
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.54 to 0.12.55.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.54...0.12.55)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-16 07:54:54 +00:00
dependabot[bot]
7cfc615af8 Bump doctrine/dbal from 2.12.0 to 2.12.1
Bumps [doctrine/dbal](https://github.com/doctrine/dbal) from 2.12.0 to 2.12.1.
- [Release notes](https://github.com/doctrine/dbal/releases)
- [Commits](https://github.com/doctrine/dbal/compare/2.12.0...2.12.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-16 07:53:29 +00:00
dependabot[bot]
cfc5dfb62f Bump adldap2/adldap2-laravel from 6.1.2 to 6.1.4
Bumps [adldap2/adldap2-laravel](https://github.com/Adldap2/Adldap2-Laravel) from 6.1.2 to 6.1.4.
- [Release notes](https://github.com/Adldap2/Adldap2-Laravel/releases)
- [Commits](https://github.com/Adldap2/Adldap2-Laravel/compare/v6.1.2...v6.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-16 07:50:43 +00:00
James Cole
3a8bfaba27 Merge pull request #4068 from firefly-iii/dependabot/composer/develop/laravel/framework-8.14.0
Bump laravel/framework from 8.13.0 to 8.14.0
2020-11-16 07:26:43 +01:00
dependabot[bot]
fedc16503a Bump laravel/framework from 8.13.0 to 8.14.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 8.13.0 to 8.14.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-8.x.md)
- [Commits](https://github.com/laravel/framework/compare/v8.13.0...v8.14.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-16 05:26:38 +00:00
James Cole
8f0d36e724 production build of frontend v1 2020-11-15 14:05:29 +01:00
James Cole
20850a604f Update frontend layout. 2020-11-15 14:05:04 +01:00
James Cole
259fadc433 Expand views in v2 2020-11-15 14:02:49 +01:00
James Cole
eb616f36ea Expand API. 2020-11-15 14:02:29 +01:00
James Cole
20e7948d99 Update sonar rules. 2020-11-15 14:02:12 +01:00
James Cole
1e4c3f0e19 Forget 2FA cookie when logout. 2020-11-15 06:13:56 +01:00
James Cole
c749e69abc Rename column 2020-11-15 06:09:23 +01:00
James Cole
f266c14f9c Missing import. 2020-11-15 05:53:42 +01:00
James Cole
b8fffe5d6d Merge pull request #4062 from hakoerber/fix-remote-guard-email-header
Fix remote guard email header
2020-11-14 20:14:48 +01:00
Hannes Körber
9082a7d9b9 Fix error on missing AUTHENTICATION_GUARD_EMAIL
Fixes #4060
2020-11-14 18:50:31 +01:00
James Cole
f7490176ec Expand table. 2020-11-13 14:03:04 +01:00
James Cole
5fce6af00a Fix #4055 2020-11-12 20:26:41 +01:00
James Cole
cd67d8fe21 New migration 2020-11-12 14:58:39 +01:00
James Cole
ce51bb8be6 Build frontend again, using Yarn. 2020-11-12 07:11:15 +01:00
James Cole
60339c9d1b Build frontend, delete old code. 2020-11-12 06:14:15 +01:00
James Cole
d90f457a36 Add to webpack 2020-11-12 05:58:17 +01:00
James Cole
8f42c6e4eb Update vue 2020-11-12 05:58:06 +01:00
James Cole
5e87d7b570 Expand configuration. 2020-11-12 05:55:14 +01:00
James Cole
80718baa16 Catch null pointer 2020-11-11 19:14:05 +01:00
James Cole
ae9a9c1647 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-11-11 19:09:02 +01:00
James Cole
68ff7fd568 Merge pull request #4050 from Johnny-Malizia/transactionapilimit
Updated Transaction Search API to set limit from user preferences
2020-11-09 15:11:56 +00:00
johnny
30ff2f0f11 Updated Transaction Search API to set limit from user preferences 2020-11-08 17:16:17 -08:00
James Cole
ab70fd8bc5 Move fields to configuration. 2020-11-08 18:26:40 +01:00
James Cole
479f9e8f0c Add links to add stuff. 2020-11-08 15:33:11 +01:00
James Cole
f584f159f0 Fix #4045 2020-11-08 15:17:44 +01:00
James Cole
9352d38c1c Update translations. 2020-11-08 14:31:38 +01:00
James Cole
6b79f1abdb Create events for transaction links. 2020-11-08 14:27:03 +01:00
James Cole
52ce873aac Update views. 2020-11-08 14:16:06 +01:00
James Cole
006da9ebbc Update frontend v2 2020-11-08 14:15:53 +01:00
James Cole
0f32761ae8 Refactor code. 2020-11-08 14:13:21 +01:00
James Cole
ec44d0dc8e Remove deprecated call 2020-11-08 14:07:59 +01:00
James Cole
d268931187 Refactor to remove deprecated methods. 2020-11-08 14:06:49 +01:00
James Cole
7efb77e000 Refactor authorize() method. 2020-11-08 13:36:13 +01:00
James Cole
e16bbf1072 Refactor request classes. 2020-11-08 13:31:54 +01:00
James Cole
6560510dd8 Remove plugin from Travis script. 2020-11-08 07:07:20 +01:00
James Cole
293d61b343 Clean up views and pages for v2 2020-11-07 20:13:06 +01:00
James Cole
f582a11feb Cleanup changelog. 2020-11-07 17:42:00 +01:00
James Cole
896fbbc146 Merge tag '5.4.6' into develop
5.4.6
2020-11-07 17:40:31 +01:00
James Cole
bcb734a459 Merge branch 'release/5.4.6' into main 2020-11-07 17:40:29 +01:00
James Cole
8e9e0f71bf Some last minute updates 2020-11-07 17:39:06 +01:00
James Cole
647c9c5eb0 Fix #4023 2020-11-07 17:22:11 +01:00
James Cole
4fa92ed5f7 Code for #4023 2020-11-07 17:19:23 +01:00
James Cole
febcbac1de Expand changelog. 2020-11-07 14:32:38 +01:00
James Cole
c9763c3d05 Fix #4006 2020-11-07 14:31:06 +01:00
James Cole
fab6d5df8d Update meta files ahead of new release. 2020-11-07 14:30:59 +01:00
James Cole
5d872bead7 Update category code for #4015 2020-11-07 14:25:43 +01:00
James Cole
60a3cc1f72 Remove migration. 2020-11-07 14:11:41 +01:00
James Cole
413df5a005 Expand tests 2020-11-07 14:05:53 +01:00
James Cole
5b35612be0 Expand v2 views 2020-11-07 14:05:42 +01:00
James Cole
54441df562 Update version 2020-11-07 14:05:28 +01:00
James Cole
87f4b59cfe Rebuild frontend. 2020-11-07 14:05:20 +01:00
James Cole
4d0839cf9c New empty views for new layout 2020-11-07 07:23:17 +01:00
James Cole
56388e46f2 Merge pull request #4015 from weimdall/develop
Forward REMOTE_USER (remote_user_guard auth mode)
2020-11-06 16:58:51 +00:00
James Cole
6b20b7ecdb Can edit category notes 2020-11-05 06:25:56 +01:00
James Cole
ee82547eed Basic expand and collapse. #4031 2020-11-05 06:16:22 +01:00
James Cole
ebd9b30f55 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-11-04 19:06:18 +01:00
James Cole
5b70f70aa7 update packages. 2020-11-04 19:05:35 +01:00
James Cole
80ef6fcb04 Send messages to owner, not to user when user is demo. 2020-11-03 20:33:46 +01:00
Julien Cassagne
700db14de2 Fix : Forward REMOTE_USER
In remote_user_guard auth mode, fireflyiii wasn't receiving REMOTE_USER
This issue occurs with docker image and standalone (when using apache)
2020-11-03 01:19:50 -05:00
James Cole
433397cb3d Update composer JSON 2020-11-02 19:56:34 +01:00
James Cole
40b952c4e8 Merge pull request #4022 from firefly-iii/dependabot/composer/develop/vimeo/psalm-4.1.0
Bump vimeo/psalm from 3.18.2 to 4.1.0
2020-11-02 08:25:29 +01:00
James Cole
b46b01e03d Merge pull request #4025 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/popperjs/core-2.5.4
Bump @popperjs/core from 2.5.3 to 2.5.4 in /frontend
2020-11-02 08:24:49 +01:00
James Cole
70b8a10e94 Merge pull request #4026 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-1.28.0
Bump sass from 1.27.0 to 1.28.0 in /frontend
2020-11-02 08:24:27 +01:00
dependabot[bot]
b40eaf7585 Bump sass from 1.27.0 to 1.28.0 in /frontend
Bumps [sass](https://github.com/sass/dart-sass) from 1.27.0 to 1.28.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.27.0...1.28.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-02 06:03:39 +00:00
dependabot[bot]
aeca645a37 Bump @popperjs/core from 2.5.3 to 2.5.4 in /frontend
Bumps [@popperjs/core](https://github.com/popperjs/popper-core) from 2.5.3 to 2.5.4.
- [Release notes](https://github.com/popperjs/popper-core/releases)
- [Commits](https://github.com/popperjs/popper-core/compare/v2.5.3...v2.5.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-02 06:02:12 +00:00
dependabot[bot]
713dbf47fb Bump vimeo/psalm from 3.18.2 to 4.1.0
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 3.18.2 to 4.1.0.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/3.18.2...4.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-02 05:28:11 +00:00
James Cole
d6c7ccf62d Remodel seeds and factories. 2020-11-02 06:20:49 +01:00
James Cole
52385ae980 Expand docs for #4015 2020-11-01 07:01:59 +01:00
James Cole
53da61429a Fix help text, courtesy of @weimdall 2020-11-01 06:58:19 +01:00
James Cole
c8a87833c6 Various code cleanup. 2020-10-31 08:00:44 +01:00
James Cole
55c8b9012c Remove unused methods. 2020-10-31 06:54:33 +01:00
James Cole
0104d46206 Update jobs table. 2020-10-31 06:47:36 +01:00
James Cole
b9963ce0bf Remove unused rule. 2020-10-31 06:47:29 +01:00
James Cole
09247cc30b Upgrade to laravel 8. 2020-10-30 17:34:51 +01:00
James Cole
b03b0c630b Fix missing method. 2020-10-30 17:13:29 +01:00
James Cole
ebd076e0ed Remove excessive debug things. 2020-10-30 12:07:26 +01:00
James Cole
a0f34666a3 Fix #4011 2020-10-29 17:20:58 +01:00
James Cole
1ed71ea742 Fix #4011 2020-10-29 14:42:24 +01:00
James Cole
b75c221626 Fix #4005 2020-10-29 06:42:14 +01:00
James Cole
3cf340e44c Merge tag '5.4.5' into develop
5.4.5
2020-10-28 20:26:31 +01:00
James Cole
e6c0bbf082 Merge branch 'release/5.4.5' into main 2020-10-28 20:26:28 +01:00
James Cole
86ca234625 Update meta files for new release. 2020-10-28 20:25:51 +01:00
James Cole
7bd86fe2b6 Update translations. 2020-10-28 20:22:30 +01:00
James Cole
23356b3884 Cleanup JS 2020-10-28 20:16:21 +01:00
James Cole
ca3d836c83 Add notes to category #4002 2020-10-28 06:32:37 +01:00
James Cole
3aa835a985 Fix #4003 2020-10-28 06:14:12 +01:00
James Cole
7b9f2b6ce5 Fix #4000 2020-10-27 19:04:19 +01:00
James Cole
31a9b03c1a Refactor and cleanup. 2020-10-27 16:26:10 +01:00
James Cole
141436aebb Exclude from code coverage. 2020-10-27 06:53:47 +01:00
James Cole
8d84bffc2d Simplify methods. 2020-10-27 06:53:33 +01:00
James Cole
0fb81a6112 Append sonarqube properties file 2020-10-27 06:41:26 +01:00
James Cole
6563a79483 Clean up code. 2020-10-27 06:40:53 +01:00
James Cole
372c6ac667 Various issues fixed (SonarQube) 2020-10-26 19:15:57 +01:00
James Cole
e4923a3c69 Move JS files 2020-10-26 19:15:35 +01:00
James Cole
54f3e60ae4 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-10-26 17:05:23 +01:00
James Cole
df6f65e0aa Sonarqube properties file. 2020-10-26 16:54:14 +01:00
James Cole
e83fdc58ff Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-10-26 16:52:34 +01:00
James Cole
7720482930 Fix bread crumbs 2020-10-26 16:51:49 +01:00
James Cole
c07fae19f9 Remove unused variable. 2020-10-26 16:50:05 +01:00
James Cole
aa3e467a3e Add message so exception isn't empty. 2020-10-26 16:22:20 +01:00
James Cole
c837692d72 Merge pull request #3997 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/axios-0.21.0
Bump axios from 0.20.0 to 0.21.0 in /frontend
2020-10-26 05:58:45 +00:00
dependabot[bot]
61c8b79e30 Bump axios from 0.20.0 to 0.21.0 in /frontend
Bumps [axios](https://github.com/axios/axios) from 0.20.0 to 0.21.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.20.0...v0.21.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-26 05:52:19 +00:00
James Cole
d0a8e6eb5b Merge pull request #3996 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.52
Bump phpstan/phpstan from 0.12.51 to 0.12.52
2020-10-26 05:50:05 +00:00
James Cole
e61236836b Merge pull request #3995 from firefly-iii/dependabot/npm_and_yarn/develop/uiv-1.1.2
Bump uiv from 1.1.1 to 1.1.2
2020-10-26 05:47:16 +00:00
James Cole
a235b60bef Merge pull request #3994 from firefly-iii/dependabot/npm_and_yarn/develop/axios-0.21.0
Bump axios from 0.20.0 to 0.21.0
2020-10-26 05:47:06 +00:00
James Cole
a7d15ef287 Temp fix for tes 2020-10-26 06:45:24 +01:00
James Cole
045cec4421 Fix #3992 2020-10-26 06:43:09 +01:00
dependabot[bot]
465e49476a Bump phpstan/phpstan from 0.12.51 to 0.12.52
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.51 to 0.12.52.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.51...0.12.52)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-26 05:24:43 +00:00
dependabot[bot]
ed6a331faa Bump uiv from 1.1.1 to 1.1.2
Bumps [uiv](https://github.com/uiv-lib/uiv) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/uiv-lib/uiv/releases)
- [Commits](https://github.com/uiv-lib/uiv/compare/v1.1.1...v1.1.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-26 05:19:05 +00:00
dependabot[bot]
f578e2c9e7 Bump axios from 0.20.0 to 0.21.0
Bumps [axios](https://github.com/axios/axios) from 0.20.0 to 0.21.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.20.0...v0.21.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-26 05:18:49 +00:00
James Cole
e0526508cb Fix #3853 2020-10-26 06:18:09 +01:00
James Cole
9151f44022 Fix #3991 2020-10-26 06:11:55 +01:00
James Cole
276de8a470 fix #3993 2020-10-26 06:10:10 +01:00
James Cole
f6ce49b586 Escape input, fixes #3990 2020-10-25 06:36:33 +01:00
James Cole
cf3d9d26fa Less hysterical about JSON errors 2020-10-25 06:35:58 +01:00
James Cole
265385c833 Merge tag '5.4.4' into develop
5.4.4
2020-10-24 18:55:40 +02:00
James Cole
ca3e4e978d Merge branch 'release/5.4.4' into main 2020-10-24 18:55:36 +02:00
James Cole
0dbfeed639 Update meta files. 2020-10-24 18:52:46 +02:00
James Cole
ca235e2287 Updated meta files for release. 2020-10-24 18:47:47 +02:00
James Cole
9d826519e3 Simplify code. 2020-10-24 18:40:17 +02:00
James Cole
3979e12043 Optimise code. 2020-10-24 17:27:36 +02:00
James Cole
b3f1737495 Reverse logic operators. 2020-10-24 16:59:56 +02:00
James Cole
179a710c5b Better note escape 2020-10-24 16:49:21 +02:00
James Cole
08f347cd57 Fix bad array validation. 2020-10-24 16:49:05 +02:00
James Cole
c910cbe5da Fix #3940 2020-10-24 15:52:51 +02:00
James Cole
34a2ab31df Update composer file. 2020-10-24 08:26:57 +02:00
James Cole
229a3b4284 Update JS 2020-10-24 08:07:30 +02:00
James Cole
dbc878950c Clean up form requests 2020-10-24 07:55:09 +02:00
James Cole
ab4bcd3703 Clean up code. 2020-10-24 07:40:56 +02:00
James Cole
048e5eeb31 Fix #3974 2020-10-24 07:18:37 +02:00
James Cole
a526559a0e Remove unused import statements. 2020-10-23 19:12:46 +02:00
James Cole
8dbd785ab8 Clean up code. 2020-10-23 19:11:25 +02:00
James Cole
0845e1cb7d Fix complicated method. 2020-10-23 18:35:56 +02:00
James Cole
20598d877d Simplify function 2020-10-23 18:33:06 +02:00
James Cole
cf540bf173 Simplify code. 2020-10-23 18:26:18 +02:00
James Cole
a8fcde1459 Fix #3985 2020-10-23 18:15:37 +02:00
James Cole
bcdc562bf7 Fix zero length limit. 2020-10-23 12:33:53 +02:00
James Cole
171f8c5848 Include IP in error message. 2020-10-23 12:30:12 +02:00
James Cole
58bb5eaeae Extra check on activity for #3974 2020-10-23 07:37:06 +02:00
James Cole
fd629d6574 Fix https://github.com/firefly-iii/firefly-iii/issues/3983 2020-10-23 06:20:59 +02:00
James Cole
9bafd067f6 Fix # 2020-10-23 06:15:56 +02:00
James Cole
bc06afe17e Fix #3978 2020-10-22 06:33:55 +02:00
James Cole
250aa989c4 Update JS 2020-10-21 06:45:53 +02:00
James Cole
2e3317b95f Remove account from preferences when set inactive, #3974 2020-10-21 06:29:25 +02:00
James Cole
c8be714d16 Do now show not uploaded attachments #3973 2020-10-21 06:24:27 +02:00
James Cole
2f885d65cc Add some cases for #3973 2020-10-21 06:24:16 +02:00
James Cole
f07c1f7164 Fix bad array 2020-10-21 06:20:11 +02:00
James Cole
ed86c26a18 Fix similar issue in piggies 2020-10-20 04:42:44 +02:00
James Cole
ec787de5e0 Simplify code 2020-10-20 04:36:36 +02:00
James Cole
0d5c09af84 Simplify budget report code. 2020-10-20 04:22:57 +02:00
James Cole
ff32f96295 Simplify report. 2020-10-19 20:34:53 +02:00
James Cole
590591f6bd Fix #3968 2020-10-19 18:44:52 +02:00
James Cole
30f708ba7a Fix bill edit submission group thing. 2020-10-19 18:28:39 +02:00
James Cole
2e3af087e8 Merge pull request #3962 from firefly-iii/dependabot/composer/develop/vimeo/psalm-3.17.2
Bump vimeo/psalm from 3.16 to 3.17.2
2020-10-19 08:39:35 +02:00
James Cole
6ce922e983 Merge pull request #3963 from firefly-iii/dependabot/composer/develop/gdbots/query-parser-2.0.1
Bump gdbots/query-parser from 2.0.0 to 2.0.1
2020-10-19 08:39:27 +02:00
James Cole
f63cff91bf Merge pull request #3964 from firefly-iii/dependabot/composer/develop/filp/whoops-2.8.0
Bump filp/whoops from 2.7.3 to 2.8.0
2020-10-19 08:39:14 +02:00
James Cole
b422ba6547 Merge pull request #3965 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/chart.js-2.9.4
Bump chart.js from 2.9.3 to 2.9.4 in /frontend
2020-10-19 08:39:04 +02:00
dependabot[bot]
114d53befd Bump chart.js from 2.9.3 to 2.9.4 in /frontend
Bumps [chart.js](https://github.com/chartjs/Chart.js) from 2.9.3 to 2.9.4.
- [Release notes](https://github.com/chartjs/Chart.js/releases)
- [Commits](https://github.com/chartjs/Chart.js/compare/v2.9.3...v2.9.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-19 05:47:18 +00:00
dependabot[bot]
076010c058 Bump filp/whoops from 2.7.3 to 2.8.0
Bumps [filp/whoops](https://github.com/filp/whoops) from 2.7.3 to 2.8.0.
- [Release notes](https://github.com/filp/whoops/releases)
- [Changelog](https://github.com/filp/whoops/blob/master/CHANGELOG.md)
- [Commits](https://github.com/filp/whoops/compare/2.7.3...2.8.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-19 05:26:45 +00:00
dependabot[bot]
56a7793bf1 Bump gdbots/query-parser from 2.0.0 to 2.0.1
Bumps [gdbots/query-parser](https://github.com/gdbots/query-parser-php) from 2.0.0 to 2.0.1.
- [Release notes](https://github.com/gdbots/query-parser-php/releases)
- [Changelog](https://github.com/gdbots/query-parser-php/blob/master/CHANGELOG-2.x.md)
- [Commits](https://github.com/gdbots/query-parser-php/compare/v2.0.0...v2.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-19 05:24:10 +00:00
dependabot[bot]
00c610045d Bump vimeo/psalm from 3.16 to 3.17.2
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 3.16 to 3.17.2.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/3.16...3.17.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-19 05:21:39 +00:00
James Cole
4b0b2f46ef Merge pull request #3961 from firefly-iii/dependabot/composer/develop/doctrine/dbal-2.11.2
Bump doctrine/dbal from 2.11.1 to 2.11.2
2020-10-19 07:20:11 +02:00
dependabot[bot]
5a53cea90b Bump doctrine/dbal from 2.11.1 to 2.11.2
Bumps [doctrine/dbal](https://github.com/doctrine/dbal) from 2.11.1 to 2.11.2.
- [Release notes](https://github.com/doctrine/dbal/releases)
- [Commits](https://github.com/doctrine/dbal/compare/2.11.1...2.11.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-19 05:19:16 +00:00
James Cole
07a3ff01b0 Merge pull request #3960 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.50
Bump phpstan/phpstan from 0.12.48 to 0.12.50
2020-10-19 07:17:25 +02:00
James Cole
03875d7e41 Merge pull request #3958 from firefly-iii/dependabot/composer/develop/nunomaduro/larastan-0.6.6
Bump nunomaduro/larastan from 0.6.4 to 0.6.6
2020-10-19 07:17:09 +02:00
dependabot[bot]
0e340288e6 Bump phpstan/phpstan from 0.12.48 to 0.12.50
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.48 to 0.12.50.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.48...0.12.50)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-19 05:16:51 +00:00
James Cole
1183c40114 Merge pull request #3959 from firefly-iii/dependabot/composer/develop/league/commonmark-1.5.6
Bump league/commonmark from 1.5.5 to 1.5.6
2020-10-19 07:16:51 +02:00
dependabot[bot]
06ab9df6fc Bump league/commonmark from 1.5.5 to 1.5.6
Bumps [league/commonmark](https://github.com/thephpleague/commonmark) from 1.5.5 to 1.5.6.
- [Release notes](https://github.com/thephpleague/commonmark/releases)
- [Changelog](https://github.com/thephpleague/commonmark/blob/1.5.6/CHANGELOG.md)
- [Commits](https://github.com/thephpleague/commonmark/compare/1.5.5...1.5.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-19 05:13:43 +00:00
dependabot[bot]
b871dab5fe Bump nunomaduro/larastan from 0.6.4 to 0.6.6
Bumps [nunomaduro/larastan](https://github.com/nunomaduro/larastan) from 0.6.4 to 0.6.6.
- [Release notes](https://github.com/nunomaduro/larastan/releases)
- [Changelog](https://github.com/nunomaduro/larastan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nunomaduro/larastan/compare/v0.6.4...v0.6.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-19 05:11:26 +00:00
James Cole
054eecf541 Optimise code. 2020-10-19 06:41:31 +02:00
James Cole
348452ec7d Simplify method. 2020-10-19 06:41:01 +02:00
James Cole
1f5934d6e2 Use trait, not class extension as an experiment. 2020-10-19 06:23:22 +02:00
James Cole
60fa6c775b Merge pull request #3957 from bu4ak/add-logged-in-request
Add base request that check user's auth
2020-10-19 06:11:34 +02:00
bu4ak
ed98c01ba0 Add LoggedInRequest 2020-10-18 20:24:47 +02:00
James Cole
198c79c048 Simplify transformer. 2020-10-18 17:44:30 +02:00
James Cole
3cd331062d Cleanup code. 2020-10-18 16:44:34 +02:00
James Cole
22f1e4db31 Simplify method. 2020-10-18 16:36:19 +02:00
James Cole
68693f20bb Slight reorder of shields. 2020-10-18 12:52:16 +02:00
James Cole
54a4c25152 Slight reorder of shields. 2020-10-18 12:51:21 +02:00
James Cole
21c615818c Slight reorder of shields. 2020-10-18 12:48:30 +02:00
James Cole
204d7e57bd Merge pull request #3954 from lastlink/patch-4
add travis build badge
2020-10-18 12:43:17 +02:00
James Cole
cd151da240 Simplify chart code with external helper. 2020-10-18 12:41:49 +02:00
lastlink
687a62fe26 add travis build badge 2020-10-18 04:25:39 -04:00
James Cole
0bf0b762b8 Simplify command. 2020-10-18 08:25:56 +02:00
James Cole
53a6af7779 Simplify code 2020-10-18 08:06:00 +02:00
James Cole
4c10f2b960 Test improv 2020-10-18 08:01:22 +02:00
James Cole
2630732b8a Code cleanup [skip ci] 2020-10-18 08:01:10 +02:00
James Cole
b8774a7af3 Code cleanup [skip ci] 2020-10-18 08:00:49 +02:00
James Cole
7a89df749d Fix #3953 2020-10-18 07:59:28 +02:00
James Cole
937c11e83c Update translations + JS 2020-10-17 21:41:13 +02:00
James Cole
a79f7e3b59 Better code. 2020-10-17 09:12:51 +02:00
James Cole
c1b52524b1 #3909 2020-10-17 09:12:38 +02:00
James Cole
04d451be8d Fix #3871 2020-10-17 09:02:52 +02:00
James Cole
e5109d6a0f Fix #3942 2020-10-17 08:57:58 +02:00
James Cole
c404354890 Fix missing var 2020-10-17 08:56:38 +02:00
James Cole
01fbe89295 Better catch for long queries, #3903 2020-10-17 08:53:32 +02:00
James Cole
388da769bb Upgrade and move some scripts. 2020-10-17 07:02:18 +02:00
James Cole
0d4f203fae Stop escaping notes, move to parser. 2020-10-13 17:48:50 +02:00
James Cole
96dbd633bf Fix #3914 2020-10-13 06:51:44 +02:00
James Cole
4b1f4ae319 Fix #3915 2020-10-13 06:48:11 +02:00
James Cole
13e15d0476 Fix # 2020-10-13 06:36:34 +02:00
James Cole
7c962c617a Debug for #3903 2020-10-13 06:35:47 +02:00
James Cole
4e51f0abc4 Clean up some code. 2020-10-13 06:35:33 +02:00
James Cole
3bd5ac21c9 Fix #3901 2020-10-13 06:28:07 +02:00
James Cole
d7b872eeaa Merge pull request #3931 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-1.27.0
Bump sass from 1.26.11 to 1.27.0 in /frontend
2020-10-12 08:13:08 +00:00
dependabot[bot]
c868a6374d Bump sass from 1.26.11 to 1.27.0 in /frontend
Bumps [sass](https://github.com/sass/dart-sass) from 1.26.11 to 1.27.0.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.26.11...1.27.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 07:20:53 +00:00
James Cole
e61720754a Merge pull request #3926 from firefly-iii/dependabot/npm_and_yarn/develop/vue-i18n-8.22.0
Bump vue-i18n from 8.21.1 to 8.22.0
2020-10-12 06:30:55 +00:00
James Cole
f9f0eaefbe Merge pull request #3928 from firefly-iii/dependabot/composer/develop/phpunit/phpunit-9.4.1
Bump phpunit/phpunit from 9.4.0 to 9.4.1
2020-10-12 06:29:12 +00:00
James Cole
5712739df1 Merge pull request #3929 from firefly-iii/dependabot/composer/develop/laravel/framework-7.28.4
Bump laravel/framework from 7.28.3 to 7.28.4
2020-10-12 06:29:01 +00:00
James Cole
6e7152a200 Merge pull request #3930 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/fortawesome/fontawesome-free-5.15.1
Bump @fortawesome/fontawesome-free from 5.15.0 to 5.15.1 in /frontend
2020-10-12 06:28:33 +00:00
James Cole
f2b8aab1d2 Merge pull request #3927 from firefly-iii/dependabot/npm_and_yarn/develop/uiv-1.1.1
Bump uiv from 1.0.1 to 1.1.1
2020-10-12 06:26:50 +00:00
James Cole
59f2e9cf72 Merge pull request #3925 from firefly-iii/dependabot/npm_and_yarn/develop/laravel-mix-5.0.7
Bump laravel-mix from 5.0.5 to 5.0.7
2020-10-12 06:26:30 +00:00
James Cole
3a0793b26a Merge pull request #3933 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-loader-10.0.3
Bump sass-loader from 10.0.2 to 10.0.3 in /frontend
2020-10-12 06:26:09 +00:00
James Cole
659df750d8 Merge pull request #3932 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/vue-router-3.4.6
Bump vue-router from 3.4.5 to 3.4.6 in /frontend
2020-10-12 06:25:55 +00:00
James Cole
b5983f7e99 Merge pull request #3934 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/laravel-mix-5.0.7
Bump laravel-mix from 5.0.5 to 5.0.7 in /frontend
2020-10-12 06:25:44 +00:00
dependabot[bot]
86d0d18b00 Bump laravel-mix from 5.0.5 to 5.0.7 in /frontend
Bumps [laravel-mix](https://github.com/JeffreyWay/laravel-mix) from 5.0.5 to 5.0.7.
- [Release notes](https://github.com/JeffreyWay/laravel-mix/releases)
- [Commits](https://github.com/JeffreyWay/laravel-mix/compare/v5.0.5...v5.0.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 05:54:12 +00:00
dependabot[bot]
28f71963f1 Bump sass-loader from 10.0.2 to 10.0.3 in /frontend
Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 10.0.2 to 10.0.3.
- [Release notes](https://github.com/webpack-contrib/sass-loader/releases)
- [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/sass-loader/compare/v10.0.2...v10.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 05:52:46 +00:00
dependabot[bot]
27f91365b4 Bump vue-router from 3.4.5 to 3.4.6 in /frontend
Bumps [vue-router](https://github.com/vuejs/vue-router) from 3.4.5 to 3.4.6.
- [Release notes](https://github.com/vuejs/vue-router/releases)
- [Changelog](https://github.com/vuejs/vue-router/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/vuejs/vue-router/compare/v3.4.5...v3.4.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 05:51:46 +00:00
dependabot[bot]
8d11fecfeb Bump @fortawesome/fontawesome-free from 5.15.0 to 5.15.1 in /frontend
Bumps [@fortawesome/fontawesome-free](https://github.com/FortAwesome/Font-Awesome) from 5.15.0 to 5.15.1.
- [Release notes](https://github.com/FortAwesome/Font-Awesome/releases)
- [Changelog](https://github.com/FortAwesome/Font-Awesome/blob/master/CHANGELOG.md)
- [Commits](https://github.com/FortAwesome/Font-Awesome/compare/5.15.0...5.15.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 05:50:06 +00:00
dependabot[bot]
c10a955928 Bump laravel/framework from 7.28.3 to 7.28.4
Bumps [laravel/framework](https://github.com/laravel/framework) from 7.28.3 to 7.28.4.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/8.x/CHANGELOG-6.x.md)
- [Commits](https://github.com/laravel/framework/compare/v7.28.3...v7.28.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 05:20:49 +00:00
dependabot[bot]
d5a12d56a6 Bump phpunit/phpunit from 9.4.0 to 9.4.1
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.4.0 to 9.4.1.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.4.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.4.0...9.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 05:18:18 +00:00
dependabot[bot]
f869ebbb30 Bump uiv from 1.0.1 to 1.1.1
Bumps [uiv](https://github.com/uiv-lib/uiv) from 1.0.1 to 1.1.1.
- [Release notes](https://github.com/uiv-lib/uiv/releases)
- [Commits](https://github.com/uiv-lib/uiv/compare/v1.0.1...v1.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 05:07:29 +00:00
dependabot[bot]
3471c964d0 Bump vue-i18n from 8.21.1 to 8.22.0
Bumps [vue-i18n](https://github.com/kazupon/vue-i18n) from 8.21.1 to 8.22.0.
- [Release notes](https://github.com/kazupon/vue-i18n/releases)
- [Changelog](https://github.com/kazupon/vue-i18n/blob/v8.x/CHANGELOG.md)
- [Commits](https://github.com/kazupon/vue-i18n/compare/v8.21.1...v8.22.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 05:07:08 +00:00
dependabot[bot]
94b1934877 Bump laravel-mix from 5.0.5 to 5.0.7
Bumps [laravel-mix](https://github.com/JeffreyWay/laravel-mix) from 5.0.5 to 5.0.7.
- [Release notes](https://github.com/JeffreyWay/laravel-mix/releases)
- [Commits](https://github.com/JeffreyWay/laravel-mix/compare/v5.0.5...v5.0.7)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-12 05:06:49 +00:00
James Cole
adfd3ab3ac Update commands and test factories 2020-10-10 11:21:45 +02:00
James Cole
a42008dd7b Add captions 2020-10-10 11:21:25 +02:00
James Cole
acfc976f6d New tests 2020-10-10 11:21:14 +02:00
James Cole
76cfdef27d Remove old tests. To be reinstated later. 2020-10-10 11:20:52 +02:00
James Cole
d75f33558d Merge pull request #3913 from vcrazyV/ruble_currency_fix
Fix space ruble currency name
2020-10-07 04:08:02 +00:00
Viktor Yakovlev
7345a558ce fix ruble currency name 2020-10-06 21:24:48 +03:00
James Cole
5ba93dda9f Merge pull request #3908 from firefly-iii/dependabot/npm_and_yarn/develop/uiv-1.0.1
Bump uiv from 0.37.0 to 1.0.1
2020-10-05 08:49:52 +02:00
dependabot[bot]
a94195ae45 Bump uiv from 0.37.0 to 1.0.1
Bumps [uiv](https://github.com/uiv-lib/uiv) from 0.37.0 to 1.0.1.
- [Release notes](https://github.com/uiv-lib/uiv/releases)
- [Commits](https://github.com/uiv-lib/uiv/compare/v0.37.0...v1.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-10-05 05:10:12 +00:00
James Cole
0b8415e82b Debug for #3897 2020-10-04 17:11:59 +02:00
James Cole
a5c37f1e4a Fix #3902 2020-10-04 16:50:16 +02:00
James Cole
7bd0b09711 Fix #3900 2020-10-04 13:45:39 +02:00
James Cole
64370229d8 Fix #3900 2020-10-04 13:44:55 +02:00
James Cole
6671c6d45c Create some new test code. 2020-10-04 10:56:10 +02:00
James Cole
a2eedb3742 Fix #3898 2020-10-04 09:19:36 +02:00
James Cole
3bae5e236b Fix #3885 2020-10-04 07:56:03 +02:00
James Cole
9f4e950a70 Fix hard coded site ID 2020-10-04 07:25:30 +02:00
James Cole
4d2d9d4d6e Whoops. Fixed self-referencing constant. 2020-10-04 07:20:48 +02:00
James Cole
61ffc8ada6 Switch should have default thing. 2020-10-03 17:53:23 +02:00
James Cole
b8e36b0398 Replace string with constant. 2020-10-03 16:51:44 +02:00
James Cole
d89e4ec143 Merge tag '5.4.3' into develop
5.4.3
2020-10-03 16:23:09 +02:00
James Cole
712b8d6e0c Merge branch 'release/5.4.3' into main 2020-10-03 16:23:07 +02:00
James Cole
50cfb54a3d Updated meta-files & translations for upcoming release. 2020-10-03 16:20:59 +02:00
James Cole
dcb1866e81 Add some breadcrumbs 2020-10-03 15:58:25 +02:00
James Cole
f2550a7861 Fix #3893 2020-10-03 15:16:42 +02:00
James Cole
5ed3d52e9a Fix #3894 2020-10-03 15:08:24 +02:00
James Cole
aadcb2cc5b Fix https://github.com/firefly-iii/firefly-iii/issues/3592 2020-10-03 07:03:41 +02:00
James Cole
96028e91be Fix #3887 2020-10-02 17:45:35 +02:00
James Cole
f92780d3da Updated meta-files & translations for upcoming release. 2020-10-02 08:46:41 +02:00
James Cole
8c7e3b3731 Fix #3884 2020-10-02 07:47:02 +02:00
James Cole
8eb6b5a364 Fix #3881 2020-10-01 18:43:41 +02:00
James Cole
d03ca0ec36 Some bug fixes. 2020-10-01 17:02:15 +02:00
James Cole
c25f5598f1 Some bug fixes. 2020-10-01 16:52:01 +02:00
James Cole
d32611b2d5 Remove unused dropdown menu. 2020-10-01 14:27:06 +02:00
James Cole
9ab034c1ad Rebuild frontend. 2020-10-01 14:24:35 +02:00
James Cole
b3edbecde2 Code for #3875 2020-10-01 12:48:27 +02:00
James Cole
3ce949f0aa Fix #3880 2020-10-01 10:50:34 +02:00
James Cole
df8c6abd5c Fix issue submitted over email by Gustav, making sure the "budgeted" amount matches the budgets below. 2020-10-01 08:06:25 +02:00
James Cole
b94561223e Fix search for #3850 2020-10-01 07:42:20 +02:00
James Cole
f633769f7b Fix links for #3824 2020-10-01 07:33:39 +02:00
James Cole
8767bad61e Fix #3879 2020-10-01 07:31:08 +02:00
James Cole
c01345468d Fix #3878 2020-10-01 07:07:18 +02:00
James Cole
8046d14d2d Clean up readme and incorporate the badges as suggested by @lastlink 2020-09-30 19:23:15 +02:00
James Cole
f957d8aeb5 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-09-30 17:28:31 +02:00
James Cole
564a387505 Rebuild JS and some switch stuff for #3826 2020-09-30 17:28:16 +02:00
James Cole
116fc0c70f Merge pull request #3874 from sephrat/fix-3858
FIx #3858
2020-09-30 17:22:32 +02:00
James Cole
f82e35a8a8 New rendered JS. 2020-09-30 17:20:51 +02:00
James Cole
ea76647b29 Fix #3862 2020-09-30 17:19:58 +02:00
James Cole
26dc70c8fd Merge pull request #3863 from lastlink/patch-3
sonarcloud badges
2020-09-30 17:10:05 +02:00
James Cole
85113d50be Merge pull request #3855 from achembarpu/patch-1
Add start_url to manifest file
2020-09-30 17:06:17 +02:00
James Cole
9e41cc27af Merge pull request #3854 from sephrat/fix-3853
Fix #3853
2020-09-30 17:05:16 +02:00
Florian Dupret
89d8c11b52 More pagination fixes 2020-09-29 14:05:41 +02:00
Florian Dupret
70d16c31ad FIx #3858 2020-09-29 13:04:41 +02:00
lastlink
e07f243344 Update readme.md
pr changes
2020-09-28 13:04:22 -04:00
James Cole
ba4a43b4aa Merge pull request #3869 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/popperjs/core-2.5.2
Bump @popperjs/core from 2.5.1 to 2.5.2 in /frontend
2020-09-28 08:18:22 +02:00
James Cole
860bf22503 Merge pull request #3868 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/vue-router-3.4.5
Bump vue-router from 3.4.3 to 3.4.5 in /frontend
2020-09-28 08:04:27 +02:00
dependabot[bot]
4a1f009458 Bump @popperjs/core from 2.5.1 to 2.5.2 in /frontend
Bumps [@popperjs/core](https://github.com/popperjs/popper-core) from 2.5.1 to 2.5.2.
- [Release notes](https://github.com/popperjs/popper-core/releases)
- [Commits](https://github.com/popperjs/popper-core/compare/v2.5.1...v2.5.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-28 05:56:13 +00:00
dependabot[bot]
4830b3b2c1 Bump vue-router from 3.4.3 to 3.4.5 in /frontend
Bumps [vue-router](https://github.com/vuejs/vue-router) from 3.4.3 to 3.4.5.
- [Release notes](https://github.com/vuejs/vue-router/releases)
- [Changelog](https://github.com/vuejs/vue-router/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/vuejs/vue-router/compare/v3.4.3...v3.4.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-28 05:55:02 +00:00
James Cole
e2bf13b5ca Merge pull request #3865 from firefly-iii/dependabot/composer/develop/phpunit/phpunit-9.3.11
Bump phpunit/phpunit from 9.3.10 to 9.3.11
2020-09-28 07:29:38 +02:00
James Cole
c36a4f64d4 Merge pull request #3867 from firefly-iii/dependabot/composer/develop/doctrine/dbal-2.11.1
Bump doctrine/dbal from 2.11.0 to 2.11.1
2020-09-28 07:29:15 +02:00
James Cole
39abea0290 Merge pull request #3866 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.45
Bump phpstan/phpstan from 0.12.43 to 0.12.45
2020-09-28 07:28:43 +02:00
dependabot[bot]
abec47f6c3 Bump doctrine/dbal from 2.11.0 to 2.11.1
Bumps [doctrine/dbal](https://github.com/doctrine/dbal) from 2.11.0 to 2.11.1.
- [Release notes](https://github.com/doctrine/dbal/releases)
- [Commits](https://github.com/doctrine/dbal/compare/2.11.0...2.11.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-28 05:25:41 +00:00
dependabot[bot]
4f0100b7a9 Bump phpstan/phpstan from 0.12.43 to 0.12.45
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.43 to 0.12.45.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.43...0.12.45)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-28 05:23:07 +00:00
dependabot[bot]
8c576953ad Bump phpunit/phpunit from 9.3.10 to 9.3.11
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.3.10 to 9.3.11.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.3.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.3.10...9.3.11)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-28 05:21:25 +00:00
lastlink
e8f9d2b608 Update readme.md
sonarcloud badges, easy fruits for open source contributors to work on. I can move the order around if preferred.
2020-09-26 23:01:37 -04:00
Arvind Chembarpu
2347267518 Add start_url to manifest
start_url is a mandatory field.
2020-09-24 22:34:58 +02:00
Florian Dupret
602f5b6646 Fix #3853 2020-09-24 19:42:12 +02:00
James Cole
b1b2e0ff09 Merge tag '5.4.2' into develop
5.4.2
2020-09-24 06:24:30 +02:00
James Cole
ab38bfe4d2 Merge branch 'release/5.4.2' into main 2020-09-24 06:24:29 +02:00
James Cole
dcb3f23078 Update meta data for new release. 2020-09-24 06:22:08 +02:00
James Cole
c0f363cf86 Consistent dates for #3847 2020-09-24 06:09:26 +02:00
James Cole
46ebf3c07c Consistent dates for #3847 2020-09-24 06:06:18 +02:00
James Cole
ed7977a105 Fix count for #3841 2020-09-24 06:00:45 +02:00
James Cole
f093dbb30b Fix #3844 2020-09-23 20:37:31 +02:00
James Cole
620b69f234 Fix #3841 2020-09-23 20:30:42 +02:00
James Cole
a346b6ee29 Bad redirect when editing a not found transaction. 2020-09-23 20:28:20 +02:00
James Cole
ccb511936e Better fix for #3842, thanks @niklas2810 2020-09-23 20:18:30 +02:00
James Cole
9f98289952 Fix #3843 2020-09-23 20:17:21 +02:00
James Cole
e549b74c97 Fix #3842 2020-09-23 20:13:08 +02:00
James Cole
f73af50eb0 Fix #3840 2020-09-23 19:32:46 +02:00
James Cole
5f5346ed71 Partial fix for #3840 2020-09-23 19:29:10 +02:00
James Cole
fc157b2944 Fix #3839 2020-09-23 19:14:50 +02:00
James Cole
cc1a537ecb Meta data for 5.4.2 2020-09-23 19:14:39 +02:00
James Cole
1e5df66c62 Expand readme. 2020-09-23 16:44:39 +02:00
James Cole
e5ea82663e Create .mergify.yml 2020-09-23 07:41:56 +00:00
James Cole
2d6e6f3ec9 Merge pull request #3837 from okaufmann/fix-account-detail
Fixes account notes parsing (Reopen)
2020-09-23 07:40:58 +00:00
James Cole
a822c9f833 Merge branch 'develop' into fix-account-detail 2020-09-23 07:40:46 +00:00
James Cole
0b8b9cb280 Update version. 2020-09-23 06:18:59 +02:00
James Cole
29b8cf936e Add mergify config 2020-09-23 06:18:49 +02:00
James Cole
b288d6b0eb Fix #3828 2020-09-23 06:18:43 +02:00
James Cole
8a2d5b12c3 Instructions for one-time donations. 2020-09-23 05:56:49 +02:00
James Cole
a7dc9e201f Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-09-23 05:50:51 +02:00
James Cole
c686f16a93 Merge pull request #3831 from okaufmann/main
Fixes `Unknown column 'notes' in 'where clause'` when using Rules
2020-09-23 03:49:50 +00:00
Oliver Kaufmann
58245d85b3 fix account notes 2020-09-23 02:18:53 +02:00
Oliver Kaufmann
f564ef5195 fix notes filter query 2020-09-22 23:48:36 +02:00
James Cole
18c24a7251 Fix #3827 2020-09-22 18:27:21 +02:00
James Cole
d97fd73ce5 Make sure notes always have a value, even when null #3823 2020-09-22 16:19:51 +02:00
James Cole
1624abd9ed Merge pull request #3822 from achembarpu/patch-1
Fix web app manifest
2020-09-22 05:15:50 +00:00
Arvind Chembarpu
14f22009ed Update manifest link 2020-09-21 21:25:57 +02:00
Arvind Chembarpu
86cd3c0c38 Do not force portrait mode
For easier use on larger devices like tablets
2020-09-21 21:24:32 +02:00
Arvind Chembarpu
855fe1235a Rename site.webmanifest to manifest.webmanifest
As per Web App Manifest spec - https://www.w3.org/TR/appmanifest/
2020-09-21 21:24:03 +02:00
Arvind Chembarpu
198a0f7011 Delete manifest.json 2020-09-21 21:21:32 +02:00
James Cole
2b16d73e65 Remove LDAP limit from 2FA 2020-09-21 20:40:47 +02:00
James Cole
03f68426e5 Merge tag '5.4.1' into develop
5.4.1
2020-09-21 19:52:27 +02:00
James Cole
229479b7ed Merge branch 'release/5.4.1' into main 2020-09-21 19:52:26 +02:00
James Cole
0f742aa040 Update changelog and meta files for 5.4.1 2020-09-21 18:28:34 +02:00
James Cole
e5ac6a3a1d Add some debug info. 2020-09-21 16:08:41 +02:00
James Cole
d05fb4472c Fix count reference. 2020-09-21 15:56:50 +02:00
James Cole
5161971373 Different call to count() 2020-09-21 15:45:51 +02:00
James Cole
2a5841c631 Temp debug information. 2020-09-21 15:39:14 +02:00
James Cole
766abd3336 Extra info for debug screen. 2020-09-21 15:39:03 +02:00
James Cole
b58cde5431 Add some debug info. 2020-09-21 15:30:54 +02:00
James Cole
9964cf11a4 Fix #3809 2020-09-21 15:20:14 +02:00
James Cole
7f9c8fa133 Merge tag '5.4.0' into develop
5.4.0
2020-09-21 13:21:42 +02:00
James Cole
10057f05a5 Merge branch 'release/5.4.0' into main 2020-09-21 13:21:41 +02:00
James Cole
fc61b20f6d Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-09-21 12:47:48 +02:00
James Cole
40e7f019dd Meta data for new release, 5.4.0. 2020-09-21 12:47:40 +02:00
James Cole
2f32ddce6b Merge pull request #3814 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.43
Bump phpstan/phpstan from 0.12.42 to 0.12.43
2020-09-21 07:52:53 +00:00
James Cole
459015c01e Merge pull request #3813 from firefly-iii/dependabot/composer/develop/doctrine/dbal-2.11.0
Bump doctrine/dbal from 2.10.4 to 2.11.0
2020-09-21 07:52:41 +00:00
dependabot[bot]
b669f96036 Bump phpstan/phpstan from 0.12.42 to 0.12.43
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.42 to 0.12.43.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.42...0.12.43)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-21 05:19:54 +00:00
dependabot[bot]
4524d1cfe3 Bump doctrine/dbal from 2.10.4 to 2.11.0
Bumps [doctrine/dbal](https://github.com/doctrine/dbal) from 2.10.4 to 2.11.0.
- [Release notes](https://github.com/doctrine/dbal/releases)
- [Commits](https://github.com/doctrine/dbal/compare/2.10.4...2.11.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-21 05:17:28 +00:00
James Cole
651029e284 Don't use isset. 2020-09-20 16:18:48 +02:00
James Cole
cbeb2675fd Fix second issue in #3809 2020-09-20 16:16:49 +02:00
James Cole
7a80caf26b Fix #3790 2020-09-18 16:14:17 +02:00
James Cole
f3eaf1dd4c Code for #3790 2020-09-18 16:07:59 +02:00
James Cole
af88e91a48 Update attributes 2020-09-18 12:25:41 +02:00
James Cole
706cb47065 Code changes for v540 2020-09-18 12:16:47 +02:00
James Cole
0d72aa9673 Default is MySQL 2020-09-18 09:46:22 +02:00
James Cole
039e654ef1 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-09-14 20:01:47 +02:00
James Cole
1c3fe93d59 Recognize a year. 2020-09-14 20:01:33 +02:00
James Cole
5ef45fd4a3 Merge pull request #3794 from firefly-iii/dependabot/composer/develop/league/commonmark-1.5.5
Bump league/commonmark from 1.5.4 to 1.5.5
2020-09-14 07:24:15 +00:00
James Cole
db700d6b80 Merge pull request #3793 from firefly-iii/dependabot/npm_and_yarn/develop/uiv-0.37.0
Bump uiv from 0.36.1 to 0.37.0
2020-09-14 07:16:35 +00:00
dependabot[bot]
7032bdc169 Bump league/commonmark from 1.5.4 to 1.5.5
Bumps [league/commonmark](https://github.com/thephpleague/commonmark) from 1.5.4 to 1.5.5.
- [Release notes](https://github.com/thephpleague/commonmark/releases)
- [Changelog](https://github.com/thephpleague/commonmark/blob/latest/CHANGELOG-1.x.md)
- [Commits](https://github.com/thephpleague/commonmark/compare/1.5.4...1.5.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-14 06:28:32 +00:00
dependabot[bot]
1dde09c738 Bump uiv from 0.36.1 to 0.37.0
Bumps [uiv](https://github.com/wxsms/uiv) from 0.36.1 to 0.37.0.
- [Release notes](https://github.com/wxsms/uiv/releases)
- [Commits](https://github.com/wxsms/uiv/compare/v0.36.1...v0.37.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-14 06:26:19 +00:00
James Cole
a54ca0141a Merge tag '5.4.0-beta.1' into develop
5.4.0-beta.1
2020-09-13 07:48:50 +02:00
James Cole
a553bfd142 Merge branch 'release/5.4.0-beta.1' into main 2020-09-13 07:48:47 +02:00
James Cole
ed01551ad4 Update composer. 2020-09-13 07:41:29 +02:00
James Cole
91473332b4 Update and rebuild JS. 2020-09-13 07:39:19 +02:00
James Cole
890de05394 Update localised JS 2020-09-13 07:38:31 +02:00
James Cole
29445e4ffb Fix #3695 2020-09-12 06:28:23 +02:00
James Cole
098eac8bab Fix #3765 2020-09-11 21:06:10 +02:00
James Cole
e2ad5c60c6 Fix #3761 2020-09-11 20:37:50 +02:00
James Cole
34e2595a3d Make sure you can't set negative amounts. 2020-09-11 20:29:30 +02:00
James Cole
284222c2ee Better call to date. 2020-09-11 07:12:33 +02:00
James Cole
0b308cb5f2 Fix #3791 2020-09-11 07:12:11 +02:00
James Cole
22dc03f32c Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-09-11 07:11:43 +02:00
James Cole
c2ff26b515 Fix lowercase 2020-09-11 07:11:37 +02:00
James Cole
402351a6b7 Fix #3789 2020-09-10 19:16:03 +02:00
James Cole
562be457ec Add more types. 2020-09-10 14:53:35 +02:00
James Cole
600e98cf47 Add hashtag 2020-09-10 14:50:49 +02:00
James Cole
bded065d42 Support date 2020-09-10 14:50:22 +02:00
James Cole
a526007957 Add URL compatibility 2020-09-10 14:48:02 +02:00
James Cole
c0af49f336 Fix missing search node type. 2020-09-09 06:10:00 +02:00
James Cole
ff6c0c26e0 Fix #3745 2020-09-07 13:03:10 +02:00
James Cole
a7af8d2195 Fix language issues #3772 2020-09-07 12:56:51 +02:00
James Cole
f5871898bd Fix #3768 2020-09-07 12:49:56 +02:00
James Cole
df8f23cba3 Merge pull request #3781 from firefly-iii/dependabot/composer/develop/nunomaduro/larastan-0.6.4
Bump nunomaduro/larastan from 0.6.2 to 0.6.4
2020-09-07 07:03:08 +00:00
James Cole
d9bc23725b Merge pull request #3782 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-loader-10.0.2
Bump sass-loader from 10.0.1 to 10.0.2 in /frontend
2020-09-07 07:02:01 +00:00
James Cole
a68ab28f00 Merge pull request #3778 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.42
Bump phpstan/phpstan from 0.12.40 to 0.12.42
2020-09-07 07:01:11 +00:00
dependabot[bot]
676c282f11 Bump phpstan/phpstan from 0.12.40 to 0.12.42
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.40 to 0.12.42.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.40...0.12.42)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-07 06:46:22 +00:00
dependabot[bot]
f99731e90b Bump nunomaduro/larastan from 0.6.2 to 0.6.4
Bumps [nunomaduro/larastan](https://github.com/nunomaduro/larastan) from 0.6.2 to 0.6.4.
- [Release notes](https://github.com/nunomaduro/larastan/releases)
- [Changelog](https://github.com/nunomaduro/larastan/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nunomaduro/larastan/compare/v0.6.2...v0.6.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-07 06:45:43 +00:00
James Cole
302ece8ffc Merge pull request #3779 from firefly-iii/dependabot/composer/develop/predis/predis-1.1.4
Bump predis/predis from 1.1.3 to 1.1.4
2020-09-07 06:17:29 +00:00
James Cole
47100a8e51 Merge pull request #3780 from firefly-iii/dependabot/composer/develop/league/csv-9.6.1
Bump league/csv from 9.6.0 to 9.6.1
2020-09-07 06:17:02 +00:00
dependabot[bot]
7e59d8cb75 Bump sass-loader from 10.0.1 to 10.0.2 in /frontend
Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 10.0.1 to 10.0.2.
- [Release notes](https://github.com/webpack-contrib/sass-loader/releases)
- [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/sass-loader/compare/v10.0.1...v10.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-07 06:16:10 +00:00
James Cole
7eaa00a5ad Merge pull request #3777 from firefly-iii/dependabot/composer/develop/vimeo/psalm-3.15
Bump vimeo/psalm from 3.14.2 to 3.15
2020-09-07 06:13:29 +00:00
dependabot[bot]
0713cc55b6 Bump league/csv from 9.6.0 to 9.6.1
Bumps [league/csv](https://github.com/thephpleague/csv) from 9.6.0 to 9.6.1.
- [Release notes](https://github.com/thephpleague/csv/releases)
- [Changelog](https://github.com/thephpleague/csv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/thephpleague/csv/compare/9.6.0...9.6.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-07 06:10:29 +00:00
James Cole
8329d68b22 Merge pull request #3776 from firefly-iii/dependabot/composer/develop/laravel/framework-7.27.0
Bump laravel/framework from 7.26.1 to 7.27.0
2020-09-07 06:10:23 +00:00
dependabot[bot]
3e05cf7306 Bump predis/predis from 1.1.3 to 1.1.4
Bumps [predis/predis](https://github.com/predis/predis) from 1.1.3 to 1.1.4.
- [Release notes](https://github.com/predis/predis/releases)
- [Changelog](https://github.com/predis/predis/blob/main/CHANGELOG.md)
- [Commits](https://github.com/predis/predis/compare/v1.1.3...v1.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-07 06:08:32 +00:00
James Cole
8c116e1bc5 Merge pull request #3775 from firefly-iii/dependabot/composer/develop/doctrine/dbal-2.10.3
Bump doctrine/dbal from 2.10.2 to 2.10.3
2020-09-07 06:06:37 +00:00
dependabot[bot]
7d61986025 Bump vimeo/psalm from 3.14.2 to 3.15
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 3.14.2 to 3.15.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/3.14.2...3.15)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-07 06:04:54 +00:00
dependabot[bot]
abff2a0a8f Bump laravel/framework from 7.26.1 to 7.27.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 7.26.1 to 7.27.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/7.x/CHANGELOG-7.x.md)
- [Commits](https://github.com/laravel/framework/compare/v7.26.1...v7.27.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-07 06:03:09 +00:00
dependabot[bot]
65499bb9ff Bump doctrine/dbal from 2.10.2 to 2.10.3
Bumps [doctrine/dbal](https://github.com/doctrine/dbal) from 2.10.2 to 2.10.3.
- [Release notes](https://github.com/doctrine/dbal/releases)
- [Commits](https://github.com/doctrine/dbal/compare/2.10.2...2.10.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-07 06:01:41 +00:00
James Cole
6f219d1932 Short header 2020-09-06 07:27:46 +02:00
James Cole
9d35048fb9 Fix #3770 2020-09-06 07:27:36 +02:00
James Cole
af58c30249 Merge branch 'main' into develop 2020-09-05 07:37:40 +02:00
James Cole
366744ed69 Catch bad SSL config 2020-09-05 07:37:18 +02:00
James Cole
d809b77154 Catch errors 2020-09-05 07:37:10 +02:00
James Cole
03cec69af3 Fix cash account display. 2020-09-03 06:55:00 +02:00
James Cole
9ae41b1645 Link in clone. 2020-09-03 06:52:09 +02:00
James Cole
b0f18a0419 Consistent end dates for budget limits. 2020-09-03 06:49:22 +02:00
James Cole
5648a9197d Merge pull request #3758 from firefly-iii/dependabot/composer/symfony/http-kernel-5.1.5
Bump symfony/http-kernel from 5.1.3 to 5.1.5
2020-09-03 04:35:01 +00:00
James Cole
f0fe8bf5c7 Fix #3759 2020-09-03 06:34:48 +02:00
dependabot[bot]
8a690afc46 Bump symfony/http-kernel from 5.1.3 to 5.1.5
Bumps [symfony/http-kernel](https://github.com/symfony/http-kernel) from 5.1.3 to 5.1.5.
- [Release notes](https://github.com/symfony/http-kernel/releases)
- [Changelog](https://github.com/symfony/http-kernel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/symfony/http-kernel/compare/v5.1.3...v5.1.5)

Signed-off-by: dependabot[bot] <support@github.com>
2020-09-02 18:56:48 +00:00
James Cole
2bb6c48278 Add some debug logging. 2020-09-02 06:46:51 +02:00
James Cole
6eb661df19 Fix #3755 2020-09-02 06:40:05 +02:00
James Cole
8e578e1058 Fix #3755 2020-09-02 06:39:56 +02:00
James Cole
4f7683b1fd Merge pull request #3751 from firefly-iii/dependabot/composer/develop/barryvdh/laravel-debugbar-3.4.2
Bump barryvdh/laravel-debugbar from 3.4.1 to 3.4.2
2020-08-31 07:55:32 +00:00
James Cole
656456b9d9 Merge pull request #3752 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-loader-10.0.1
Bump sass-loader from 9.0.3 to 10.0.1 in /frontend
2020-08-31 07:14:07 +00:00
dependabot[bot]
8c1daa9eed Bump sass-loader from 9.0.3 to 10.0.1 in /frontend
Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 9.0.3 to 10.0.1.
- [Release notes](https://github.com/webpack-contrib/sass-loader/releases)
- [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/sass-loader/compare/v9.0.3...v10.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-31 06:46:38 +00:00
dependabot[bot]
f146205208 Bump barryvdh/laravel-debugbar from 3.4.1 to 3.4.2
Bumps [barryvdh/laravel-debugbar](https://github.com/barryvdh/laravel-debugbar) from 3.4.1 to 3.4.2.
- [Release notes](https://github.com/barryvdh/laravel-debugbar/releases)
- [Changelog](https://github.com/barryvdh/laravel-debugbar/blob/master/changelog.md)
- [Commits](https://github.com/barryvdh/laravel-debugbar/compare/v3.4.1...v3.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-31 06:25:22 +00:00
James Cole
dce3c333da Merge pull request #3748 from psychowood/develop
Wrong query params in autocomplete
2020-08-31 04:25:38 +00:00
psychowood
b0d67f1637 Typos in b63e8d60bb 2020-08-31 00:27:55 +02:00
James Cole
bc913d0e9c Merge pull request #3746 from GrayStrider/patch-1
Fix anchor link
2020-08-29 11:41:14 +00:00
GrayStrider
415ef57458 Fix anchor link 2020-08-29 22:33:10 +11:00
James Cole
278ddf27bd Merge tag '5.4.0-alpha.3' into develop
5.4.0-alpha.3
2020-08-29 13:10:35 +02:00
James Cole
3566305c27 Merge branch 'release/5.4.0-alpha.3' into main 2020-08-29 13:10:33 +02:00
James Cole
b41b03e8f0 Update meta files for new alpha release. 2020-08-29 13:08:26 +02:00
James Cole
e5642b59d7 Update meta files 2020-08-29 12:10:13 +02:00
James Cole
e159de9a6a Expand warning with better text 2020-08-29 07:18:41 +02:00
James Cole
2a02e8a790 Clarify + warning 2020-08-28 22:03:27 +02:00
James Cole
798c73394d Code for #3712 2020-08-28 21:58:03 +02:00
James Cole
7f48043505 Fix #3729 2020-08-28 21:29:47 +02:00
James Cole
82b49a9e51 Add telemetry to get insight in update preferences. 2020-08-28 21:04:29 +02:00
James Cole
56ea680e46 Add telemetry to get insight into updates 2020-08-28 21:03:23 +02:00
James Cole
70f3d13626 Update translations 2020-08-28 16:36:03 +02:00
James Cole
093f34b7a8 Account search fixed. 2020-08-28 11:24:55 +02:00
James Cole
63794cab07 Fix bill from rule 2020-08-28 06:10:31 +02:00
James Cole
ed17600f79 Fix currency search. 2020-08-28 06:09:04 +02:00
James Cole
778af9f4e2 Fix #3735 2020-08-28 05:51:02 +02:00
James Cole
8c97754b64 Expand rule/search combination. 2020-08-27 20:22:52 +02:00
James Cole
2393344978 Correct params for search 2020-08-27 07:20:58 +02:00
James Cole
4c81a46af6 New features for rules in search. 2020-08-27 07:12:44 +02:00
James Cole
7df084dd3c Other way to test rule for #3735 2020-08-27 06:35:53 +02:00
James Cole
08aa61a2bf Basic bread crumb code to replace obsolete package 2020-08-27 06:19:41 +02:00
James Cole
a16ac479d5 Fix #3735 2020-08-27 06:19:16 +02:00
James Cole
483e7256f7 Disable layout caches. 2020-08-27 06:18:47 +02:00
James Cole
412b169e3a Kill 2FA 2020-08-26 20:37:30 +02:00
James Cole
bfcd743efa Fix copy/paste error [skip ci] 2020-08-26 20:22:11 +02:00
James Cole
f123c28540 Fix HTML 2020-08-26 20:21:12 +02:00
James Cole
56f9ce333c Updated strings. 2020-08-26 20:19:00 +02:00
James Cole
cd156d6991 Fix #3740 2020-08-26 20:18:27 +02:00
James Cole
c985683ee3 Fixed #3737 2020-08-26 19:41:50 +02:00
James Cole
59ab0c9f0d Fix #3739 2020-08-26 18:18:53 +02:00
James Cole
a24b6711d1 Clean up. 2020-08-26 18:06:47 +02:00
James Cole
7f7d7be646 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-08-26 18:06:24 +02:00
James Cole
2f2a02834b Fix #3736 2020-08-26 18:06:14 +02:00
James Cole
e2a3aa12a8 Merge pull request #3733 from glmdev/glmdev-ldap-filter
Add config option to specify custom LDAP filter
2020-08-26 14:53:11 +00:00
root
a4f70794a2 LdapFilterScope - make ldap filter config call coerce string 2020-08-26 14:46:01 +00:00
root
0ee3941b43 This adds support for the ADLDAP_AUTH_FILTER env var, and the
ldap_auth.custom_filter config option. These are optional.

If provided, the custom filter will be applied to the LDAP query
using the FireflyIII\Scopes\LdapFilterScope class.

This allows the integrator to specify a custom LDAP filter.
2020-08-26 14:07:47 +00:00
James Cole
4e05ce4c35 Wrong field when updating limit 2020-08-25 06:21:44 +02:00
James Cole
c5fa48ca46 Extra text 2020-08-25 06:12:43 +02:00
James Cole
20e39b2e12 Missing default variable. 2020-08-25 06:10:52 +02:00
James Cole
d28394c5d9 Update changelog. 2020-08-24 18:31:26 +02:00
James Cole
86fff1b61c Update packages. 2020-08-24 18:31:18 +02:00
James Cole
71ef5abea5 Remove references to unused code. 2020-08-24 18:31:10 +02:00
James Cole
6b83313ce8 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-08-24 18:05:27 +02:00
James Cole
2fe93656ee Delete unused files. 2020-08-24 18:05:05 +02:00
James Cole
ec8003245f Clean up configuration file. 2020-08-24 18:00:49 +02:00
James Cole
8f632cb57b Merge pull request #3725 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/axios-0.20.0
Bump axios from 0.19.2 to 0.20.0 in /frontend
2020-08-24 08:07:53 +00:00
dependabot[bot]
d7b9129c33 Bump axios from 0.19.2 to 0.20.0 in /frontend
Bumps [axios](https://github.com/axios/axios) from 0.19.2 to 0.20.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.19.2...v0.20.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-24 08:04:30 +00:00
James Cole
82efe530ea Merge pull request #3724 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/vue-chartjs-3.5.1
Bump vue-chartjs from 3.5.0 to 3.5.1 in /frontend
2020-08-24 08:03:39 +00:00
James Cole
b3805585a7 Merge pull request #3726 from firefly-iii/dependabot/npm_and_yarn/develop/axios-0.20.0
Bump axios from 0.19.2 to 0.20.0
2020-08-24 08:03:03 +00:00
James Cole
04b84fd0dc Merge pull request #3727 from firefly-iii/dependabot/composer/develop/vimeo/psalm-3.14.2
Bump vimeo/psalm from 3.14.1 to 3.14.2
2020-08-24 07:58:56 +00:00
dependabot[bot]
2ac405b2d0 Bump vimeo/psalm from 3.14.1 to 3.14.2
Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 3.14.1 to 3.14.2.
- [Release notes](https://github.com/vimeo/psalm/releases)
- [Commits](https://github.com/vimeo/psalm/compare/3.14.1...3.14.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-24 07:14:39 +00:00
dependabot[bot]
eb8571a508 Bump axios from 0.19.2 to 0.20.0
Bumps [axios](https://github.com/axios/axios) from 0.19.2 to 0.20.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.19.2...v0.20.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-24 07:03:01 +00:00
dependabot[bot]
f7e75e9b8a Bump vue-chartjs from 3.5.0 to 3.5.1 in /frontend
Bumps [vue-chartjs](https://github.com/apertureless/vue-chartjs) from 3.5.0 to 3.5.1.
- [Release notes](https://github.com/apertureless/vue-chartjs/releases)
- [Changelog](https://github.com/apertureless/vue-chartjs/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/apertureless/vue-chartjs/compare/v3.5.0...v3.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-24 06:43:49 +00:00
James Cole
0fd7dabbc1 Restore missing functions. 2020-08-24 07:38:33 +02:00
James Cole
9123454545 Migrate to new rule engine. 2020-08-24 07:31:50 +02:00
James Cole
3141ec0406 Expand search. 2020-08-24 07:03:17 +02:00
James Cole
4bf86500bd Fix tag search 2020-08-23 18:48:40 +02:00
James Cole
bee54146bf Fix #3721 2020-08-23 18:48:24 +02:00
James Cole
28698cc769 Make sure limits exist in rule engine. 2020-08-23 17:00:47 +02:00
James Cole
41f2339c8c Switch to new rule engine on command line. 2020-08-23 16:37:08 +02:00
James Cole
ce34e097a2 Add new rule engine to API commands. 2020-08-23 16:26:39 +02:00
James Cole
fecc9f7659 Fix actions and associated tests. 2020-08-23 16:12:16 +02:00
James Cole
139b3ffab4 Test more rule actions. 2020-08-23 09:21:50 +02:00
James Cole
febe60b3d1 Test more actions in new format. 2020-08-23 08:51:58 +02:00
James Cole
fc519c41bc Update conversion actions. 2020-08-23 08:03:28 +02:00
James Cole
6e074d9b8b Start testing new rule actions. 2020-08-23 07:42:14 +02:00
James Cole
d89a4d8a54 Fix #3720 2020-08-23 05:52:59 +02:00
James Cole
a504617425 Mark all triggers as deprecated. 2020-08-22 20:07:39 +02:00
James Cole
0c0fef6e84 Fix #3715 2020-08-22 19:48:00 +02:00
James Cole
1dfda62125 Fix #3715 2020-08-22 19:46:08 +02:00
James Cole
5e0c0e25f2 Fix #3716 2020-08-22 19:27:16 +02:00
James Cole
07220eb167 Update rule actions. 2020-08-22 17:18:15 +02:00
James Cole
216a0a186c Implement first version of the new rule engine. 2020-08-22 16:55:54 +02:00
James Cole
14df37712c Fix date searches. 2020-08-22 13:02:33 +02:00
James Cole
ab5a146277 Rename class. 2020-08-22 13:01:37 +02:00
James Cole
24a373abf4 Fix search 2020-08-22 12:25:00 +02:00
James Cole
ffca935ced Expand search. 2020-08-22 12:24:01 +02:00
James Cole
d69934ca8f Rule engine and search engine now use the same operators; making them interchangeable. 2020-08-21 08:23:44 +02:00
James Cole
3081911eae Merge tag '5.4.0-alpha.2' into develop
5.4.0-alpha.2
2020-08-21 08:04:50 +02:00
James Cole
67806cacdb Merge branch 'release/5.4.0-alpha.2' into main 2020-08-21 08:04:49 +02:00
James Cole
8ee2f12217 Updates for alpha 2 2020-08-21 08:03:00 +02:00
James Cole
c63721a15f Final code + language for alpha 2. 2020-08-20 20:43:23 +02:00
James Cole
9f80d729a2 Optimize some code. 2020-08-20 17:59:44 +02:00
James Cole
d78d2f25eb Fix #3710 2020-08-20 17:57:19 +02:00
James Cole
229d4bfe6b Fix missing query node. 2020-08-18 17:48:27 +02:00
James Cole
8e638d1cff Fix issue with budget limit creation 2020-08-17 17:20:59 +02:00
James Cole
1b17d53d65 Fix update 2020-08-17 15:58:06 +02:00
James Cole
77d3410b4e Fix date 2020-08-17 14:55:54 +02:00
James Cole
6b279398b3 Fix missing key. 2020-08-17 14:54:56 +02:00
James Cole
c34a00b3f3 Fix missing key. 2020-08-17 14:52:49 +02:00
James Cole
ce3c1cccc3 Remove debug statement. 2020-08-17 07:08:54 +02:00
James Cole
00683ff1bc Update languages and libraries. 2020-08-14 15:23:26 +02:00
James Cole
c2852e30bf Merge pull request #3699 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/vue-i18n-8.21.0
Bump vue-i18n from 8.20.0 to 8.21.0 in /frontend
2020-08-14 12:51:37 +00:00
dependabot[bot]
44680a38b0 Bump vue-i18n from 8.20.0 to 8.21.0 in /frontend
Bumps [vue-i18n](https://github.com/kazupon/vue-i18n) from 8.20.0 to 8.21.0.
- [Release notes](https://github.com/kazupon/vue-i18n/releases)
- [Changelog](https://github.com/kazupon/vue-i18n/blob/v8.x/CHANGELOG.md)
- [Commits](https://github.com/kazupon/vue-i18n/compare/v8.20.0...v8.21.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-14 09:11:03 +00:00
James Cole
80a674baab Merge tag '5.4.0-alpha.1' into develop
5.4.0-alpha.1
2020-08-14 11:09:15 +02:00
James Cole
ff85654cb9 Merge branch 'release/5.4.0-alpha.1' into main 2020-08-14 11:09:13 +02:00
James Cole
56a122705d Code for 5.4.0-alpha.1 2020-08-14 10:56:43 +02:00
James Cole
a48df9ac83 Pretty basic copy/paste code for #3648 2020-08-14 10:12:07 +02:00
James Cole
d4029775ec Fix #3586 2020-08-14 09:59:56 +02:00
James Cole
3dc1050929 Merge pull request #3696 from psychowood/develop
Added revenue/liabilities *_account_inactive keys
2020-08-13 16:59:08 +00:00
psychowood
c9a444b079 Added revenue/liabilities *_account_inactive keys 2020-08-13 18:07:02 +02:00
James Cole
831267b2ab Fix audit logger. 2020-08-13 13:55:16 +02:00
James Cole
d8b807df50 Add version to show login form call. 2020-08-13 13:54:32 +02:00
James Cole
879e24e7b1 Remove unused code. 2020-08-13 13:49:15 +02:00
James Cole
a1e454d693 Whhops 2020-08-13 13:31:06 +02:00
James Cole
39f8f14aa1 Fix PHP error 2020-08-13 13:30:24 +02:00
James Cole
d7fd1e333e Expand message 2020-08-13 13:29:11 +02:00
James Cole
76cd77cc73 Better audit logs 2020-08-13 13:18:54 +02:00
James Cole
ee3ef4b8cc Make audit log configurable. 2020-08-13 10:39:21 +02:00
James Cole
5f9ba78d94 Clean up example file 2020-08-12 07:12:00 +02:00
James Cole
93628f4d36 Remove some example things. 2020-08-12 07:08:45 +02:00
James Cole
ac2824dfdd Add missing file #3681 2020-08-12 07:05:51 +02:00
James Cole
9dd6a4430e Fix https://github.com/firefly-iii/firefly-iii/issues/3659 2020-08-12 06:47:43 +02:00
James Cole
f840de0b93 Slightly different failure message. 2020-08-11 23:52:27 +02:00
James Cole
6b5e4d34d5 Merge branch 'feature/custom-guard-header' into develop 2020-08-11 06:00:28 +02:00
James Cole
94f0b9f331 Merge pull request #3683 from sephrat/fix-3679
Fix #3679
2020-08-10 07:48:32 +00:00
Florian Dupret
67b5a6c096 Merge branch 'fix-3679' of https://github.com/sephrat/firefly-iii into fix-3679 2020-08-10 09:42:27 +02:00
Florian Dupret
644796e466 Rollback rule_trigger_* pluralization - Fix #3679 2020-08-10 09:41:39 +02:00
Florian Dupret
d244ab1af9 Rollback rule_trigger_* pluralization - Fix #3679 2020-08-10 09:38:00 +02:00
James Cole
f2683ae011 Merge pull request #3682 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/vue-router-3.4.2
Bump vue-router from 3.4.1 to 3.4.2 in /frontend
2020-08-10 06:44:43 +00:00
dependabot[bot]
8844583807 Bump vue-router from 3.4.1 to 3.4.2 in /frontend
Bumps [vue-router](https://github.com/vuejs/vue-router) from 3.4.1 to 3.4.2.
- [Release notes](https://github.com/vuejs/vue-router/releases)
- [Changelog](https://github.com/vuejs/vue-router/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/vuejs/vue-router/compare/v3.4.1...v3.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-10 06:23:29 +00:00
James Cole
c7bf6fc866 Fix #3679 2020-08-09 22:32:00 +02:00
James Cole
55c4465e5d Some translations. 2020-08-09 19:02:58 +02:00
James Cole
f63054823b Update libraries. 2020-08-09 18:59:47 +02:00
James Cole
83f441340c Fix search for #3678 2020-08-09 18:58:18 +02:00
James Cole
e81865fce3 Clean up JS 2020-08-09 08:57:06 +02:00
James Cole
bceffbc874 Better transaction overview. 2020-08-09 08:56:51 +02:00
James Cole
c6e8a63f7c Fix https://github.com/firefly-iii/firefly-iii/issues/3675 2020-08-09 08:56:41 +02:00
James Cole
10c9118f49 Optimise transformer. 2020-08-09 08:56:15 +02:00
James Cole
cdf42e2a37 Fix #3673 2020-08-08 17:34:56 +02:00
James Cole
d4c26820fc Fix #3673 2020-08-08 17:33:53 +02:00
James Cole
87c134322d Fix #3673 2020-08-08 17:17:09 +02:00
James Cole
6d627be679 Fix #3638 2020-08-08 14:09:30 +02:00
James Cole
1191ec00db Fix misaligned table 2020-08-08 11:07:29 +02:00
James Cole
027c212546 New fields for bills. 2020-08-08 11:07:15 +02:00
James Cole
be0f2f0b9f Fix budget date. 2020-08-08 11:07:08 +02:00
James Cole
73c1452aa9 Clean up profile 2020-08-07 12:05:58 +02:00
James Cole
7a7f1e7d97 Fix #3435 2020-08-07 11:38:31 +02:00
James Cole
f60bacba85 Fix transaction link route. 2020-08-07 11:10:35 +02:00
James Cole
d078764ae4 Fix #3265 2020-08-07 11:10:22 +02:00
James Cole
1558a41397 From daily to weekly 2020-08-07 11:07:48 +02:00
James Cole
9fca946821 Merge pull request #3668 from firefly-iii/dependabot/composer/develop/laravel/framework-7.23.2
Bump laravel/framework from 7.23.0 to 7.23.2
2020-08-07 07:17:00 +00:00
James Cole
4f35b9f327 Merge pull request #3669 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/bootstrap-4.5.2
Bump bootstrap from 4.5.1 to 4.5.2 in /frontend
2020-08-07 07:16:49 +00:00
James Cole
74d7183a10 Merge pull request #3670 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/vue-router-3.4.1
Bump vue-router from 3.4.0 to 3.4.1 in /frontend
2020-08-07 07:16:38 +00:00
James Cole
3990f4b7af Update dependabot.yml 2020-08-07 07:15:26 +00:00
dependabot[bot]
99342d615e Bump vue-router from 3.4.0 to 3.4.1 in /frontend
Bumps [vue-router](https://github.com/vuejs/vue-router) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/vuejs/vue-router/releases)
- [Changelog](https://github.com/vuejs/vue-router/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/vuejs/vue-router/compare/v3.4.0...v3.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-07 06:44:30 +00:00
dependabot[bot]
0ad9380226 Bump bootstrap from 4.5.1 to 4.5.2 in /frontend
Bumps [bootstrap](https://github.com/twbs/bootstrap) from 4.5.1 to 4.5.2.
- [Release notes](https://github.com/twbs/bootstrap/releases)
- [Commits](https://github.com/twbs/bootstrap/compare/v4.5.1...v4.5.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-07 06:43:18 +00:00
dependabot[bot]
0453493a9e Bump laravel/framework from 7.23.0 to 7.23.2
Bumps [laravel/framework](https://github.com/laravel/framework) from 7.23.0 to 7.23.2.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/7.x/CHANGELOG-7.x.md)
- [Commits](https://github.com/laravel/framework/compare/v7.23.0...v7.23.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-07 05:17:39 +00:00
James Cole
eb256fced6 Fix #3475 2020-08-06 20:08:04 +02:00
James Cole
ed0f04d644 Fix #3475 2020-08-06 18:34:10 +02:00
James Cole
1a17d5be39 Merge pull request #3663 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.36
Bump phpstan/phpstan from 0.12.35 to 0.12.36
2020-08-06 07:40:37 +00:00
James Cole
0f33e9d48f Merge pull request #3666 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/vue-router-3.4.0
Bump vue-router from 3.3.4 to 3.4.0 in /frontend
2020-08-06 07:39:45 +00:00
James Cole
5be8c8e2a7 Merge pull request #3665 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-loader-9.0.3
Bump sass-loader from 9.0.2 to 9.0.3 in /frontend
2020-08-06 07:39:31 +00:00
dependabot[bot]
66c1b881ef Bump vue-router from 3.3.4 to 3.4.0 in /frontend
Bumps [vue-router](https://github.com/vuejs/vue-router) from 3.3.4 to 3.4.0.
- [Release notes](https://github.com/vuejs/vue-router/releases)
- [Changelog](https://github.com/vuejs/vue-router/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/vuejs/vue-router/compare/v3.3.4...v3.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-06 06:43:54 +00:00
dependabot[bot]
520206ad52 Bump sass-loader from 9.0.2 to 9.0.3 in /frontend
Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 9.0.2 to 9.0.3.
- [Release notes](https://github.com/webpack-contrib/sass-loader/releases)
- [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/sass-loader/compare/v9.0.2...v9.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-06 06:43:26 +00:00
dependabot[bot]
db00e22063 Bump phpstan/phpstan from 0.12.35 to 0.12.36
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.35 to 0.12.36.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.35...0.12.36)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-06 05:15:41 +00:00
James Cole
342626684b Allows for a simpler fix for #3382 2020-08-05 18:55:51 +02:00
James Cole
8df6356abf Simplify frontpage. 2020-08-05 18:51:17 +02:00
James Cole
dfa60ec703 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-08-05 18:39:33 +02:00
James Cole
1e3fb073e0 Merge pull request #3603 from sephrat/fix-transfer-sign
Improvements to transactions list on home page
2020-08-05 16:39:20 +00:00
James Cole
cbf44a9069 Merge pull request #3656 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/bootstrap-4.5.1
Bump bootstrap from 4.5.0 to 4.5.1 in /frontend
2020-08-05 07:37:29 +00:00
James Cole
54e6b5aa83 Merge pull request #3655 from firefly-iii/dependabot/composer/develop/phpstan/phpstan-0.12.35
Bump phpstan/phpstan from 0.12.34 to 0.12.35
2020-08-05 07:37:17 +00:00
James Cole
bd20500d39 Merge pull request #3654 from firefly-iii/dependabot/composer/develop/laravel/framework-7.23.0
Bump laravel/framework from 7.22.4 to 7.23.0
2020-08-05 07:37:03 +00:00
dependabot[bot]
d26331bd36 Bump bootstrap from 4.5.0 to 4.5.1 in /frontend
Bumps [bootstrap](https://github.com/twbs/bootstrap) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/twbs/bootstrap/releases)
- [Commits](https://github.com/twbs/bootstrap/compare/v4.5.0...v4.5.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-05 07:05:26 +00:00
dependabot[bot]
9d6d15635f Bump phpstan/phpstan from 0.12.34 to 0.12.35
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 0.12.34 to 0.12.35.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Commits](https://github.com/phpstan/phpstan/compare/0.12.34...0.12.35)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-05 05:32:45 +00:00
dependabot[bot]
3e372bb1d9 Bump laravel/framework from 7.22.4 to 7.23.0
Bumps [laravel/framework](https://github.com/laravel/framework) from 7.22.4 to 7.23.0.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/7.x/CHANGELOG-7.x.md)
- [Commits](https://github.com/laravel/framework/compare/v7.22.4...v7.23.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-05 05:31:38 +00:00
James Cole
8f22b97905 Code for #3651 2020-08-05 07:15:28 +02:00
James Cole
6ecbaf554b Merge pull request #3643 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/overlayscrollbars-1.13.0
Bump overlayscrollbars from 1.12.0 to 1.13.0 in /frontend
2020-08-03 08:03:32 +00:00
dependabot[bot]
74b9b0db10 Bump overlayscrollbars from 1.12.0 to 1.13.0 in /frontend
Bumps [overlayscrollbars](https://github.com/KingSora/OverlayScrollbars) from 1.12.0 to 1.13.0.
- [Release notes](https://github.com/KingSora/OverlayScrollbars/releases)
- [Commits](https://github.com/KingSora/OverlayScrollbars/compare/v1.12.0...v1.13.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-03 06:47:18 +00:00
James Cole
4623ff9955 Fix env files. 2020-08-03 06:35:06 +02:00
James Cole
2a3651013c Fix #3642 2020-08-03 06:24:25 +02:00
James Cole
3fa5694bb8 property_exists doesn't seem to work 2020-08-02 18:58:44 +02:00
James Cole
839ba9d109 Use correct method for key. 2020-08-02 18:43:58 +02:00
James Cole
8dd315d7d6 Add some custom order. 2020-08-02 18:25:09 +02:00
James Cole
9a4a2708c0 Merge pull request #3640 from sephrat/hide-empty-budget
Hide budgets list when it is empty
2020-08-02 15:22:57 +00:00
James Cole
e93521f3ac Merge pull request #3641 from sephrat/fix-empty-piggy-banks
Fix "Let's create a piggy bank!" not being displayed anymore
2020-08-02 15:22:06 +00:00
James Cole
71ce9eb004 Merge pull request #3638 from sephrat/windows-locale
UTF8 locale support for Windows
2020-08-02 15:19:02 +00:00
Florian Dupret
1338dab5e7 Do not return ungrouped piggy banks if none assigned to group 2020-08-02 16:29:33 +02:00
Florian Dupret
7208f8ae35 Indentation fix 2020-08-02 15:57:26 +02:00
James Cole
490740721e Update some translations. 2020-08-02 15:56:13 +02:00
Florian Dupret
9d9d1325bd Hide budget list when it is empty 2020-08-02 15:55:33 +02:00
James Cole
a22e757502 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2020-08-02 15:49:44 +02:00
Florian Dupret
6db2b3d434 Remove string for warning about Windows locale 2020-08-02 15:33:56 +02:00
Florian Dupret
e74bce197f Merge remote-tracking branch 'upstream/develop' into windows-locale 2020-08-02 15:33:22 +02:00
James Cole
bb6f4843b9 Merge pull request #3639 from sephrat/docker-locale
Remove mention of Docker when not running Docker
2020-08-02 13:27:56 +00:00
Florian Dupret
61dc1b6f33 Remove string for mention of Docker when not running Docker 2020-08-02 15:15:46 +02:00
Florian Dupret
700579e06a Remove mention of Docker when not running Docker 2020-08-02 14:56:23 +02:00
Florian Dupret
bff6c81ed2 Remove warning about Windows locale 2020-08-02 14:48:12 +02:00
Florian Dupret
c741d56b32 UTF8 locale support for Windows 2020-08-02 14:37:15 +02:00
James Cole
0219069766 Fix some nullable methods. 2020-08-02 12:19:10 +02:00
James Cole
d0a01d73c4 Function no longer returns nulls. 2020-08-02 12:14:56 +02:00
James Cole
e7e21348eb Remove deprecated method. 2020-08-02 12:13:23 +02:00
James Cole
e29b2066c2 Remove deprecated method. 2020-08-02 11:59:43 +02:00
James Cole
fb0d31226a Remove use of deprecated function. 2020-08-02 11:53:04 +02:00
James Cole
30d7d5d90e Fix some translations. 2020-08-02 09:47:19 +02:00
James Cole
386c067e93 Make note of some query heavy pages. 2020-08-02 09:26:14 +02:00
James Cole
384854b353 New language strings. 2020-08-02 08:54:28 +02:00
Florian Dupret
5d63f54fe2 Rollback #3382 part 3 2020-08-01 18:57:58 +02:00
Florian Dupret
9db79c3142 Rollback #3382 part 2 2020-08-01 18:53:42 +02:00
Florian Dupret
f4b6a63514 Rollback #3382 2020-08-01 18:51:12 +02:00
James Cole
1947d81c58 New translations. 2020-08-01 17:54:35 +02:00
James Cole
1169c5c5e2 Various code quality improvements. 2020-08-01 17:51:52 +02:00
James Cole
ae7cd76d87 Fix #3635 2020-08-01 17:40:27 +02:00
James Cole
7b7076116e Merge pull request #3635 from sephrat/text-fix
Fix copy/paste error
2020-08-01 15:39:32 +00:00
Florian Dupret
1b8ebe498a Fix copy/paste error 2020-08-01 17:36:06 +02:00
James Cole
dc53bedff7 Exit 0 fixes build. 2020-08-01 16:29:20 +02:00
James Cole
b9b8c1168f Fix #3246 2020-08-01 15:52:28 +02:00
James Cole
35d30fea9c Fix #3238 2020-08-01 15:31:11 +02:00
James Cole
f3b116cfce Always return 0. Cheap but it works. 2020-08-01 15:09:05 +02:00
James Cole
3bf6891e1c Fix #3630 2020-08-01 15:08:39 +02:00
James Cole
723d1cffe2 Fix some tests, disable actions for the time being. 2020-08-01 15:06:02 +02:00
Florian Dupret
977c78412f Better refactorization for #3382 2020-08-01 14:08:03 +02:00
James Cole
a6a83286b9 Update libraries, add phpunit xml for coverage. 2020-08-01 07:56:13 +02:00
James Cole
43fc4c5f52 Expand some test code. 2020-08-01 07:55:55 +02:00
James Cole
c26de3bdd2 Fix order query. 2020-08-01 06:45:20 +02:00
James Cole
65f54ed8f3 Include correct URI for transaction autocomplete [skip ci] 2020-08-01 06:21:15 +02:00
James Cole
c2fc759b68 Reference to correct DB 2020-08-01 06:00:36 +02:00
James Cole
c41d766604 Update libraries [skip ci] 2020-08-01 05:57:32 +02:00
James Cole
f76fd06055 Copied to wrong path. 2020-08-01 05:56:32 +02:00
James Cole
3d5230228e Fix env file, fix logging 2020-08-01 05:49:45 +02:00
James Cole
07b93037b3 No need to cat non-existent file. 2020-08-01 05:46:52 +02:00
James Cole
8cebd03298 Fix namespace. 2020-08-01 05:46:10 +02:00
James Cole
a502594545 Run PHPUnit 2020-08-01 05:44:26 +02:00
James Cole
57cb325639 Optimise tests 2020-08-01 05:34:32 +02:00
James Cole
e0b71c316b Fix first test! 2020-08-01 05:32:38 +02:00
James Cole
ad76afe4f6 Correct namespace and location. 2020-08-01 05:32:17 +02:00
James Cole
895762ff18 Move tests 2020-08-01 05:31:26 +02:00
James Cole
214dcc7e4c Don't echo to file 2020-07-31 19:30:30 +02:00
James Cole
49b855f7fd Not raw, echo more. 2020-07-31 19:28:08 +02:00
James Cole
62494e7943 Fix format. 2020-07-31 19:18:40 +02:00
James Cole
d2fd858d18 Analyse less code, optimise run. 2020-07-31 19:15:26 +02:00
James Cole
749236bc8d Push better PHPStan config. 2020-07-31 19:10:02 +02:00
James Cole
d3daf8d61e Composer install (duh) 2020-07-31 17:47:48 +02:00
James Cole
d3051cb229 Switch directory 2020-07-31 17:46:26 +02:00
James Cole
bb89c59b51 Back to correct dir. 2020-07-31 17:44:01 +02:00
James Cole
fbd46c683e Try again with local packages. 2020-07-31 17:41:21 +02:00
James Cole
d45a5e6c93 Expand cache, better links. 2020-07-31 17:36:09 +02:00
James Cole
fbb8a0e543 Fix script and neon locations. 2020-07-31 17:33:23 +02:00
James Cole
4d5a50c026 Correct dir for phpstan 2020-07-31 17:28:45 +02:00
James Cole
b25d046528 Switch to PHP so composer is present. Make script executable. 2020-07-31 17:25:37 +02:00
James Cole
142b7b9c0e Let's see what Travis will do. 2020-07-31 17:24:18 +02:00
James Cole
e46958c23e Update some code style 2020-07-31 15:12:26 +02:00
James Cole
c3d8d70b34 Move phpstan config file for cleaner root. 2020-07-31 12:56:32 +02:00
James Cole
b302775c37 Various code cleanup. 2020-07-31 12:45:02 +02:00
James Cole
4b96558433 Do some code cleanup and call correct phpunit. 2020-07-31 12:12:54 +02:00
James Cole
c3110a43da Downgrade to php 8 so CI works. 2020-07-31 12:11:01 +02:00
James Cole
22b1bfd189 Small improvements to CI 2020-07-31 12:08:58 +02:00
James Cole
c0b7ef878a Code style fixes. 2020-07-31 09:42:00 +02:00
James Cole
9234636422 Basic code standard fixes. 2020-07-31 09:24:08 +02:00
James Cole
886e9459a5 Switch to v9 2020-07-31 08:56:12 +02:00
James Cole
9d6979e3dd Fix path. 2020-07-31 08:48:06 +02:00
James Cole
cea3f860f2 Try another path 2020-07-31 07:46:24 +02:00
James Cole
bc27ce8c56 Fix command. 2020-07-31 07:41:13 +02:00
James Cole
c78c1bea7d Add thing for code standard. 2020-07-31 07:37:44 +02:00
James Cole
7dcc76f217 Add empty factory. 2020-07-31 07:28:59 +02:00
James Cole
4c38c7c67b Update lock files. 2020-07-31 07:05:28 +02:00
James Cole
fcf6863aaf Update .env.ci. 2020-07-31 06:58:14 +02:00
James Cole
e57251abf4 Rename file. 2020-07-31 06:57:38 +02:00
James Cole
6e6dd60b46 Merge pull request #3604 from hoshsadiq/feature/ci
Add initial continuous integration
2020-07-31 04:55:31 +00:00
James Cole
8a91618f8d Merge branch 'develop' into feature/ci 2020-07-31 04:55:23 +00:00
James Cole
cd19e86141 Clean up test code, prep for merge. 2020-07-31 06:53:48 +02:00
James Cole
1e2829ed8e New config for custom guard header 2020-07-31 06:50:57 +02:00
James Cole
981960fcb4 Remote user guard accepts custom header 2020-07-31 06:21:53 +02:00
James Cole
77658d19dd Update env for custom guard. 2020-07-31 06:21:39 +02:00
James Cole
0264184442 New trait for tests 2020-07-31 06:21:03 +02:00
James Cole
eabda85b1e Add missing API endpoints. 2020-07-31 06:19:48 +02:00
James Cole
93856a3c57 Basic test, no value. 2020-07-30 21:16:14 +02:00
James Cole
7351d98590 Update libraries. 2020-07-30 20:56:25 +02:00
James Cole
7ad1458ad7 Fix test with DB fixtures 2020-07-30 20:56:12 +02:00
James Cole
2cb61ea501 Fix issue when DB is empty. 2020-07-30 20:55:58 +02:00
James Cole
7c2ae7a91e Add column for new OAuth thing. 2020-07-30 20:50:22 +02:00
James Cole
5ae786516a Mark all tests as incomplete. 2020-07-30 20:49:40 +02:00
James Cole
a590cfd881 Clean up test case 2020-07-30 20:48:47 +02:00
James Cole
3b03fb7e8b Add sqlite test entry 2020-07-30 20:48:28 +02:00
James Cole
d6564f7b7b Clean up test code. 2020-07-30 20:48:07 +02:00
James Cole
fcdeaf3510 Merge pull request #3622 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/vue-i18n-8.20.0
Bump vue-i18n from 8.19.0 to 8.20.0 in /frontend
2020-07-30 06:37:35 +00:00
James Cole
b3761c7088 Merge pull request #3621 from firefly-iii/dependabot/npm_and_yarn/develop/vue-i18n-8.20.0
Bump vue-i18n from 8.19.0 to 8.20.0
2020-07-30 06:37:24 +00:00
dependabot[bot]
2486faebe9 Bump vue-i18n from 8.19.0 to 8.20.0 in /frontend
Bumps [vue-i18n](https://github.com/kazupon/vue-i18n) from 8.19.0 to 8.20.0.
- [Release notes](https://github.com/kazupon/vue-i18n/releases)
- [Changelog](https://github.com/kazupon/vue-i18n/blob/v8.x/CHANGELOG.md)
- [Commits](https://github.com/kazupon/vue-i18n/compare/v8.19.0...v8.20.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-30 05:56:36 +00:00
dependabot[bot]
0c7a38a1ad Bump vue-i18n from 8.19.0 to 8.20.0
Bumps [vue-i18n](https://github.com/kazupon/vue-i18n) from 8.19.0 to 8.20.0.
- [Release notes](https://github.com/kazupon/vue-i18n/releases)
- [Changelog](https://github.com/kazupon/vue-i18n/blob/v8.x/CHANGELOG.md)
- [Commits](https://github.com/kazupon/vue-i18n/compare/v8.19.0...v8.20.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-30 05:04:44 +00:00
James Cole
bdfce234b0 Merge pull request #3619 from firefly-iii/dependabot/composer/develop/phpunit/phpunit-9.2.6
Bump phpunit/phpunit from 8.5.8 to 9.2.6
2020-07-29 09:21:01 +00:00
James Cole
c5e0ced4bd Merge branch 'develop' into dependabot/composer/develop/phpunit/phpunit-9.2.6 2020-07-29 09:11:36 +00:00
James Cole
2aed0651b5 Merge pull request #3618 from firefly-iii/dependabot/composer/develop/laravel/passport-9.3.2
Bump laravel/passport from 8.5.0 to 9.3.2
2020-07-29 07:19:45 +00:00
dependabot[bot]
15089217f0 Bump phpunit/phpunit from 8.5.8 to 9.2.6
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 8.5.8 to 9.2.6.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-8.5.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/8.5.8...9.2.6)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-29 05:26:06 +00:00
dependabot[bot]
9dff2cca2b Bump laravel/passport from 8.5.0 to 9.3.2
Bumps [laravel/passport](https://github.com/laravel/passport) from 8.5.0 to 9.3.2.
- [Release notes](https://github.com/laravel/passport/releases)
- [Changelog](https://github.com/laravel/passport/blob/9.x/CHANGELOG.md)
- [Upgrade guide](https://github.com/laravel/passport/blob/9.x/UPGRADE.md)
- [Commits](https://github.com/laravel/passport/compare/v8.5.0...v9.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-29 05:24:57 +00:00
James Cole
6eb401247e Fix dependabot in dev 2020-07-28 20:41:44 +02:00
James Cole
dc66163edd Update libraries thanks to dependabot, fix some issues. 2020-07-28 20:40:08 +02:00
James Cole
8d7972ed07 Merge pull request #3607 from firefly-iii/dependabot/composer/develop/rcrowe/twigbridge-0.12.1
Bump rcrowe/twigbridge from 0.11.3 to 0.12.1
2020-07-28 18:19:24 +00:00
James Cole
a40bbb34b3 Merge branch 'develop' into dependabot/composer/develop/rcrowe/twigbridge-0.12.1 2020-07-28 18:19:17 +00:00
James Cole
ab2602b5d6 Merge pull request #3608 from firefly-iii/dependabot/composer/develop/pragmarx/google2fa-8.0.0
Bump pragmarx/google2fa from 7.0.0 to 8.0.0
2020-07-28 18:18:08 +00:00
dependabot[bot]
9123222830 Bump rcrowe/twigbridge from 0.11.3 to 0.12.1
Bumps [rcrowe/twigbridge](https://github.com/rcrowe/TwigBridge) from 0.11.3 to 0.12.1.
- [Release notes](https://github.com/rcrowe/TwigBridge/releases)
- [Changelog](https://github.com/rcrowe/TwigBridge/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rcrowe/TwigBridge/compare/v0.11.3...v0.12.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 18:17:52 +00:00
dependabot[bot]
b8994a7755 Bump pragmarx/google2fa from 7.0.0 to 8.0.0
Bumps [pragmarx/google2fa](https://github.com/antonioribeiro/google2fa) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/antonioribeiro/google2fa/releases)
- [Changelog](https://github.com/antonioribeiro/google2fa/blob/8.x/CHANGELOG.md)
- [Commits](https://github.com/antonioribeiro/google2fa/compare/v7.0.0...8.0.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 18:17:51 +00:00
James Cole
089bb9e076 Merge pull request #3605 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/sass-loader-9.0.2
Bump sass-loader from 8.0.2 to 9.0.2 in /frontend
2020-07-28 18:16:09 +00:00
James Cole
5b3bb0fa80 Merge pull request #3615 from firefly-iii/dependabot/composer/develop/ramsey/uuid-4.1.0
Bump ramsey/uuid from 3.9.3 to 4.1.0
2020-07-28 18:15:32 +00:00
dependabot[bot]
fafee5f527 Bump ramsey/uuid from 3.9.3 to 4.1.0
Bumps [ramsey/uuid](https://github.com/ramsey/uuid) from 3.9.3 to 4.1.0.
- [Release notes](https://github.com/ramsey/uuid/releases)
- [Changelog](https://github.com/ramsey/uuid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ramsey/uuid/compare/3.9.3...4.1.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 18:14:47 +00:00
James Cole
21d7eadee2 Merge pull request #3606 from firefly-iii/dependabot/npm_and_yarn/frontend/develop/vue-i18n-8.19.0
Bump vue-i18n from 8.18.2 to 8.19.0 in /frontend
2020-07-28 18:14:45 +00:00
James Cole
fe7a30c238 Merge pull request #3612 from firefly-iii/dependabot/npm_and_yarn/develop/uiv-0.36.0
Bump uiv from 0.34.4 to 0.36.0
2020-07-28 18:13:27 +00:00
James Cole
e769a10a95 Merge pull request #3610 from firefly-iii/dependabot/npm_and_yarn/develop/axios-0.19.2
Bump axios from 0.18.1 to 0.19.2
2020-07-28 18:13:14 +00:00
James Cole
24b5a3787e Merge pull request #3613 from firefly-iii/dependabot/composer/develop/bacon/bacon-qr-code-2.0.1
Bump bacon/bacon-qr-code from 1.0.3 to 2.0.1
2020-07-28 18:12:29 +00:00
James Cole
f227f19d9f Merge pull request #3614 from firefly-iii/dependabot/composer/develop/laravel/framework-7.22.4
Bump laravel/framework from 7.21.0 to 7.22.4
2020-07-28 18:12:05 +00:00
James Cole
8f95e4c55d Merge pull request #3611 from firefly-iii/dependabot/npm_and_yarn/develop/cross-env-7.0.2
Bump cross-env from 5.2.1 to 7.0.2
2020-07-28 18:11:54 +00:00
dependabot[bot]
da309a3d03 Bump laravel/framework from 7.21.0 to 7.22.4
Bumps [laravel/framework](https://github.com/laravel/framework) from 7.21.0 to 7.22.4.
- [Release notes](https://github.com/laravel/framework/releases)
- [Changelog](https://github.com/laravel/framework/blob/7.x/CHANGELOG-7.x.md)
- [Commits](https://github.com/laravel/framework/compare/v7.21.0...v7.22.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 13:55:46 +00:00
dependabot[bot]
c2650df224 Bump bacon/bacon-qr-code from 1.0.3 to 2.0.1
Bumps [bacon/bacon-qr-code](https://github.com/Bacon/BaconQrCode) from 1.0.3 to 2.0.1.
- [Release notes](https://github.com/Bacon/BaconQrCode/releases)
- [Changelog](https://github.com/Bacon/BaconQrCode/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Bacon/BaconQrCode/compare/1.0.3...2.0.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 13:54:57 +00:00
dependabot[bot]
8bbbaab9bb Bump uiv from 0.34.4 to 0.36.0
Bumps [uiv](https://github.com/wxsms/uiv) from 0.34.4 to 0.36.0.
- [Release notes](https://github.com/wxsms/uiv/releases)
- [Commits](https://github.com/wxsms/uiv/compare/v0.34.4...v0.36.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 13:54:30 +00:00
dependabot[bot]
67482858b9 Bump cross-env from 5.2.1 to 7.0.2
Bumps [cross-env](https://github.com/kentcdodds/cross-env) from 5.2.1 to 7.0.2.
- [Release notes](https://github.com/kentcdodds/cross-env/releases)
- [Changelog](https://github.com/kentcdodds/cross-env/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kentcdodds/cross-env/compare/v5.2.1...v7.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 13:54:22 +00:00
dependabot[bot]
a29487abcd Bump axios from 0.18.1 to 0.19.2
Bumps [axios](https://github.com/axios/axios) from 0.18.1 to 0.19.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.18.1...v0.19.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 13:54:13 +00:00
dependabot[bot]
b910a249cb Bump vue-i18n from 8.18.2 to 8.19.0 in /frontend
Bumps [vue-i18n](https://github.com/kazupon/vue-i18n) from 8.18.2 to 8.19.0.
- [Release notes](https://github.com/kazupon/vue-i18n/releases)
- [Changelog](https://github.com/kazupon/vue-i18n/blob/v8.x/CHANGELOG.md)
- [Commits](https://github.com/kazupon/vue-i18n/compare/v8.18.2...v8.19.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 13:52:13 +00:00
dependabot[bot]
20498efd2e Bump sass-loader from 8.0.2 to 9.0.2 in /frontend
Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 8.0.2 to 9.0.2.
- [Release notes](https://github.com/webpack-contrib/sass-loader/releases)
- [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/sass-loader/compare/v8.0.2...v9.0.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-28 13:51:54 +00:00
James Cole
4feddb61c5 Update dependabot.yml 2020-07-28 15:50:37 +02:00
James Cole
012420c47d Remove ability to see balance. 2020-07-28 06:31:56 +02:00
James Cole
ff9d8865d1 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-07-28 06:27:05 +02:00
James Cole
3cda3b27e2 Merge pull request #3598 from maroux/fix_recurring_create
Fix recurring transactions create and fix cache access
2020-07-28 04:26:55 +00:00
James Cole
8363efd1f9 Add locale to JS variables. 2020-07-28 06:25:28 +02:00
James Cole
36b0167eac Expand charts with currency code. 2020-07-28 06:25:14 +02:00
James Cole
66b5523310 Remove unused method. 2020-07-28 06:24:30 +02:00
Hosh Sadiq
8f568d41ca Add initial continuous integration
Currently it will run phpunit, check coding standards and run
phpstan. This can and should be build upon, so that eventually builds
are automated and hopefully reproducable.
2020-07-27 19:47:22 +01:00
James Cole
1c07feb446 Add locale to variables. 2020-07-27 20:06:18 +02:00
Florian Dupret
261156588f Fix broken merge from 294cda7 2020-07-27 11:52:25 +02:00
Florian Dupret
294cda7f33 Merge remote-tracking branch 'upstream/develop' into fix-transfer-sign 2020-07-27 11:06:00 +02:00
Florian Dupret
995c43d832 First refactoring towards fixing #3382 2020-07-27 10:53:36 +02:00
James Cole
d49743031f Add windows locale support #3519 2020-07-27 07:13:39 +02:00
James Cole
7017d33b87 Small code improv #3578 2020-07-27 07:08:29 +02:00
James Cole
fade9ae6f9 Simpler get currency routine 2020-07-27 07:06:44 +02:00
James Cole
c5489a7c55 Restore locale info from localeconv #3578 2020-07-27 07:05:41 +02:00
James Cole
9c14bc24e2 Expand limit. 2020-07-26 19:30:24 +02:00
James Cole
fe66be673a Some extra code for #3578 2020-07-26 17:35:13 +02:00
James Cole
fdea25051c Make sure sorting doesnt break opening balance. 2020-07-26 15:05:48 +02:00
James Cole
c86673f3ec Trim the label. 2020-07-26 14:37:45 +02:00
James Cole
94c31ad747 Add extra order for better form. 2020-07-26 14:30:56 +02:00
James Cole
633bc043da Reverse chart sort 2020-07-26 14:18:25 +02:00
James Cole
453709a117 Reverse sort in chart 2020-07-26 14:17:49 +02:00
James Cole
83467ef2f2 Code for #3240 2020-07-26 07:57:48 +02:00
Aniruddha Maru
9d409a7412 Fix recurring transactions create
- If there's a lot of accounts to calculate balances for, then recurring transactions create page
  doesn't load. Partly because it has to calculate a lot of balances, but partly because the cache
  isn't being used at all because date is `new Date` rather than say, end of month.

Fix: Change Steam balance calculator to always default cache using end of month. Since cache is
'invalidated' upon any edit, there's no reason to use current datetime anywhere its not explicitly
required by user flow.
Fix: Don't calculate balances for revenue / expense accounts since those are unbounded.

Issue: #3597
2020-07-25 16:16:29 -07:00
James Cole
4b16d7c53d Remove unused code. 2020-07-25 08:19:31 +02:00
James Cole
5e1306282a Code to fix #3213 2020-07-25 08:03:57 +02:00
James Cole
02ad8273eb Update meta files. 2020-07-24 16:42:42 +02:00
James Cole
74247c292f Update / create methods can handle order #3200 2020-07-24 16:41:58 +02:00
James Cole
1286694efd Different method call 2020-07-24 16:41:41 +02:00
James Cole
69d63bc3ba API allows order to be set. #3200 2020-07-24 16:41:31 +02:00
James Cole
bc4b841baa Add consistency for API calls #3150 2020-07-24 16:41:10 +02:00
James Cole
ba488b71eb Register user count in upgrade instructions. 2020-07-24 16:40:54 +02:00
James Cole
117affb1d4 Model updates for #3200 2020-07-24 16:40:42 +02:00
James Cole
50ee1a11f6 UI updates for #3200 2020-07-24 16:40:32 +02:00
James Cole
74eddfa1fa New migration for #3200 2020-07-24 16:40:16 +02:00
James Cole
758e1ff2ad Update links. 2020-07-24 06:16:56 +02:00
James Cole
e1f4cd7565 Fix #3187 2020-07-23 19:40:10 +02:00
James Cole
93a0338678 Expand autocomplete for #3150 2020-07-23 19:34:17 +02:00
James Cole
3d6bf713ee Fix #3150 2020-07-23 17:58:53 +02:00
James Cole
b63e8d60bb Expand autocomplete and remove old code #3150 2020-07-23 06:58:00 +02:00
James Cole
162e791dfd Update autocomplete code for #3150 2020-07-23 06:19:34 +02:00
James Cole
0f840ad082 Updated routes for auto-complete. 2020-07-22 20:17:20 +02:00
James Cole
6a158a173d Fix #3585 2020-07-22 20:10:48 +02:00
James Cole
f777abdeb1 Add limit to object groups #3150 2020-07-21 06:30:37 +02:00
James Cole
bb841e66c7 Add currency limit, without currency code #3150 2020-07-21 06:29:24 +02:00
James Cole
74ed80aaef Add limit to category #3150 2020-07-21 06:24:49 +02:00
James Cole
723696b971 Add limit to budget #3150 2020-07-21 06:23:37 +02:00
James Cole
858158d886 Add limit to bills. #3150 2020-07-21 06:22:29 +02:00
James Cole
62fd701808 Add limit #3150 2020-07-21 06:20:31 +02:00
James Cole
b207100074 Add empty controllers #3150 2020-07-21 06:19:49 +02:00
James Cole
5ad7439241 Optimise code 2020-07-21 06:14:47 +02:00
James Cole
debbe89187 Code for #3150 2020-07-21 06:09:24 +02:00
James Cole
a654158bd4 Rename method. 2020-07-19 20:10:47 +02:00
James Cole
0bb59f5505 Yoda style and dump unused method. 2020-07-19 20:08:50 +02:00
James Cole
6881d4479e Remove round(). 2020-07-19 20:07:58 +02:00
James Cole
7f3168cc55 Merge pull request #3578 from hoshsadiq/feature/use-intl-formatter
Use php-intl to format currencies
2020-07-19 18:05:25 +00:00
Hosh Sadiq
14dd185717 Use php-intl to format currencies
Currently the php function `number_format` is used to format currencies.
This is problematic as we have to figure out different things for
different currencies ourselves. These formats are determined based on
the libc's locale functions.

The issue arises where an OS doesn't have the proper locales installed,
or, in some cases, it's not supported (see below on multiple issues).

This addresses this issue by using the php-intl extensions to format the
numbers based on the locale. The extension is already a requirement in
`composer.json`. The solution does not rely on `LC_MONETARY` from the
underlying libc (which in Alpine Linux's case, which uses musl, is not
supported as of yet).

List of issues that are related and would potentially be fixed using
this PR:

- #2298
- #2946
- #3070
- #3306
- #3519
2020-07-19 18:34:39 +01:00
James Cole
edf6ece7cb Fix category autocomplete. 2020-07-19 18:03:02 +02:00
James Cole
3619427f60 Remove old tag cloud code. 2020-07-19 18:02:48 +02:00
James Cole
bd779c8156 Include Request class. 2020-07-19 17:43:12 +02:00
James Cole
cf977a2bfa Upgrade lock file. 2020-07-19 17:29:24 +02:00
James Cole
8a4999406b More auto-complete migration. 2020-07-19 17:24:29 +02:00
James Cole
fd6f1fbbf0 Expand autocomplete routes 2020-07-19 17:05:37 +02:00
James Cole
9cf99314d1 Fix logging 2020-07-19 13:18:25 +02:00
James Cole
fc7d8bb810 Auto complete route 2020-07-19 13:06:59 +02:00
James Cole
c1f0dedd09 API token thing 2020-07-19 13:06:22 +02:00
James Cole
3653469dda Add command. 2020-07-19 13:06:01 +02:00
James Cole
1e313f80a4 Remove unused class. 2020-07-19 13:05:27 +02:00
James Cole
73f1f8aea0 Add new command 2020-07-19 13:05:15 +02:00
James Cole
78107b1212 New routes and a fix for account types. 2020-07-19 13:04:41 +02:00
James Cole
3b56f4271e Update JS, to use API auto complete routes. 2020-07-19 13:04:22 +02:00
James Cole
f3a55e6cee Add command to fix transaction types. 2020-07-19 13:03:18 +02:00
James Cole
2f70ea074e Not async url, but async function. 2020-07-19 12:34:44 +02:00
James Cole
88172dbc7c From 'title' to 'inputDescription' 2020-07-19 12:33:57 +02:00
James Cole
34eda509c2 Update readme. 2020-07-19 11:42:49 +02:00
James Cole
c7eab7873e Clean up requests 2020-07-18 08:42:13 +02:00
James Cole
58c1880219 Extend correct class 2020-07-18 08:36:42 +02:00
James Cole
d73195ec36 Point to all the right classes. 2020-07-18 08:34:00 +02:00
James Cole
427bcaa522 First basic remodelling of request classes 2020-07-18 08:25:25 +02:00
James Cole
d55cc03edf Fix issue with reconciliation displayed amount. 2020-07-18 04:45:12 +02:00
James Cole
1282009257 Merge tag '5.3.3' into develop
5.3.3
2020-07-17 19:16:37 +02:00
James Cole
106f097b45 Merge branch 'release/5.3.3' into main 2020-07-17 19:16:36 +02:00
James Cole
fafb7f5e49 Add dependabot 2020-07-17 19:16:05 +02:00
James Cole
e54c08e2d3 Update meta files for new release. 2020-07-17 19:12:29 +02:00
James Cole
03a63d0119 Update translations. 2020-07-17 19:00:38 +02:00
James Cole
e2b698f166 Fix timezone call 2020-07-17 18:52:34 +02:00
James Cole
f14ac5928f Fix some tests. 2020-07-17 18:51:54 +02:00
James Cole
cd65d4d4c5 Call correct timezone. 2020-07-17 18:51:35 +02:00
James Cole
7aa3cd5ba4 Fix #3568 2020-07-17 17:26:36 +02:00
James Cole
0fe17d5458 Fix #3574 2020-07-17 17:24:36 +02:00
James Cole
aaa3cc3d19 Merge pull request #3573 from emansih/develop
Fix url
2020-07-17 13:23:37 +00:00
emansih
c80d1d3402 Fix url 2020-07-17 20:48:18 +10:00
James Cole
254b004587 Fix #3566 2020-07-16 09:55:26 +02:00
James Cole
d813d0b7c2 Merge pull request #3565 from maroux/fix-monthly-date
Fix update monthly_payment_date using the API
2020-07-16 04:14:23 +00:00
Aniruddha Maru
53909fdd8a Fix maybe? 2020-07-15 12:22:09 -07:00
James Cole
0ba03be9a3 Merge branch 'release/5.3.2' into main 2020-07-13 16:03:36 +02:00
James Cole
7aac446cf2 Merge tag '5.3.2' into develop
5.3.2
2020-07-13 16:03:36 +02:00
James Cole
f2dcb108e8 Update meta files for new release. 2020-07-13 15:57:39 +02:00
James Cole
c0e5d6dd68 Update version. 2020-07-13 15:13:57 +02:00
James Cole
0b966ed541 Less verbose error logging for https://github.com/firefly-iii/firefly-iii/issues/3559 2020-07-13 15:03:19 +02:00
James Cole
8219b51e47 Skip error fix https://github.com/firefly-iii/firefly-iii/issues/3559 2020-07-13 14:22:00 +02:00
James Cole
9b102d1cf4 Merge tag '5.3.1' into develop
5.3.1
2020-07-12 20:25:23 +02:00
James Cole
ac607483aa Merge branch 'release/5.3.1' into main 2020-07-12 20:25:20 +02:00
James Cole
3ef46a59e9 Last-minute meta files. 2020-07-12 20:24:30 +02:00
James Cole
5529fa7124 Some last-minute translations, thanks guys! 2020-07-12 20:19:54 +02:00
James Cole
7a30bc4ff6 Updated meta for new release. 2020-07-12 19:48:24 +02:00
James Cole
8a9f6b1896 Double check on integers for https://github.com/firefly-iii/firefly-iii/issues/3554 2020-07-12 17:54:51 +02:00
James Cole
da77bcde04 Update version and API. 2020-07-12 17:34:06 +02:00
James Cole
c4979bdd27 Code for #3554 2020-07-12 17:32:48 +02:00
James Cole
0c9a25a073 Code cleanup and better auth check 2020-07-12 17:31:11 +02:00
James Cole
e24c2491a6 Expand frontend 2020-07-12 17:30:24 +02:00
James Cole
72a2718a93 Fix tests 2020-07-12 17:28:43 +02:00
James Cole
54d92f5b39 Code for #3546 2020-07-11 15:13:15 +02:00
James Cole
86600d4fcf Fix timezone issues. 2020-07-11 08:16:31 +02:00
James Cole
5cfe02edf6 Small textual changes 2020-07-11 07:18:51 +02:00
James Cole
22cb9dfbe0 make sure amount is a string. 2020-07-11 07:18:41 +02:00
James Cole
3782388e45 New security policy + release document. 2020-07-11 07:16:07 +02:00
James Cole
5821256590 Fix https://github.com/firefly-iii/firefly-iii/issues/3545 2020-07-11 07:01:29 +02:00
James Cole
14e06bfedd Experimental signed commit. 2020-07-10 06:48:39 +02:00
James Cole
886475740a Fix issue with profile functions. 2020-07-09 20:03:11 +02:00
James Cole
32e0a5bd80 Fix validation for #3532 2020-07-06 06:55:27 +02:00
James Cole
26d19fab32 Slightly more robust configuration polling. 2020-07-06 06:49:48 +02:00
James Cole
4271dc1638 Better frontend code and charts. 2020-07-05 21:03:35 +02:00
James Cole
a56cefda7d Basic new dashboard. 2020-07-05 18:29:58 +02:00
James Cole
4d4d91bf84 Merge branch 'main' into develop 2020-07-05 09:36:01 +02:00
James Cole
54dfb35007 Fix .env.example 2020-07-05 09:35:44 +02:00
James Cole
3893f59773 Fix some casting 2020-07-05 09:34:56 +02:00
James Cole
7d8786a620 Update changelog 2020-07-05 09:34:48 +02:00
James Cole
f48bc8d299 Budget and category charts in new layout. 2020-07-04 12:08:38 +02:00
James Cole
d33c87c565 Add error log for #3522 2020-07-03 18:41:16 +02:00
James Cole
5a28479788 Merge tag '5.3.0' into develop
5.3.0
2020-07-03 06:24:32 +02:00
James Cole
fabd7b1bfd Merge branch 'release/5.3.0' into main 2020-07-03 06:24:31 +02:00
James Cole
e57cd13145 Fix date in changelog 2020-07-03 06:23:54 +02:00
James Cole
515ee0a503 New version. 2020-07-03 06:22:57 +02:00
James Cole
cacbef4f75 Add PHP7.4 instructions. 2020-07-03 06:19:39 +02:00
James Cole
2772275e62 Update meta files before release. 2020-07-03 05:59:36 +02:00
James Cole
34fd66c835 Remove income from category chart #3517 2020-07-03 05:42:57 +02:00
James Cole
45f5a38512 Update meta files. 2020-07-02 20:23:45 +02:00
James Cole
6874d6469d Fix bill 2020-07-02 20:13:47 +02:00
James Cole
979c1ad305 Merge tag '5.3.0-beta.2' into develop
5.3.0-beta.2
2020-07-01 19:54:32 +02:00
James Cole
80de6c78dc Merge branch 'release/5.3.0-beta.2' into main 2020-07-01 19:54:31 +02:00
James Cole
5009cb5d55 New meta files. 2020-07-01 19:53:48 +02:00
James Cole
0c90171a49 Fix range for #3513 2020-07-01 19:47:32 +02:00
James Cole
d282cb4e34 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-07-01 19:47:20 +02:00
James Cole
976f79b5a6 Add account info for #3513 2020-07-01 19:43:53 +02:00
James Cole
6693a5166f Merge pull request #3506 from Johnny-Malizia/searchapi
Added transaction search api support
2020-07-01 19:35:44 +02:00
johnny
7b9906d493 Added transaction search api support
Transaction search api implemented using mostly the same process as the
existing search functionality.
Updated internal_reference and external_id search support to use exact
matches, expecting values in the database to be double quoted. This is
being done to ensure a specific transaction can be looked up at a later
time without prior knowledge of the internal transaction id.
2020-07-01 10:23:44 -07:00
James Cole
f927e61b37 Fix #3509 2020-07-01 15:46:26 +02:00
James Cole
430b498caf Fix meta files. 2020-07-01 15:45:09 +02:00
James Cole
983508e291 Expand API for bills. 2020-07-01 15:33:06 +02:00
James Cole
104a2379f3 Add fancy amounts. 2020-07-01 11:47:16 +02:00
James Cole
e337bcf8bd Can sort and group bills. 2020-07-01 06:33:21 +02:00
James Cole
029774687c Add command to fix inconsistent groups. 2020-07-01 06:02:58 +02:00
James Cole
be58545999 Make sure split transactions are always consistent. 2020-07-01 05:51:15 +02:00
James Cole
d774b4e2e3 Remove locale if using Docker. 2020-06-30 20:43:53 +02:00
James Cole
cb65999124 Expand API, add new migration. 2020-06-30 20:33:08 +02:00
James Cole
77e7af75dc Update translations and routes. 2020-06-30 19:10:17 +02:00
James Cole
714184867c Piggybank thing 2020-06-30 19:06:16 +02:00
James Cole
fad2331d80 Give bills groups too. 2020-06-30 19:06:05 +02:00
James Cole
bb5de8bf7e Update copyrights. 2020-06-30 19:05:35 +02:00
James Cole
6f78c96cee Fix piggy list. 2020-06-30 17:05:25 +02:00
James Cole
883342b2c8 Updated front matter 2020-06-29 08:04:38 +02:00
James Cole
6232858b85 Fix #3469 2020-06-29 06:44:17 +02:00
James Cole
4e4b44d41d Move to main branch. 2020-06-29 06:43:53 +02:00
James Cole
daf74e11ed Bigger max upload. 2020-06-28 15:30:59 +02:00
James Cole
3e2c2e6395 Merge tag '5.3.0-beta.1' into develop
5.3.0-beta.1
2020-06-28 09:25:31 +02:00
James Cole
bc5b2085b9 Merge branch 'release/5.3.0-beta.1' into main 2020-06-28 09:25:30 +02:00
James Cole
ebcd751145 Beta to changelog. 2020-06-28 09:25:19 +02:00
James Cole
cdfde3dca8 Update meta files for new release. 2020-06-28 09:19:18 +02:00
James Cole
4e3378451c Update readme. 2020-06-27 17:54:29 +02:00
James Cole
415fb7294c Fix sonarcloud issues 2020-06-27 17:33:18 +02:00
James Cole
1e35f0e7e3 You can logout other sessions. 2020-06-27 15:42:18 +02:00
James Cole
b83d06294d Drop Sandstorm related code. 2020-06-27 15:19:00 +02:00
James Cole
7945220825 Fix #3493 2020-06-27 13:41:27 +02:00
James Cole
3e8a4d55ef Make list grouped. 2020-06-27 13:32:40 +02:00
James Cole
e1fbdca5c1 Make list grouped. 2020-06-27 13:08:51 +02:00
James Cole
1b31d20877 Skip deleted piggies. 2020-06-27 09:56:38 +02:00
James Cole
aaaab03995 New translations 2020-06-26 08:35:59 +02:00
James Cole
affa8a317a Update packages 2020-06-26 07:30:29 +02:00
James Cole
5a03f3395c Fix #3440 2020-06-26 07:28:25 +02:00
James Cole
8da6ec3f5b Fix #3488 2020-06-26 04:04:54 +02:00
James Cole
a0402ac742 Fix text 2020-06-26 04:04:30 +02:00
James Cole
654e0fc74f Pretty basic fix #3490 2020-06-25 15:49:28 +02:00
James Cole
d3bd1f4124 Escape names to fix #3489 2020-06-25 13:37:44 +02:00
James Cole
2aa6067437 New strings. 2020-06-24 06:45:40 +02:00
James Cole
356c87da49 Fix #3427 2020-06-23 20:45:10 +02:00
James Cole
0d76fcd564 Fix #3398 2020-06-23 20:26:13 +02:00
James Cole
963c3b2a68 Fix #3391 2020-06-23 20:18:59 +02:00
James Cole
7617fe3510 Fix null pointer 2020-06-23 15:30:02 +02:00
James Cole
88724be3aa Fix mailer 2020-06-22 18:31:39 +02:00
James Cole
f845c97955 Merge tag '5.3.0-alpha.1' into develop
5.3.0-alpha.1
2020-06-22 18:18:02 +02:00
James Cole
2c69a2eda2 Merge branch 'release/5.3.0-alpha.1' 2020-06-22 18:17:59 +02:00
James Cole
dcce747e92 Mysql instructions. 2020-06-22 18:17:31 +02:00
James Cole
c251ca5daf Update meta files. 2020-06-22 18:08:23 +02:00
James Cole
bcb9794315 Update meta files. 2020-06-22 18:03:57 +02:00
James Cole
1a043e35c2 New meta files 2020-06-22 18:02:28 +02:00
James Cole
4fef316ddd Fix more date issues 2020-06-21 19:16:21 +02:00
James Cole
7196ac3ec9 Fix date issues. 2020-06-21 19:08:57 +02:00
James Cole
1c74db30ed More layout stuff 2020-06-21 18:29:23 +02:00
James Cole
00440f282b API for piggies + groups. 2020-06-21 18:28:51 +02:00
James Cole
dfe099f9c6 Emergency fix for #3479 2020-06-21 14:16:23 +02:00
James Cole
0dbee47182 Fix issue with null pointer 2020-06-20 22:16:03 +02:00
James Cole
46796a8c10 Logo 2020-06-20 19:14:28 +02:00
James Cole
c381067364 New code. 2020-06-20 19:14:06 +02:00
James Cole
19573de5df Fonts 2020-06-20 19:10:44 +02:00
James Cole
77359fbc55 Code for front page 2020-06-20 19:09:37 +02:00
James Cole
45eb758583 Fix list 2020-06-20 18:57:20 +02:00
James Cole
1a154a8d45 API for object groups. 2020-06-20 16:28:23 +02:00
James Cole
c40f6f2864 Add user id. 2020-06-20 10:23:57 +02:00
James Cole
c036c5a2bc Fix user management for groups. 2020-06-20 10:22:07 +02:00
James Cole
5b29e78c4b Group management code. 2020-06-20 10:10:55 +02:00
James Cole
b54ef9f5e5 Fix bad UUID generation. 2020-06-18 18:14:10 +02:00
James Cole
b7f48a19e8 Merge pull request #3467 from sephrat/days-left-for-bills
Fix #3437
2020-06-17 18:23:13 +00:00
James Cole
c8f1e4bbd7 Expand new layout code. 2020-06-17 07:06:45 +02:00
James Cole
5cc1369191 Expand debug. 2020-06-17 07:05:33 +02:00
Florian Dupret
16a511cf79 move 7c78708 logic from transformer to controller 2020-06-16 18:02:48 +02:00
Florian Dupret
7c78708865 Fix #3437 2020-06-16 14:07:40 +02:00
James Cole
0449430ec3 I messed up 2020-06-14 19:24:23 +02:00
James Cole
dd5a179ba1 More stuff for new layout. 2020-06-14 19:17:45 +02:00
James Cole
7c1139e42b First set of code for new layout based on AdminLTE 3.0 2020-06-14 15:51:20 +02:00
James Cole
caddf3d1c6 Fix #3461 2020-06-13 13:48:52 +02:00
James Cole
54d5778bf3 Add attachment to recurring. 2020-06-12 20:56:58 +02:00
James Cole
b1732d0de8 New possibilities for date range triggers #3403 2020-06-12 07:49:39 +02:00
James Cole
48b5f749a1 Fix logout for #3184 2020-06-11 17:55:38 +02:00
James Cole
a63b8322db Updates for #3184 2020-06-11 06:55:13 +02:00
James Cole
2130eef971 Update .env.example for #3184 2020-06-11 06:54:42 +02:00
James Cole
5b829b514f Include notes in export. 2020-06-09 17:40:09 +02:00
James Cole
1bac3258da Merge pull request #3455 from sephrat/debug_translation
Translate debug page
2020-06-09 15:18:17 +00:00
James Cole
d7181100ee Merge pull request #3454 from sephrat/translations
Translations tweaks
2020-06-09 15:17:30 +00:00
James Cole
ccc82858ad Fix drag/drop + sort 2020-06-09 17:16:21 +02:00
Florian Dupret
5dd6b23b09 Translate debug page 2020-06-09 13:51:01 +02:00
James Cole
6a08f52fa5 Update packages and order. 2020-06-09 11:09:23 +02:00
James Cole
18172b7fdb Fix order, fix bar. 2020-06-09 10:33:55 +02:00
James Cole
3eccc56c7a Better column 2020-06-09 08:48:28 +02:00
Florian Dupret
f7545af17a Missing translation on budgets index page 2020-06-09 08:37:40 +02:00
Florian Dupret
aa4da1e2e1 Telemetry count pluralization 2020-06-09 08:35:10 +02:00
James Cole
b4aafefc2b Fix NULL 2020-06-08 18:22:36 +02:00
James Cole
8304ee21f3 Fix #3450 2020-06-07 21:42:52 +02:00
James Cole
ca6479ede6 Update version. 2020-06-07 16:38:25 +02:00
James Cole
471cdefcff Organise object groups 2020-06-07 16:38:15 +02:00
James Cole
16b0307b0a Piggy bank can now have a group. 2020-06-07 11:31:01 +02:00
James Cole
2f63090e7c Split controller 2020-06-07 11:30:02 +02:00
James Cole
8643034945 Upgrade to 7.4 2020-06-06 22:25:52 +02:00
James Cole
6cc4d14fcb Remove import code. 2020-06-06 21:23:26 +02:00
James Cole
389ffa820f Merge branch 'release/5.2.8' 2020-06-06 12:19:11 +02:00
James Cole
60fa0d7244 Merge tag '5.2.8' into develop
5.2.8
2020-06-06 12:19:11 +02:00
James Cole
28d6885178 Update meta files for 5.2.8 2020-06-06 12:18:42 +02:00
James Cole
00f579909e Update meta files. 2020-06-06 12:16:32 +02:00
James Cole
a35bccb940 Fix #3443 2020-06-06 12:14:55 +02:00
James Cole
1cba62aa42 Cleanup changelog, forgot some unused entries. 2020-06-06 07:26:22 +02:00
James Cole
0974591a8f Merge tag '5.2.7' into develop
5.2.7
2020-06-06 07:18:38 +02:00
James Cole
326bef66ee Merge branch 'release/5.2.7' 2020-06-06 07:18:36 +02:00
James Cole
67ba8cee09 Updated meta files. 2020-06-06 07:15:56 +02:00
James Cole
08107f7103 Fix translations. 2020-06-06 07:09:27 +02:00
James Cole
f5c075936f Better generation of installation ID. 2020-06-06 06:57:44 +02:00
James Cole
d493820cc8 Migrate default env file to MySQL 2020-06-06 06:40:59 +02:00
James Cole
af4a006192 New translations. 2020-06-06 06:40:44 +02:00
James Cole
946e3fb540 New changelog. 2020-06-06 06:37:20 +02:00
James Cole
b19338e2f3 Add db connection info. 2020-06-06 06:34:43 +02:00
James Cole
d4a44e6089 Hold the DB changes for now. 2020-06-05 19:44:40 +02:00
James Cole
c90c181785 Basic code for an object group select item thing. 2020-06-05 19:39:09 +02:00
James Cole
b75178a184 New view for #3415 2020-06-05 18:40:02 +02:00
James Cole
a77187135f Fixed #3297 2020-06-05 06:34:55 +02:00
James Cole
61e24a41a2 Add groups, and the option for objects to be linked to one (or more) groups. #3128 2020-06-05 06:25:39 +02:00
James Cole
07c7bf1d49 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-06-04 18:08:53 +02:00
James Cole
d4cb72cb77 Updated strings. 2020-06-04 18:08:18 +02:00
James Cole
948cdf7e5e Merge pull request #3428 from sephrat/fix-reconcile-difference
Fix reconcile difference
2020-06-04 12:23:28 +02:00
Florian Dupret
e93292d98c Fix identation from 7105d34 2020-06-04 08:34:46 +02:00
Florian Dupret
7105d34fb3 Fix wrong reconciliation difference with "select all" button 2020-06-04 08:32:17 +02:00
James Cole
29847c9711 Updated strings. 2020-06-04 06:49:44 +02:00
James Cole
3db778a2b1 Fix #3425 2020-06-04 06:31:34 +02:00
James Cole
361f78542a Add time for #3419 2020-06-04 06:26:14 +02:00
James Cole
15d0e04431 Add timeout for #3427 2020-06-04 06:20:52 +02:00
James Cole
b968ef416a Fix #3419 2020-06-02 19:11:17 +02:00
James Cole
6191362fe0 Merge pull request #3420 from sephrat/fix#3409
Display account names only once when displaying split transactions
2020-06-02 17:59:52 +02:00
Florian Dupret
6d8fd79922 Fix #3409 - Split transactions show source/destination accounts several times 2020-06-01 17:51:07 +02:00
James Cole
0227879a69 Merge pull request #3417 from sephrat/pluralization
Fix typo from #3413
2020-06-01 11:41:49 +02:00
Florian Dupret
e4d2b121c1 Merge branch 'pluralization' of https://github.com/sephrat/firefly-iii into pluralization 2020-06-01 08:25:27 +02:00
Florian Dupret
f8941ab507 Fix string displayed twice 2020-06-01 08:15:19 +02:00
James Cole
f3ac8a5888 Add newlines and remove some unused translations. 2020-05-30 07:33:06 +02:00
James Cole
64ac3927ec Pluralization. 2020-05-29 21:00:10 +02:00
James Cole
a558613189 Merge pull request #3413 from sephrat/pluralization
String pluralization
2020-05-29 20:55:56 +02:00
James Cole
7535ca9a26 Merge branch 'develop' into pluralization 2020-05-29 20:55:31 +02:00
James Cole
03670e2dfe New translations. 2020-05-29 19:53:49 +02:00
Florian Dupret
be797f5353 pluralization wave 2 2020-05-29 19:07:51 +02:00
Florian Dupret
da38df6e4b pluralization wave 1 2020-05-29 18:00:29 +02:00
James Cole
2d53eb300a Some more info in changelog. 2020-05-29 16:08:31 +02:00
James Cole
523ea78166 Error strings. 2020-05-29 07:55:59 +02:00
James Cole
3b33730e48 Remove VSCode 2020-05-29 06:45:01 +02:00
James Cole
351272cc27 Merge pull request #3408 from sephrat/issue/3407
Fix #3407
2020-05-29 06:44:34 +02:00
James Cole
a293827739 Reformat translations. 2020-05-29 06:43:42 +02:00
James Cole
ead2cf92d3 Merge pull request #3405 from sephrat/error_pages_translation
Make error pages translatable
2020-05-29 06:41:55 +02:00
James Cole
dea9e21382 Merge branch 'develop' into error_pages_translation 2020-05-29 06:41:47 +02:00
James Cole
69725eb8c3 Rebuild JS #3404 2020-05-29 06:40:45 +02:00
James Cole
d31bb1f9b6 Regenerated JSON files for all languages. #3404 2020-05-29 06:39:48 +02:00
James Cole
b64979e45a New strings in all languages for #3404 2020-05-29 06:39:24 +02:00
James Cole
3dd3d2cabb Clean up strings #3404 2020-05-29 06:34:39 +02:00
James Cole
94e7c3527f Refactor strings #3404 2020-05-29 06:30:42 +02:00
James Cole
1a71d22146 Add strings to i18n #3404 2020-05-29 06:28:34 +02:00
James Cole
fdc3b80f1f Refactor strings #3404 2020-05-29 06:28:24 +02:00
James Cole
b978de78e4 Refactor strings #3404 2020-05-29 06:22:13 +02:00
James Cole
8b6bd296e1 Refactor string identifiers #3404 2020-05-29 06:19:56 +02:00
James Cole
4d075feed6 Merge pull request #3404 from sephrat/js_translations
Make new profile settings translatable
2020-05-29 06:18:29 +02:00
James Cole
e0e16489a1 Merge branch 'develop' into js_translations 2020-05-29 06:18:22 +02:00
James Cole
deeb4933fc Reformat for readability (PHPStorm) 2020-05-29 06:16:42 +02:00
James Cole
be8a0ddb3e Merge pull request #3393 from bpatath/feature/add-ssl-to-mysql
Add SSL conf to MySQL and LDAP
2020-05-29 06:13:16 +02:00
James Cole
49b1a6d844 Alignment 2020-05-29 06:12:24 +02:00
James Cole
3c1361e377 Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2020-05-29 06:09:27 +02:00
James Cole
a7ab5b7504 A note about telemetry for the next release. 2020-05-29 06:07:12 +02:00
James Cole
0c8229d689 Some language strings. 2020-05-29 06:07:03 +02:00
Florian Dupret
aebf45697f fix #3407 2020-05-28 19:08:34 +02:00
Florian Dupret
d5d5530a8e .gitgnore 2020-05-28 16:06:11 +02:00
bpatath
8aa7776072 Replace unnused MySQL SSL mode 2020-05-28 09:26:42 +02:00
bpatath
f427267f5b Add SSL configuration for LDAP 2020-05-28 09:26:42 +02:00
bpatath
3195dd0db0 Add SSL configuration for MySQL 2020-05-28 09:26:42 +02:00
Florian Dupret
e67c62e6cd ignore node.js built files and vscode files 2020-05-27 19:35:41 +02:00
Florian Dupret
d319a21b01 Make error pages translatable 2020-05-27 17:42:19 +02:00
Florian Dupret
f8963179c3 Make new profile settings translatable 2020-05-27 16:17:24 +02:00
James Cole
d3cd657501 Merge pull request #3395 from sephrat/master
Make email notifications translatable (#3387)
2020-05-27 14:00:49 +00:00
Florian Dupret
6c6bb2cd1e Email translations cleanup 2020-05-27 09:34:52 +02:00
Florian Dupret
1771b3964e Email view cleanup: confirm account is obsolete 2020-05-26 18:50:48 +02:00
Florian Dupret
351c0ee2d7 Email notifications are now translatable 2020-05-26 12:01:39 +02:00
James Cole
1c9c380c8c Expand debug 2020-05-26 06:28:42 +02:00
James Cole
24455bf980 Fix #3133 2020-05-26 06:28:02 +02:00
James Cole
e21b40b46c Remove unused var 2020-05-26 06:27:43 +02:00
James Cole
29eabf9c8a Bad type. 2020-05-25 19:40:22 +02:00
James Cole
60e20ceeb1 Add another telemetry entry 2020-05-25 19:30:38 +02:00
Florian Dupret
37b35661be most email notifications translatable 2020-05-25 19:24:21 +02:00
Florian Dupret
b54bb20617 Make admin test email translatable 2020-05-25 13:13:33 +02:00
James Cole
19ce6b71e2 Some notes. 2020-05-24 16:58:17 +02:00
James Cole
b68663c977 Fix submission command. 2020-05-24 12:32:02 +02:00
James Cole
ac385e2647 Will now accept other values too. 2020-05-24 12:20:21 +02:00
James Cole
bc70174f44 Remove and cleanup commands. 2020-05-24 12:17:53 +02:00
James Cole
b8668b44a0 Enable feature telemetry 2020-05-24 12:12:06 +02:00
James Cole
86a87cc951 More text in .env.example 2020-05-24 12:01:40 +02:00
James Cole
be58b1d2be Enable the feature flag for telemetry. 2020-05-24 12:00:14 +02:00
James Cole
61733f6553 Forgot to remove debug variable. 2020-05-24 11:47:44 +02:00
James Cole
15e772d9dc Update some (disabled) commands. 2020-05-24 11:24:28 +02:00
James Cole
ae7b81bf86 Merge pull request #3390 from sephrat/master
Fix typos and minor text inconsistency
2020-05-24 09:19:02 +00:00
Florian Dupret
2c9ac0982a Fix minor typos 2020-05-24 09:59:34 +02:00
Florian Dupret
2df390065b Minor fix: fix rule action/trigger labels consistency 2020-05-24 09:53:54 +02:00
sephrat
247c9aebf3 Merge pull request #1 from firefly-iii/master
keep up with main repo
2020-05-24 09:51:01 +02:00
James Cole
0783500eaa Fix #3309 2020-05-23 19:54:02 +02:00
James Cole
c2e542004d Add some debug. 2020-05-23 08:14:13 +02:00
James Cole
806ad918f0 Include original collection time. 2020-05-22 20:24:56 +02:00
James Cole
84406a74c3 Merge tag '5.2.6' into develop
5.2.6
2020-05-22 17:54:03 +02:00
2480 changed files with 146214 additions and 150407 deletions

326
.ci/.env.ci Normal file
View File

@@ -0,0 +1,326 @@
# You can leave this on "local". If you change it to production most console commands will ask for extra confirmation.
# Never set it to "testing".
APP_ENV=local
# Set to true if you want to see debug information in error screens.
APP_DEBUG=false
# This should be your email address.
# If you use Docker or similar, you can set this variable from a file by using SITE_OWNER_FILE
SITE_OWNER=mail@example.com
# The encryption key for your sessions. Keep this very secure.
# If you generate a new one all existing attachments must be considered LOST.
# Change it to a string of exactly 32 chars or use something like `php artisan key:generate` to generate it.
# If you use Docker or similar, you can set this variable from a file by using APP_KEY_FILE
APP_KEY=SomeRandomStringOf32CharsExactly
#
# Firefly III will launch using this language (for new users and unauthenticated visitors)
# For a list of available languages: https://github.com/firefly-iii/firefly-iii/tree/main/resources/lang
#
# If text is still in English, remember that not everything may have been translated.
DEFAULT_LANGUAGE=en_US
# The locale defines how numbers are formatted.
# by default this value is the same as whatever the language is.
DEFAULT_LOCALE=equal
# Change this value to your preferred time zone.
# Example: Europe/Amsterdam
# For a list of supported time zones, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TZ=Europe/Amsterdam
# TRUSTED_PROXIES is a useful variable when using Docker and/or a reverse proxy.
# Set it to ** and reverse proxies work just fine.
TRUSTED_PROXIES=
# The log channel defines where your log entries go to.
# Several other options exist. You can use 'single' for one big fat error log (not recommended).
# Also available are 'syslog', 'errorlog' and 'stdout' which will log to the system itself.
# A rotating log option is 'daily', creates 5 files that (surprise) rotate.
# Default setting 'stack' will log to 'daily' and to 'stdout' at the same time.
# - Docker + versions <= 4.8.1.8 and before: use "stdout"
# - Docker + versions > 4.8.1.8 : use "docker_out"
# - Docker + versions >= 5.1.1 : use "stack"
# - For everything else (als not Docker) : use 'stack'
LOG_CHANNEL=single
# Log level. You can set this from least severe to most severe:
# debug, info, notice, warning, error, critical, alert, emergency
# If you set it to debug your logs will grow large, and fast. If you set it to emergency probably
# nothing will get logged, ever.
APP_LOG_LEVEL=info
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
# For other database types, please see the FAQ: https://docs.firefly-iii.org/support/faq
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
# Use "pgsql" for PostgreSQL
# Use "mysql" for MySQL and MariaDB.
# Use "sqlite" for SQLite.
DB_CONNECTION=sqlite_test
# MySQL supports SSL. You can configure it here.
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
MYSQL_USE_SSL=false
MYSQL_SSL_VERIFY_SERVER_CERT=true
# You need to set at least of these options
MYSQL_SSL_CAPATH=/etc/ssl/certs/
MYSQL_SSL_CA=
MYSQL_SSL_CERT=
MYSQL_SSL_KEY=
MYSQL_SSL_CIPHER=
# PostgreSQL supports SSL. You can configure it here.
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
PGSQL_SSL_MODE=prefer
PGSQL_SSL_ROOT_CERT=null
PGSQL_SSL_CERT=null
PGSQL_SSL_KEY=null
PGSQL_SSL_CRL_FILE=null
# If you're looking for performance improvements, you could install memcached.
CACHE_DRIVER=array
SESSION_DRIVER=array
# If you set either of these to 'redis', you might want to update these settings too
# If you use Docker or similar, you can set REDIS_HOST_FILE, REDIS_PASSWORD_FILE or
# REDIS_PORT_FILE to set the value from a file instead of from an environment variable
# can be tcp, unix or http
REDIS_SCHEME=tcp
# use only when using 'unix' for REDIS_SCHEME. Leave empty otherwise.
REDIS_PATH=
# use only when using 'tcp' or 'http' for REDIS_SCHEME. Leave empty otherwise.
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=null
# always use quotes and make sure redis db "0" and "1" exists. Otherwise change accordingly.
REDIS_DB="0"
REDIS_CACHE_DB="1"
# Cookie settings. Should not be necessary to change these.
# If you use Docker or similar, you can set COOKIE_DOMAIN_FILE to set
# the value from a file instead of from an environment variable
COOKIE_PATH="/"
COOKIE_DOMAIN=
COOKIE_SECURE=false
# If you want Firefly III to mail you, update these settings
# For instructions, see: https://docs.firefly-iii.org/advanced-installation/email
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
MAIL_MAILER=log
MAIL_HOST=null
MAIL_PORT=2525
MAIL_FROM=changeme@example.com
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
# Other mail drivers:
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
MAILGUN_DOMAIN=
MAILGUN_SECRET=
# If you are on EU region in mailgun, use api.eu.mailgun.net, otherwise use api.mailgun.net
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
MAILGUN_ENDPOINT=api.mailgun.net
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
MANDRILL_SECRET=
SPARKPOST_SECRET=
# Firefly III can send you the following messages
SEND_REGISTRATION_MAIL=true
SEND_ERROR_MESSAGE=true
# These messages contain (sensitive) transaction information:
SEND_REPORT_JOURNALS=true
# Set a Mapbox API key here (see mapbox.com) so there might be a map available at various places.
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
MAPBOX_API_KEY=
# The map will default to this location:
MAP_DEFAULT_LAT=51.983333
MAP_DEFAULT_LONG=5.916667
MAP_DEFAULT_ZOOM=6
# Firefly III currently supports two provider for live Currency Exchange Rates:
# "fixer", and "ratesapi".
# RatesApi.IO (see https://ratesapi.io) is a FREE and OPEN SOURCE live currency exchange rates,
# built compatible with Fixer.IO, based on data published by European Central Bank, and doesn't require API key.
CER_PROVIDER=ratesapi
# If you have select "fixer" as default currency exchange rates,
# set a Fixer IO API key here (see https://fixer.io) to enable live currency exchange rates.
# Please note that this WILL ONLY WORK FOR PAID fixer.io accounts because they severely limited
# the free API up to the point where you might as well offer nothing.
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
FIXER_API_KEY=
# Firefly III has two options for user authentication. "eloquent" is the default,
# and "ldap" for LDAP servers.
# For full instructions on these settings please visit:
# https://docs.firefly-iii.org/advanced-installation/authentication
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
LOGIN_PROVIDER=eloquent
#
# It's also possible to change the way users are authenticated. You could use Authelia for example.
# Authentication via the REMOTE_USER header is supported. Change the value below to "remote_user_guard".
#
# If you do this please read the documentation for instructions and warnings:
# https://docs.firefly-iii.org/advanced-installation/authentication
#
# This function is available in Firefly III v5.3.0 and higher.
AUTHENTICATION_GUARD=web
#
# Likewise, it's impossible to log out users who's authentication is handled by an external system.
# Enter a custom URL here that will force a logout (your authentication provider can tell you).
# Setting this variable only works when AUTHENTICATION_GUARD != web
#
CUSTOM_LOGOUT_URI=
# LDAP connection configuration
# OpenLDAP, FreeIPA or ActiveDirectory
# # If you use Docker or similar, you can set this variable from a file by appending it with _FILE
ADLDAP_CONNECTION_SCHEME=OpenLDAP
ADLDAP_AUTO_CONNECT=true
# LDAP connection settings
# You can set the following variables from a file by appending them with _FILE:
# ADLDAP_CONTROLLERS, ADLDAP_PORT, ADLDAP_BASEDN
ADLDAP_CONTROLLERS=
ADLDAP_PORT=389
ADLDAP_TIMEOUT=5
ADLDAP_BASEDN=""
ADLDAP_FOLLOW_REFFERALS=false
# SSL/TLS settings
ADLDAP_USE_SSL=false
ADLDAP_USE_TLS=false
ADLDAP_SSL_CACERTDIR=
ADLDAP_SSL_CACERTFILE=
ADLDAP_SSL_CERTFILE=
ADLDAP_SSL_KEYFILE=
ADLDAP_SSL_CIPHER_SUITE=
ADLDAP_SSL_REQUIRE_CERT=
# You can set the following variables from a file by appending them with _FILE:
ADLDAP_ADMIN_USERNAME=
ADLDAP_ADMIN_PASSWORD=
# You can set the following variables from a file by appending them with _FILE:
ADLDAP_ACCOUNT_PREFIX=
ADLDAP_ACCOUNT_SUFFIX=
# LDAP authentication settings.
ADLDAP_PASSWORD_SYNC=false
ADLDAP_LOGIN_FALLBACK=false
ADLDAP_DISCOVER_FIELD=distinguishedname
ADLDAP_AUTH_FIELD=distinguishedname
# Will allow SSO if your server provides an AUTH_USER field.
# You can set the following variables from a file by appending them with _FILE:
WINDOWS_SSO_ENABLED=false
WINDOWS_SSO_DISCOVER=samaccountname
WINDOWS_SSO_KEY=AUTH_USER
# field to sync as local username.
# You can set the following variable from a file by appending it with _FILE:
ADLDAP_SYNC_FIELD=userprincipalname
# You can disable the X-Frame-Options header if it interferes with tools like
# Organizr. This is at your own risk. Applications running in frames run the risk
# of leaking information to their parent frame.
DISABLE_FRAME_HEADER=false
# You can disable the Content Security Policy header when you're using an ancient browser
# or any version of Microsoft Edge / Internet Explorer (which amounts to the same thing really)
# This leaves you with the risk of not being able to stop XSS bugs should they ever surface.
# This is at your own risk.
DISABLE_CSP_HEADER=false
# If you wish to track your own behavior over Firefly III, set valid analytics tracker information here.
# Nobody uses this except for me on the demo site. But hey, feel free to use this if you want to.
# Do not prepend the TRACKER_URL with http:// or https://
# The only tracker supported is Matomo.
# You can set the following variables from a file by appending them with _FILE:
TRACKER_SITE_ID=
TRACKER_URL=
#
# Firefly III can collect telemetry on how you use Firefly III. This is opt-in.
# In order to allow this, change the following variable to true.
# To read more about this feature, go to this page: https://docs.firefly-iii.org/support/telemetry
SEND_TELEMETRY=false
# You can fine tune the start-up of a Docker container by editing these environment variables.
# Use this at your own risk. Disabling certain checks and features may result in lost of inconsistent data.
# However if you know what you're doing you can significantly speed up container start times.
# Set each value to true to enable, or false to disable.
# Check if the SQLite database exists. Can be skipped if you're not using SQLite.
# Won't significantly speed up things.
DKR_CHECK_SQLITE=true
# Run database creation and migration commands. Disable this only if you're 100% sure the DB exists
# and is up to date.
DKR_RUN_MIGRATION=true
# Run database upgrade commands. Disable this only when you're 100% sure your DB is up-to-date
# with the latest fixes (outside of migrations!)
DKR_RUN_UPGRADE=true
# Verify database integrity. Includes all data checks and verifications.
# Disabling this makes Firefly III assume your DB is intact.
DKR_RUN_VERIFY=true
# Run database reporting commands. When disabled, Firefly III won't go over your data to report current state.
# Disabling this should have no impact on data integrity or safety but it won't warn you of possible issues.
DKR_RUN_REPORT=true
# Generate OAuth2 keys.
# When disabled, Firefly III won't attempt to generate OAuth2 Passport keys. This won't be an issue, IFF (if and only if)
# you had previously generated keys already and they're stored in your database for restoration.
DKR_RUN_PASSPORT_INSTALL=true
# Leave the following configuration vars as is.
# Unless you like to tinker and know what you're doing.
APP_NAME=FireflyIII
ADLDAP_CONNECTION=default
BROADCAST_DRIVER=log
QUEUE_DRIVER=sync
CACHE_PREFIX=firefly
SEARCH_RESULT_LIMIT=50
PUSHER_KEY=
PUSHER_SECRET=
PUSHER_ID=
DEMO_USERNAME=
DEMO_PASSWORD=
USE_ENCRYPTION=false
IS_HEROKU=false
FIREFLY_III_LAYOUT=v1
#
# If you have trouble configuring your Firefly III installation, DON'T BOTHER setting this variable.
# It won't work. It doesn't do ANYTHING. Don't believe the lies you read online. I'm not joking.
# This configuration value WILL NOT HELP.
#
# This variable is ONLY used in some of the emails Firefly III sends around. Nowhere else.
# So when configuring anything WEB related this variable doesn't do anything. Nothing
#
# If you're stuck I understand you get desperate but look SOMEWHERE ELSE.
#
APP_URL=http://localhost

View File

@@ -0,0 +1,250 @@
parameters:
indentation: spaces
file_extensions:
- php
exclude_files:
- fixtures/*
- fixtures*/*
- temp/*
- tmp/*
services:
# Checkers bellow aim on 1:1 copy of https://nette.org/en/coding-standard
# General rules - https://nette.org/en/coding-standard#toc-general-rules
# use tabs over spaces
# PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\DisallowSpaceIndentSniff: ~
# PHP code must use only UTF-8 without BOM
PhpCsFixer\Fixer\Basic\EncodingFixer: ~
# <?php opening tag
PhpCsFixer\Fixer\PhpTag\FullOpeningTagFixer: ~
# Ensure there is no code on the same line as the PHP open tag.
PhpCsFixer\Fixer\PhpTag\LinebreakAfterOpeningTagFixer: ~
# The closing ?> tag must be omitted from files containing only PHP.
PhpCsFixer\Fixer\PhpTag\NoClosingTagFixer: ~
# There must not be trailing whitespace at the end of lines.
PhpCsFixer\Fixer\Whitespace\NoTrailingWhitespaceFixer: ~
# ...and at the end of blank lines.
PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer: ~
# All files must end with a single blank line.
PhpCsFixer\Fixer\Whitespace\SingleBlankLineAtEofFixer: ~
# File name should match class name if possible.
PhpCsFixer\Fixer\Basic\Psr4Fixer: ~
# Enforces using shorthand scalar typehint variants in phpDocs: `int` instead of `integer` and `bool` instead of `boolean`
SlevomatCodingStandard\Sniffs\TypeHints\LongTypeHintsSniff: ~
# File Header - https://nette.org/en/coding-standard#toc-file-header
# empty line before namespace
PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer: ~
# 1 Use statement per line
PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer: ~
# Use statements are alphabetically ordered
PhpCsFixer\Fixer\Import\OrderedImportsFixer: ~
# disallow group use declarations use FooLibrary\Bar\Baz\{ ClassA, ClassB, ClassC, ClassD as Fizbo }
SlevomatCodingStandard\Sniffs\Namespaces\DisallowGroupUseSniff: ~
# Disallows leading backslash in use statement: use \Foo\Bar;
SlevomatCodingStandard\Sniffs\Namespaces\UseDoesNotStartWithBackslashSniff: ~
# Looks for unused imports from other namespaces.
Nette\CodingStandard\Sniffs\Namespaces\UnusedUsesSniff:
searchAnnotations: yes
ignoredAnnotationNames: ['@testCase']
ignoredAnnotations: ['@internal']
# Language Construct (should be placed before some other fixers)
# Functions should be used with `$strict` param set to `true`
PhpCsFixer\Fixer\Strict\StrictParamFixer: ~
# replaces is_null(parameter) expression with `null === parameter`.
PhpCsFixer\Fixer\LanguageConstruct\IsNullFixer:
use_yoda_style: true
# Calling `unset` on multiple items should be done in one call.
PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveUnsetsFixer: ~
# Replace all `<>` with `!=`.
PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer: ~
# Include/Require and file path should be divided with a single space. File path should not be placed under brackets.
PhpCsFixer\Fixer\ControlStructure\IncludeFixer: ~
# Requires short ternary operator ?: when possible
SlevomatCodingStandard\Sniffs\ControlStructures\RequireShortTernaryOperatorSniff: ~
# Arrays - https://nette.org/en/coding-standard#toc-arrays
# use short array fixes
PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer:
syntax: short
# use trailing command in last array element
PhpCsFixer\Fixer\ArrayNotation\TrailingCommaInMultilineArrayFixer: ~
# PHP single-line arrays should not have trailing comma.
# PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer: ~
# In array declaration, there MUST NOT be a whitespace before each comma.
PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer: ~
# Arrays should be formatted like function/method arguments, without leading or trailing single line space.
PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer: ~
# In array declaration, there MUST be a whitespace after each comma.
PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer: ~
# Strings
# Convert `heredoc` to `nowdoc` where possible.
PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer: ~
# Convert double quotes to single quotes for simple strings.
PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer: ~
# Keywords and True/False/Null - https://nette.org/en/coding-standard#toc-keywords-and-true-false-null
# PHP keywords must be in lower case
PhpCsFixer\Fixer\Casing\LowercaseKeywordsFixer: ~
# The PHP constants `true`, `false`, and `null` MUST be in lower case
PhpCsFixer\Fixer\Casing\LowercaseConstantsFixer: ~
# Method and Functions Calls - https://nette.org/en/coding-standard#toc-method-and-function-calls
# Function defined by PHP should be called using the correct casing
PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer: ~
# In the argument list, there must be one space after each comma, and there must no be a space before each comma
PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer: ~
# This sniff checks that there are two blank lines between functions declarations and single between signatures.
#Nette\CodingStandard\Sniffs\WhiteSpace\FunctionSpacingSniff: ~
# Classes - https://nette.org/en/coding-standard#toc-classes
# Inside a classy element "self" should be preferred to the class name itself.
PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer: ~
# class element order: constants, properties, from public to private
PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer:
order:
- use_trait
- constant
- constant_public
- constant_protected
- constant_private
- property_public
- property_protected
- property_private
# Constants - https://nette.org/en/coding-standard#toc-constants
# constant names are CAPITALIZED (manuall fixing only :()
PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\UpperCaseConstantNameSniff: ~
# Class Properties - https://nette.org/en/coding-standard#toc-class-properties
# There MUST NOT be more than one property declared per statement.
PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer:
elements: ['property']
# Methods - https://nette.org/en/coding-standard#toc-methods
# They must be declared in camelCase.
PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff: ~
# Checks that there's a single space between a typehint and a parameter name and no whitespace between a nullability symbol and a typehint
SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSpacingSniff: ~
# Spaces should be properly placed in a function declaration.
PhpCsFixer\Fixer\FunctionNotation\FunctionDeclarationFixer: ~
# In function arguments there must not be arguments with default values before non-default ones.
PhpCsFixer\Fixer\FunctionNotation\NoUnreachableDefaultArgumentValueFixer: ~
# Constans, Class Properties, Methods
# Constants and Properties should be separated by 1 blank line
#PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer:
# elements: [const, property]
# Last property and 1st method should be separated by 2 spaces
Nette\CodingStandard\Fixer\ClassNotation\LastPropertyAndFirstMethodSeparationFixer:
space_count: 2
# Control Statements - https://nette.org/en/coding-standard#toc-control-statements
# The keyword `elseif` should be used instead of `else if` so that all control keywords look like single words.
PhpCsFixer\Fixer\ControlStructure\ElseifFixer: ~
# Remove useless semicolon statements.
PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer: ~
# Remove trailing commas in list() calls.
PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer: ~
# Removes unneeded parentheses around control statements.
PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer: ~
# A case should be followed by a colon and not a semicolon.
PhpCsFixer\Fixer\ControlStructure\SwitchCaseSemicolonToColonFixer: ~
# The structure body must be indented once.
# The closing brace must be on the next line after the body.
# There should not be more than one statement per line.
#Nette\CodingStandard\Fixer\Basic\BracesFixer:
# allow_single_line_closure: true
# changes if (1 === $cond) to if ($cond === 1)
#SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff: ~
# finds unreachable catch blocks:
SlevomatCodingStandard\Sniffs\Exceptions\DeadCatchSniff: ~
# Casting
# A single space or none should be between cast and variable (int) $val
PhpCsFixer\Fixer\CastNotation\CastSpacesFixer: ~
# Cast should be written in lower case.
PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer: ~
# Replaces `intval`, `floatval`, `doubleval`, `strval` and `boolval` function calls with according type casting operator
PhpCsFixer\Fixer\CastNotation\ModernizeTypesCastingFixer: ~
# Short cast `bool` using double exclamation mark should not be used
PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer: ~
# Cast `(boolean)` and `(integer)` should be written as `(bool)` and `(int)`, `(double)` and `(real)` as `(float)`
PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer: ~
# Language Whitespace
# Binary operators should be surrounded by at least one space. DO NOT USE
#PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer: ~
# Unary operators should be placed adjacent to their operands.
PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer: ~
# No space after the opening parenthesis and before the closing parenthesis
PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer: ~
# There MUST NOT be spaces around offset braces $a[0]
PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer: ~
# There should not be space before or after object `T_OBJECT_OPERATOR` `->`.
PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer: ~
# Standardize spaces around ternary operator.
PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer: ~
# Concatenation $a . $b should be spaced according configuration
PhpCsFixer\Fixer\Operator\ConcatSpaceFixer:
spacing: one
# Removes extra spaces between colon and case value.
PhpCsFixer\Fixer\ControlStructure\SwitchCaseSpaceFixer: ~
# Comments
# Docblocks should have the same indentation as the documented subject.
PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer: ~
# There should not be any empty comments.
PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer: ~
# There should not be empty PHPDoc blocks.
#PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer: ~
# Phpdocs should start and end with content, excluding the very first and last line of the docblocks.
PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer: ~
# Single-line comments comments with only one line of actual content should use the `//` syntax.
PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer:
comment_types: ['hash']
# Require comments with single-line content to be written as one-liners
SlevomatCodingStandard\Sniffs\Commenting\RequireOneLinePropertyDocCommentSniff: ~
# Properties MUST not be explicitly initialized with `null`.
#PhpCsFixer\Fixer\ClassNotation\NoNullPropertyInitializationFixer: ~
PhpCsFixer\Fixer\ControlStructure\NoBreakCommentFixer:
comment_text: 'break omitted'
# declare(strict_types=1);
PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer: ~
# Enforces consistent formatting of return typehints: function foo(): ?int
SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSpacingSniff: ~
# Use `null` coalescing operator `??` where possible.
PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer: ~
Nette\CodingStandard\Fixer\ClassNotation\ClassAndTraitVisibilityRequiredFixer:
elements: ['const', 'property', 'method']
# short list() syntax []
PhpCsFixer\Fixer\ListNotation\ListSyntaxFixer:
syntax: short

33
.ci/phpstan.neon Normal file
View File

@@ -0,0 +1,33 @@
includes:
- ../vendor/nunomaduro/larastan/extension.neon
- ../vendor/ergebnis/phpstan-rules/rules.neon
- ../vendor/phpstan/phpstan-deprecation-rules/rules.neon
- ../vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
parameters:
ignoreErrors:
- '#is not allowed to extend#'
- '#is neither abstract nor final#'
- '#Control structures using switch should not be used\.#'
- '#has a nullable return type declaration#'
- '#with a nullable type declaration#'
- '#with null as default value#'
- '#Constructor in [a-zA-Z0-9\\_]+ has parameter \$[a-zA-Z0-9\\_]+ with default value#'
-
message: '#Function compact\(\) should not be used.#'
paths:
- ../app/Http/Controllers
- ../app/Support/Http/Controllers/RenderPartialViews.php
- ../app/Support/Form/FormSupport.php
- ../app/Support/Form/CurrencyForm.php
- ../app/Support/Form/AccountForm.php
- ../app/Support/ExpandedForm.php
- ../app/Generator/Report
paths:
- ../app
- ../database
- ../routes
- ../bootstrap/app.php
# The level 8 is the highest level. original was 5
level: 2

33
.ci/phpstan.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
#
# phpstan.sh
# Copyright (c) 2021 james@firefly-iii.org
#
# This file is part of Firefly III (https://github.com/firefly-iii).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# Install composer packages
#composer install --no-scripts --no-ansi
# enable test .env file.
cp .ci/.env.ci .env
# Do static code analysis.
# ./vendor/bin/phpstan analyse -c .ci/phpstan.neon --no-progress
./vendor/bin/phpstan analyse -c .ci/phpstan.neon
exit 0

33
.ci/phpunit.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
#
# phpunit.sh
# Copyright (c) 2021 james@firefly-iii.org
#
# This file is part of Firefly III (https://github.com/firefly-iii).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# enable test .env file.
cp .ci/.env.ci ../.env
# download test database
# TODO no longer exists
wget --quiet https://raw.githubusercontent.com/firefly-iii/test-data/main/test_db.sqlite -o storage/database/test_db.sqlite
# run phpunit
./vendor/bin/phpunit --configuration phpunit.coverage.xml
exit 0

View File

@@ -5,77 +5,118 @@ APP_ENV=heroku
# Set to true if you want to see debug information in error screens.
APP_DEBUG=false
# This should be your email address
# This should be your email address.
# If you use Docker or similar, you can set this variable from a file by using SITE_OWNER_FILE
SITE_OWNER=heroku@example.com
# The encryption key for your database and sessions. Keep this very secure.
# If you generate a new one all existing data must be considered LOST.
# Change it to a string of exactly 32 chars or use command `php artisan key:generate` to generate it
# The encryption key for your sessions. Keep this very secure.
# If you generate a new one all existing attachments must be considered LOST.
# Change it to a string of exactly 32 chars or use something like `php artisan key:generate` to generate it.
# If you use Docker or similar, you can set this variable from a file by using APP_KEY_FILE
APP_KEY=7ahyYVPVsmxjdhsweWCauGeJfwc92NP2
#
# Firefly III will launch using this language (for new users and unauthenticated visitors)
# For a list of available languages: https://github.com/firefly-iii/firefly-iii/tree/main/resources/lang
#
# If text is still in English, remember that not everything may have been translated.
DEFAULT_LANGUAGE=en_US
# The locale defines how numbers are formatted.
# by default this value is the same as whatever the language is.
DEFAULT_LOCALE=equal
# Change this value to your preferred time zone.
# Example: Europe/Amsterdam
# For a list of supported time zones, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TZ=UTC
# This variable must match your installation's external address but keep in mind that
# it's only used on the command line as a fallback value.
APP_URL=http://localhost
# TRUSTED_PROXIES is a useful variable when using Docker and/or a reverse proxy.
# Set it to ** and reverse proxies work just fine.
TRUSTED_PROXIES=**
# The log channel defines where your log entries go to.
# 'daily' is the default logging mode giving you 5 daily rotated log files in /storage/logs/.
# Several other options exist. You can use 'single' for one big fat error log (not recommended).
# Also available are 'syslog', 'errorlog' and 'stdout' which will log to the system itself.
# A rotating log option is 'daily', creates 5 files that (surprise) rotate.
# Default setting 'stack' will log to 'daily' and to 'stdout' at the same time.
# - Docker + versions <= 4.8.1.8 and before: use "stdout"
# - Docker + versions > 4.8.1.8 : use "docker_out"
# - Docker + versions >= 5.1.1 : use "stack"
# - For everything else (als not Docker) : use 'stack'
LOG_CHANNEL=stdout
# Log level. You can set this from least severe to most severe:
# debug, info, notice, warning, error, critical, alert, emergency
# If you set it to debug your logs will grow large, and fast. If you set it to emergency probably
# nothing will get logged, ever.
APP_LOG_LEVEL=debug
APP_LOG_LEVEL=notice
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
# If you use SQLite, set connection to `sqlite` and remove the database, username and password settings.
# For other database types, please see the FAQ: https://docs.firefly-iii.org/support/faq
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
# Use "pgsql" for PostgreSQL
# Use "mysql" for MySQL and MariaDB.
# Use "sqlite" for SQLite.
DB_CONNECTION=pgsql
# MySQL supports SSL. You can configure it here.
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
MYSQL_USE_SSL=false
MYSQL_SSL_VERIFY_SERVER_CERT=true
# You need to set at least of these options
MYSQL_SSL_CAPATH=/etc/ssl/certs/
MYSQL_SSL_CA=
MYSQL_SSL_CERT=
MYSQL_SSL_KEY=
MYSQL_SSL_CIPHER=
# PostgreSQL supports SSL. You can configure it here.
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
PGSQL_SSL_MODE=prefer
PGSQL_SSL_ROOT_CERT=null
PGSQL_SSL_CERT=null
PGSQL_SSL_KEY=null
PGSQL_SSL_CRL_FILE=null
# If you're looking for performance improvements, you could install memcached.
CACHE_DRIVER=file
SESSION_DRIVER=file
# You can configure another file storage backend if you cannot use the local storage option.
# To set this up, fill in the following variables. The upload path is used to store uploaded
# files and the export path is to store exported data (before download).
SFTP_HOST=
SFTP_PORT=
SFTP_UPLOAD_PATH=
SFTP_EXPORT_PATH=
# If you set either of these to 'redis', you might want to update these settings too
# If you use Docker or similar, you can set REDIS_HOST_FILE, REDIS_PASSWORD_FILE or
# REDIS_PORT_FILE to set the value from a file instead of from an environment variable
# SFTP uses either the username/password combination or the private key to authenticate.
SFTP_USERNAME=
SFTP_PASSWORD=
SFTP_PRIV_KEY=
# can be tcp, unix or http
REDIS_SCHEME=tcp
# use only when using 'unix' for REDIS_SCHEME. Leave empty otherwise.
REDIS_PATH=
# use only when using 'tcp' or 'http' for REDIS_SCHEME. Leave empty otherwise.
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=null
# always use quotes and make sure redis db "0" and "1" exists. Otherwise change accordingly.
REDIS_DB="0"
REDIS_CACHE_DB="1"
# Cookie settings. Should not be necessary to change these.
# If you use Docker or similar, you can set COOKIE_DOMAIN_FILE to set
# the value from a file instead of from an environment variable
COOKIE_PATH="/"
COOKIE_DOMAIN=
COOKIE_SECURE=false
# If you want Firefly III to mail you, update these settings
# For instructions, see: https://firefly-iii.readthedocs.io/en/latest/installation/mail.html
MAIL_DRIVER=log
MAIL_HOST=smtp.mailtrap.io
# For instructions, see: https://docs.firefly-iii.org/advanced-installation/email
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
MAIL_MAILER=log
MAIL_HOST=null
MAIL_PORT=2525
MAIL_FROM=changeme@example.com
MAIL_USERNAME=null
@@ -83,11 +124,20 @@ MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
# Other mail drivers:
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
MAILGUN_DOMAIN=
MAILGUN_SECRET=
# If you are on EU region in mailgun, use api.eu.mailgun.net, otherwise use api.mailgun.net
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
MAILGUN_ENDPOINT=api.mailgun.net
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
MANDRILL_SECRET=
SPARKPOST_SECRET=
# Firefly III can send you the following messages
SEND_REGISTRATION_MAIL=true
SEND_ERROR_MESSAGE=true
@@ -96,53 +146,85 @@ SEND_ERROR_MESSAGE=true
SEND_REPORT_JOURNALS=true
# Set a Mapbox API key here (see mapbox.com) so there might be a map available at various places.
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
MAPBOX_API_KEY=
# The map will default to this location:
MAP_DEFAULT_LAT=51.983333
MAP_DEFAULT_LONG=5.916667
MAP_DEFAULT_ZOOM=6
# Firefly III currently supports two provider for live Currency Exchange Rates:
# "fixer" is the default (for backward compatibility), and "ratesapi" is the new one.
# "fixer", and "ratesapi".
# RatesApi.IO (see https://ratesapi.io) is a FREE and OPEN SOURCE live currency exchange rates,
# built compatible with Fixer.IO, based on data published by European Central Bank, and don't require API key.
CER_PROVIDER=fixer
# built compatible with Fixer.IO, based on data published by European Central Bank, and doesn't require API key.
CER_PROVIDER=ratesapi
# If you have select "fixer" as default currency exchange rates,
# set a Fixer IO API key here (see https://fixer.io) to enable live currency exchange rates.
# Please note that this WILL ONLY WORK FOR PAID fixer.io accounts because they severely limited
# the free API up to the point where you might as well offer nothing.
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
FIXER_API_KEY=
# If you wish to track your own behavior over Firefly III, set a valid analytics tracker ID here.
TRACKER_SITE_ID=
TRACKER_URL=
# Most parts of the database are encrypted by default, but you can turn this off if you want to.
# This makes it easier to migrate your database. Not that some fields will never be decrypted.
USE_ENCRYPTION=true
# Firefly III has two options for user authentication. "eloquent" is the default,
# and "ldap" for LDAP servers.
# For full instructions on these settings please visit:
# https://firefly-iii.readthedocs.io/en/latest/installation/authentication.html
# https://docs.firefly-iii.org/advanced-installation/authentication
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
LOGIN_PROVIDER=eloquent
#
# It's also possible to change the way users are authenticated. You could use Authelia for example.
# Authentication via the REMOTE_USER header is supported. Change the value below to "remote_user_guard".
#
# If you do this please read the documentation for instructions and warnings:
# https://docs.firefly-iii.org/advanced-installation/authentication
#
# This function is available in Firefly III v5.3.0 and higher.
AUTHENTICATION_GUARD=web
#
# Likewise, it's impossible to log out users who's authentication is handled by an external system.
# Enter a custom URL here that will force a logout (your authentication provider can tell you).
# Setting this variable only works when AUTHENTICATION_GUARD != web
#
CUSTOM_LOGOUT_URI=
# LDAP connection configuration
# OpenLDAP, FreeIPA or ActiveDirectory
# # If you use Docker or similar, you can set this variable from a file by appending it with _FILE
ADLDAP_CONNECTION_SCHEME=OpenLDAP
ADLDAP_AUTO_CONNECT=true
# LDAP connection settings
# You can set the following variables from a file by appending them with _FILE:
# ADLDAP_CONTROLLERS, ADLDAP_PORT, ADLDAP_BASEDN
ADLDAP_CONTROLLERS=
ADLDAP_PORT=389
ADLDAP_TIMEOUT=5
ADLDAP_BASEDN=""
ADLDAP_FOLLOW_REFFERALS=false
# SSL/TLS settings
ADLDAP_USE_SSL=false
ADLDAP_USE_TLS=false
ADLDAP_SSL_CACERTDIR=
ADLDAP_SSL_CACERTFILE=
ADLDAP_SSL_CERTFILE=
ADLDAP_SSL_KEYFILE=
ADLDAP_SSL_CIPHER_SUITE=
ADLDAP_SSL_REQUIRE_CERT=
# You can set the following variables from a file by appending them with _FILE:
ADLDAP_ADMIN_USERNAME=
ADLDAP_ADMIN_PASSWORD=
# You can set the following variables from a file by appending them with _FILE:
ADLDAP_ACCOUNT_PREFIX=
ADLDAP_ACCOUNT_SUFFIX=
# LDAP authentication settings.
ADLDAP_PASSWORD_SYNC=false
ADLDAP_LOGIN_FALLBACK=false
@@ -151,25 +233,76 @@ ADLDAP_DISCOVER_FIELD=distinguishedname
ADLDAP_AUTH_FIELD=distinguishedname
# Will allow SSO if your server provides an AUTH_USER field.
# You can set the following variables from a file by appending them with _FILE:
WINDOWS_SSO_ENABLED=false
WINDOWS_SSO_DISCOVER=samaccountname
WINDOWS_SSO_KEY=AUTH_USER
# field to sync as local username.
# You can set the following variable from a file by appending it with _FILE:
ADLDAP_SYNC_FIELD=userprincipalname
# You can disable the X-Frame-Options header if it interfears with tools like
# Organizr. This is at your own risk.
# You can disable the X-Frame-Options header if it interferes with tools like
# Organizr. This is at your own risk. Applications running in frames run the risk
# of leaking information to their parent frame.
DISABLE_FRAME_HEADER=false
# You can disable the Content Security Policy header when you're using an ancient browser
# or any version of Microsoft Edge / Internet Explorer (which amounts to the same thing really)
# This leaves you with the risk of not being able to stop XSS bugs should they ever surface.
# This is at your own risk.
DISABLE_CSP_HEADER=false
# If you wish to track your own behavior over Firefly III, set valid analytics tracker information here.
# Nobody uses this except for me on the demo site. But hey, feel free to use this if you want to.
# Do not prepend the TRACKER_URL with http:// or https://
# The only tracker supported is Matomo.
# You can set the following variables from a file by appending them with _FILE:
TRACKER_SITE_ID=
TRACKER_URL=
#
# Firefly III can collect telemetry on how you use Firefly III. This is opt-in.
# In order to allow this, change the following variable to true.
# To read more about this feature, go to this page: https://docs.firefly-iii.org/support/telemetry
SEND_TELEMETRY=false
# You can fine tune the start-up of a Docker container by editing these environment variables.
# Use this at your own risk. Disabling certain checks and features may result in lost of inconsistent data.
# However if you know what you're doing you can significantly speed up container start times.
# Set each value to true to enable, or false to disable.
# Check if the SQLite database exists. Can be skipped if you're not using SQLite.
# Won't significantly speed up things.
DKR_CHECK_SQLITE=true
# Run database creation and migration commands. Disable this only if you're 100% sure the DB exists
# and is up to date.
DKR_RUN_MIGRATION=true
# Run database upgrade commands. Disable this only when you're 100% sure your DB is up-to-date
# with the latest fixes (outside of migrations!)
DKR_RUN_UPGRADE=true
# Verify database integrity. Includes all data checks and verifications.
# Disabling this makes Firefly III assume your DB is intact.
DKR_RUN_VERIFY=true
# Run database reporting commands. When disabled, Firefly III won't go over your data to report current state.
# Disabling this should have no impact on data integrity or safety but it won't warn you of possible issues.
DKR_RUN_REPORT=true
# Generate OAuth2 keys.
# When disabled, Firefly III won't attempt to generate OAuth2 Passport keys. This won't be an issue, IFF (if and only if)
# you had previously generated keys already and they're stored in your database for restoration.
DKR_RUN_PASSPORT_INSTALL=true
# Leave the following configuration vars as is.
# Unless you like to tinker and know what you're doing.
APP_NAME=FireflyIII
ADLDAP_CONNECTION=default
BROADCAST_DRIVER=log
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
CACHE_PREFIX=firefly
SEARCH_RESULT_LIMIT=50
PUSHER_KEY=
@@ -177,7 +310,18 @@ PUSHER_SECRET=
PUSHER_ID=
DEMO_USERNAME=
DEMO_PASSWORD=
IS_SANDSTORM=false
IS_HEROKU=true
BUNQ_USE_SANDBOX=false
FFIII_LAYOUT=v1
USE_ENCRYPTION=false
IS_HEROKU=false
FIREFLY_III_LAYOUT=v1
#
# If you have trouble configuring your Firefly III installation, DON'T BOTHER setting this variable.
# It won't work. It doesn't do ANYTHING. Don't believe the lies you read online. I'm not joking.
# This configuration value WILL NOT HELP.
#
# This variable is ONLY used in some of the emails Firefly III sends around. Nowhere else.
# So when configuring anything WEB related this variable doesn't do anything. Nothing
#
# If you're stuck I understand you get desperate but look SOMEWHERE ELSE.
#
APP_URL=http://localhost

View File

@@ -1,19 +1,23 @@
en_US
bg_BG
cs_CZ
es_ES
de_DE
el_GR
en_GB
en_US
es_ES
fi_FI
fr_FR
hu_HU
it_IT
nb_NO
nl_NL
pl_PL
pt_BR
pt_PT
ro_RO
ru_RU
hu_HU
el_GR
sk_SK
sv_SE
vi_VN
zh-hans_CN
zh-hant_CN
fi_FI
vi_VN

View File

@@ -10,14 +10,12 @@ APP_DEBUG=false
SITE_OWNER=mail@example.com
# The encryption key for your sessions. Keep this very secure.
# If you generate a new one existing data must be considered LOST.
# Change it to a string of exactly 32 chars or use something like `php artisan key:generate` to generate it.
# If you use Docker or similar, you can set this variable from a file by using APP_KEY_FILE
APP_KEY=SomeRandomStringOf32CharsExactly
#
# Firefly III will launch using this language (for new users and unauthenticated visitors)
# For a list of available languages: https://github.com/firefly-iii/firefly-iii/tree/master/resources/lang
# For a list of available languages: https://github.com/firefly-iii/firefly-iii/tree/main/resources/lang
#
# If text is still in English, remember that not everything may have been translated.
DEFAULT_LANGUAGE=en_US
@@ -54,17 +52,35 @@ LOG_CHANNEL=stack
# nothing will get logged, ever.
APP_LOG_LEVEL=notice
# Audit log level.
# set to "emergency" if you dont want to store audit logs.
# leave on info otherwise.
AUDIT_LOG_LEVEL=info
# Database credentials. Make sure the database exists. I recommend a dedicated user for Firefly III
# For other database types, please see the FAQ: https://docs.firefly-iii.org/support/faq
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
# Use "mysql" for MySQL and MariaDB. Use "sqlite" for SQLite.
DB_CONNECTION=pgsql
# Use "pgsql" for PostgreSQL
# Use "mysql" for MySQL and MariaDB.
# Use "sqlite" for SQLite.
DB_CONNECTION=mysql
DB_HOST=fireflyiiidb
DB_PORT=5432
DB_PORT=3306
DB_DATABASE=firefly
DB_USERNAME=firefly
DB_PASSWORD=secret_firefly_password
# MySQL supports SSL. You can configure it here.
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
MYSQL_USE_SSL=false
MYSQL_SSL_VERIFY_SERVER_CERT=true
# You need to set at least of these options
MYSQL_SSL_CAPATH=/etc/ssl/certs/
MYSQL_SSL_CA=
MYSQL_SSL_CERT=
MYSQL_SSL_KEY=
MYSQL_SSL_CIPHER=
# PostgreSQL supports SSL. You can configure it here.
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
PGSQL_SSL_MODE=prefer
@@ -80,9 +96,18 @@ SESSION_DRIVER=file
# If you set either of these to 'redis', you might want to update these settings too
# If you use Docker or similar, you can set REDIS_HOST_FILE, REDIS_PASSWORD_FILE or
# REDIS_PORT_FILE to set the value from a file instead of from an environment variable
# can be tcp, unix or http
REDIS_SCHEME=tcp
# use only when using 'unix' for REDIS_SCHEME. Leave empty otherwise.
REDIS_PATH=
# use only when using 'tcp' or 'http' for REDIS_SCHEME. Leave empty otherwise.
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
REDIS_PASSWORD=null
# always use quotes and make sure redis db "0" and "1" exists. Otherwise change accordingly.
REDIS_DB="0"
REDIS_CACHE_DB="1"
@@ -93,12 +118,13 @@ REDIS_CACHE_DB="1"
COOKIE_PATH="/"
COOKIE_DOMAIN=
COOKIE_SECURE=false
COOKIE_SAMESITE=lax
# If you want Firefly III to mail you, update these settings
# For instructions, see: https://docs.firefly-iii.org/advanced-installation/email
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
MAIL_DRIVER=log
MAIL_HOST=smtp.mailtrap.io
MAIL_MAILER=log
MAIL_HOST=null
MAIL_PORT=2525
MAIL_FROM=changeme@example.com
MAIL_USERNAME=null
@@ -119,36 +145,31 @@ MAILGUN_ENDPOINT=api.mailgun.net
MANDRILL_SECRET=
SPARKPOST_SECRET=
# Firefly III can send you the following messages
SEND_REGISTRATION_MAIL=true
SEND_ERROR_MESSAGE=true
SEND_LOGIN_NEW_IP_WARNING=true
# These messages contain (sensitive) transaction information:
SEND_REPORT_JOURNALS=true
# Set a Mapbox API key here (see mapbox.com) so there might be a map available at various places.
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
# Take note: it is no longer necessary to set this value, and it will be removed in future versions.
MAPBOX_API_KEY=
#
# Instead of the mapbox API key, just set this value to true if you want to set the location
# of certain things, like transactions. Since this involves an external service, it's optional
# and disabled by default.
#
ENABLE_EXTERNAL_MAP=false
# The map will default to this location:
MAP_DEFAULT_LAT=51.983333
MAP_DEFAULT_LONG=5.916667
MAP_DEFAULT_ZOOM=6
# Firefly III currently supports two provider for live Currency Exchange Rates:
# "fixer", and "ratesapi".
# RatesApi.IO (see https://ratesapi.io) is a FREE and OPEN SOURCE live currency exchange rates,
# built compatible with Fixer.IO, based on data published by European Central Bank, and doesn't require API key.
CER_PROVIDER=ratesapi
# If you have select "fixer" as default currency exchange rates,
# set a Fixer IO API key here (see https://fixer.io) to enable live currency exchange rates.
# Please note that this WILL ONLY WORK FOR PAID fixer.io accounts because they severely limited
# the free API up to the point where you might as well offer nothing.
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
FIXER_API_KEY=
# Firefly III has two options for user authentication. "eloquent" is the default,
# and "ldap" for LDAP servers.
# For full instructions on these settings please visit:
@@ -156,6 +177,46 @@ FIXER_API_KEY=
# If you use Docker or similar, you can set this variable from a file by appending it with _FILE
LOGIN_PROVIDER=eloquent
# It's also possible to change the way users are authenticated. You could use Authelia for example.
# Authentication via the REMOTE_USER header is supported. Change the value below to "remote_user_guard".
#
# This will also allow Windows SSO.
#
# If you do this please read the documentation for instructions and warnings:
# https://docs.firefly-iii.org/advanced-installation/authentication
#
# This function is available in Firefly III v5.3.0 and higher.
AUTHENTICATION_GUARD=web
# If the guard is changed, Firefly III uses the 'REMOTE_USER' header as per RFC 3875.
# You can also use another header, like AUTH_USER when using Windows SSO.
# Some systems use X-Auth headers. In that case, use HTTP_X_AUTH_USERNAME or HTTP_X_AUTH_EMAIL
# Depending on your system, REMOTE_USER may need to be changed to HTTP_REMOTE_USER
#
# If this header is 'unexpectedly empty', check out the documentation.
# https://docs.firefly-iii.org/advanced-installation/authentication
#
AUTHENTICATION_GUARD_HEADER=REMOTE_USER
#
# Firefly III uses email addresses as user identifiers. When you're using an external authentication guard
# that doesn't do this, Firefly III is incapable of emailing you. Messages sent to "Bill Gates" always fail.
#
# However, if you set this value, Firefly III will store the value from this header as the user's backup
# email address and use it to communicate. So user "Bill Gates" could still have
# the email address "bill@microsoft.com".
#
# Example value: AUTHENTICATION_GUARD_EMAIL=HTTP_X_AUTH_EMAIL
#
AUTHENTICATION_GUARD_EMAIL=
# It's impossible to log out users who's authentication is handled by an external system.
# Enter a custom URL here that will force a logout (your authentication provider can tell you).
# Setting this variable only works when AUTHENTICATION_GUARD != web
#
CUSTOM_LOGOUT_URI=
# LDAP connection configuration
# OpenLDAP, FreeIPA or ActiveDirectory
# # If you use Docker or similar, you can set this variable from a file by appending it with _FILE
@@ -170,8 +231,16 @@ ADLDAP_PORT=389
ADLDAP_TIMEOUT=5
ADLDAP_BASEDN=""
ADLDAP_FOLLOW_REFFERALS=false
# SSL/TLS settings
ADLDAP_USE_SSL=false
ADLDAP_USE_TLS=false
ADLDAP_SSL_CACERTDIR=
ADLDAP_SSL_CACERTFILE=
ADLDAP_SSL_CERTFILE=
ADLDAP_SSL_KEYFILE=
ADLDAP_SSL_CIPHER_SUITE=
ADLDAP_SSL_REQUIRE_CERT=
# You can set the following variables from a file by appending them with _FILE:
ADLDAP_ADMIN_USERNAME=
@@ -181,7 +250,6 @@ ADLDAP_ADMIN_PASSWORD=
ADLDAP_ACCOUNT_PREFIX=
ADLDAP_ACCOUNT_SUFFIX=
# LDAP authentication settings.
ADLDAP_PASSWORD_SYNC=false
ADLDAP_LOGIN_FALLBACK=false
@@ -189,12 +257,6 @@ ADLDAP_LOGIN_FALLBACK=false
ADLDAP_DISCOVER_FIELD=distinguishedname
ADLDAP_AUTH_FIELD=distinguishedname
# Will allow SSO if your server provides an AUTH_USER field.
# You can set the following variables from a file by appending them with _FILE:
WINDOWS_SSO_ENABLED=false
WINDOWS_SSO_DISCOVER=samaccountname
WINDOWS_SSO_KEY=AUTH_USER
# field to sync as local username.
# You can set the following variable from a file by appending it with _FILE:
ADLDAP_SYNC_FIELD=userprincipalname
@@ -218,11 +280,16 @@ DISABLE_CSP_HEADER=false
TRACKER_SITE_ID=
TRACKER_URL=
#
# Firefly III could (in the future) collect telemetry on how you use Firefly III.
# In order to allow this, change the following variable to true:
# Firefly III can collect telemetry on how you use Firefly III. This is opt-in.
# In order to allow this, change the following variable to true.
# To read more about this feature, go to this page: https://docs.firefly-iii.org/support/telemetry
SEND_TELEMETRY=false
#
# Firefly III supports webhooks. These are security sensitive and must be enabled manually first.
#
ALLOW_WEBHOOKS=false
# You can fine tune the start-up of a Docker container by editing these environment variables.
# Use this at your own risk. Disabling certain checks and features may result in lost of inconsistent data.
# However if you know what you're doing you can significantly speed up container start times.
@@ -260,17 +327,14 @@ ADLDAP_CONNECTION=default
BROADCAST_DRIVER=log
QUEUE_DRIVER=sync
CACHE_PREFIX=firefly
SEARCH_RESULT_LIMIT=50
PUSHER_KEY=
IPINFO_TOKEN=
PUSHER_SECRET=
PUSHER_ID=
DEMO_USERNAME=
DEMO_PASSWORD=
USE_ENCRYPTION=false
IS_SANDSTORM=false
IS_DOCKER=false
IS_HEROKU=false
BUNQ_USE_SANDBOX=false
FIREFLY_III_LAYOUT=v1
#
# If you have trouble configuring your Firefly III installation, DON'T BOTHER setting this variable.

3
.gitattributes vendored
View File

@@ -3,3 +3,6 @@
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
/tests export-ignore
/phpunit.xml export-ignore
/.ci export-ignore

7
.github/.mergify.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
pull_request_rules:
- name: PR on main is never approved.
conditions:
- base=main
actions:
close:
message: Please reopen this PR on the `develop` branch. Thank you.

View File

@@ -1,6 +1,9 @@
---
name: Bug report
about: Create a report to help Firefly III improve
title: ''
labels: ''
assignees: ''
---
@@ -13,7 +16,12 @@ I am running Firefly III version x.x.x, and my problem is:
<!-- What do you need to do to trigger this bug? -->
**Extra info**
<!-- Please add extra info here, such as OS, browser, and the output from the /debug page of your Firefly III installation (click the version at the bottom). -->
<!-- Please add extra info here, such as OS, browser, and the output from the /debug page of your Firefly III installation (click the version at the bottom).
DO NOT PUT ```BACKTICKS``` AROUND THE OUTPUT OF THE /debug PAGE
-->
**Bonus points**
<!-- Before you submit, verify the following please: -->

View File

@@ -10,7 +10,11 @@ I am running Firefly III version x.x.x.
<!-- (if relevant of course) -->
**Extra info**
<!-- Please add extra info here, such as OS, browser, and the output from the `/debug`-page of your Firefly III installation (click the version at the bottom). -->
<!-- Please add extra info here, such as OS, browser, and the output from the `/debug`-page of your Firefly III installation (click the version at the bottom).
DO NOT PUT ```BACKTICKS``` AROUND THE OUTPUT OF THE /debug PAGE
-->
**Bonus points**

View File

@@ -1,6 +1,9 @@
---
name: Feature request
about: Suggest an idea or feature for Firefly III
title: ''
labels: ''
assignees: ''
---
@@ -28,4 +31,4 @@ Please describe your feature request:
- Make a drawing
- Donate money (just kidding ;)
-->
-->

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/firefly-iii/firefly-iii/discussions
about: Please ask and answer questions here.

View File

@@ -1,15 +1,3 @@
# Welcome to Firefly III on Github!
# [Contributing guidelines](https://docs.firefly-iii.org/other-pages/contributing)
:+1::tada: Thank you for taking the time to contribute something to Firefly III!
## Feature requests
I am always interested in expanding Firefly III's many features. Just open a ticket or [drop me a line](mailto:james@firefly-iii.org).
## Pull requests
When contributing to Firefly III, please first discuss the change you wish to make via issue, email, or any other method. I can only accept pull requests against the `develop` branch, never the `master` branch.
## Translations :us: :fr: :de:
If you see a spelling error, grammatical error or a weird translation in your language, please join [our CrowdIn](https://crowdin.com/project/firefly-iii) project. There, you can submit your translations and fixes. The GitHub repository will download these automatically and they will be included in the next release.
[Contributing guidelines](https://docs.firefly-iii.org/other-pages/contributing)

26
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
version: 2
updates:
# composer updates
- package-ecosystem: "composer"
directory: "/" # Location of package manifests
target-branch: develop
labels: ["bug"]
schedule:
interval: "weekly"
# yarn / JS updates
- package-ecosystem: "npm"
directory: "/"
target-branch: develop
labels: ["bug"]
schedule:
interval: "weekly"
# yarn / JS updates for new frontend
- package-ecosystem: "npm"
directory: "/frontend"
target-branch: develop
labels: ["bug"]
schedule:
interval: "weekly"

1
.github/funding.yml vendored
View File

@@ -2,4 +2,3 @@
github: jc5
patreon: JC5
custom: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=44UKUT455HUFA

2
.github/lock.yml vendored
View File

@@ -32,4 +32,4 @@ setLockReason: true
# daysUntilLock: 30
# Repository to extend settings from
# _extends: repo
# _extends: repo

View File

@@ -1,8 +1,9 @@
<!--
Before you create a new PR, please consider the following two considerations.
Before you create a new PR, please consider:
1) Pull request for the MASTER branch will be closed.
1) Pull requests for the MAIN branch will be closed.
2) We cannot accept pull requests to add new currencies.
3) DO NOT include translations in your PR. Only English US sentences.
Thanks.
-->

50
.github/security.md vendored
View File

@@ -1,12 +1,54 @@
# Security Policy
Firefly III is an application to manage your personal finances. As such, the developer has adopted this security disclosure and response policy to ensure that critical issues are responsibly handled.
## Supported Versions
Only the latest Firefly III release is maintained. Applicable fixes, including security fixes, will not backported to older release branches. Please refer to [releases.md](https://github.com/firefly-iii/firefly-iii/blob/main/releases.md) for details.
Only the latest version of Firefly III is supported. If you're not running the latest version of Firefly III, please upgrade at your earliest convenience.
## Reporting a Vulnerability - Private Disclosure Process
Security is of the highest importance and all security vulnerabilities or suspected security vulnerabilities should be reported to Firefly III privately, to minimize attacks against current users of Firefly III before they are fixed. Vulnerabilities will be investigated and patched on the next patch (or minor) release as soon as possible. This information could be kept entirely internal to the project.
## Reporting a Vulnerability
If you know of a publicly disclosed security vulnerability for Firefly III, please **IMMEDIATELY** contact james@firefly-iii.org to inform the Firefly III developer. You can use my [GPG key](https://keybase.io/jc5) for extra security.
If you find something that compromises the security of Firefly III, you should [send me a message](mailto:james@firefly-iii.org) as soon as possible. These issues will be fixed immediately. You can also open an issue, but if you feel the issue is sensitive, please drop me a message instead.
**IMPORTANT: Do not file public issues on GitHub for security vulnerabilities**
You can use my [GPG key](https://keybase.io/jc5) for extra security. My [GitHub commits](https://github.com/firefly-iii/firefly-iii/commits/master) are almost always signed with this key.
To report a vulnerability or a security-related issue, please email the private address james@firefly-iii.org with the details of the vulnerability. The email will be received by the developer of Firefly III. Emails will be addressed within 3 business days, including a detailed plan to investigate the issue and any potential workarounds to perform in the meantime. Do not report non-security-impacting bugs through this channel. Use [GitHub issues](https://github.com/firefly-iii/firefly-iii/issues/new/choose) instead.
### Proposed Email Content
Provide a descriptive subject line and in the body of the email include the following information:
* Basic identity information, such as your name and your affiliation or company.
* Detailed steps to reproduce the vulnerability (POC scripts, screenshots, and compressed packet captures are all helpful to us).
* Description of the effects of the vulnerability on Firefly III and the related hardware and software configurations, so that the developer can reproduce it.
* How the vulnerability affects Firefly III usage and an estimation of the attack surface, if there is one.
* List other projects or dependencies that were used in conjunction with Firefly III to produce the vulnerability.
## When to report a vulnerability
* When you think Firefly III has a potential security vulnerability.
* When you suspect a potential vulnerability but you are unsure that it impacts Firefly III.
* When you know of or suspect a potential vulnerability on another project that is used by Firefly III. For example Firefly III has a dependency on Docker, MySQL, etc.
## Patch, Release, and Disclosure
The Firefly III developer will respond to vulnerability reports as follows:
1. The developer will investigate the vulnerability and determine its effects and criticality.
2. If the issue is not deemed to be a vulnerability, the developer will follow up with a detailed reason for rejection.
3. The developer will initiate a conversation with the reporter within 3 business days.
4. If a vulnerability is acknowledged and the timeline for a fix is determined, the developer will work on a plan to communicate with the appropriate community, including identifying mitigating steps that affected users can take to protect themselves until the fix is rolled out.
5. The developer will also create a [CVSS](https://www.first.org/cvss/specification-document) using the [CVSS Calculator](https://www.first.org/cvss/calculator/3.0). The developer makes the final call on the calculated CVSS; it is better to move quickly than making the CVSS perfect. Issues may also be reported to [Mitre](https://cve.mitre.org/) using this [scoring calculator](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator). The CVE will initially be set to private.
6. The developer will work on fixing the vulnerability and perform internal testing before preparing to roll out the fix.
7. A public disclosure date is negotiated by the Firefly III developer and the bug submitter. We prefer to fully disclose the bug as soon as possible once a user mitigation or patch is available. It is reasonable to delay disclosure when the bug or the fix is not yet fully understood, the solution is not well-tested, or for distributor coordination. The timeframe for disclosure is from immediate (especially if its already publicly known) to a few weeks. For a critical vulnerability with a straightforward mitigation, we expect report date to public disclosure date to be on the order of 14 business days. The Firefly III developer holds the final say when setting a public disclosure date.
9. Once the fix is confirmed, the developer will patch the vulnerability in the next patch or minor release. Upon release of the patched version of Firefly III, we will follow the **Public Disclosure Process**.
### Public Disclosure Process
The developer publishes a public [advisory](https://github.com/firefly-iii/firefly-iii/security/advisories) to the Firefly III community via GitHub. In most cases, additional communication via Twitter, reddit and other channels will assist in educating Firefly III users and rolling out the patched release to affected users.
The develop will also publish any mitigating steps users can take until the fix can be applied to their Firefly III instances.
## Confidentiality, integrity and availability
We consider vulnerabilities leading to the compromise of data confidentiality, elevation of privilege, or integrity to be our highest priority concerns. Availability, in particular in areas relating to DoS and resource exhaustion, is also a serious security concern. The Firefly III developer takes all vulnerabilities, potential vulnerabilities, and suspected vulnerabilities seriously and will investigate them in an urgent and expeditious manner.
Note that we do not currently consider the default settings for Firefly III to be secure-by-default. It is necessary for operators to explicitly configure settings, role based access control, and other resource related features in Firefly III to provide a hardened Firefly III environment. We will not act on any security disclosure that relates to a lack of safe defaults. Over time, we will work towards improved safe-by-default configuration, taking into account backwards compatibility.
## Credits
This security policy is based on [Harbor](https://github.com/goharbor/harbor)'s security policy.

146
.github/workflows/laravel.yml vendored Normal file
View File

@@ -0,0 +1,146 @@
name: Firefly III
on:
push:
branches-ignore:
- '**'
jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Copy .env
run: test -f .env || cp .ci/.env.ci .env
- name: Prepare dependencies
run: |
set -euxo pipefail
export PATH=$PATH:$HOME/.composer/vendor/bin/
composer global require hirak/prestissimo --no-plugins --no-scripts
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
touch ./storage/database/database.sqlite
- name: Prepare Firefly III
run: |
chmod -R 777 storage bootstrap/cache
php artisan migrate --seed
php artisan firefly-iii:upgrade-database
- name: Upload database
uses: actions/upload-artifact@v2
with:
name: database
path: storage/database/database.sqlite
- name: Upload cache
uses: actions/upload-artifact@v2
with:
name: cache
path: bootstrap/cache/
- name: Upload composer cache
uses: actions/upload-artifact@v2
with:
name: composer
path: ~/.composer
laravel-tests:
runs-on: ubuntu-latest
needs:
- prepare
steps:
- uses: actions/checkout@v2
- name: Copy .env
run: test -f .env || cp .ci/.env.ci .env
- name: Download database
uses: actions/download-artifact@v2
with:
name: database
path: storage/database/database.sqlite
- name: Download cache
uses: actions/download-artifact@v2
with:
name: cache
path: bootstrap/cache/
- name: Download vendor
uses: actions/download-artifact@v2
with:
name: composer
path: ~/.composer
- name: Install composer
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
- name: PHPUnit tests
uses: php-actions/phpunit@v1
with:
config: phpunit.xml
memory: 512M
coding-standards:
runs-on: ubuntu-latest
needs:
- prepare
steps:
- uses: actions/checkout@v2
- name: Copy .env
run: test -f .env || cp .ci/.env.ci .env
- name: Download database
uses: actions/download-artifact@v2
with:
name: database
path: storage/database/database.sqlite
- name: Download cache
uses: actions/download-artifact@v2
with:
name: cache
path: bootstrap/cache/
- name: Download vendor
uses: actions/download-artifact@v2
with:
name: composer
path: ~/.composer
- name: install depenencies
run: |
composer global require nette/coding-standard
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
- name: Execute code standard
run: /home/runner/.composer/vendor/bin/ecs check app tests --config ./.ci/firefly-iii-standard.yml
phpstan:
runs-on: ubuntu-latest
needs:
- prepare
steps:
- uses: actions/checkout@v2
- name: Copy .env
run: test -f .env || cp .ci/.env.ci .env
- name: Download database
uses: actions/download-artifact@v2
with:
name: database
path: storage/database/database.sqlite
- name: Download cache
uses: actions/download-artifact@v2
with:
name: cache
path: bootstrap/cache/
- name: Download vendor
uses: actions/download-artifact@v2
with:
name: composer
path: ~/.composer
- name: Install depenencies
run: |
composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --no-suggest
- name: Execute PHPStan
run: vendor/bin/phpstan analyse -c .ci/phpstan.neon

23
.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: "Close stale issues"
on:
schedule:
- cron: "30 1 * * *"
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
stale-pr-message: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
days-before-stale: 14
days-before-close: 7
exempt-issue-labels: 'enhancement,feature,bug,announcement'

2
.gitignore vendored
View File

@@ -1,5 +1,7 @@
/node_modules
/frontend/node_modules
/frontend/fonts
/frontend/images
/public/hot
/public/storage
/storage/*.key

20
.travis.yml Normal file
View File

@@ -0,0 +1,20 @@
language: php
php:
- '7.4'
dist: xenial
os: linux
cache:
directories:
- "/home/travis/.config"
- "/home/travis/build/firefly-iii/firefly-iii/vendor"
branches:
only:
- develop
before_script:
- phpenv config-rm xdebug.ini || return 0
script:
- "./.ci/phpstan.sh"
- "./.ci/phpunit.sh"

View File

@@ -3,7 +3,7 @@
"description": "A free and open source personal finances manager",
"repository": "https://github.com/firefly-iii/firefly-iii",
"website": "https://firefly-iii.org/",
"logo": "https://raw.githubusercontent.com/firefly-iii/firefly-iii/master/public/mstile-150x150.png",
"logo": "https://raw.githubusercontent.com/firefly-iii/firefly-iii/main/public/mstile-150x150.png",
"keywords": [
"finance",
"finances",
@@ -41,7 +41,7 @@
{
"plan": "heroku-postgresql",
"options": {
"version": "9.5"
"version": "12"
}
}
],
@@ -58,8 +58,8 @@
],
"env": {
"APP_KEY": {
"description": "This key is used to encrypt your data.",
"description": "This key is used to create app cookies en secure attachments.",
"value": "base64:If1gJN4pyycXTq+WS5TjneDympKuu+8SKvTl6RZnhJg="
}
}
}
}

View File

@@ -0,0 +1,116 @@
<?php
/**
* AccountController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Http\Api\AccountFilter;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class AccountController
*/
class AccountController extends Controller
{
use AccountFilter;
private array $balanceTypes;
private AccountRepositoryInterface $repository;
/**
* AccountController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
$this->balanceTypes = [AccountType::ASSET, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE,];
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function accounts(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$types = $data['types'];
$query = $data['query'];
$date = $data['date'] ?? today(config('app.timezone'));
$return = [];
$result = $this->repository->searchAccount((string)$query, $types, $data['limit']);
$defaultCurrency = app('amount')->getDefaultCurrency();
/** @var Account $account */
foreach ($result as $account) {
$nameWithBalance = $account->name;
$currency = $this->repository->getAccountCurrency($account) ?? $defaultCurrency;
if (in_array($account->accountType->type, $this->balanceTypes, true)) {
$balance = app('steam')->balance($account, $date);
$nameWithBalance = sprintf('%s (%s)', $account->name, app('amount')->formatAnything($currency, $balance, false));
}
$return[] = [
'id' => (string)$account->id,
'name' => $account->name,
'name_with_balance' => $nameWithBalance,
'type' => $account->accountType->type,
'currency_id' => $currency->id,
'currency_name' => $currency->name,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
];
}
// custom order.
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
usort(
$return, function ($a, $b) use ($order) {
$pos_a = array_search($a['type'], $order);
$pos_b = array_search($b['type'], $order);
return $pos_a - $pos_b;
}
);
return response()->json($return);
}
}

View File

@@ -0,0 +1,79 @@
<?php
/**
* BillController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class BillController
*/
class BillController extends Controller
{
private BillRepositoryInterface $repository;
/**
* BillController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(BillRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function bills(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$result = $this->repository->searchBill($data['query'], $data['limit']);
$filtered = $result->map(
static function (Bill $item) {
return [
'id' => (string)$item->id,
'name' => $item->name,
];
}
);
return response()->json($filtered->toArray());
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* BudgetController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class BudgetController
*/
class BudgetController extends Controller
{
private BudgetRepositoryInterface $repository;
/**
* BudgetController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(BudgetRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function budgets(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$result = $this->repository->searchBudget($data['query'], $data['limit']);
$filtered = $result->map(
static function (Budget $item) {
return [
'id' => (string)$item->id,
'name' => $item->name,
];
}
);
return response()->json($filtered);
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* CategoryController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class CategoryController
*/
class CategoryController extends Controller
{
private CategoryRepositoryInterface $repository;
/**
* CategoryController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(CategoryRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function categories(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$result = $this->repository->searchCategory($data['query'], $data['limit']);
$filtered = $result->map(
static function (Category $item) {
return [
'id' => (string)$item->id,
'name' => $item->name,
];
}
);
return response()->json($filtered);
}
}

View File

@@ -0,0 +1,107 @@
<?php
/**
* CurrencyController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class CurrencyController
*/
class CurrencyController extends Controller
{
private CurrencyRepositoryInterface $repository;
/**
* CurrencyController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(CurrencyRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function currencies(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$collection = $this->repository->searchCurrency($data['query'], $data['limit']);
$result = [];
/** @var TransactionCurrency $currency */
foreach ($collection as $currency) {
$result[] = [
'id' => (string)$currency->id,
'name' => $currency->name,
'code' => $currency->code,
'symbol' => $currency->symbol,
'decimal_places' => $currency->decimal_places,
];
}
return response()->json($result);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function currenciesWithCode(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$collection = $this->repository->searchCurrency($data['query'], $data['limit']);
$result = [];
/** @var TransactionCurrency $currency */
foreach ($collection as $currency) {
$result[] = [
'id' => (string)$currency->id,
'name' => sprintf('%s (%s)', $currency->name, $currency->code),
'code' => $currency->code,
'symbol' => $currency->symbol,
'decimal_places' => $currency->decimal_places,
];
}
return response()->json($result);
}
}

View File

@@ -0,0 +1,81 @@
<?php
/**
* ObjectGroupController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\ObjectGroup;
use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class ObjectGroupController
*/
class ObjectGroupController extends Controller
{
private ObjectGroupRepositoryInterface $repository;
/**
* CurrencyController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(ObjectGroupRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function objectGroups(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$return = [];
$result = $this->repository->search($data['query'], $data['limit']);
/** @var ObjectGroup $objectGroup */
foreach ($result as $objectGroup) {
$return[] = [
'id' => (string)$objectGroup->id,
'name' => $objectGroup->title,
'title' => $objectGroup->title,
];
}
return response()->json($return);
}
}

View File

@@ -0,0 +1,122 @@
<?php
/**
* PiggyBankController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class PiggyBankController
*/
class PiggyBankController extends Controller
{
private AccountRepositoryInterface $accountRepository;
private PiggyBankRepositoryInterface $piggyRepository;
/**
* PiggyBankController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->piggyRepository = app(PiggyBankRepositoryInterface::class);
$this->accountRepository = app(AccountRepositoryInterface::class);
$this->piggyRepository->setUser($user);
$this->accountRepository->setUser($user);
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function piggyBanks(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$piggies = $this->piggyRepository->searchPiggyBank($data['query'], $data['limit']);
$defaultCurrency = app('amount')->getDefaultCurrency();
$response = [];
/** @var PiggyBank $piggy */
foreach ($piggies as $piggy) {
$currency = $this->accountRepository->getAccountCurrency($piggy->account) ?? $defaultCurrency;
$response[] = [
'id' => (string)$piggy->id,
'name' => $piggy->name,
'currency_id' => $currency->id,
'currency_name' => $currency->name,
'currency_code' => $currency->code,
'currency_decimal_places' => $currency->decimal_places,
];
}
return response()->json($response);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function piggyBanksWithBalance(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$piggies = $this->piggyRepository->searchPiggyBank($data['query'], $data['limit']);
$defaultCurrency = app('amount')->getDefaultCurrency();
$response = [];
/** @var PiggyBank $piggy */
foreach ($piggies as $piggy) {
$currency = $this->accountRepository->getAccountCurrency($piggy->account) ?? $defaultCurrency;
$currentAmount = $this->piggyRepository->getRepetition($piggy)->currentamount ?? '0';
$response[] = [
'id' => (string)$piggy->id,
'name' => $piggy->name,
'name_with_balance' => sprintf(
'%s (%s / %s)', $piggy->name, app('amount')->formatAnything($currency, $currentAmount, false),
app('amount')->formatAnything($currency, $piggy->targetamount, false),
),
'currency_id' => $currency->id,
'currency_name' => $currency->name,
'currency_code' => $currency->code,
'currency_decimal_places' => $currency->decimal_places,
];
}
return response()->json($response);
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* RecurrenceController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\Rule;
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
use Illuminate\Http\JsonResponse;
/**
* Class RecurrenceController
*/
class RecurrenceController extends Controller
{
private RecurringRepositoryInterface $repository;
/**
* RecurrenceController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(RecurringRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function recurring(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$rules = $this->repository->searchRecurrence($data['query'], $data['limit']);
$response = [];
/** @var Rule $rule */
foreach ($rules as $rule) {
$response[] = [
'id' => (string)$rule->id,
'name' => $rule->title,
'description' => $rule->description,
];
}
return response()->json($response);
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* RuleController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\Rule;
use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
use Illuminate\Http\JsonResponse;
/**
* Class RuleController
*/
class RuleController extends Controller
{
private RuleRepositoryInterface $repository;
/**
* RuleController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(RuleRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function rules(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$rules = $this->repository->searchRule($data['query'], $data['limit']);
$response = [];
/** @var Rule $rule */
foreach ($rules as $rule) {
$response[] = [
'id' => (string)$rule->id,
'name' => $rule->title,
'description' => $rule->description,
];
}
return response()->json($response);
}
}

View File

@@ -0,0 +1,77 @@
<?php
/**
* RuleGroupController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\RuleGroup;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
use Illuminate\Http\JsonResponse;
/**
* Class RuleGroupController
*/
class RuleGroupController extends Controller
{
private RuleGroupRepositoryInterface $repository;
/**
* RuleGroupController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(RuleGroupRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function ruleGroups(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$groups = $this->repository->searchRuleGroup($data['query'], $data['limit']);
$response = [];
/** @var RuleGroup $group */
foreach ($groups as $group) {
$response[] = [
'id' => (string)$group->id,
'name' => $group->title,
'description' => $group->description,
];
}
return response()->json($response);
}
}

View File

@@ -0,0 +1,80 @@
<?php
/**
* TagController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\Tag;
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class TagController
*/
class TagController extends Controller
{
private TagRepositoryInterface $repository;
/**
* TagController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(TagRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function tags(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$result = $this->repository->searchTags($data['query'], $data['limit']);
$array = [];
/** @var Tag $tag */
foreach ($result as $tag) {
$array[] = [
'id' => (string)$tag->id,
'name' => $tag->tag,
'tag' => $tag->tag,
];
}
return response()->json($array);
}
}

View File

@@ -0,0 +1,128 @@
<?php
/**
* TransactionController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Repositories\TransactionGroup\TransactionGroupRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
/**
* Class TransactionController
*/
class TransactionController extends Controller
{
private TransactionGroupRepositoryInterface $groupRepository;
private JournalRepositoryInterface $repository;
/**
* TransactionController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(JournalRepositoryInterface::class);
$this->groupRepository = app(TransactionGroupRepositoryInterface::class);
$this->repository->setUser($user);
$this->groupRepository->setUser($user);
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function transactions(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$result = $this->repository->searchJournalDescriptions($data['query'], $data['limit']);
// limit and unique
$filtered = $result->unique('description');
$array = [];
/** @var TransactionJournal $journal */
foreach ($filtered as $journal) {
$array[] = [
'id' => (string)$journal->id,
'transaction_group_id' => (string)$journal->transaction_group_id,
'name' => $journal->description,
'description' => $journal->description,
];
}
return response()->json($array);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
*/
public function transactionsWithID(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$result = new Collection;
if (is_numeric($data['query'])) {
// search for group, not journal.
$firstResult = $this->groupRepository->find((int)$data['query']);
if (null !== $firstResult) {
// group may contain multiple journals, each a result:
foreach ($firstResult->transactionJournals as $journal) {
$result->push($journal);
}
}
}
if (!is_numeric($data['query'])) {
$result = $this->repository->searchJournalDescriptions($data['query'], $data['limit']);
}
// limit and unique
$array = [];
/** @var TransactionJournal $journal */
foreach ($result as $journal) {
$array[] = [
'id' => (string)$journal->id,
'transaction_group_id' => (string)$journal->transaction_group_id,
'name' => sprintf('#%d: %s', $journal->transaction_group_id, $journal->description),
'description' => sprintf('#%d: %s', $journal->transaction_group_id, $journal->description),
];
}
return response()->json($array);
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* TransactionTypeController.php
* Copyright (c) 2020 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteRequest;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\TransactionType\TransactionTypeRepositoryInterface;
use Illuminate\Http\JsonResponse;
/**
* Class TransactionTypeController
*/
class TransactionTypeController extends Controller
{
private TransactionTypeRepositoryInterface $repository;
/**
* TransactionTypeController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(TransactionTypeRepositoryInterface::class);
return $next($request);
}
);
}
/**
* @param AutocompleteRequest $request
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function transactionTypes(AutocompleteRequest $request): JsonResponse
{
$data = $request->getData();
$types = $this->repository->searchTypes($data['query'], $data['limit']);
$array = [];
/** @var TransactionType $type */
foreach ($types as $type) {
// different key for consistency.
$array[] = [
'id' => (string)$type->id,
'name' => $type->type,
'type' => $type->type,
];
}
return response()->json($array);
}
}

View File

@@ -1,260 +0,0 @@
<?php
/**
* BudgetLimitController.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
use FireflyIII\Api\V1\Requests\BudgetLimitRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Support\Http\Api\TransactionFilter;
use FireflyIII\Transformers\BudgetLimitTransformer;
use FireflyIII\Transformers\TransactionGroupTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class BudgetLimitController.
*
*/
class BudgetLimitController extends Controller
{
use TransactionFilter;
/** @var BudgetLimitRepositoryInterface */
private $blRepository;
/** @var BudgetRepositoryInterface The budget repository */
private $repository;
/**
* BudgetLimitController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(BudgetRepositoryInterface::class);
$this->blRepository = app(BudgetLimitRepositoryInterface::class);
$this->repository->setUser($user);
$this->blRepository->setUser($user);
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @param BudgetLimit $budgetLimit
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function delete(BudgetLimit $budgetLimit): JsonResponse
{
$this->blRepository->destroyBudgetLimit($budgetLimit);
return response()->json([], 204);
}
/**
* Display a listing of the resource.
*
* @param Request $request
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function index(Request $request): JsonResponse
{
$manager = $this->getManager();
$budgetId = (int) ($request->get('budget_id') ?? 0);
$budget = $this->repository->findNull($budgetId);
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$this->parameters->set('budget_id', $budgetId);
$collection = new Collection;
if (null === $budget) {
$collection = $this->blRepository->getAllBudgetLimits($this->parameters->get('start'), $this->parameters->get('end'));
}
if (null !== $budget) {
$collection = $this->blRepository->getBudgetLimits($budget, $this->parameters->get('start'), $this->parameters->get('end'));
}
$count = $collection->count();
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budget_limits.index') . $this->buildParams());
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($budgetLimits, $transformer, 'budget_limits');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Display the specified resource.
*
* @param BudgetLimit $budgetLimit
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function show(BudgetLimit $budgetLimit): JsonResponse
{
$manager = $this->getManager();
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budgetLimit, $transformer, 'budget_limits');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Store a newly created resource in storage.
*
* @param BudgetLimitRequest $request
*
* @throws FireflyException
*
* @return JsonResponse
*/
public function store(BudgetLimitRequest $request): JsonResponse
{
$data = $request->getAll();
$budget = $this->repository->findNull($data['budget_id']);
if (null === $budget) {
throw new FireflyException('200004: Budget does not exist.'); // @codeCoverageIgnore
}
$data['budget'] = $budget;
$budgetLimit = $this->blRepository->storeBudgetLimit($data);
$manager = $this->getManager();
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budgetLimit, $transformer, 'budget_limits');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Show all transactions.
*
* @param Request $request
* @param BudgetLimit $budgetLimit
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function transactions(Request $request, BudgetLimit $budgetLimit): JsonResponse
{
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$type = $request->get('type') ?? 'default';
$this->parameters->set('type', $type);
$types = $this->mapTransactionTypes($this->parameters->get('type'));
$manager = $this->getManager();
/** @var User $admin */
$admin = auth()->user();
// use new group collector:
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$collector
->setUser($admin)
// filter on budget.
->setBudget($budgetLimit->budget)
// all info needed for the API:
->withAPIInformation()
// set page size:
->setLimit($pageSize)
// set page to retrieve
->setPage($this->parameters->get('page'))
// set types of transactions to return.
->setTypes($types);
$collector->setRange($budgetLimit->start_date, $budgetLimit->end_date);
$collector->setTypes($types);
$paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.budget_limits.transactions', [$budgetLimit->id]) . $this->buildParams());
$transactions = $paginator->getCollection();
/** @var TransactionGroupTransformer $transformer */
$transformer = app(TransactionGroupTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($transactions, $transformer, 'transactions');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Update the specified resource in storage.
*
* @param BudgetLimitRequest $request
* @param BudgetLimit $budgetLimit
*
* @return JsonResponse
*/
public function update(BudgetLimitRequest $request, BudgetLimit $budgetLimit): JsonResponse
{
$data = $request->getAll();
$data['budget'] = $budgetLimit->budget;
$budgetLimit = $this->blRepository->updateBudgetLimit($budgetLimit, $data);
$manager = $this->getManager();
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budgetLimit, $transformer, 'budget_limits');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
}

View File

@@ -26,10 +26,9 @@ namespace FireflyIII\Api\V1\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\DateRequest;
use FireflyIII\Api\V1\Requests\Data\DateRequest;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Support\Http\Api\ApiSupport;
@@ -42,10 +41,9 @@ use Illuminate\Http\JsonResponse;
class AccountController extends Controller
{
use ApiSupport;
/** @var CurrencyRepositoryInterface */
private $currencyRepository;
/** @var AccountRepositoryInterface */
private $repository;
private CurrencyRepositoryInterface $currencyRepository;
private AccountRepositoryInterface $repository;
/**
* AccountController constructor.
@@ -70,92 +68,6 @@ class AccountController extends Controller
);
}
/**
* @param DateRequest $request
*
* @return JsonResponse
*/
public function expenseOverview(DateRequest $request): JsonResponse
{
// parameters for chart:
$dates = $request->getAll();
/** @var Carbon $start */
$start = $dates['start'];
/** @var Carbon $end */
$end = $dates['end'];
$start->subDay();
// prep some vars:
$currencies = [];
$chartData = [];
$tempData = [];
// grab all accounts and names
$accounts = $this->repository->getAccountsByType([AccountType::EXPENSE]);
$accountNames = $this->extractNames($accounts);
$startBalances = app('steam')->balancesPerCurrencyByAccounts($accounts, $start);
$endBalances = app('steam')->balancesPerCurrencyByAccounts($accounts, $end);
// loop the end balances. This is an array for each account ($expenses)
foreach ($endBalances as $accountId => $expenses) {
$accountId = (int) $accountId;
// loop each expense entry (each entry can be a different currency).
foreach ($expenses as $currencyId => $endAmount) {
$currencyId = (int) $currencyId;
// see if there is an accompanying start amount.
// grab the difference and find the currency.
$startAmount = $startBalances[$accountId][$currencyId] ?? '0';
$diff = bcsub($endAmount, $startAmount);
$currencies[$currencyId] = $currencies[$currencyId] ?? $this->currencyRepository->findNull($currencyId);
if (0 !== bccomp($diff, '0')) {
// store the values in a temporary array.
$tempData[] = [
'name' => $accountNames[$accountId],
'difference' => $diff,
'diff_float' => (float) $diff,
'currency_id' => $currencyId,
];
}
}
}
// sort temp array by amount.
$amounts = array_column($tempData, 'diff_float');
array_multisort($amounts, SORT_DESC, $tempData);
// loop all found currencies and build the data array for the chart.
/**
* @var int $currencyId
* @var TransactionCurrency $currency
*/
foreach ($currencies as $currencyId => $currency) {
$currentSet = [
'label' => trans('firefly.box_spent_in_currency', ['currency' => $currency->symbol]),
'currency_id' => $currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
'type' => 'bar', // line, area or bar
'yAxisID' => 0, // 0, 1, 2
'entries' => $this->expandNames($tempData),
];
$chartData[$currencyId] = $currentSet;
}
// loop temp data and place data in correct array:
foreach ($tempData as $entry) {
$currencyId = $entry['currency_id'];
$name = $entry['name'];
$chartData[$currencyId]['entries'][$name] = round($entry['difference'], $chartData[$currencyId]['currency_decimal_places']);
}
$chartData = array_values($chartData);
return response()->json($chartData);
}
/**
* @param DateRequest $request
*
@@ -174,12 +86,12 @@ class AccountController extends Controller
$defaultSet = $this->repository->getAccountsByType([AccountType::ASSET])->pluck('id')->toArray();
$frontPage = app('preferences')->get('frontPageAccounts', $defaultSet);
$default = app('amount')->getDefaultCurrency();
// @codeCoverageIgnoreStart
if (0 === count($frontPage->data)) {
$frontPage->data = $defaultSet;
$frontPage->save();
}
// @codeCoverageIgnoreEnd
// get accounts:
$accounts = $this->repository->getAccountsById($frontPage->data);
@@ -188,14 +100,16 @@ class AccountController extends Controller
foreach ($accounts as $account) {
$currency = $this->repository->getAccountCurrency($account);
if (null === $currency) {
$currency = $default; // @codeCoverageIgnore
$currency = $default;
}
$currentSet = [
'label' => $account->name,
'currency_id' => $currency->id,
'currency_id' => (string)$currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
'start_date' => $start->toAtomString(),
'end_date' => $end->toAtomString(),
'type' => 'line', // line, area or bar
'yAxisID' => 0, // 0, 1, 2
'entries' => [],
@@ -203,11 +117,11 @@ class AccountController extends Controller
/** @var Carbon $currentStart */
$currentStart = clone $start;
$range = app('steam')->balanceInRange($account, $start, clone $end);
$previous = round(array_values($range)[0], 12);
$previous = round((float)array_values($range)[0], 12);
while ($currentStart <= $end) {
$format = $currentStart->format('Y-m-d');
$label = $currentStart->format('Y-m-d');
$balance = isset($range[$format]) ? round($range[$format], 12) : $previous;
$label = $currentStart->toAtomString();
$balance = array_key_exists($format, $range) ? round((float)$range[$format], 12) : $previous;
$previous = $balance;
$currentStart->addDay();
$currentSet['entries'][$label] = $balance;
@@ -217,91 +131,4 @@ class AccountController extends Controller
return response()->json($chartData);
}
/**
* @param DateRequest $request
*
* @return JsonResponse
*/
public function revenueOverview(DateRequest $request): JsonResponse
{
// parameters for chart:
$dates = $request->getAll();
/** @var Carbon $start */
$start = $dates['start'];
/** @var Carbon $end */
$end = $dates['end'];
$start->subDay();
// prep some vars:
$currencies = [];
$chartData = [];
$tempData = [];
// grab all accounts and names
$accounts = $this->repository->getAccountsByType([AccountType::REVENUE]);
$accountNames = $this->extractNames($accounts);
$startBalances = app('steam')->balancesPerCurrencyByAccounts($accounts, $start);
$endBalances = app('steam')->balancesPerCurrencyByAccounts($accounts, $end);
// loop the end balances. This is an array for each account ($expenses)
foreach ($endBalances as $accountId => $expenses) {
$accountId = (int) $accountId;
// loop each expense entry (each entry can be a different currency).
foreach ($expenses as $currencyId => $endAmount) {
$currencyId = (int) $currencyId;
// see if there is an accompanying start amount.
// grab the difference and find the currency.
$startAmount = $startBalances[$accountId][$currencyId] ?? '0';
$diff = bcsub($endAmount, $startAmount);
$currencies[$currencyId] = $currencies[$currencyId] ?? $this->currencyRepository->findNull($currencyId);
if (0 !== bccomp($diff, '0')) {
// store the values in a temporary array.
$tempData[] = [
'name' => $accountNames[$accountId],
'difference' => bcmul($diff, '-1'),
// For some reason this line is never covered in code coverage:
'diff_float' => ((float) $diff) * -1, // @codeCoverageIgnore
'currency_id' => $currencyId,
];
}
}
}
// sort temp array by amount.
$amounts = array_column($tempData, 'diff_float');
array_multisort($amounts, SORT_DESC, $tempData);
// loop all found currencies and build the data array for the chart.
/**
* @var int $currencyId
* @var TransactionCurrency $currency
*/
foreach ($currencies as $currencyId => $currency) {
$currentSet = [
'label' => trans('firefly.box_earned_in_currency', ['currency' => $currency->symbol]),
'currency_id' => $currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
'type' => 'bar', // line, area or bar
'yAxisID' => 0, // 0, 1, 2
'entries' => $this->expandNames($tempData),
];
$chartData[$currencyId] = $currentSet;
}
// loop temp data and place data in correct array:
foreach ($tempData as $entry) {
$currencyId = $entry['currency_id'];
$name = $entry['name'];
$chartData[$currencyId]['entries'][$name] = round($entry['difference'], $chartData[$currencyId]['currency_decimal_places']);
}
$chartData = array_values($chartData);
return response()->json($chartData);
}
}

View File

@@ -1,118 +0,0 @@
<?php
/**
* AvailableBudgetController.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Chart;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\AvailableBudget;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
/**
* Class AvailableBudgetController
*/
class AvailableBudgetController extends Controller
{
/** @var OperationsRepositoryInterface */
private $opsRepository;
/** @var BudgetRepositoryInterface */
private $repository;
/**
* AvailableBudgetController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(BudgetRepositoryInterface::class);
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->repository->setUser($user);
$this->opsRepository->setUser($user);
return $next($request);
}
);
}
/**
* @param AvailableBudget $availableBudget
*
* @return JsonResponse
*/
public function overview(AvailableBudget $availableBudget): JsonResponse
{
$currency = $availableBudget->transactionCurrency;
$budgets = $this->repository->getActiveBudgets();
$budgetInformation = $this->opsRepository->spentInPeriodMc($budgets, new Collection, $availableBudget->start_date, $availableBudget->end_date);
$spent = 0.0;
// get for current currency
foreach ($budgetInformation as $spentInfo) {
if ($spentInfo['currency_id'] === $availableBudget->transaction_currency_id) {
$spent = $spentInfo['amount'];
}
}
$left = bcadd($availableBudget->amount, (string) $spent);
// left less than zero? Set to zero.
if (-1 === bccomp($left, '0')) {
$left = '0';
}
$chartData = [
[
'label' => trans('firefly.spent'),
'currency_id' => $currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
'type' => 'pie',
'yAxisID' => 0, // 0, 1, 2
'entries' => [$spent * -1],
],
[
'label' => trans('firefly.left'),
'currency_id' => $currency->id,
'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places,
'type' => 'line', // line, area or bar
'yAxisID' => 0, // 0, 1, 2
'entries' => [round($left, $currency->decimal_places)],
],
];
return response()->json($chartData);
}
}

View File

@@ -1,202 +0,0 @@
<?php
/**
* CategoryController.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\DateRequest;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Repositories\Category\NoCategoryRepositoryInterface;
use FireflyIII\Repositories\Category\OperationsRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class CategoryController
*/
class CategoryController extends Controller
{
/** @var CategoryRepositoryInterface */
private $categoryRepository;
/** @var NoCategoryRepositoryInterface */
private $noCatRepository;
/** @var OperationsRepositoryInterface */
private $opsRepository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->categoryRepository = app(CategoryRepositoryInterface::class);
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->noCatRepository = app(NoCategoryRepositoryInterface::class);
$this->categoryRepository->setUser($user);
$this->opsRepository->setUser($user);
$this->noCatRepository->setUser($user);
return $next($request);
}
);
}
/**
* @param DateRequest $request
*
* @return JsonResponse
*
* TODO after 4.8,0, simplify
*/
public function overview(DateRequest $request): JsonResponse
{
// parameters for chart:
$dates = $request->getAll();
/** @var Carbon $start */
$start = $dates['start'];
/** @var Carbon $end */
$end = $dates['end'];
$tempData = [];
$spentWith = $this->opsRepository->listExpenses($start, $end);
$earnedWith = $this->opsRepository->listIncome($start, $end);
$spentWithout = $this->noCatRepository->listExpenses($start, $end);
$earnedWithout = $this->noCatRepository->listIncome($start, $end);
$categories = [];
foreach ([$spentWith, $earnedWith, $spentWithout, $earnedWithout] as $set) {
foreach ($set as $currency) {
foreach ($currency['categories'] as $category) {
$categories[] = $category['name'];
$inKey = sprintf('%d-i', $currency['currency_id']);
$outKey = sprintf('%d-e', $currency['currency_id']);
// make data arrays if not yet present.
$tempData[$inKey] = $tempData[$inKey] ?? [
'currency_id' => $currency['currency_id'],
'label' => (string) trans('firefly.box_earned_in_currency', ['currency' => $currency['currency_name']]),
'currency_code' => $currency['currency_code'],
'currency_symbol' => $currency['currency_symbol'],
'currency_decimal_places' => $currency['currency_decimal_places'],
'type' => 'bar', // line, area or bar
'yAxisID' => 0, // 0, 1, 2
'entries' => [
// per category:
// "category" => 5,
],
];
$tempData[$outKey] = $tempData[$outKey] ?? [
'currency_id' => $currency['currency_id'],
'label' => (string) trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]),
'currency_code' => $currency['currency_code'],
'currency_symbol' => $currency['currency_symbol'],
'currency_decimal_places' => $currency['currency_decimal_places'],
'type' => 'bar', // line, area or bar
'yAxisID' => 0, // 0, 1, 2
'entries' => [
// per category:
// "category" => 5,
],
];
foreach ($category['transaction_journals'] as $journal) {
// is it expense or income?
$letter = -1 === bccomp($journal['amount'], '0') ? 'e' : 'i';
$currentKey = sprintf('%d-%s', $currency['currency_id'], $letter);
$name = $category['name'];
$tempData[$currentKey]['entries'][$name] = $tempData[$currentKey]['entries'][$name] ?? '0';
$tempData[$currentKey]['entries'][$name] = bcadd($tempData[$currentKey]['entries'][$name], $journal['amount']);
}
}
}
}
// foreach ([] as $set) {
// foreach ($set as $currency) {
// $inKey = sprintf('%d-i', $currency['currency_id']);
// $outKey = sprintf('%d-e', $currency['currency_id']);
// $categories[] = (string)trans('firefly.no_category');
// // make data arrays if not yet present.
// $tempData[$inKey] = $tempData[$inKey] ?? [
// 'currency_id' => $currency['currency_id'],
// 'label' => (string)trans('firefly.box_earned_in_currency', ['currency' => $currency['currency_name']]),
// 'currency_code' => $currency['currency_code'],
// 'currency_symbol' => $currency['currency_symbol'],
// 'currency_decimal_places' => $currency['currency_decimal_places'],
// 'type' => 'bar', // line, area or bar
// 'yAxisID' => 0, // 0, 1, 2
// 'entries' => [
// // per category:
// // "category" => 5,
// ],
// ];
// $tempData[$outKey] = $tempData[$outKey] ?? [
// 'currency_id' => $currency['currency_id'],
// 'label' => (string)trans('firefly.box_spent_in_currency', ['currency' => $currency['currency_name']]),
// 'currency_code' => $currency['currency_code'],
// 'currency_symbol' => $currency['currency_symbol'],
// 'currency_decimal_places' => $currency['currency_decimal_places'],
// 'type' => 'bar', // line, area or bar
// 'yAxisID' => 0, // 0, 1, 2
// 'entries' => [
// // per category:
// // "category" => 5,
// ],
// ];
// foreach ($currency['transaction_journals'] as $journal) {
// // is it expense or income?
// $letter = -1 === bccomp($journal['amount'], '0') ? 'e' : 'i';
// $currentKey = sprintf('%d-%s', $currency['currency_id'], $letter);
// $name = (string)trans('firefly.no_category');
// $tempData[$currentKey]['entries'][$name] = $tempData[$currentKey]['entries'][$name] ?? '0';
// $tempData[$currentKey]['entries'][$name] = bcadd($tempData[$currentKey]['entries'][$name], $journal['amount']);
// }
// }
// }
// re-sort every spent array and add 0 for missing entries.
foreach ($tempData as $index => $set) {
$oldSet = $set['entries'];
$newSet = [];
foreach ($categories as $category) {
$value = $oldSet[$category] ?? '0';
$value = -1 === bccomp($value, '0') ? bcmul($value, '-1') : $value;
$newSet[$category] = $value;
}
$tempData[$index]['entries'] = $newSet;
}
$chartData = array_values($tempData);
return response()->json($chartData);
}
}

View File

@@ -1,119 +0,0 @@
<?php
/**
* ConfigurationController.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
use FireflyIII\Api\V1\Requests\ConfigurationRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Configuration;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class ConfigurationController.
*
* @codeCoverageIgnore
*/
class ConfigurationController extends Controller
{
/** @var UserRepositoryInterface The user repository */
private $repository;
/**
* ConfigurationController constructor.
*
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(UserRepositoryInterface::class);
/** @var User $admin */
$admin = auth()->user();
if (!$this->repository->hasRole($admin, 'owner')) {
throw new FireflyException('200005: You need the "owner" role to do this.'); // @codeCoverageIgnore
}
return $next($request);
}
);
}
/**
* Show all configuration.
*
* @return JsonResponse
*/
public function index(): JsonResponse
{
$configData = $this->getConfigData();
return response()->json(['data' => $configData])->header('Content-Type', 'application/vnd.api+json');
}
/**
* Update the configuration.
*
* @param ConfigurationRequest $request
* @param string $name
*
* @return JsonResponse
*/
public function update(ConfigurationRequest $request, string $name): JsonResponse
{
$data = $request->getAll();
app('fireflyconfig')->set($name, $data['value']);
$configData = $this->getConfigData();
return response()->json(['data' => $configData])->header('Content-Type', 'application/vnd.api+json');
}
/**
* Get all config values.
*
* @return array
*/
private function getConfigData(): array
{
/** @var Configuration $isDemoSite */
$isDemoSite = app('fireflyconfig')->get('is_demo_site');
/** @var Configuration $updateCheck */
$updateCheck = app('fireflyconfig')->get('permission_update_check');
/** @var Configuration $lastCheck */
$lastCheck = app('fireflyconfig')->get('last_update_check');
/** @var Configuration $singleUser */
$singleUser = app('fireflyconfig')->get('single_user_mode');
return [
'is_demo_site' => null === $isDemoSite ? null : $isDemoSite->data,
'permission_update_check' => null === $updateCheck ? null : (int) $updateCheck->data,
'last_update_check' => null === $lastCheck ? null : (int) $lastCheck->data,
'single_user_mode' => null === $singleUser ? null : $singleUser->data,
];
}
}

View File

@@ -39,61 +39,32 @@ use Symfony\Component\HttpFoundation\ParameterBag;
* Class Controller.
*
* @codeCoverageIgnore
*
*/
class Controller extends BaseController
abstract class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
/** @var ParameterBag Parameters from the URI are stored here. */
protected $parameters;
protected const CONTENT_TYPE = 'application/vnd.api+json';
protected ParameterBag $parameters;
/**
* Controller constructor.
*
*/
public function __construct()
{
// get global parameters
$this->parameters = $this->getParameters();
}
$this->middleware(
function ($request, $next) {
if (auth()->check()) {
$language = app('steam')->getLanguage();
app()->setLocale($language);
}
/**
* Method to help build URI's.
*
* @return string
*
*/
protected function buildParams(): string
{
$return = '?';
$params = [];
foreach ($this->parameters as $key => $value) {
if ('page' === $key) {
continue;
return $next($request);
}
if ($value instanceof Carbon) {
$params[$key] = $value->format('Y-m-d');
continue;
}
$params[$key] = $value;
}
$return .= http_build_query($params);
);
return $return;
}
/**
* @return Manager
*/
protected function getManager(): Manager
{
// create some objects:
$manager = new Manager;
$baseUrl = request()->getSchemeAndHttpHost() . '/api/v1';
$manager->setSerializer(new JsonApiSerializer($baseUrl));
return $manager;
}
/**
@@ -104,7 +75,7 @@ class Controller extends BaseController
private function getParameters(): ParameterBag
{
$bag = new ParameterBag;
$page = (int) request()->get('page');
$page = (int)request()->get('page');
if (0 === $page) {
$page = 1;
}
@@ -131,11 +102,47 @@ class Controller extends BaseController
foreach ($integers as $integer) {
$value = request()->query->get($integer);
if (null !== $value) {
$bag->set($integer, (int) $value);
$bag->set($integer, (int)$value);
}
}
return $bag;
}
/**
* Method to help build URI's.
*
* @return string
*/
final protected function buildParams(): string
{
$return = '?';
$params = [];
foreach ($this->parameters as $key => $value) {
if ('page' === $key) {
continue;
}
if ($value instanceof Carbon) {
$params[$key] = $value->format('Y-m-d');
continue;
}
$params[$key] = $value;
}
return $return . http_build_query($params);
}
/**
* @return Manager
*/
final protected function getManager(): Manager
{
// create some objects:
$manager = new Manager;
$baseUrl = request()->getSchemeAndHttpHost() . '/api/v1';
$manager->setSerializer(new JsonApiSerializer($baseUrl));
return $manager;
}
}

View File

@@ -1,112 +0,0 @@
<?php
/**
* CurrencyExchangeRateController.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Services\Currency\ExchangeRateInterface;
use FireflyIII\Transformers\CurrencyExchangeRateTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use League\Fractal\Resource\Item;
/**
* Class CurrencyExchangeRateController
*
* @codeCoverageIgnore
*/
class CurrencyExchangeRateController extends Controller
{
/** @var CurrencyRepositoryInterface The currency repository */
private $repository;
/**
* CurrencyExchangeRateController constructor.
*
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $admin */
$admin = auth()->user();
$this->repository = app(CurrencyRepositoryInterface::class);
$this->repository->setUser($admin);
return $next($request);
}
);
}
/**
* Show an exchange rate.
*
* @param Request $request
*
* @throws FireflyException
* @return JsonResponse
*/
public function index(Request $request): JsonResponse
{
$manager = $this->getManager();
$fromCurrency = $this->repository->findByCodeNull($request->get('from') ?? 'EUR');
$toCurrency = $this->repository->findByCodeNull($request->get('to') ?? 'USD');
if (null === $fromCurrency) {
throw new FireflyException('200007: Unknown source currency');
}
if (null === $toCurrency) {
throw new FireflyException('200007: Unknown destination currency');
}
/** @var Carbon $dateObj */
$dateObj = Carbon::createFromFormat('Y-m-d', $request->get('date') ?? date('Y-m-d'));
$this->parameters->set('from', $fromCurrency->code);
$this->parameters->set('to', $toCurrency->code);
$this->parameters->set('date', $dateObj->format('Y-m-d'));
$this->parameters->set('amount', $request->get('amount'));
$rate = $this->repository->getExchangeRate($fromCurrency, $toCurrency, $dateObj);
if (null === $rate) {
/** @var User $admin */
$admin = auth()->user();
// create service:
/** @var ExchangeRateInterface $service */
$service = app(ExchangeRateInterface::class);
$service->setUser($admin);
$rate = $service->getRate($fromCurrency, $toCurrency, $dateObj);
}
/** @var CurrencyExchangeRateTransformer $transformer */
$transformer = app(CurrencyExchangeRateTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($rate, $transformer, 'currency_exchange_rates');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
}

View File

@@ -0,0 +1,71 @@
<?php
declare(strict_types=1);
/*
* AccountController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Controllers\Data\Bulk;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Data\Bulk\MoveTransactionsRequest;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Services\Internal\Destroy\AccountDestroyService;
use Illuminate\Http\JsonResponse;
/**
* Class AccountController
*/
class AccountController extends Controller
{
private AccountRepositoryInterface $repository;
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* @param MoveTransactionsRequest $request
*
* @return JsonResponse
*/
public function moveTransactions(MoveTransactionsRequest $request): JsonResponse
{
$accountIds = $request->getAll();
$original = $this->repository->findNull($accountIds['original_account']);
$destination = $this->repository->findNull($accountIds['destination_account']);
/** @var AccountDestroyService $service */
$service = app(AccountDestroyService::class);
$service->moveTransactions($original, $destination);
return response()->json([], 204);
}
}

View File

@@ -0,0 +1,281 @@
<?php
/*
* DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Data;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Data\DestroyRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
use FireflyIII\Repositories\RuleGroup\RuleGroupRepositoryInterface;
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use FireflyIII\Services\Internal\Destroy\AccountDestroyService;
use FireflyIII\Services\Internal\Destroy\JournalDestroyService;
use Illuminate\Http\JsonResponse;
/**
* Class DestroyController
*/
class DestroyController extends Controller
{
/**
* @param DestroyRequest $request
*
* @return JsonResponse
* @throws FireflyException
*/
public function destroy(DestroyRequest $request): JsonResponse
{
$objects = $request->getObjects();
switch ($objects) {
default:
throw new FireflyException(sprintf('This endpoint can\'t handle object "%s"', $objects));
case 'budgets':
$this->destroyBudgets();
break;
case 'bills':
$this->destroyBills();
break;
case 'piggy_banks':
$this->destroyPiggyBanks();
break;
case 'rules':
$this->destroyRules();
break;
case 'recurring':
$this->destroyRecurringTransactions();
break;
case 'categories':
$this->destroyCategories();
break;
case 'tags':
$this->destroyTags();
break;
case 'object_groups':
$this->destroyObjectGroups();
break;
case 'accounts':
$this->destroyAccounts(
[
AccountType::ASSET, AccountType::DEFAULT,
AccountType::BENEFICIARY, AccountType::EXPENSE,
AccountType::REVENUE, AccountType::INITIAL_BALANCE,
AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::CREDITCARD,
]
);
break;
case 'asset_accounts':
$this->destroyAccounts(
[
AccountType::ASSET, AccountType::DEFAULT,
]
);
break;
case 'expense_accounts':
$this->destroyAccounts(
[
AccountType::BENEFICIARY, AccountType::EXPENSE,
]
);
break;
case 'revenue_accounts':
$this->destroyAccounts(
[
AccountType::REVENUE,
]
);
break;
case 'liabilities':
$this->destroyAccounts(
[
AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::CREDITCARD,
]
);
break;
case 'transactions':
$this->destroyTransactions(
[
TransactionType::WITHDRAWAL,
TransactionType::DEPOSIT,
TransactionType::TRANSFER,
TransactionType::RECONCILIATION,
TransactionType::OPENING_BALANCE,
]
);
break;
case 'withdrawals':
$this->destroyTransactions(
[
TransactionType::WITHDRAWAL,
]
);
break;
case 'deposits':
$this->destroyTransactions(
[
TransactionType::DEPOSIT,
]
);
break;
case 'transfers':
$this->destroyTransactions(
[
TransactionType::TRANSFER,
]
);
break;
}
return response()->json([], 204);
}
/**
*
*/
private function destroyBudgets(): void
{
/** @var AvailableBudgetRepositoryInterface $abRepository */
$abRepository = app(AvailableBudgetRepositoryInterface::class);
$abRepository->destroyAll();
/** @var BudgetLimitRepositoryInterface $blRepository */
$blRepository = app(BudgetLimitRepositoryInterface::class);
$blRepository->destroyAll();
/** @var BudgetRepositoryInterface $budgetRepository */
$budgetRepository = app(BudgetRepositoryInterface::class);
$budgetRepository->destroyAll();
}
/**
*
*/
private function destroyBills(): void
{
/** @var BillRepositoryInterface $repository */
$repository = app(BillRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyPiggyBanks(): void
{
/** @var PiggyBankRepositoryInterface $repository */
$repository = app(PiggyBankRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyRules(): void
{
/** @var RuleGroupRepositoryInterface $repository */
$repository = app(RuleGroupRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyRecurringTransactions(): void
{
/** @var RecurringRepositoryInterface $repository */
$repository = app(RecurringRepositoryInterface::class);
$repository->destroyAll();
}
/**
*
*/
private function destroyCategories(): void
{
/** @var CategoryRepositoryInterface $categoryRepos */
$categoryRepos = app(CategoryRepositoryInterface::class);
$categoryRepos->destroyAll();
}
/**
*
*/
private function destroyTags(): void
{
/** @var TagRepositoryInterface $tagRepository */
$tagRepository = app(TagRepositoryInterface::class);
$tagRepository->destroyAll();
}
private function destroyObjectGroups(): void
{
/** @var ObjectGroupRepositoryInterface $repository */
$repository = app(ObjectGroupRepositoryInterface::class);
$repository->deleteAll();
}
/**
* @param array $types
*/
private function destroyAccounts(array $types): void
{
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class);
$collection = $repository->getAccountsByType($types);
$service = app(AccountDestroyService::class);
/** @var Account $account */
foreach ($collection as $account) {
$service->destroy($account, null);
}
}
/**
* @param array $types
*/
private function destroyTransactions(array $types): void
{
/** @var JournalRepositoryInterface $repository */
$repository = app(JournalRepositoryInterface::class);
$journals = $repository->findByType($types);
$service = app(JournalDestroyService::class);
/** @var TransactionJournal $journal */
foreach ($journals as $journal) {
$service->destroy($journal);
}
}
}

View File

@@ -0,0 +1,204 @@
<?php
declare(strict_types=1);
/*
* AccountController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Controllers\Data\Export;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Data\Export\ExportRequest;
use FireflyIII\Support\Export\ExportDataGenerator;
use Illuminate\Http\Response as LaravelResponse;
use League\Csv\CannotInsertRecord;
/**
* Class ExportController
*/
class ExportController extends Controller
{
private ExportDataGenerator $exporter;
/**
* ExportController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->exporter = app(ExportDataGenerator::class);
$this->exporter->setUser(auth()->user());
return $next($request);
}
);
}
/**
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws CannotInsertRecord
*/
public function accounts(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportAccounts(true);
return $this->returnExport('accounts');
}
/**
* @param string $key
*
* @return LaravelResponse
* @throws CannotInsertRecord
*/
private function returnExport(string $key): LaravelResponse
{
$date = date('Y-m-d-H-i-s');
$fileName = sprintf('%s-export-%s.csv', $date, $key);
$data = $this->exporter->export();
/** @var LaravelResponse $response */
$response = response($data[$key]);
$response
->header('Content-Description', 'File Transfer')
->header('Content-Type', 'application/octet-stream')
->header('Content-Disposition', 'attachment; filename=' . $fileName)
->header('Content-Transfer-Encoding', 'binary')
->header('Connection', 'Keep-Alive')
->header('Expires', '0')
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
->header('Pragma', 'public')
->header('Content-Length', (string)strlen($data[$key]));
return $response;
}
/**
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws CannotInsertRecord
*/
public function bills(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportBills(true);
return $this->returnExport('bills');
}
/**
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws CannotInsertRecord
*/
public function budgets(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportBudgets(true);
return $this->returnExport('budgets');
}
/**
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws CannotInsertRecord
*/
public function categories(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportCategories(true);
return $this->returnExport('categories');
}
/**
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws CannotInsertRecord
*/
public function piggyBanks(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportPiggies(true);
return $this->returnExport('piggies');
}
/**
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws CannotInsertRecord
*/
public function recurring(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportRecurring(true);
return $this->returnExport('recurrences');
}
/**
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws CannotInsertRecord
*/
public function rules(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportRules(true);
return $this->returnExport('rules');
}
/**
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws CannotInsertRecord
*/
public function tags(ExportRequest $request): LaravelResponse
{
$this->exporter->setExportTags(true);
return $this->returnExport('tags');
}
/**
* @param ExportRequest $request
*
* @return LaravelResponse
* @throws CannotInsertRecord
*/
public function transactions(ExportRequest $request): LaravelResponse
{
$params = $request->getAll();
$this->exporter->setStart($params['start']);
$this->exporter->setEnd($params['end']);
$this->exporter->setAccounts($params['accounts']);
$this->exporter->setExportTransactions(true);
return $this->returnExport('transactions');
}
}

View File

@@ -1,181 +0,0 @@
<?php
/**
* ImportController.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\ImportJob;
use FireflyIII\Repositories\ImportJob\ImportJobRepositoryInterface;
use FireflyIII\Support\Http\Api\TransactionFilter;
use FireflyIII\Transformers\ImportJobTransformer;
use FireflyIII\Transformers\TransactionGroupTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class ImportController
*
* @deprecated
* @codeCoverageIgnore
*/
class ImportController extends Controller
{
use TransactionFilter;
/** @var ImportJobRepositoryInterface Import job repository. */
private $repository;
/**
* ImportController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(ImportJobRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* @return JsonResponse
* @codeCoverageIgnore
*/
public function listAll(): JsonResponse
{
// create some objects:
$manager = $this->getManager();
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of accounts. Count it and split it.
$collection = $this->repository->get();
$count = $collection->count();
$importJobs = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($importJobs, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.import.list') . $this->buildParams());
/** @var ImportJobTransformer $transformer */
$transformer = app(ImportJobTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($importJobs, $transformer, 'import_jobs');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* @param ImportJob $importJob
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function show(ImportJob $importJob): JsonResponse
{
$manager = $this->getManager();
/** @var ImportJobTransformer $transformer */
$transformer = app(ImportJobTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($importJob, $transformer, 'import_jobs');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Show all transactions
*
* @param Request $request
* @param ImportJob $importJob
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function transactions(Request $request, ImportJob $importJob): JsonResponse
{
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$type = $request->get('type') ?? 'default';
$this->parameters->set('type', $type);
$types = $this->mapTransactionTypes($this->parameters->get('type'));
$manager = $this->getManager();
$tag = $importJob->tag;
$transactions = new Collection();
$paginator = new LengthAwarePaginator($transactions, 0, $pageSize);
$paginator->setPath(route('api.v1.import.transactions', [$importJob->key]) . $this->buildParams());
if (null !== $tag) {
/** @var User $admin */
$admin = auth()->user();
// use new group collector:
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$collector
->setUser($admin)
// filter on tag.
->setTag($tag)
// all info needed for the API:
->withAPIInformation()
// set page size:
->setLimit($pageSize)
// set page to retrieve
->setPage($this->parameters->get('page'))
// set types of transactions to return.
->setTypes($types);
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
}
$paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.transactions.index') . $this->buildParams());
$transactions = $paginator->getCollection();
}
/** @var TransactionGroupTransformer $transformer */
$transformer = app(TransactionGroupTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($transactions, $transformer, 'transactions');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
}

View File

@@ -0,0 +1,132 @@
<?php
/*
* DateController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Account\OperationsRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Support\Http\Api\ApiSupport;
use Illuminate\Http\JsonResponse;
/**
*
* Class AccountController
*
* Shows expense information grouped or limited by date.
* Ie. all expenses grouped by account + currency.
*/
class AccountController extends Controller
{
use ApiSupport;
private CurrencyRepositoryInterface $currencyRepository;
private OperationsRepositoryInterface $opsRepository;
private AccountRepositoryInterface $repository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$user = auth()->user();
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser($user);
$this->currencyRepository = app(CurrencyRepositoryInterface::class);
$this->currencyRepository->setUser($user);
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->opsRepository->setUser($user);
return $next($request);
}
);
}
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function asset(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$assetAccounts = $request->getAssetAccounts();
$expenses = $this->opsRepository->sumExpensesBySource($start, $end, $assetAccounts);
$result = [];
/** @var array $expense */
foreach ($expenses as $expense) {
$result[] = [
'id' => (string)$expense['id'],
'name' => $expense['name'],
'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'],
'currency_id' => (string)$expense['currency_id'],
'currency_code' => $expense['currency_code'],
];
}
return response()->json($result);
}
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function expense(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$assetAccounts = $request->getAssetAccounts();
$expenseAccounts = $request->getExpenseAccounts();
$expenses = $this->opsRepository->sumExpensesByDestination($start, $end, $assetAccounts, $expenseAccounts);
$result = [];
/** @var array $expense */
foreach ($expenses as $expense) {
$result[] = [
'id' => (string)$expense['id'],
'name' => $expense['name'],
'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'],
'currency_id' => (string)$expense['currency_id'],
'currency_code' => $expense['currency_code'],
];
}
return response()->json($result);
}
}

View File

@@ -0,0 +1,166 @@
<?php
declare(strict_types=1);
/*
* PeriodController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use Illuminate\Http\JsonResponse;
/**
* Class BillController
*/
class BillController extends Controller
{
private BillRepositoryInterface $repository;
/**
* BillController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$user = auth()->user();
$this->repository = app(BillRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* Expenses per bill, possibly filtered by bill and account.
*
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function bill(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$bills = $request->getBills();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// get all bills:
if (0 === $bills->count()) {
$bills = $this->repository->getBills();
}
// collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::WITHDRAWAL])->setRange($start, $end)->setSourceAccounts($accounts);
$collector->setBills($bills);
$genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) {
$billId = (int)$journal['bill_id'];
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
$key = sprintf('%d-%d', $billId, $currencyId);
$foreignKey = sprintf('%d-%d', $billId, $foreignCurrencyId);
if (0 !== $currencyId) {
$response[$key] = $response[$key] ?? [
'id' => (string)$billId,
'name' => $journal['bill_name'],
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$key]['difference'] = bcadd($response[$key]['difference'], $journal['amount']);
$response[$key]['difference_float'] = (float)$response[$key]['difference'];
}
if (0 !== $foreignCurrencyId) {
$response[$foreignKey] = $response[$foreignKey] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignKey]['difference'] = bcadd($response[$foreignKey]['difference'], $journal['foreign_amount']);
$response[$foreignKey]['difference_float'] = (float)$response[$foreignKey]['difference'];
}
}
return response()->json(array_values($response));
}
/**
* Expenses for no bill filtered by account.
*
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function noBill(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::WITHDRAWAL])->setRange($start, $end)->setSourceAccounts($accounts);
$collector->withoutBill();
$genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
if (0 !== $currencyId) {
$response[$currencyId] = $response[$currencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']);
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference'];
}
if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] = $response[$foreignCurrencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']);
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference'];
}
}
return response()->json(array_values($response));
}
}

View File

@@ -0,0 +1,127 @@
<?php
/*
* BudgetController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Budget\NoBudgetRepositoryInterface;
use FireflyIII\Repositories\Budget\OperationsRepositoryInterface;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
/**
* Class BudgetController
*/
class BudgetController extends Controller
{
private NoBudgetRepositoryInterface $noRepository;
private OperationsRepositoryInterface $opsRepository;
private BudgetRepositoryInterface $repository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->repository = app(BudgetRepositoryInterface::class);
$this->noRepository = app(NoBudgetRepositoryInterface::class);
$user = auth()->user();
$this->opsRepository->setUser($user);
$this->repository->setUser($user);
$this->noRepository->setUser($user);
return $next($request);
}
);
}
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function budget(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$budgets = $request->getBudgets();
$assetAccounts = $request->getAssetAccounts();
$result = [];
if (0 === $budgets->count()) {
$budgets = $this->repository->getActiveBudgets();
}
/** @var Budget $budget */
foreach ($budgets as $budget) {
$expenses = $this->opsRepository->sumExpenses($start, $end, $assetAccounts, new Collection([$budget]), null);
/** @var array $expense */
foreach ($expenses as $expense) {
$result[] = [
'id' => (string)$budget->id,
'name' => $budget->name,
'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'],
'currency_id' => (string)$expense['currency_id'],
'currency_code' => $expense['currency_code'],
];
}
}
return response()->json($result);
}
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function noBudget(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$assetAccounts = $request->getAssetAccounts();
$result = [];
$expenses = $this->noRepository->sumExpenses($start, $end, $assetAccounts, null);
/** @var array $expense */
foreach ($expenses as $expense) {
$result[] = [
'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'],
'currency_id' => (string)$expense['currency_id'],
'currency_code' => $expense['currency_code'],
];
}
return response()->json($result);
}
}

View File

@@ -0,0 +1,127 @@
<?php
/*
* CategoryController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Repositories\Category\NoCategoryRepositoryInterface;
use FireflyIII\Repositories\Category\OperationsRepositoryInterface;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
/**
* Class CategoryController
*/
class CategoryController extends Controller
{
private NoCategoryRepositoryInterface $noRepository;
private OperationsRepositoryInterface $opsRepository;
private CategoryRepositoryInterface $repository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->repository = app(CategoryRepositoryInterface::class);
$this->noRepository = app(NoCategoryRepositoryInterface::class);
$user = auth()->user();
$this->opsRepository->setUser($user);
$this->repository->setUser($user);
$this->noRepository->setUser($user);
return $next($request);
}
);
}
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function category(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$categories = $request->getCategories();
$assetAccounts = $request->getAssetAccounts();
$result = [];
if (0 === $categories->count()) {
$categories = $this->repository->getCategories();
}
/** @var Category $category */
foreach ($categories as $category) {
$expenses = $this->opsRepository->sumExpenses($start, $end, $assetAccounts, new Collection([$category]));
/** @var array $expense */
foreach ($expenses as $expense) {
$result[] = [
'id' => (string)$category->id,
'name' => $category->name,
'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'],
'currency_id' => (string)$expense['currency_id'],
'currency_code' => $expense['currency_code'],
];
}
}
return response()->json($result);
}
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function noCategory(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$assetAccounts = $request->getAssetAccounts();
$result = [];
$expenses = $this->noRepository->sumExpenses($start, $end, $assetAccounts);
/** @var array $expense */
foreach ($expenses as $expense) {
$result[] = [
'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'],
'currency_id' => (string)$expense['currency_id'],
'currency_code' => $expense['currency_code'],
];
}
return response()->json($result);
}
}

View File

@@ -0,0 +1,83 @@
<?php
/*
* PeriodController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use Illuminate\Http\JsonResponse;
/**
* Class PeriodController
*/
class PeriodController extends Controller
{
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function total(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// collect all expenses in this period (regardless of type)
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::WITHDRAWAL])->setRange($start, $end)->setSourceAccounts($accounts);
$genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
if (0 !== $currencyId) {
$response[$currencyId] = $response[$currencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']);
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference'];
}
if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] = $response[$foreignCurrencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']);
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference'];
}
}
return response()->json(array_values($response));
}
}

View File

@@ -0,0 +1,172 @@
<?php
declare(strict_types=1);
/*
* PeriodController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Http\JsonResponse;
/**
* Class TagController
*/
class TagController extends Controller
{
private TagRepositoryInterface $repository;
/**
* TagController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(TagRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Expenses for no tag filtered by account.
*
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function noTag(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::WITHDRAWAL])->setRange($start, $end)->setSourceAccounts($accounts);
$collector->withoutTags();
$genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
if (0 !== $currencyId) {
$response[$currencyId] = $response[$currencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']);
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference'];
}
if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] = $response[$foreignCurrencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']);
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference'];
}
}
return response()->json(array_values($response));
}
/**
* Expenses per tag, possibly filtered by tag and account.
*
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function tag(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$tags = $request->getTags();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// get all tags:
if (0 === $tags->count()) {
$tags = $this->repository->get();
}
// collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::WITHDRAWAL])->setRange($start, $end)->setSourceAccounts($accounts);
$collector->setTags($tags);
$genericSet = $collector->getExtractedJournals();
/** @var array $journal */
foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
/** @var array $tag */
foreach ($journal['tags'] as $tag) {
$tagId = $tag['id'];
$key = sprintf('%d-%d', $tagId, $currencyId);
$foreignKey = sprintf('%d-%d', $tagId, $foreignCurrencyId);
// on currency ID
if (0 !== $currencyId) {
$response[$key] = $response[$key] ?? [
'id' => (string)$tagId,
'name' => $tag['name'],
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$key]['difference'] = bcadd($response[$key]['difference'], $journal['amount']);
$response[$key]['difference_float'] = (float)$response[$key]['difference'];
}
// on foreign ID
if (0 !== $foreignCurrencyId) {
$response[$foreignKey] = $journal[$foreignKey] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignKey]['difference'] = bcadd($response[$foreignKey]['difference'], $journal['foreign_amount']);
$response[$foreignKey]['difference_float'] = (float)$response[$foreignKey]['difference'];
}
}
}
return response()->json(array_values($response));
}
}

View File

@@ -0,0 +1,136 @@
<?php
/*
* DateController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Income;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Account\OperationsRepositoryInterface;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use FireflyIII\Support\Http\Api\ApiSupport;
use Illuminate\Http\JsonResponse;
/**
*
* Class AccountController
*
* Shows income information grouped or limited by date.
* Ie. all income grouped by account + currency.
* TODO same code as Expense/AccountController.
*/
class AccountController extends Controller
{
use ApiSupport;
private CurrencyRepositoryInterface $currencyRepository;
private OperationsRepositoryInterface $opsRepository;
private AccountRepositoryInterface $repository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$user = auth()->user();
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser($user);
$this->currencyRepository = app(CurrencyRepositoryInterface::class);
$this->currencyRepository->setUser($user);
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->opsRepository->setUser($user);
return $next($request);
}
);
}
/**
* TODO same code as Expense/AccountController.
* TODO does not actually include the name of the expense account.
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function asset(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$assetAccounts = $request->getAssetAccounts();
$income = $this->opsRepository->sumIncomeByDestination($start, $end, $assetAccounts);
$result = [];
/** @var array $entry */
foreach ($income as $entry) {
$result[] = [
'id' => (string)$entry['id'],
'name' => $entry['name'],
'difference' => $entry['sum'],
'difference_float' => (float)$entry['sum'],
'currency_id' => (string)$entry['currency_id'],
'currency_code' => $entry['currency_code'],
];
}
return response()->json($result);
}
/**
* TODO does not actually include the name of the expense account.
*
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function revenue(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$assetAccounts = $request->getAssetAccounts();
$revenueAccounts = $request->getRevenueAccounts();
$income = $this->opsRepository->sumIncomeBySource($start, $end, $assetAccounts, $revenueAccounts);
$result = [];
/** @var array $entry */
foreach ($income as $entry) {
$result[] = [
'id' => (string)$entry['id'],
'name' => $entry['name'],
'difference' => $entry['sum'],
'difference_float' => (float)$entry['sum'],
'currency_id' => (string)$entry['currency_id'],
'currency_code' => $entry['currency_code'],
];
}
return response()->json($result);
}
}

View File

@@ -0,0 +1,128 @@
<?php
/*
* CategoryController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Income;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Repositories\Category\NoCategoryRepositoryInterface;
use FireflyIII\Repositories\Category\OperationsRepositoryInterface;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
/**
* Class CategoryController
* TODO same as opposing category controller
*/
class CategoryController extends Controller
{
private NoCategoryRepositoryInterface $noRepository;
private OperationsRepositoryInterface $opsRepository;
private CategoryRepositoryInterface $repository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->repository = app(CategoryRepositoryInterface::class);
$this->noRepository = app(NoCategoryRepositoryInterface::class);
$user = auth()->user();
$this->opsRepository->setUser($user);
$this->repository->setUser($user);
$this->noRepository->setUser($user);
return $next($request);
}
);
}
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function category(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$categories = $request->getCategories();
$assetAccounts = $request->getAssetAccounts();
$result = [];
if (0 === $categories->count()) {
$categories = $this->repository->getCategories();
}
/** @var Category $category */
foreach ($categories as $category) {
$expenses = $this->opsRepository->sumIncome($start, $end, $assetAccounts, new Collection([$category]));
/** @var array $expense */
foreach ($expenses as $expense) {
$result[] = [
'id' => (string)$category->id,
'name' => $category->name,
'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'],
'currency_id' => (string)$expense['currency_id'],
'currency_code' => $expense['currency_code'],
];
}
}
return response()->json($result);
}
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function noCategory(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$assetAccounts = $request->getAssetAccounts();
$result = [];
$expenses = $this->noRepository->sumIncome($start, $end, $assetAccounts);
/** @var array $expense */
foreach ($expenses as $expense) {
$result[] = [
'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'],
'currency_id' => (string)$expense['currency_id'],
'currency_code' => $expense['currency_code'],
];
}
return response()->json($result);
}
}

View File

@@ -0,0 +1,85 @@
<?php
/*
* PeriodController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Income;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use Illuminate\Http\JsonResponse;
/**
* Class PeriodController
*/
class PeriodController extends Controller
{
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function total(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// collect all expenses in this period (regardless of type)
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::DEPOSIT])->setRange($start, $end)->setDestinationAccounts($accounts);
$genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
if (0 !== $currencyId) {
$response[$currencyId] = $response[$currencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount']));
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference'];
}
if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] = $response[$foreignCurrencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignCurrencyId]['difference'] = bcadd(
$response[$foreignCurrencyId]['difference'], app('steam')->positive($journal['foreign_amount'])
);
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference'];
}
}
return response()->json(array_values($response));
}
}

View File

@@ -0,0 +1,177 @@
<?php
declare(strict_types=1);
/*
* PeriodController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Controllers\Insight\Income;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Http\JsonResponse;
/**
* Class TagController
*/
class TagController extends Controller
{
private TagRepositoryInterface $repository;
/**
* TagController constructor.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$user = auth()->user();
$this->repository = app(TagRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* Expenses for no tag filtered by account.
*
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function noTag(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::DEPOSIT])->setRange($start, $end)->setDestinationAccounts($accounts);
$collector->withoutTags();
$genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
if (0 !== $currencyId) {
$response[$currencyId] = $response[$currencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount']));
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference'];
}
if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] = $response[$foreignCurrencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignCurrencyId]['difference'] = bcadd(
$response[$foreignCurrencyId]['difference'], app('steam')->positive($journal['foreign_amount'])
);
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference'];
}
}
return response()->json(array_values($response));
}
/**
* Expenses per tag, possibly filtered by tag and account.
*
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function tag(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$tags = $request->getTags();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// get all tags:
if (0 === $tags->count()) {
$tags = $this->repository->get();
}
// collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::DEPOSIT])->setRange($start, $end)->setDestinationAccounts($accounts);
$collector->setTags($tags);
$genericSet = $collector->getExtractedJournals();
/** @var array $journal */
foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
/** @var array $tag */
foreach ($journal['tags'] as $tag) {
$tagId = $tag['id'];
$key = sprintf('%d-%d', $tagId, $currencyId);
$foreignKey = sprintf('%d-%d', $tagId, $foreignCurrencyId);
// on currency ID
if (0 !== $currencyId) {
$response[$key] = $response[$key] ?? [
'id' => (string)$tagId,
'name' => $tag['name'],
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$key]['difference'] = bcadd($response[$key]['difference'], app('steam')->positive($journal['amount']));
$response[$key]['difference_float'] = (float)$response[$key]['difference'];
}
// on foreign ID
if (0 !== $foreignCurrencyId) {
$response[$foreignKey] = $journal[$foreignKey] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignKey]['difference'] = bcadd(
$response[$foreignKey]['difference'], app('steam')->positive($journal['foreign_amount'])
);
$response[$foreignKey]['difference_float'] = (float)$response[$foreignKey]['difference'];
}
}
}
return response()->json(array_values($response));
}
}

View File

@@ -0,0 +1,76 @@
<?php
/*
* AccountController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Transfer;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Repositories\Account\OperationsRepositoryInterface;
use FireflyIII\Support\Http\Api\ApiSupport;
use Illuminate\Http\JsonResponse;
/**
* Class AccountController
*/
class AccountController extends Controller
{
use ApiSupport;
private OperationsRepositoryInterface $opsRepository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$user = auth()->user();
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->opsRepository->setUser($user);
return $next($request);
}
);
}
/**
* TODO same code as Expense/AccountController.
* TODO does not actually include the name of the expense account.
*
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function asset(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$assetAccounts = $request->getAssetAccounts();
$transfers = $this->opsRepository->sumTransfers($start, $end, $assetAccounts);
return response()->json($transfers);
}
}

View File

@@ -0,0 +1,126 @@
<?php
/*
* CategoryController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Transfer;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Repositories\Category\NoCategoryRepositoryInterface;
use FireflyIII\Repositories\Category\OperationsRepositoryInterface;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Collection;
/**
* Class CategoryController
*/
class CategoryController extends Controller
{
private NoCategoryRepositoryInterface $noRepository;
private OperationsRepositoryInterface $opsRepository;
private CategoryRepositoryInterface $repository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->opsRepository = app(OperationsRepositoryInterface::class);
$this->repository = app(CategoryRepositoryInterface::class);
$this->noRepository = app(NoCategoryRepositoryInterface::class);
$user = auth()->user();
$this->opsRepository->setUser($user);
$this->repository->setUser($user);
$this->noRepository->setUser($user);
return $next($request);
}
);
}
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function category(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$categories = $request->getCategories();
$assetAccounts = $request->getAssetAccounts();
$result = [];
if (0 === $categories->count()) {
$categories = $this->repository->getCategories();
}
/** @var Category $category */
foreach ($categories as $category) {
$expenses = $this->opsRepository->sumTransfers($start, $end, $assetAccounts, new Collection([$category]));
/** @var array $expense */
foreach ($expenses as $expense) {
$result[] = [
'id' => (string)$category->id,
'name' => $category->name,
'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'],
'currency_id' => (string)$expense['currency_id'],
'currency_code' => $expense['currency_code'],
];
}
}
return response()->json($result);
}
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function noCategory(GenericRequest $request): JsonResponse
{
$start = $request->getStart();
$end = $request->getEnd();
$assetAccounts = $request->getAssetAccounts();
$result = [];
$expenses = $this->noRepository->sumTransfers($start, $end, $assetAccounts);
/** @var array $expense */
foreach ($expenses as $expense) {
$result[] = [
'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'],
'currency_id' => (string)$expense['currency_id'],
'currency_code' => $expense['currency_code'],
];
}
return response()->json($result);
}
}

View File

@@ -0,0 +1,85 @@
<?php
/*
* PeriodController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Transfer;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use Illuminate\Http\JsonResponse;
/**
* Class PeriodController
*/
class PeriodController extends Controller
{
/**
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function total(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// collect all expenses in this period (regardless of type)
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::TRANSFER])->setRange($start, $end)->setDestinationAccounts($accounts);
$genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
if (0 !== $currencyId) {
$response[$currencyId] = $response[$currencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount']));
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference'];
}
if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] = $response[$foreignCurrencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignCurrencyId]['difference'] = bcadd(
$response[$foreignCurrencyId]['difference'], app('steam')->positive($journal['foreign_amount'])
);
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference'];
}
}
return response()->json(array_values($response));
}
}

View File

@@ -0,0 +1,178 @@
<?php
/*
* TagController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Insight\Transfer;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Http\JsonResponse;
/**
* Class TagController
*/
class TagController extends Controller
{
private TagRepositoryInterface $repository;
/**
* TagController constructor.
* TODO lots of copying and pasting here.
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$user = auth()->user();
$this->repository = app(TagRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* Expenses for no tag filtered by account.
*
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function noTag(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::TRANSFER])->setRange($start, $end)->setDestinationAccounts($accounts);
$collector->withoutTags();
$genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
if (0 !== $currencyId) {
$response[$currencyId] = $response[$currencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount']));
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference'];
}
if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] = $response[$foreignCurrencyId] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignCurrencyId]['difference'] = bcadd(
$response[$foreignCurrencyId]['difference'], app('steam')->positive($journal['foreign_amount'])
);
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference'];
}
}
return response()->json(array_values($response));
}
/**
* Transfers per tag, possibly filtered by tag and account.
*
* @param GenericRequest $request
*
* @return JsonResponse
*/
public function tag(GenericRequest $request): JsonResponse
{
$accounts = $request->getAssetAccounts();
$tags = $request->getTags();
$start = $request->getStart();
$end = $request->getEnd();
$response = [];
// get all tags:
if (0 === $tags->count()) {
$tags = $this->repository->get();
}
// collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::TRANSFER])->setRange($start, $end)->setDestinationAccounts($accounts);
$collector->setTags($tags);
$genericSet = $collector->getExtractedJournals();
/** @var array $journal */
foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id'];
/** @var array $tag */
foreach ($journal['tags'] as $tag) {
$tagId = $tag['id'];
$key = sprintf('%d-%d', $tagId, $currencyId);
$foreignKey = sprintf('%d-%d', $tagId, $foreignCurrencyId);
// on currency ID
if (0 !== $currencyId) {
$response[$key] = $response[$key] ?? [
'id' => (string)$tagId,
'name' => $tag['name'],
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$currencyId,
'currency_code' => $journal['currency_code'],
];
$response[$key]['difference'] = bcadd($response[$key]['difference'], app('steam')->positive($journal['amount']));
$response[$key]['difference_float'] = (float)$response[$key]['difference'];
}
// on foreign ID
if (0 !== $foreignCurrencyId) {
$response[$foreignKey] = $journal[$foreignKey] ?? [
'difference' => '0',
'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'],
];
$response[$foreignKey]['difference'] = bcadd(
$response[$foreignKey]['difference'], app('steam')->positive($journal['foreign_amount'])
);
$response[$foreignKey]['difference_float'] = (float)$response[$foreignKey]['difference'];
}
}
}
return response()->json(array_values($response));
}
}

View File

@@ -1,272 +0,0 @@
<?php
/**
* LinkTypeController.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
use FireflyIII\Api\V1\Requests\LinkTypeRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\LinkType;
use FireflyIII\Repositories\LinkType\LinkTypeRepositoryInterface;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\Support\Http\Api\TransactionFilter;
use FireflyIII\Transformers\LinkTypeTransformer;
use FireflyIII\Transformers\TransactionGroupTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class LinkTypeController.
*
*/
class LinkTypeController extends Controller
{
use TransactionFilter;
/** @var LinkTypeRepositoryInterface The link type repository */
private $repository;
/** @var UserRepositoryInterface The user repository */
private $userRepository;
/**
* LinkTypeController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(LinkTypeRepositoryInterface::class);
$this->userRepository = app(UserRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* Delete the resource.
*
* @param LinkType $linkType
*
* @throws FireflyException
* @codeCoverageIgnore
* @return JsonResponse
*/
public function delete(LinkType $linkType): JsonResponse
{
if (false === $linkType->editable) {
throw new FireflyException('200020: Link type cannot be changed.');
}
$this->repository->destroy($linkType);
return response()->json([], 204);
}
/**
* List all of them.
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function index(): JsonResponse
{
// create some objects:
$manager = $this->getManager();
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of accounts. Count it and split it.
$collection = $this->repository->get();
$count = $collection->count();
$linkTypes = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($linkTypes, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.link_types.index') . $this->buildParams());
/** @var LinkTypeTransformer $transformer */
$transformer = app(LinkTypeTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($linkTypes, $transformer, 'link_types');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* List single resource.
*
* @param LinkType $linkType
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function show(LinkType $linkType): JsonResponse
{
$manager = $this->getManager();
/** @var LinkTypeTransformer $transformer */
$transformer = app(LinkTypeTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($linkType, $transformer, 'link_types');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Store new object.
*
* @param LinkTypeRequest $request
*
* @throws FireflyException
* @return JsonResponse
*/
public function store(LinkTypeRequest $request): JsonResponse
{
/** @var User $admin */
$admin = auth()->user();
if (!$this->userRepository->hasRole($admin, 'owner')) {
throw new FireflyException('200005: You need the "owner" role to do this.'); // @codeCoverageIgnore
}
$data = $request->getAll();
// if currency ID is 0, find the currency by the code:
$linkType = $this->repository->store($data);
$manager = $this->getManager();
/** @var LinkTypeTransformer $transformer */
$transformer = app(LinkTypeTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($linkType, $transformer, 'link_types');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Delete the resource.
*
* @param Request $request
* @param LinkType $linkType
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function transactions(Request $request, LinkType $linkType): JsonResponse
{
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$type = $request->get('type') ?? 'default';
$this->parameters->set('type', $type);
$types = $this->mapTransactionTypes($this->parameters->get('type'));
$manager = $this->getManager();
// whatever is returned by the query, it must be part of these journals:
$journalIds = $this->repository->getJournalIds($linkType);
/** @var User $admin */
$admin = auth()->user();
// use new group collector:
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$collector
->setUser($admin)
// filter on journal IDs.
->setJournalIds($journalIds)
// all info needed for the API:
->withAPIInformation()
// set page size:
->setLimit($pageSize)
// set page to retrieve
->setPage($this->parameters->get('page'))
// set types of transactions to return.
->setTypes($types);
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
}
$paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.transactions.index') . $this->buildParams());
$transactions = $paginator->getCollection();
/** @var TransactionGroupTransformer $transformer */
$transformer = app(TransactionGroupTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($transactions, $transformer, 'transactions');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Update object.
*
* @param LinkTypeRequest $request
* @param LinkType $linkType
*
* @throws FireflyException
* @return JsonResponse
*/
public function update(LinkTypeRequest $request, LinkType $linkType): JsonResponse
{
if (false === $linkType->editable) {
throw new FireflyException('200020: Link type cannot be changed.');
}
/** @var User $admin */
$admin = auth()->user();
if (!$this->userRepository->hasRole($admin, 'owner')) {
throw new FireflyException('200005: You need the "owner" role to do this.'); // @codeCoverageIgnore
}
$data = $request->getAll();
$this->repository->update($linkType, $data);
$manager = $this->getManager();
/** @var LinkTypeTransformer $transformer */
$transformer = app(LinkTypeTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($linkType, $transformer, 'link_types');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
}

View File

@@ -0,0 +1,72 @@
<?php
/**
* AccountController.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Account;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Illuminate\Http\JsonResponse;
/**
* Class DestroyController
*/
class DestroyController extends Controller
{
public const RESOURCE_KEY = 'accounts';
private AccountRepositoryInterface $repository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @param Account $account
*
* @codeCoverageIgnore
* @return JsonResponse
*/
public function destroy(Account $account): JsonResponse
{
$this->repository->destroy($account, null);
return response()->json([], 204);
}
}

View File

@@ -21,16 +21,13 @@
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
namespace FireflyIII\Api\V1\Controllers\Models\Account;
use FireflyIII\Api\V1\Requests\AccountStoreRequest;
use FireflyIII\Api\V1\Requests\AccountUpdateRequest;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Http\Api\AccountFilter;
use FireflyIII\Support\Http\Api\TransactionFilter;
use FireflyIII\Transformers\AccountTransformer;
use FireflyIII\Transformers\AttachmentTransformer;
use FireflyIII\Transformers\PiggyBankTransformer;
use FireflyIII\Transformers\TransactionGroupTransformer;
@@ -41,17 +38,17 @@ use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class AccountController.
*
* Class ListController
*/
class AccountController extends Controller
class ListController extends Controller
{
use AccountFilter, TransactionFilter;
/** @var AccountRepositoryInterface The account repository */
private $repository;
use TransactionFilter;
public const RESOURCE_KEY = 'accounts';
private AccountRepositoryInterface $repository;
/**
* AccountController constructor.
@@ -63,11 +60,8 @@ class AccountController extends Controller
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
// @var AccountRepositoryInterface repository
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser($user);
$this->repository->setUser(auth()->user());
return $next($request);
}
@@ -83,7 +77,7 @@ class AccountController extends Controller
public function attachments(Account $account): JsonResponse
{
$manager = $this->getManager();
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$collection = $this->repository->getAttachments($account);
$count = $collection->count();
@@ -100,63 +94,9 @@ class AccountController extends Controller
$resource = new FractalCollection($attachments, $transformer, 'attachments');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Remove the specified resource from storage.
*
* @param Account $account
*
* @codeCoverageIgnore
* @return JsonResponse
*/
public function delete(Account $account): JsonResponse
{
$this->repository->destroy($account, null);
return response()->json([], 204);
}
/**
* Display a listing of the resource.
*
* @param Request $request
*
* @codeCoverageIgnore
* @return JsonResponse
*/
public function index(Request $request): JsonResponse
{
$manager = $this->getManager();
$type = $request->get('type') ?? 'all';
$this->parameters->set('type', $type);
// types to get, page size:
$types = $this->mapAccountTypes($this->parameters->get('type'));
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of accounts. Count it and split it.
$collection = $this->repository->getAccountsByType($types);
$count = $collection->count();
$accounts = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($accounts, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.accounts.index') . $this->buildParams());
/** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($accounts, $transformer, 'accounts');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* List all piggies.
*
@@ -164,7 +104,6 @@ class AccountController extends Controller
*
* @return JsonResponse
* @codeCoverageIgnore
*
*/
public function piggyBanks(Account $account): JsonResponse
{
@@ -172,7 +111,7 @@ class AccountController extends Controller
$manager = $this->getManager();
// types to get, page size:
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of budgets. Count it and split it.
$collection = $this->repository->getPiggyBanks($account);
@@ -190,51 +129,10 @@ class AccountController extends Controller
$resource = new FractalCollection($piggyBanks, $transformer, 'piggy_banks');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Show single instance.
*
* @param Account $account
*
* @return JsonResponse
*/
public function show(Account $account): JsonResponse
{
$manager = $this->getManager();
/** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($account, $transformer, 'accounts');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Store a new instance.
*
* @param AccountStoreRequest $request
*
* @return JsonResponse
*/
public function store(AccountStoreRequest $request): JsonResponse
{
$data = $request->getAllAccountData();
$account = $this->repository->store($data);
$manager = $this->getManager();
/** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($account, $transformer, 'accounts');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Show all transaction groups related to the account.
*
@@ -244,11 +142,10 @@ class AccountController extends Controller
* @param Account $account
*
* @return JsonResponse
*
*/
public function transactions(Request $request, Account $account): JsonResponse
{
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$type = $request->get('type') ?? 'default';
$this->parameters->set('type', $type);
@@ -283,29 +180,6 @@ class AccountController extends Controller
$resource = new FractalCollection($groups, $transformer, 'transactions');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Update account.
*
* @param AccountUpdateRequest $request
* @param Account $account
*
* @return JsonResponse
*/
public function update(AccountUpdateRequest $request, Account $account): JsonResponse
{
$data = $request->getUpdateData();
$data['type'] = config('firefly.shortNamesByFullName.' . $account->accountType->type);
$this->repository->update($account, $data);
$manager = $this->getManager();
/** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($account, $transformer, 'accounts');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,127 @@
<?php
/*
* ShowController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Account;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Http\Api\AccountFilter;
use FireflyIII\Transformers\AccountTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class ShowController
*/
class ShowController extends Controller
{
use AccountFilter;
public const RESOURCE_KEY = 'accounts';
private AccountRepositoryInterface $repository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Display a listing of the resource.
*
* @param Request $request
*
* @codeCoverageIgnore
* @return JsonResponse
*/
public function index(Request $request): JsonResponse
{
$manager = $this->getManager();
$type = $request->get('type') ?? 'all';
$this->parameters->set('type', $type);
// types to get, page size:
$types = $this->mapAccountTypes($this->parameters->get('type'));
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of accounts. Count it and split it.
$this->repository->resetAccountOrder();
$collection = $this->repository->getAccountsByType($types);
$count = $collection->count();
$accounts = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($accounts, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.accounts.index') . $this->buildParams());
/** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($accounts, $transformer, self::RESOURCE_KEY);
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Show single instance.
*
* @param Account $account
*
* @return JsonResponse
*/
public function show(Account $account): JsonResponse
{
// get list of accounts. Count it and split it.
$this->repository->resetAccountOrder();
$account->refresh();
$manager = $this->getManager();
/** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($account, $transformer, self::RESOURCE_KEY);
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,83 @@
<?php
/**
* AccountController.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Account;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\Account\StoreRequest;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Transformers\AccountTransformer;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class StoreController
*/
class StoreController extends Controller
{
public const RESOURCE_KEY = 'accounts';
private AccountRepositoryInterface $repository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Store a new instance.
*
* @param StoreRequest $request
*
* @return JsonResponse
*/
public function store(StoreRequest $request): JsonResponse
{
$data = $request->getAllAccountData();
$this->repository->resetAccountOrder();
$account = $this->repository->store($data);
$manager = $this->getManager();
/** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($account, $transformer, self::RESOURCE_KEY);
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,86 @@
<?php
/**
* AccountController.php
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Account;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\Account\UpdateRequest;
use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Transformers\AccountTransformer;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
use Log;
/**
* Class UpdateController
*/
class UpdateController extends Controller
{
public const RESOURCE_KEY = 'accounts';
private AccountRepositoryInterface $repository;
/**
* AccountController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(AccountRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Update account.
*
* @param UpdateRequest $request
* @param Account $account
*
* @return JsonResponse
*/
public function update(UpdateRequest $request, Account $account): JsonResponse
{
Log::debug(sprintf('Now in %s', __METHOD__));
$data = $request->getUpdateData();
$data['type'] = config('firefly.shortNamesByFullName.' . $account->accountType->type);
$account = $this->repository->update($account, $data);
$manager = $this->getManager();
$account->refresh();
/** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($account, $transformer, self::RESOURCE_KEY);
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,76 @@
<?php
/*
* DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Attachment;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Middleware\ApiDemoUser;
use FireflyIII\Models\Attachment;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class DestroyController
*/
class DestroyController extends Controller
{
private AttachmentRepositoryInterface $repository;
/**
* DestroyController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(ApiDemoUser::class)->except(['delete', 'download', 'show', 'index']);
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(AttachmentRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @codeCoverageIgnore
*
* @param Attachment $attachment
*
* @return JsonResponse
*/
public function destroy(Attachment $attachment): JsonResponse
{
$this->repository->destroy($attachment);
return response()->json([], 204);
}
}

View File

@@ -1,7 +1,7 @@
<?php
/**
* AttachmentController.php
* Copyright (c) 2019 james@firefly-iii.org
/*
* ShowController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@@ -21,39 +21,31 @@
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
namespace FireflyIII\Api\V1\Controllers\Models\Attachment;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Middleware\ApiDemoUser;
use FireflyIII\Api\V1\Requests\AttachmentStoreRequest;
use FireflyIII\Api\V1\Requests\AttachmentUpdateRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Http\Middleware\IsDemoUser;
use FireflyIII\Models\Attachment;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use FireflyIII\Transformers\AttachmentTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response as LaravelResponse;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
use Log;
use function strlen;
/**
* Class AttachmentController.
*
* Class ShowController
*/
class AttachmentController extends Controller
class ShowController extends Controller
{
/** @var AttachmentRepositoryInterface The attachment repository */
private $repository;
private AttachmentRepositoryInterface $repository;
/**
* AccountController constructor.
* ShowController constructor.
*
* @codeCoverageIgnore
*/
@@ -68,36 +60,19 @@ class AttachmentController extends Controller
$this->repository = app(AttachmentRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @codeCoverageIgnore
*
* @param Attachment $attachment
*
* @return JsonResponse
*/
public function delete(Attachment $attachment): JsonResponse
{
$this->repository->destroy($attachment);
return response()->json([], 204);
}
/**
* Download an attachment.
*
* @param Attachment $attachment
*
* @codeCoverageIgnore
* @throws FireflyException
* @return LaravelResponse
* @throws FireflyException
*/
public function download(Attachment $attachment): LaravelResponse
{
@@ -125,7 +100,7 @@ class AttachmentController extends Controller
->header('Expires', '0')
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
->header('Pragma', 'public')
->header('Content-Length', strlen($content));
->header('Content-Length', (string)strlen($content));
return $response;
}
@@ -143,9 +118,9 @@ class AttachmentController extends Controller
$manager = $this->getManager();
// types to get, page size:
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of accounts. Count it and split it.
// get list of attachments. Count it and split it.
$collection = $this->repository->get();
$count = $collection->count();
$attachments = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
@@ -161,7 +136,7 @@ class AttachmentController extends Controller
$resource = new FractalCollection($attachments, $transformer, 'attachments');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
@@ -180,78 +155,6 @@ class AttachmentController extends Controller
$resource = new Item($attachment, $transformer, 'attachments');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Store a newly created resource in storage.
*
* @param AttachmentStoreRequest $request
*
* @throws FireflyException
* @return JsonResponse
*/
public function store(AttachmentStoreRequest $request): JsonResponse
{
$data = $request->getAll();
$attachment = $this->repository->store($data);
$manager = $this->getManager();
/** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($attachment, $transformer, 'attachments');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Update the specified resource in storage.
*
* @param AttachmentUpdateRequest $request
* @param Attachment $attachment
*
* @return JsonResponse
*/
public function update(AttachmentUpdateRequest $request, Attachment $attachment): JsonResponse
{
$data = $request->getAll();
$this->repository->update($attachment, $data);
$manager = $this->getManager();
/** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($attachment, $transformer, 'attachments');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Upload an attachment.
*
* @codeCoverageIgnore
*
* @param Request $request
* @param Attachment $attachment
*
* @return JsonResponse
*/
public function upload(Request $request, Attachment $attachment): JsonResponse
{
/** @var AttachmentHelperInterface $helper */
$helper = app(AttachmentHelperInterface::class);
$body = $request->getContent();
if ('' === $body) {
Log::error('Body of attachment is empty.');
return response()->json([], 422);
}
$helper->saveAttachmentFromApi($attachment, $body);
return response()->json([], 204);
}
}

View File

@@ -0,0 +1,116 @@
<?php
/*
* StoreController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Attachment;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Middleware\ApiDemoUser;
use FireflyIII\Api\V1\Requests\Models\Attachment\StoreRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Models\Attachment;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use FireflyIII\Transformers\AttachmentTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use League\Fractal\Resource\Item;
use Log;
/**
* Class StoreController
*/
class StoreController extends Controller
{
private AttachmentRepositoryInterface $repository;
/**
* StoreController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(ApiDemoUser::class)->except(['delete', 'download', 'show', 'index']);
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(AttachmentRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* Store a newly created resource in storage.
*
* @param StoreRequest $request
*
* @return JsonResponse
* @throws FireflyException
*/
public function store(StoreRequest $request): JsonResponse
{
Log::debug(sprintf('Now in %s', __METHOD__));
$data = $request->getAll();
$attachment = $this->repository->store($data);
$manager = $this->getManager();
/** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($attachment, $transformer, 'attachments');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Upload an attachment.
*
* @codeCoverageIgnore
*
* @param Request $request
* @param Attachment $attachment
*
* @return JsonResponse
*/
public function upload(Request $request, Attachment $attachment): JsonResponse
{
/** @var AttachmentHelperInterface $helper */
$helper = app(AttachmentHelperInterface::class);
$body = $request->getContent();
if ('' === $body) {
Log::error('Body of attachment is empty.');
return response()->json([], 422);
}
$helper->saveAttachmentFromApi($attachment, $body);
return response()->json([], 204);
}
}

View File

@@ -0,0 +1,86 @@
<?php
/*
* UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Attachment;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Middleware\ApiDemoUser;
use FireflyIII\Api\V1\Requests\Models\Attachment\UpdateRequest;
use FireflyIII\Models\Attachment;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use FireflyIII\Transformers\AttachmentTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class UpdateController
*/
class UpdateController extends Controller
{
private AttachmentRepositoryInterface $repository;
/**
* UpdateController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(ApiDemoUser::class)->except(['delete', 'download', 'show', 'index']);
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(AttachmentRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* Update the specified resource in storage.
*
* @param UpdateRequest $request
* @param Attachment $attachment
*
* @return JsonResponse
*/
public function update(UpdateRequest $request, Attachment $attachment): JsonResponse
{
$data = $request->getAll();
$this->repository->update($attachment, $data);
$manager = $this->getManager();
/** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($attachment, $transformer, 'attachments');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,74 @@
<?php
/*
* DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\AvailableBudget;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\AvailableBudget;
use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class DestroyController
*/
class DestroyController extends Controller
{
private AvailableBudgetRepositoryInterface $abRepository;
/**
* AvailableBudgetController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->abRepository = app(AvailableBudgetRepositoryInterface::class);
$this->abRepository->setUser($user);
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @param AvailableBudget $availableBudget
*
* @codeCoverageIgnore
*
* @return JsonResponse
*/
public function destroy(AvailableBudget $availableBudget): JsonResponse
{
$this->abRepository->destroyAvailableBudget($availableBudget);
return response()->json([], 204);
}
}

View File

@@ -1,7 +1,7 @@
<?php
/**
* AvailableBudgetController.php
* Copyright (c) 2019 james@firefly-iii.org
/*
* ShowController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@@ -21,12 +21,10 @@
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
namespace FireflyIII\Api\V1\Controllers\Models\AvailableBudget;
use FireflyIII\Api\V1\Requests\AvailableBudgetRequest;
use FireflyIII\Factory\TransactionCurrencyFactory;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\AvailableBudget;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
use FireflyIII\Transformers\AvailableBudgetTransformer;
use FireflyIII\User;
@@ -37,13 +35,11 @@ use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class AvailableBudgetController.
*
* Class ShowController
*/
class AvailableBudgetController extends Controller
class ShowController extends Controller
{
/** @var AvailableBudgetRepositoryInterface */
private $abRepository;
private AvailableBudgetRepositoryInterface $abRepository;
/**
* AvailableBudgetController constructor.
@@ -65,22 +61,6 @@ class AvailableBudgetController extends Controller
);
}
/**
* Remove the specified resource from storage.
*
* @param AvailableBudget $availableBudget
*
* @codeCoverageIgnore
*
* @return JsonResponse
*/
public function delete(AvailableBudget $availableBudget): JsonResponse
{
$this->abRepository->destroyAvailableBudget($availableBudget);
return response()->json([], 204);
}
/**
* Display a listing of the resource.
*
@@ -92,7 +72,7 @@ class AvailableBudgetController extends Controller
$manager = $this->getManager();
// types to get, page size:
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$start = $this->parameters->get('start');
$end = $this->parameters->get('end');
@@ -113,7 +93,7 @@ class AvailableBudgetController extends Controller
$resource = new FractalCollection($availableBudgets, $transformer, 'available_budgets');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
@@ -134,77 +114,7 @@ class AvailableBudgetController extends Controller
$resource = new Item($availableBudget, $transformer, 'available_budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Store a newly created resource in storage.
*
* @param AvailableBudgetRequest $request
*
* @return JsonResponse
*/
public function store(AvailableBudgetRequest $request): JsonResponse
{
$data = $request->getAll();
/** @var TransactionCurrencyFactory $factory */
$factory = app(TransactionCurrencyFactory::class);
$currency = $factory->find($data['currency_id'], $data['currency_code']);
if (null === $currency) {
$currency = app('amount')->getDefaultCurrency();
}
$data['currency'] = $currency;
$availableBudget = $this->abRepository->store($data);
$manager = $this->getManager();
/** @var AvailableBudgetTransformer $transformer */
$transformer = app(AvailableBudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($availableBudget, $transformer, 'available_budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Update the specified resource in storage.
*
* @param AvailableBudgetRequest $request
* @param AvailableBudget $availableBudget
*
* @return JsonResponse
*/
public function update(AvailableBudgetRequest $request, AvailableBudget $availableBudget): JsonResponse
{
$data = $request->getAll();
/** @var TransactionCurrencyFactory $factory */
$factory = app(TransactionCurrencyFactory::class);
/** @var TransactionCurrency $currency */
$currency = $factory->find($data['currency_id'] ?? null, $data['currency_code'] ?? null);
if (null === $currency) {
// use default currency:
$currency = app('amount')->getDefaultCurrency();
}
$currency->enabled = true;
$currency->save();
unset($data['currency_code']);
$data['currency_id'] = $currency->id;
$this->abRepository->updateAvailableBudget($availableBudget, $data);
$manager = $this->getManager();
/** @var AvailableBudgetTransformer $transformer */
$transformer = app(AvailableBudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($availableBudget, $transformer, 'available_budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
}

View File

@@ -0,0 +1,98 @@
<?php
/*
* StoreController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\AvailableBudget;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\AvailableBudget\Request;
use FireflyIII\Factory\TransactionCurrencyFactory;
use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
use FireflyIII\Transformers\AvailableBudgetTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class StoreController
*/
class StoreController extends Controller
{
private AvailableBudgetRepositoryInterface $abRepository;
/**
* AvailableBudgetController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->abRepository = app(AvailableBudgetRepositoryInterface::class);
$this->abRepository->setUser($user);
return $next($request);
}
);
}
/**
* Store a newly created resource in storage.
*
* @param Request $request
*
* @return JsonResponse
*/
public function store(Request $request): JsonResponse
{
$data = $request->getAll();
$data['start']->startOfDay();
$data['end']->endOfDay();
// currency is not mandatory:
if (array_key_exists('currency_id', $data) || array_key_exists('currency_code', $data)) {
$factory = app(TransactionCurrencyFactory::class);
$currency = $factory->find($data['currency_id'] ?? null, $data['currency_code'] ?? null);
$data['currency_id'] = $currency->id;
unset($data['currency_code']);
}
if (!array_key_exists('currency_id', $data)) {
$currency = app('amount')->getDefaultCurrencyByUser(auth()->user());
$data['currency_id'] = $currency->id;
}
$availableBudget = $this->abRepository->store($data);
$manager = $this->getManager();
/** @var AvailableBudgetTransformer $transformer */
$transformer = app(AvailableBudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($availableBudget, $transformer, 'available_budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,97 @@
<?php
/*
* UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\AvailableBudget;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\AvailableBudget\Request;
use FireflyIII\Factory\TransactionCurrencyFactory;
use FireflyIII\Models\AvailableBudget;
use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
use FireflyIII\Transformers\AvailableBudgetTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class UpdateController
*/
class UpdateController extends Controller
{
private AvailableBudgetRepositoryInterface $abRepository;
/**
* AvailableBudgetController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->abRepository = app(AvailableBudgetRepositoryInterface::class);
$this->abRepository->setUser($user);
return $next($request);
}
);
}
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param AvailableBudget $availableBudget
*
* @return JsonResponse
*/
public function update(Request $request, AvailableBudget $availableBudget): JsonResponse
{
$data = $request->getAll();
// find and validate currency ID
if (array_key_exists('currency_id', $data) || array_key_exists('currency_code', $data)) {
$factory = app(TransactionCurrencyFactory::class);
$currency = $factory->find($data['currency_id'] ?? null, $data['currency_code'] ?? null) ?? app('amount')->getDefaultCurrency();
$currency->enabled = true;
$currency->save();
unset($data['currency_code']);
$data['currency_id'] = $currency->id;
}
$this->abRepository->updateAvailableBudget($availableBudget, $data);
$manager = $this->getManager();
/** @var AvailableBudgetTransformer $transformer */
$transformer = app(AvailableBudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($availableBudget, $transformer, 'available_budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,72 @@
<?php
/*
* DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Bill;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class DestroyController
*/
class DestroyController extends Controller
{
private BillRepositoryInterface $repository;
/**
* BillController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(BillRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @param Bill $bill
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function destroy(Bill $bill): JsonResponse
{
$this->repository->destroy($bill);
return response()->json([], 204);
}
}

View File

@@ -1,8 +1,7 @@
<?php
/**
* BillController.php
* Copyright (c) 2019 james@firefly-iii.org
/*
* ListController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@@ -22,16 +21,14 @@
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
namespace FireflyIII\Api\V1\Controllers\Models\Bill;
use FireflyIII\Api\V1\Requests\BillRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Support\Http\Api\TransactionFilter;
use FireflyIII\Transformers\AttachmentTransformer;
use FireflyIII\Transformers\BillTransformer;
use FireflyIII\Transformers\RuleTransformer;
use FireflyIII\Transformers\TransactionGroupTransformer;
use FireflyIII\User;
@@ -40,17 +37,15 @@ use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class BillController.
*
* Class ListController
*/
class BillController extends Controller
class ListController extends Controller
{
use TransactionFilter;
/** @var BillRepositoryInterface The bill repository */
private $repository;
private BillRepositoryInterface $repository;
/**
* BillController constructor.
@@ -62,12 +57,8 @@ class BillController extends Controller
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $admin */
$admin = auth()->user();
/** @var BillRepositoryInterface repository */
$this->repository = app(BillRepositoryInterface::class);
$this->repository->setUser($admin);
$this->repository->setUser(auth()->user());
return $next($request);
}
@@ -85,7 +76,7 @@ class BillController extends Controller
public function attachments(Bill $bill): JsonResponse
{
$manager = $this->getManager();
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$collection = $this->repository->getAttachments($bill);
$count = $collection->count();
@@ -102,47 +93,7 @@ class BillController extends Controller
$resource = new FractalCollection($attachments, $transformer, 'attachments');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Remove the specified resource from storage.
*
* @param Bill $bill
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function delete(Bill $bill): JsonResponse
{
$this->repository->destroy($bill);
return response()->json([], 204);
}
/**
* Display a listing of the resource.
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function index(): JsonResponse
{
$bills = $this->repository->getBills();
$manager = $this->getManager();
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$count = $bills->count();
$bills = $bills->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($bills, $count, $pageSize, $this->parameters->get('page'));
/** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($bills, $transformer, 'bills');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
@@ -158,7 +109,7 @@ class BillController extends Controller
$manager = $this->getManager();
// types to get, page size:
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of budgets. Count it and split it.
$collection = $this->repository->getRulesForBill($bill);
@@ -172,57 +123,13 @@ class BillController extends Controller
/** @var RuleTransformer $transformer */
$transformer = app(RuleTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($rules, $transformer, 'rules');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Show the specified bill.
*
* @param Bill $bill
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function show(Bill $bill): JsonResponse
{
$manager = $this->getManager();
/** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($bill, $transformer, 'bills');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Store a bill.
*
* @param BillRequest $request
*
* @throws FireflyException
* @return JsonResponse
*/
public function store(BillRequest $request): JsonResponse
{
$bill = $this->repository->store($request->getAll());
$manager = $this->getManager();
/** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($bill, $transformer, 'bills');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Show all transactions.
*
@@ -235,7 +142,7 @@ class BillController extends Controller
*/
public function transactions(Request $request, Bill $bill): JsonResponse
{
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$type = $request->get('type') ?? 'default';
$this->parameters->set('type', $type);
@@ -278,30 +185,7 @@ class BillController extends Controller
$resource = new FractalCollection($transactions, $transformer, 'transactions');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Update a bill.
*
* @param BillRequest $request
* @param Bill $bill
*
* @return JsonResponse
*/
public function update(BillRequest $request, Bill $bill): JsonResponse
{
$data = $request->getAll();
$bill = $this->repository->update($bill, $data);
$manager = $this->getManager();
/** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($bill, $transformer, 'bills');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
}

View File

@@ -0,0 +1,107 @@
<?php
/*
* ShowController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Bill;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Transformers\BillTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class ShowController
*/
class ShowController extends Controller
{
private BillRepositoryInterface $repository;
/**
* BillController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(BillRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Display a listing of the resource.
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function index(): JsonResponse
{
$this->repository->correctOrder();
$bills = $this->repository->getBills();
$manager = $this->getManager();
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$count = $bills->count();
$bills = $bills->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($bills, $count, $pageSize, $this->parameters->get('page'));
/** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($bills, $transformer, 'bills');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Show the specified bill.
*
* @param Bill $bill
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function show(Bill $bill): JsonResponse
{
$manager = $this->getManager();
/** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($bill, $transformer, 'bills');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,85 @@
<?php
/*
* StoreController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Bill;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\Bill\StoreRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Support\Http\Api\TransactionFilter;
use FireflyIII\Transformers\BillTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class StoreController
*/
class StoreController extends Controller
{
use TransactionFilter;
private BillRepositoryInterface $repository;
/**
* BillController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(BillRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Store a bill.
*
* @param StoreRequest $request
*
* @return JsonResponse
* @throws FireflyException
*/
public function store(StoreRequest $request): JsonResponse
{
$data = $request->getAll();
$bill = $this->repository->store($data);
$manager = $this->getManager();
/** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($bill, $transformer, 'bills');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,84 @@
<?php
/*
* UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Bill;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\Bill\UpdateRequest;
use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Transformers\BillTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class UpdateController
*/
class UpdateController extends Controller
{
private BillRepositoryInterface $repository;
/**
* BillController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(BillRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Update a bill.
*
* @param UpdateRequest $request
* @param Bill $bill
*
* @return JsonResponse
*/
public function update(UpdateRequest $request, Bill $bill): JsonResponse
{
$data = $request->getAll();
$bill = $this->repository->update($bill, $data);
$manager = $this->getManager();
/** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($bill, $transformer, 'bills');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,70 @@
<?php
/*
* DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Budget;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Http\JsonResponse;
/**
* Class DestroyController
*/
class DestroyController extends Controller
{
private BudgetRepositoryInterface $repository;
/**
* DestroyController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(BudgetRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @param Budget $budget
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function destroy(Budget $budget): JsonResponse
{
$this->repository->destroy($budget);
return response()->json([], 204);
}
}

View File

@@ -1,7 +1,7 @@
<?php
/**
* BudgetController.php
* Copyright (c) 2019 james@firefly-iii.org
/*
* ListController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@@ -21,13 +21,9 @@
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
namespace FireflyIII\Api\V1\Controllers\Models\Budget;
use Exception;
use FireflyIII\Api\V1\Requests\BudgetLimitRequest;
use FireflyIII\Api\V1\Requests\BudgetStoreRequest;
use FireflyIII\Api\V1\Requests\BudgetUpdateRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
@@ -35,7 +31,6 @@ use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Support\Http\Api\TransactionFilter;
use FireflyIII\Transformers\AttachmentTransformer;
use FireflyIII\Transformers\BudgetLimitTransformer;
use FireflyIII\Transformers\BudgetTransformer;
use FireflyIII\Transformers\TransactionGroupTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
@@ -43,22 +38,19 @@ use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class BudgetController.
*
/***
* Class ListController
*/
class BudgetController extends Controller
class ListController extends Controller
{
use TransactionFilter;
/** @var BudgetLimitRepositoryInterface */
private $blRepository;
/** @var BudgetRepositoryInterface The budget repository */
private $repository;
private BudgetLimitRepositoryInterface $blRepository;
private BudgetRepositoryInterface $repository;
/**
* BudgetController constructor.
* ListController constructor.
*
* @codeCoverageIgnore
*/
@@ -67,49 +59,16 @@ class BudgetController extends Controller
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $admin */
$admin = auth()->user();
$this->repository = app(BudgetRepositoryInterface::class);
$this->blRepository = app(BudgetLimitRepositoryInterface::class);
$this->repository->setUser($admin);
$this->blRepository->setUser($admin);
$this->repository->setUser(auth()->user());
$this->blRepository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Display a listing of the resource.
*
* @param Budget $budget
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function budgetLimits(Budget $budget): JsonResponse
{
$manager = $this->getManager();
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$this->parameters->set('budget_id', $budget->id);
$collection = $this->blRepository->getBudgetLimits($budget, $this->parameters->get('start'), $this->parameters->get('end'));
$count = $collection->count();
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budgets.budget_limits', [$budget->id]) . $this->buildParams());
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($budgetLimits, $transformer, 'budget_limits');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* @param Budget $budget
*
@@ -119,7 +78,7 @@ class BudgetController extends Controller
public function attachments(Budget $budget): JsonResponse
{
$manager = $this->getManager();
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$collection = $this->repository->getAttachments($budget);
$count = $collection->count();
@@ -136,123 +95,35 @@ class BudgetController extends Controller
$resource = new FractalCollection($attachments, $transformer, 'attachments');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Remove the specified resource from storage.
*
* @param Budget $budget
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function delete(Budget $budget): JsonResponse
{
$this->repository->destroy($budget);
return response()->json([], 204);
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Display a listing of the resource.
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function index(): JsonResponse
{
$manager = $this->getManager();
// types to get, page size:
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of budgets. Count it and split it.
$collection = $this->repository->getBudgets();
$count = $collection->count();
$budgets = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($budgets, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budgets.index') . $this->buildParams());
/** @var BudgetTransformer $transformer */
$transformer = app(BudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($budgets, $transformer, 'budgets');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Show a budget.
*
* @param Budget $budget
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function show(Budget $budget): JsonResponse
public function budgetLimits(Budget $budget): JsonResponse
{
$manager = $this->getManager();
/** @var BudgetTransformer $transformer */
$transformer = app(BudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budget, $transformer, 'budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Store a budget.
*
* @param BudgetStoreRequest $request
*
* @throws FireflyException
*
* @return JsonResponse
*/
public function store(BudgetStoreRequest $request): JsonResponse
{
$budget = $this->repository->store($request->getAll());
$manager = $this->getManager();
/** @var BudgetTransformer $transformer */
$transformer = app(BudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budget, $transformer, 'budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Store a newly created resource in storage.
*
* @param BudgetLimitRequest $request
* @param Budget $budget
*
* @throws Exception
* @return JsonResponse
*/
public function storeBudgetLimit(BudgetLimitRequest $request, Budget $budget): JsonResponse
{
$data = $request->getAll();
$data['budget'] = $budget;
$budgetLimit = $this->blRepository->storeBudgetLimit($data);
$manager = $this->getManager();
$manager = $this->getManager();
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$this->parameters->set('budget_id', $budget->id);
$collection = $this->blRepository->getBudgetLimits($budget, $this->parameters->get('start'), $this->parameters->get('end'));
$count = $collection->count();
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budgets.budget_limits', [$budget->id]) . $this->buildParams());
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($budgetLimits, $transformer, 'budget_limits');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
$resource = new Item($budgetLimit, $transformer, 'budget_limits');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
@@ -267,7 +138,7 @@ class BudgetController extends Controller
*/
public function transactions(Request $request, Budget $budget): JsonResponse
{
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// user can overrule page size with limit parameter.
$limit = $this->parameters->get('limit');
@@ -311,36 +182,10 @@ class BudgetController extends Controller
/** @var TransactionGroupTransformer $transformer */
$transformer = app(TransactionGroupTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($transactions, $transformer, 'transactions');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Update a budget.
*
* @param BudgetUpdateRequest $request
* @param Budget $budget
*
* @return JsonResponse
*/
public function update(BudgetUpdateRequest $request, Budget $budget): JsonResponse
{
$data = $request->getAll();
$budget = $this->repository->update($budget, $data);
$manager = $this->getManager();
/** @var BudgetTransformer $transformer */
$transformer = app(BudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budget, $transformer, 'budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,118 @@
<?php
/*
* ShowController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Budget;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Transformers\BudgetTransformer;
use Illuminate\Http\JsonResponse;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class ShowController
*/
class ShowController extends Controller
{
private BudgetLimitRepositoryInterface $blRepository;
private BudgetRepositoryInterface $repository;
/**
* ListController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(BudgetRepositoryInterface::class);
$this->blRepository = app(BudgetLimitRepositoryInterface::class);
$this->repository->setUser(auth()->user());
$this->blRepository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Display a listing of the resource.
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function index(): JsonResponse
{
$manager = $this->getManager();
// types to get, page size:
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of budgets. Count it and split it.
$collection = $this->repository->getBudgets();
$count = $collection->count();
$budgets = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($budgets, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budgets.index') . $this->buildParams());
/** @var BudgetTransformer $transformer */
$transformer = app(BudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($budgets, $transformer, 'budgets');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Show a budget.
*
* @param Budget $budget
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function show(Budget $budget): JsonResponse
{
$manager = $this->getManager();
/** @var BudgetTransformer $transformer */
$transformer = app(BudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budget, $transformer, 'budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,82 @@
<?php
/*
* StoreController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Budget;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\Budget\StoreRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Transformers\BudgetTransformer;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class StoreController
*/
class StoreController extends Controller
{
private BudgetRepositoryInterface $repository;
/**
* StoreController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(BudgetRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Store a budget.
*
* @param StoreRequest $request
*
* @return JsonResponse
* @throws FireflyException
*
*/
public function store(StoreRequest $request): JsonResponse
{
$budget = $this->repository->store($request->getAll());
$budget->refresh();
$manager = $this->getManager();
/** @var BudgetTransformer $transformer */
$transformer = app(BudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budget, $transformer, 'budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,82 @@
<?php
/*
* UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Budget;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\Budget\UpdateRequest;
use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Transformers\BudgetTransformer;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class UpdateController
*/
class UpdateController extends Controller
{
private BudgetRepositoryInterface $repository;
/**
* UpdateController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(BudgetRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Update a budget.
*
* @param UpdateRequest $request
* @param Budget $budget
*
* @return JsonResponse
*/
public function update(UpdateRequest $request, Budget $budget): JsonResponse
{
$data = $request->getAll();
$budget = $this->repository->update($budget, $data);
$manager = $this->getManager();
/** @var BudgetTransformer $transformer */
$transformer = app(BudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budget, $transformer, 'budgets');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,79 @@
<?php
/*
* DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\BudgetLimit;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class DestroyController
*/
class DestroyController extends Controller
{
private BudgetLimitRepositoryInterface $blRepository;
/**
* BudgetLimitController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->blRepository = app(BudgetLimitRepositoryInterface::class);
$this->blRepository->setUser($user);
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @param Budget $budget
* @param BudgetLimit $budgetLimit
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function destroy(Budget $budget, BudgetLimit $budgetLimit): JsonResponse
{
if ($budget->id !== $budgetLimit->budget_id) {
throw new FireflyException('20028: The budget limit does not belong to the budget.');
}
$this->blRepository->destroyBudgetLimit($budgetLimit);
return response()->json([], 204);
}
}

View File

@@ -0,0 +1,121 @@
<?php
/*
* ListController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\BudgetLimit;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
use FireflyIII\Support\Http\Api\TransactionFilter;
use FireflyIII\Transformers\TransactionGroupTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
/**
* Class ListController
*/
class ListController extends Controller
{
use TransactionFilter;
private BudgetLimitRepositoryInterface $blRepository;
/**
* BudgetLimitController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->blRepository = app(BudgetLimitRepositoryInterface::class);
$this->blRepository->setUser($user);
return $next($request);
}
);
}
/**
* Show all transactions.
*
* @param Request $request
* @param Budget $budget
* @param BudgetLimit $budgetLimit
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function transactions(Request $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse
{
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$type = $request->get('type') ?? 'default';
$this->parameters->set('type', $type);
$types = $this->mapTransactionTypes($this->parameters->get('type'));
$manager = $this->getManager();
/** @var User $admin */
$admin = auth()->user();
// use new group collector:
/** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class);
$collector
->setUser($admin)
// filter on budget.
->setBudget($budget)
// all info needed for the API:
->withAPIInformation()
// set page size:
->setLimit($pageSize)
// set page to retrieve
->setPage($this->parameters->get('page'))
// set types of transactions to return.
->setTypes($types);
$collector->setRange($budgetLimit->start_date, $budgetLimit->end_date);
$collector->setTypes($types);
$paginator = $collector->getPaginatedGroups();
$paginator->setPath(route('api.v1.budgets.limits.transactions', [$budget->id, $budgetLimit->id]) . $this->buildParams());
$transactions = $paginator->getCollection();
/** @var TransactionGroupTransformer $transformer */
$transformer = app(TransactionGroupTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($transactions, $transformer, 'transactions');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,154 @@
<?php
/*
* ShowController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\BudgetLimit;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Data\DateRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Transformers\BudgetLimitTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class ShowController
*/
class ShowController extends Controller
{
private BudgetLimitRepositoryInterface $blRepository;
private BudgetRepositoryInterface $repository;
/**
* BudgetLimitController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(BudgetRepositoryInterface::class);
$this->blRepository = app(BudgetLimitRepositoryInterface::class);
$this->repository->setUser($user);
$this->blRepository->setUser($user);
return $next($request);
}
);
}
/**
* Display a listing of the budget limits for this budget..
*
* @param Request $request
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function index(Request $request, Budget $budget): JsonResponse
{
$manager = $this->getManager();
$manager->parseIncludes('budget');
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$collection = $this->blRepository->getBudgetLimits($budget, $this->parameters->get('start'), $this->parameters->get('end'));
$count = $collection->count();
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budgets.limits.index', [$budget->id]) . $this->buildParams());
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($budgetLimits, $transformer, 'budget_limits');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Display a listing of the budget limits for this budget..
*
* @param DateRequest $request
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function indexAll(DateRequest $request): JsonResponse
{
$manager = $this->getManager();
$manager->parseIncludes('budget');
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$collection = $this->blRepository->getAllBudgetLimits($this->parameters->get('start'), $this->parameters->get('end'));
$count = $collection->count();
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
$paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.budget-limits.index') . $this->buildParams());
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($budgetLimits, $transformer, 'budget_limits');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* @param Request $request
* @param Budget $budget
* @param BudgetLimit $budgetLimit
*
* @return JsonResponse
*/
public function show(Request $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse
{
if ((int)$budget->id !== (int)$budgetLimit->budget_id) {
throw new FireflyException('20028: The budget limit does not belong to the budget.');
}
// continue!
$manager = $this->getManager();
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budgetLimit, $transformer, 'budget_limits');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,89 @@
<?php
/*
* StoreController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\BudgetLimit;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\BudgetLimit\StoreRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Budget;
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
use FireflyIII\Transformers\BudgetLimitTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class StoreController
*/
class StoreController extends Controller
{
private BudgetLimitRepositoryInterface $blRepository;
/**
* BudgetLimitController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->blRepository = app(BudgetLimitRepositoryInterface::class);
$this->blRepository->setUser($user);
return $next($request);
}
);
}
/**
* Store a newly created resource in storage.
*
* @param StoreRequest $request
*
* @return JsonResponse
* @throws FireflyException
*
*/
public function store(StoreRequest $request, Budget $budget): JsonResponse
{
$data = $request->getAll();
$data['start_date'] = $data['start'];
$data['end_date'] = $data['end'];
$data['budget_id'] = $budget->id;
$budgetLimit = $this->blRepository->store($data);
$manager = $this->getManager();
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budgetLimit, $transformer, 'budget_limits');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,93 @@
<?php
/*
* UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\BudgetLimit;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\BudgetLimit\UpdateRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit;
use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
use FireflyIII\Transformers\BudgetLimitTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class UpdateController
*/
class UpdateController extends Controller
{
private BudgetLimitRepositoryInterface $blRepository;
/**
* BudgetLimitController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->blRepository = app(BudgetLimitRepositoryInterface::class);
$this->blRepository->setUser($user);
return $next($request);
}
);
}
/**
* Update the specified resource in storage.
*
* @param UpdateRequest $request
* @param Budget $budget
* @param BudgetLimit $budgetLimit
*
* @return JsonResponse
*/
public function update(UpdateRequest $request, Budget $budget, BudgetLimit $budgetLimit): JsonResponse
{
if ((int)$budget->id !== (int)$budgetLimit->budget_id) {
throw new FireflyException('20028: The budget limit does not belong to the budget.');
}
$data = $request->getAll();
$data['budget_id'] = $budget->id;
$budgetLimit = $this->blRepository->update($budgetLimit, $data);
$manager = $this->getManager();
/** @var BudgetLimitTransformer $transformer */
$transformer = app(BudgetLimitTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($budgetLimit, $transformer, 'budget_limits');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,71 @@
<?php
/*
* DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Category;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class DestroyController
*/
class DestroyController extends Controller
{
private CategoryRepositoryInterface $repository;
/**
* CategoryController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(CategoryRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @param Category $category
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function destroy(Category $category): JsonResponse
{
$this->repository->destroy($category);
return response()->json([], 204);
}
}

View File

@@ -1,7 +1,7 @@
<?php
/**
* CategoryController.php
* Copyright (c) 2019 james@firefly-iii.org
/*
* ListController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@@ -21,16 +21,14 @@
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers;
namespace FireflyIII\Api\V1\Controllers\Models\Category;
use FireflyIII\Api\V1\Requests\CategoryRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Support\Http\Api\TransactionFilter;
use FireflyIII\Transformers\AttachmentTransformer;
use FireflyIII\Transformers\CategoryTransformer;
use FireflyIII\Transformers\TransactionGroupTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
@@ -38,17 +36,15 @@ use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class CategoryController.
*
* Class ListController
*/
class CategoryController extends Controller
class ListController extends Controller
{
use TransactionFilter;
/** @var CategoryRepositoryInterface The category repository */
private $repository;
private CategoryRepositoryInterface $repository;
/**
* CategoryController constructor.
@@ -60,12 +56,8 @@ class CategoryController extends Controller
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $admin */
$admin = auth()->user();
/** @var CategoryRepositoryInterface repository */
$this->repository = app(CategoryRepositoryInterface::class);
$this->repository->setUser($admin);
$this->repository->setUser(auth()->user());
return $next($request);
}
@@ -81,7 +73,7 @@ class CategoryController extends Controller
public function attachments(Category $category): JsonResponse
{
$manager = $this->getManager();
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$collection = $this->repository->getAttachments($category);
$count = $collection->count();
@@ -98,99 +90,7 @@ class CategoryController extends Controller
$resource = new FractalCollection($attachments, $transformer, 'attachments');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Remove the specified resource from storage.
*
* @param Category $category
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function delete(Category $category): JsonResponse
{
$this->repository->destroy($category);
return response()->json([], 204);
}
/**
* Display a listing of the resource.
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function index(): JsonResponse
{
$manager = $this->getManager();
// types to get, page size:
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of budgets. Count it and split it.
$collection = $this->repository->getCategories();
$count = $collection->count();
$categories = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($categories, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.categories.index') . $this->buildParams());
/** @var CategoryTransformer $transformer */
$transformer = app(CategoryTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($categories, $transformer, 'categories');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Show the category.
*
* @param Category $category
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function show(Category $category): JsonResponse
{
$manager = $this->getManager();
/** @var CategoryTransformer $transformer */
$transformer = app(CategoryTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($category, $transformer, 'categories');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Store new category.
*
* @param CategoryRequest $request
*
* @throws FireflyException
* @return JsonResponse
*/
public function store(CategoryRequest $request): JsonResponse
{
$category = $this->repository->store($request->getAll());
$manager = $this->getManager();
/** @var CategoryTransformer $transformer */
$transformer = app(CategoryTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($category, $transformer, 'categories');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
@@ -205,7 +105,7 @@ class CategoryController extends Controller
*/
public function transactions(Request $request, Category $category): JsonResponse
{
$pageSize = (int) app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$type = $request->get('type') ?? 'default';
$this->parameters->set('type', $type);
@@ -246,31 +146,7 @@ class CategoryController extends Controller
$resource = new FractalCollection($transactions, $transformer, 'transactions');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
}
/**
* Update the category.
*
* @param CategoryRequest $request
* @param Category $category
*
* @return JsonResponse
*/
public function update(CategoryRequest $request, Category $category): JsonResponse
{
$data = $request->getAll();
$category = $this->repository->update($category, $data);
$manager = $this->getManager();
/** @var CategoryTransformer $transformer */
$transformer = app(CategoryTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($category, $transformer, 'categories');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', 'application/vnd.api+json');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,113 @@
<?php
/*
* ShowController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Category;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Transformers\CategoryTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class ShowController
*/
class ShowController extends Controller
{
private CategoryRepositoryInterface $repository;
/**
* CategoryController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(CategoryRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Display a listing of the resource.
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function index(): JsonResponse
{
$manager = $this->getManager();
// types to get, page size:
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of budgets. Count it and split it.
$collection = $this->repository->getCategories();
$count = $collection->count();
$categories = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($categories, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.categories.index') . $this->buildParams());
/** @var CategoryTransformer $transformer */
$transformer = app(CategoryTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($categories, $transformer, 'categories');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Show the category.
*
* @param Category $category
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function show(Category $category): JsonResponse
{
$manager = $this->getManager();
/** @var CategoryTransformer $transformer */
$transformer = app(CategoryTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($category, $transformer, 'categories');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,82 @@
<?php
/*
* StoreController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Category;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\Category\StoreRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Transformers\CategoryTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class StoreController
*/
class StoreController extends Controller
{
private CategoryRepositoryInterface $repository;
/**
* CategoryController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(CategoryRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Store new category.
*
* @param StoreRequest $request
*
* @return JsonResponse
* @throws FireflyException
*/
public function store(StoreRequest $request): JsonResponse
{
$category = $this->repository->store($request->getAll());
$manager = $this->getManager();
/** @var CategoryTransformer $transformer */
$transformer = app(CategoryTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($category, $transformer, 'categories');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,83 @@
<?php
/*
* UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Category;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Models\Category\UpdateRequest;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use FireflyIII\Transformers\CategoryTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use League\Fractal\Resource\Item;
/**
* Class UpdateController
*/
class UpdateController extends Controller
{
private CategoryRepositoryInterface $repository;
/**
* CategoryController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
$this->repository = app(CategoryRepositoryInterface::class);
$this->repository->setUser(auth()->user());
return $next($request);
}
);
}
/**
* Update the category.
*
* @param UpdateRequest $request
* @param Category $category
*
* @return JsonResponse
*/
public function update(UpdateRequest $request, Category $category): JsonResponse
{
$data = $request->getAll();
$category = $this->repository->update($category, $data);
$manager = $this->getManager();
/** @var CategoryTransformer $transformer */
$transformer = app(CategoryTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($category, $transformer, 'categories');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,73 @@
<?php
/*
* DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\ObjectGroup;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\ObjectGroup;
use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
/**
* Class DestroyController
*/
class DestroyController extends Controller
{
private ObjectGroupRepositoryInterface $repository;
/**
* ObjectGroupController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(ObjectGroupRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* Remove the specified resource from storage.
*
* @param ObjectGroup $objectGroup
*
* @codeCoverageIgnore
* @return JsonResponse
*/
public function destroy(ObjectGroup $objectGroup): JsonResponse
{
$this->repository->destroy($objectGroup);
return response()->json([], 204);
}
}

View File

@@ -0,0 +1,131 @@
<?php
/*
* ListController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\ObjectGroup;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\ObjectGroup;
use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface;
use FireflyIII\Transformers\BillTransformer;
use FireflyIII\Transformers\PiggyBankTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
/**
* Class ListController
*/
class ListController extends Controller
{
private ObjectGroupRepositoryInterface $repository;
/**
* ObjectGroupController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(ObjectGroupRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* List all bills
*
* @param ObjectGroup $objectGroup
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function bills(ObjectGroup $objectGroup): JsonResponse
{
$manager = $this->getManager();
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of piggy banks. Count it and split it.
$collection = $this->repository->getBills($objectGroup);
$count = $collection->count();
$bills = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($bills, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.currencies.bills', [$objectGroup->id]) . $this->buildParams());
/** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($bills, $transformer, 'bills');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* List all piggies under the object group.
*
* @param ObjectGroup $objectGroup
*
* @return JsonResponse
* @codeCoverageIgnore
*/
public function piggyBanks(ObjectGroup $objectGroup): JsonResponse
{
// create some objects:
$manager = $this->getManager();
// types to get, page size:
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
// get list of piggy banks. Count it and split it.
$collection = $this->repository->getPiggyBanks($objectGroup);
$count = $collection->count();
$piggyBanks = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($piggyBanks, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.object-groups.piggy_banks', [$objectGroup->id]) . $this->buildParams());
/** @var PiggyBankTransformer $transformer */
$transformer = app(PiggyBankTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($piggyBanks, $transformer, 'piggy_banks');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

View File

@@ -0,0 +1,119 @@
<?php
/*
* ShowController.php
* Copyright (c) 2021 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\ObjectGroup;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Models\ObjectGroup;
use FireflyIII\Repositories\ObjectGroup\ObjectGroupRepositoryInterface;
use FireflyIII\Transformers\ObjectGroupTransformer;
use FireflyIII\User;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection;
use League\Fractal\Resource\Item;
/**
* Class ShowController
*/
class ShowController extends Controller
{
private ObjectGroupRepositoryInterface $repository;
/**
* ObjectGroupController constructor.
*
* @codeCoverageIgnore
*/
public function __construct()
{
parent::__construct();
$this->middleware(
function ($request, $next) {
/** @var User $user */
$user = auth()->user();
$this->repository = app(ObjectGroupRepositoryInterface::class);
$this->repository->setUser($user);
return $next($request);
}
);
}
/**
* Display a listing of the resource.
*
* @param Request $request
*
* @codeCoverageIgnore
* @return JsonResponse
*/
public function index(Request $request): JsonResponse
{
$manager = $this->getManager();
// types to get, page size:
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
$this->repository->resetOrder();
$collection = $this->repository->get();
$count = $collection->count();
$objectGroups = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($objectGroups, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.object-groups.index') . $this->buildParams());
/** @var ObjectGroupTransformer $transformer */
$transformer = app(ObjectGroupTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($objectGroups, $transformer, 'object_groups');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/**
* Show single instance.
*
* @param ObjectGroup $objectGroup
*
* @return JsonResponse
*/
public function show(ObjectGroup $objectGroup): JsonResponse
{
$manager = $this->getManager();
$this->repository->resetOrder();
$objectGroup->refresh();
/** @var ObjectGroupTransformer $transformer */
$transformer = app(ObjectGroupTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($objectGroup, $transformer, 'object_groups');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
}

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