Compare commits

...

179 Commits

Author SHA1 Message Date
James Cole
f191086adb Enable cache again. 2024-12-27 19:47:35 +01:00
James Cole
68b446db18 Final changes. 2024-12-27 19:46:40 +01:00
James Cole
3d49d81856 Expand some multi currency things. 2024-12-27 16:36:01 +01:00
James Cole
96493425d1 Convert more of the budget view to native currency. 2024-12-27 13:42:48 +01:00
James Cole
419975285c Fix nullpointer 2024-12-27 13:02:23 +01:00
github-actions
aa5bde122e Auto commit for release 'branch-v6.2' on 2024-12-27 2024-12-27 12:43:57 +01:00
James Cole
0fa3c2bd8d Fix issue with prefilled piggy banks. 2024-12-27 12:39:26 +01:00
James Cole
b9249a4d96 Update commands. 2024-12-27 09:30:41 +01:00
James Cole
6638ca270f Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2 2024-12-27 07:36:37 +01:00
James Cole
9bfef892f8 Remove lots of debug logs 2024-12-27 07:36:30 +01:00
github-actions
32e5efec7c Auto commit for release 'branch-v6.2' on 2024-12-27 2024-12-27 07:29:17 +01:00
James Cole
36457455ca Rename and clean up commands. 2024-12-27 07:24:47 +01:00
James Cole
062c148e43 Rename all correction commands. 2024-12-27 06:56:08 +01:00
James Cole
2314ce8004 Refactor and renam commands. 2024-12-27 06:48:58 +01:00
James Cole
a3ff73903a Fix bad error message. 2024-12-27 05:44:03 +01:00
James Cole
7c8445707e Add moar debug. 2024-12-26 14:12:05 +01:00
James Cole
291e73da4b Rename bills to subscriptions 2024-12-26 13:41:57 +01:00
James Cole
286a29ca3e Display for bills. 2024-12-26 11:28:31 +01:00
github-actions
71cf6c6a5e Auto commit for release 'branch-v6.2' on 2024-12-26 2024-12-26 10:24:39 +01:00
James Cole
1e8f0adaf8 Fix broken account balance. 2024-12-26 10:20:40 +01:00
James Cole
33531244aa Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2
# Conflicts:
#	app/Http/Controllers/Chart/AccountController.php
#	app/Support/Steam.php
2024-12-26 09:19:04 +01:00
James Cole
06049a9a28 Update various pages, clean up some code. 2024-12-26 09:16:17 +01:00
James Cole
d313f5fdf5 Fix chart balance. 2024-12-26 08:53:16 +01:00
github-actions
f4868126c1 Auto commit for release 'branch-v6.2' on 2024-12-26 2024-12-26 05:25:46 +01:00
James Cole
00147e98dd Fix home chart. 2024-12-26 05:21:28 +01:00
James Cole
6d22663ca2 Fix charts and balances. 2024-12-26 05:11:32 +01:00
James Cole
756bb9cf5e Fix overview, skip chart for now. 2024-12-25 11:59:15 +01:00
James Cole
399d7968f5 Fix another null. 2024-12-25 08:30:00 +01:00
James Cole
966b68f42e Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2 2024-12-25 08:29:50 +01:00
James Cole
134c551c12 Remove some comments, add others. 2024-12-25 08:23:17 +01:00
github-actions
9aeca15355 Auto commit for release 'branch-v6.2' on 2024-12-25 2024-12-25 08:17:59 +01:00
James Cole
6c6d31830b Fix nullpointer 2024-12-25 08:14:07 +01:00
github-actions
e8cc321898 Auto commit for release 'branch-v6.2' on 2024-12-25 2024-12-25 07:13:41 +01:00
James Cole
e73fe06f7e Expand currency view in accounts. 2024-12-25 07:10:02 +01:00
James Cole
98b579c042 Fix native display. 2024-12-24 19:03:47 +01:00
James Cole
7b3a5c1afd Frontpage seems to be multi currency aware. 2024-12-24 16:56:31 +01:00
James Cole
7e2e49e129 Convert more charts. 2024-12-24 10:29:07 +01:00
James Cole
e8ef630424 Expand native amount things. 2024-12-24 06:34:12 +01:00
James Cole
8805bcf6f6 Various updates to display native/foreign amounts. 2024-12-23 17:32:15 +01:00
James Cole
ff5c9a3aa0 Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2 2024-12-23 14:35:34 +01:00
James Cole
3a274dcaa7 Little debug page with routes. 2024-12-23 14:35:27 +01:00
github-actions
ddfededf02 Auto commit for release 'branch-v6.2' on 2024-12-23 2024-12-23 08:40:29 +01:00
James Cole
e1785898ba Add notes to audit report. 2024-12-23 08:35:33 +01:00
James Cole
ae09200f42 Fix import 2024-12-23 08:26:35 +01:00
James Cole
847984f678 New rule triggers for account balance. 2024-12-23 08:22:54 +01:00
James Cole
42305672ac Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2 2024-12-23 07:14:12 +01:00
James Cole
25a56d9f72 Chart no longer as a line chart. 2024-12-23 07:13:59 +01:00
github-actions
8f9f08b96f Auto commit for release 'branch-v6.2' on 2024-12-23 2024-12-23 07:01:44 +01:00
James Cole
3c65b46aa5 Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2
# Conflicts:
#	app/Support/Steam.php
2024-12-23 06:56:31 +01:00
James Cole
1cf9c76329 Fix array bug. 2024-12-23 06:55:14 +01:00
github-actions
c0499df4ec Auto commit for release 'branch-v6.2' on 2024-12-22 2024-12-22 20:37:54 +01:00
James Cole
d90ac519f7 Clean up balance methods. 2024-12-22 20:32:58 +01:00
James Cole
a0e92b6969 Clean up variety of account balance methods. 2024-12-22 19:42:06 +01:00
James Cole
df49dd23e2 Try to convert balance to native, still internal debates. 2024-12-22 16:41:55 +01:00
James Cole
d4525da6bc Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2 2024-12-22 15:54:06 +01:00
James Cole
25b11bd20b Add preference for native amounts. 2024-12-22 15:53:59 +01:00
github-actions
705aac419a Auto commit for release 'branch-v6.2' on 2024-12-22 2024-12-22 14:00:37 +01:00
James Cole
f6e642f72e Add and remove exchange rates 2024-12-22 13:19:23 +01:00
James Cole
565bd87959 Code cleanup 2024-12-22 08:43:12 +01:00
James Cole
5751f7e5a3 Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2
# Conflicts:
#	app/Api/V2/Controllers/Model/ExchangeRate/ShowController.php
#	app/Repositories/UserGroups/ExchangeRate/ExchangeRateRepository.php
#	routes/api.php
2024-12-22 08:28:44 +01:00
James Cole
f5a755d4fc Various changes 2024-12-22 08:27:01 +01:00
github-actions
a500de8ab1 Auto commit for release 'branch-v6.2' on 2024-12-22 2024-12-22 07:05:15 +01:00
James Cole
303548a5fe Clean up command. 2024-12-22 07:01:16 +01:00
James Cole
68de905698 Remove command. 2024-12-22 06:59:05 +01:00
James Cole
9240b9868b Optimize memory usage. 2024-12-22 06:55:07 +01:00
James Cole
0e2e155cc6 Expand notifications. 2024-12-22 06:44:01 +01:00
James Cole
bffa0088b4 Extend warning with IP + host etc. 2024-12-22 06:33:37 +01:00
James Cole
2e993857e8 APIs and views for exchange rates. 2024-12-22 06:24:45 +01:00
James Cole
117a376fc3 Expand page for currency exchange rates. 2024-12-21 21:31:28 +01:00
James Cole
1daffedde0 First page for currency exchange rates. 2024-12-21 21:01:03 +01:00
James Cole
0e8fdd76a6 Index for exchange rates. 2024-12-21 18:35:05 +01:00
James Cole
7ff4f29bcb Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2 2024-12-21 12:51:52 +01:00
James Cole
9e4cff2b23 Add a little debug, less massive recalculations. 2024-12-21 12:51:40 +01:00
github-actions
4aaea89f2c Auto commit for release 'branch-v6.2' on 2024-12-21 2024-12-21 12:27:07 +01:00
James Cole
4fbf7b38fb Do not pull in invalid transactions 2024-12-21 11:40:34 +01:00
James Cole
76075401f9 Recalculate amounts. 2024-12-21 11:33:58 +01:00
James Cole
e2a20dd63d Command to recalculate foreign amounts. 2024-12-21 11:20:48 +01:00
James Cole
b52a1f3eb1 Respond to currency changes. 2024-12-21 07:12:11 +01:00
James Cole
7fd5a88122 Add more column conversions. 2024-12-20 05:31:16 +01:00
James Cole
1a1baa5cda Add observers for amounts. 2024-12-20 05:20:37 +01:00
James Cole
577d671a0c Add native amount column 2024-12-19 06:21:17 +01:00
James Cole
380029ffd8 Fix missing method. 2024-12-18 16:57:11 +01:00
github-actions
76cc27a267 Auto commit for release 'branch-v6.2' on 2024-12-18 2024-12-18 16:45:41 +01:00
James Cole
e8a6f30e4e Merge branch 'develop' into v6.2
# Conflicts:
#	composer.lock
#	config/firefly.php
#	package-lock.json
2024-12-18 16:39:22 +01:00
github-actions
fe6021a3d6 Auto commit for release 'v6.1.25' on 2024-12-18 2024-12-18 16:36:08 +01:00
James Cole
563c54702b Update changelog. 2024-12-18 16:31:37 +01:00
James Cole
4d67d27ba0 Fix #9546 2024-12-18 16:29:19 +01:00
James Cole
edf3876a57 Merge branch 'main' into develop 2024-12-18 16:26:35 +01:00
James Cole
2d10f255c2 Fix reference to old method. 2024-12-18 16:18:06 +01:00
James Cole
ee76cc6761 Fix methods 2024-12-18 16:13:32 +01:00
James Cole
f197e6623b Merge pull request #9551 from firefly-iii/dependabot/github_actions/github/command-1.3.0 2024-12-16 06:59:19 +01:00
James Cole
42a9809450 Merge pull request #9550 from firefly-iii/dependabot/npm_and_yarn/develop/chartjs-chart-sankey-0.14.0 2024-12-16 06:59:10 +01:00
James Cole
444f80a933 Merge pull request #9549 from firefly-iii/dependabot/npm_and_yarn/develop/ag-grid-community/styles-33.0.2 2024-12-16 06:59:01 +01:00
dependabot[bot]
4b985c818a Bump github/command from 1.2.2 to 1.3.0
Bumps [github/command](https://github.com/github/command) from 1.2.2 to 1.3.0.
- [Release notes](https://github.com/github/command/releases)
- [Commits](https://github.com/github/command/compare/v1.2.2...v1.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 03:49:31 +00:00
github-actions
2e62fe7b72 Auto commit for release 'develop' on 2024-12-16 2024-12-16 04:22:19 +01:00
dependabot[bot]
ccd182aed9 Bump chartjs-chart-sankey from 0.13.0 to 0.14.0
Bumps [chartjs-chart-sankey](https://github.com/kurkle/chartjs-chart-sankey) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/kurkle/chartjs-chart-sankey/releases)
- [Commits](https://github.com/kurkle/chartjs-chart-sankey/compare/v0.13.0...v0.14.0)

---
updated-dependencies:
- dependency-name: chartjs-chart-sankey
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 03:06:22 +00:00
dependabot[bot]
615eef3fdd Bump @ag-grid-community/styles from 32.3.3 to 33.0.2
Bumps [@ag-grid-community/styles](https://github.com/ag-grid/ag-grid) from 32.3.3 to 33.0.2.
- [Release notes](https://github.com/ag-grid/ag-grid/releases)
- [Commits](https://github.com/ag-grid/ag-grid/compare/v32.3.3...v33.0.2)

---
updated-dependencies:
- dependency-name: "@ag-grid-community/styles"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 03:06:13 +00:00
James Cole
d4e4907363 Add option for manual activation. 2024-12-15 19:59:36 +01:00
James Cole
c205e93876 Fix https://github.com/firefly-iii/firefly-iii/issues/7288 2024-12-15 19:51:46 +01:00
James Cole
3b24bb99bb Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2 2024-12-15 19:51:37 +01:00
James Cole
2814cd1b2a Better name 2024-12-15 19:51:30 +01:00
github-actions
5285e1ac14 Auto commit for release 'branch-v6.2' on 2024-12-15 2024-12-15 16:16:13 +01:00
James Cole
48a999cf91 Fix old reference. 2024-12-15 16:11:48 +01:00
James Cole
3117c8846e Rename branch release. 2024-12-15 12:31:36 +01:00
github-actions
6bb297e76f Auto commit for release 'branch-v6.2' on 2024-12-15 2024-12-15 10:32:00 +01:00
James Cole
bc698f67ea Merge branch 'main' into v6.2 2024-12-15 09:07:04 +01:00
James Cole
f1c859aaa3 Update build job 2024-12-15 08:57:55 +01:00
James Cole
2d0aa207d4 Fix various piggy bank errors 2024-12-15 08:50:57 +01:00
James Cole
4a75e9c262 Merge branch 'v6.2' of github.com:firefly-iii/firefly-iii into v6.2 2024-12-15 08:20:52 +01:00
James Cole
ee7c4b8863 Fix user test notification. 2024-12-15 08:20:42 +01:00
github-actions
f782979d6c Auto commit for release 'develop' on 2024-12-15 2024-12-15 04:09:28 +01:00
github-actions
53cce6510c Auto commit for release 'branch-v6.2' on 2024-12-14 2024-12-14 22:20:13 +01:00
github-actions
53252b84fd Auto commit for release 'develop' on 2024-12-14 2024-12-14 22:13:19 +01:00
James Cole
8f3cf38f77 Remove exception because it breaks the upgrade. 2024-12-14 22:12:56 +01:00
James Cole
f33766a062 Make column nullable so migration does not fail. 2024-12-14 22:06:53 +01:00
James Cole
ac5e62c65d Merge branch 'main' into v6.2 2024-12-14 21:56:26 +01:00
github-actions
e2289ce1e6 Auto commit for release 'branch-v6.2' on 2024-12-14 2024-12-14 21:55:42 +01:00
James Cole
f0e2913802 Ignore phpcs errors. 2024-12-14 21:50:46 +01:00
James Cole
1fa928b98f Should work from here 2024-12-14 21:45:20 +01:00
James Cole
1c691cca33 Duh, that wasn't smart. 2024-12-14 21:39:30 +01:00
James Cole
69e1eb3eff echo debug and upgrade to 8.4 2024-12-14 21:37:45 +01:00
James Cole
90794cb515 Experimental branch build. 2024-12-14 21:35:14 +01:00
James Cole
28d7e24d30 Fix piggy bank orders 2024-12-14 20:16:08 +01:00
James Cole
6a62f781e9 Multi account piggy banks. 2024-12-14 17:32:03 +01:00
James Cole
fb6c67fa04 Fix https://github.com/firefly-iii/firefly-iii/issues/9532 2024-12-14 08:10:58 +01:00
James Cole
03e9e3dbdb Expand all notifications. 2024-12-14 08:03:18 +01:00
James Cole
5520992861 Clean up and fix notifications. 2024-12-14 07:52:02 +01:00
James Cole
5f1502eea7 Clean up code. 2024-12-14 07:22:46 +01:00
James Cole
b3560ff525 Clean up notifications 2024-12-14 07:13:01 +01:00
James Cole
8030167ffc Clean up notifications, fix first user notification. 2024-12-14 07:05:08 +01:00
James Cole
fd2c1615cf Start cleaning up notifications. 2024-12-14 06:57:57 +01:00
James Cole
b976239580 Fix all test channels for user and owner. 2024-12-14 06:30:27 +01:00
James Cole
7d8d773f8f Clean up some code. 2024-12-14 05:45:54 +01:00
James Cole
b930ad4da7 Update code and packages 2024-12-14 05:43:13 +01:00
James Cole
abad7cdf16 Update packages and notification settings 2024-12-14 05:39:55 +01:00
James Cole
0e5eb036b0 Unknown user warning. 2024-12-12 07:09:17 +01:00
James Cole
d995bfc081 Update all owner events so they support all channels 2024-12-12 06:33:48 +01:00
James Cole
c920070ce2 Expand settings for notifications. 2024-12-11 07:23:46 +01:00
James Cole
277f5e538f Merge pull request #9534 from firefly-iii/dependabot/composer/composer-736964bd2b 2024-12-10 04:33:36 +01:00
dependabot[bot]
89f197b9d4 Bump league/commonmark in the composer group across 1 directory
Bumps the composer group with 1 update in the / directory: [league/commonmark](https://github.com/thephpleague/commonmark).


Updates `league/commonmark` from 2.5.3 to 2.6.0
- [Release notes](https://github.com/thephpleague/commonmark/releases)
- [Changelog](https://github.com/thephpleague/commonmark/blob/2.6/CHANGELOG.md)
- [Commits](https://github.com/thephpleague/commonmark/compare/2.5.3...2.6.0)

---
updated-dependencies:
- dependency-name: league/commonmark
  dependency-type: direct:production
  dependency-group: composer
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-10 01:17:43 +00:00
James Cole
c35ff3174a Add support for Pushover 2024-12-09 07:34:01 +01:00
James Cole
94085ee940 Add config for ntfy 2024-12-09 06:27:37 +01:00
James Cole
c841fa3620 Remove references to discord. 2024-12-09 06:00:43 +01:00
github-actions
69b2c1f4d2 Auto commit for release 'develop' on 2024-12-09 2024-12-09 04:21:46 +01:00
James Cole
2f7a1c941e Expand test notification framework. 2024-12-08 16:28:22 +01:00
James Cole
c06fb8daf6 Expand notifications settings. 2024-12-07 09:41:09 +01:00
James Cole
26948a058a Expand UI for notifications. 2024-12-07 08:05:51 +01:00
James Cole
1220564f30 Fix creating piggies 2024-12-07 08:05:29 +01:00
James Cole
ea4be9dd0c Expand forms and improve validation for multi-account piggy banks 2024-12-06 08:10:31 +01:00
James Cole
1ccda0b598 Merge pull request #9516 from firefly-iii/dependabot/npm_and_yarn/develop/vite-6.0.1
Bump vite from 5.4.11 to 6.0.1
2024-12-04 06:54:15 +01:00
James Cole
eb3b67ffd6 Merge pull request #9515 from firefly-iii/dependabot/composer/develop/laravel-json-api/laravel-5.0.0
Bump laravel-json-api/laravel from 4.1.1 to 5.0.0
2024-12-04 06:39:04 +01:00
James Cole
4819b5ac5d More code for multi account piggy banks. 2024-12-04 06:38:47 +01:00
dependabot[bot]
591b795aa3 Bump vite from 5.4.11 to 6.0.1
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.11 to 6.0.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/create-vite@6.0.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 03:59:55 +00:00
dependabot[bot]
ac21ed7d18 Bump laravel-json-api/laravel from 4.1.1 to 5.0.0
Bumps [laravel-json-api/laravel](https://github.com/laravel-json-api/laravel) from 4.1.1 to 5.0.0.
- [Release notes](https://github.com/laravel-json-api/laravel/releases)
- [Changelog](https://github.com/laravel-json-api/laravel/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/laravel-json-api/laravel/compare/v4.1.1...v5.0.0)

---
updated-dependencies:
- dependency-name: laravel-json-api/laravel
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-02 03:55:52 +00:00
github-actions
d9c66a2db0 Auto commit for release 'develop' on 2024-12-02 2024-12-02 04:21:56 +01:00
James Cole
d740814f88 API works for multi-account piggies, the rest throws an exception 2024-12-01 18:32:05 +01:00
James Cole
cdf1ebf3f7 Better ability to store piggy banks. 2024-12-01 18:16:48 +01:00
James Cole
f2fab5d4ee Update code for piggy banks. 2024-12-01 06:48:15 +01:00
James Cole
21a6927279 Rename fields for piggy bank 2024-11-30 16:02:30 +01:00
James Cole
92190bbc54 Rename fields in piggy bank. 2024-11-30 15:57:11 +01:00
James Cole
9ad005e31f Add edit button for notes https://github.com/firefly-iii/firefly-iii/issues/5523 2024-11-30 06:19:21 +01:00
James Cole
f5c56e02da API allows update/set of budget limit notes. https://github.com/firefly-iii/firefly-iii/issues/5523 2024-11-30 05:42:59 +01:00
github-actions
6f02eff020 Auto commit for release 'develop' on 2024-11-29 2024-11-29 06:56:47 +01:00
James Cole
c25c0d37c5 Replace constants with enums. 2024-11-27 08:08:52 +01:00
James Cole
4ba1c5bcfc New set of PHP 8.4 files 2024-11-26 18:04:32 +01:00
James Cole
64aefe5848 Merge pull request #9495 from firefly-iii/dependabot/npm_and_yarn/develop/i18next-24.0.0
Bump i18next from 23.16.8 to 24.0.0
2024-11-25 07:22:13 +01:00
James Cole
73f2f71b03 Merge pull request #9496 from firefly-iii/dependabot/npm_and_yarn/develop/i18next-http-backend-3.0.1
Bump i18next-http-backend from 2.7.1 to 3.0.1
2024-11-25 07:22:04 +01:00
James Cole
12ee37d700 Switch API to transaction type enums 2024-11-25 07:14:14 +01:00
James Cole
9679c22a27 Fix https://github.com/firefly-iii/firefly-iii/issues/9497 2024-11-25 07:12:36 +01:00
dependabot[bot]
1395c95353 Bump i18next-http-backend from 2.7.1 to 3.0.1
Bumps [i18next-http-backend](https://github.com/i18next/i18next-http-backend) from 2.7.1 to 3.0.1.
- [Changelog](https://github.com/i18next/i18next-http-backend/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next-http-backend/commits/v3.0.1)

---
updated-dependencies:
- dependency-name: i18next-http-backend
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-25 03:21:57 +00:00
dependabot[bot]
4d1fd43c8c Bump i18next from 23.16.8 to 24.0.0
Bumps [i18next](https://github.com/i18next/i18next) from 23.16.8 to 24.0.0.
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](https://github.com/i18next/i18next/compare/v23.16.8...v24.0.0)

---
updated-dependencies:
- dependency-name: i18next
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-25 03:21:31 +00:00
github-actions
71c208c4fb Auto commit for release 'develop' on 2024-11-25 2024-11-25 04:18:55 +01:00
James Cole
91a2a1afc3 Fix https://github.com/firefly-iii/firefly-iii/issues/9492 2024-11-24 15:23:17 +01:00
github-actions
25c1ca2f5d Auto commit for release 'develop' on 2024-11-24 2024-11-24 04:56:25 +01:00
James Cole
6f0bb82f59 Fix missing import 2024-11-24 04:52:33 +01:00
github-actions
22a5184ebe Auto commit for release 'develop' on 2024-11-23 2024-11-23 21:16:06 +01:00
github-actions
17b0b1f43f Auto commit for release 'v6.1.24' on 2024-11-23 2024-11-23 21:07:01 +01:00
James Cole
b61df5ec19 Update changelog 2024-11-23 21:01:58 +01:00
James Cole
1ac7275f83 Fix https://github.com/firefly-iii/firefly-iii/issues/9491 2024-11-23 20:59:08 +01:00
1041 changed files with 21025 additions and 13105 deletions

View File

@@ -97,13 +97,13 @@
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": {
"dev-main": "3.x-dev"
},
"phpstan": { "phpstan": {
"includes": [ "includes": [
"extension.neon" "extension.neon"
] ]
},
"branch-alias": {
"dev-main": "3.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -406,16 +406,16 @@
}, },
{ {
"name": "friendsofphp/php-cs-fixer", "name": "friendsofphp/php-cs-fixer",
"version": "v3.64.0", "version": "v3.65.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "58dd9c931c785a79739310aef5178928305ffa67" "reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/58dd9c931c785a79739310aef5178928305ffa67", "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/79d4f3e77b250a7d8043d76c6af8f0695e8a469f",
"reference": "58dd9c931c785a79739310aef5178928305ffa67", "reference": "79d4f3e77b250a7d8043d76c6af8f0695e8a469f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -425,7 +425,7 @@
"ext-filter": "*", "ext-filter": "*",
"ext-json": "*", "ext-json": "*",
"ext-tokenizer": "*", "ext-tokenizer": "*",
"fidry/cpu-core-counter": "^1.0", "fidry/cpu-core-counter": "^1.2",
"php": "^7.4 || ^8.0", "php": "^7.4 || ^8.0",
"react/child-process": "^0.6.5", "react/child-process": "^0.6.5",
"react/event-loop": "^1.0", "react/event-loop": "^1.0",
@@ -445,18 +445,18 @@
"symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
}, },
"require-dev": { "require-dev": {
"facile-it/paraunit": "^1.3 || ^2.3", "facile-it/paraunit": "^1.3.1 || ^2.4",
"infection/infection": "^0.29.5", "infection/infection": "^0.29.8",
"justinrainbow/json-schema": "^5.2", "justinrainbow/json-schema": "^5.3 || ^6.0",
"keradus/cli-executor": "^2.1", "keradus/cli-executor": "^2.1",
"mikey179/vfsstream": "^1.6.11", "mikey179/vfsstream": "^1.6.12",
"php-coveralls/php-coveralls": "^2.7", "php-coveralls/php-coveralls": "^2.7",
"php-cs-fixer/accessible-object": "^1.1", "php-cs-fixer/accessible-object": "^1.1",
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5",
"phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2", "phpunit/phpunit": "^9.6.21 || ^10.5.38 || ^11.4.3",
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0", "symfony/var-dumper": "^5.4.47 || ^6.4.15 || ^7.1.8",
"symfony/yaml": "^5.4 || ^6.0 || ^7.0" "symfony/yaml": "^5.4.45 || ^6.4.13 || ^7.1.6"
}, },
"suggest": { "suggest": {
"ext-dom": "For handling output formats in XML", "ext-dom": "For handling output formats in XML",
@@ -497,7 +497,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.64.0" "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.65.0"
}, },
"funding": [ "funding": [
{ {
@@ -505,7 +505,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-08-30T23:09:38+00:00" "time": "2024-11-25T00:39:24+00:00"
}, },
{ {
"name": "psr/container", "name": "psr/container",
@@ -1259,16 +1259,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v7.1.8", "version": "v7.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3",
"reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1332,7 +1332,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v7.1.8" "source": "https://github.com/symfony/console/tree/v7.2.1"
}, },
"funding": [ "funding": [
{ {
@@ -1348,20 +1348,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-11-06T14:23:19+00:00" "time": "2024-12-11T03:49:26+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
"version": "v3.5.0", "version": "v3.5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git", "url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
"reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1399,7 +1399,7 @@
"description": "A generic function and convention to trigger deprecation notices", "description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1"
}, },
"funding": [ "funding": [
{ {
@@ -1415,20 +1415,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-04-18T09:32:20+00:00" "time": "2024-09-25T14:20:29+00:00"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v7.1.6", "version": "v7.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher.git", "url": "https://github.com/symfony/event-dispatcher.git",
"reference": "87254c78dd50721cfd015b62277a8281c5589702" "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87254c78dd50721cfd015b62277a8281c5589702", "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1",
"reference": "87254c78dd50721cfd015b62277a8281c5589702", "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1479,7 +1479,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/event-dispatcher/tree/v7.1.6" "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0"
}, },
"funding": [ "funding": [
{ {
@@ -1495,20 +1495,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-09-25T14:20:29+00:00" "time": "2024-09-25T14:21:43+00:00"
}, },
{ {
"name": "symfony/event-dispatcher-contracts", "name": "symfony/event-dispatcher-contracts",
"version": "v3.5.0", "version": "v3.5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher-contracts.git", "url": "https://github.com/symfony/event-dispatcher-contracts.git",
"reference": "8f93aec25d41b72493c6ddff14e916177c9efc50" "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/8f93aec25d41b72493c6ddff14e916177c9efc50", "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f",
"reference": "8f93aec25d41b72493c6ddff14e916177c9efc50", "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1555,7 +1555,7 @@
"standards" "standards"
], ],
"support": { "support": {
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.0" "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1"
}, },
"funding": [ "funding": [
{ {
@@ -1571,20 +1571,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-04-18T09:32:20+00:00" "time": "2024-09-25T14:20:29+00:00"
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v7.1.6", "version": "v7.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/filesystem.git", "url": "https://github.com/symfony/filesystem.git",
"reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4" "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/c835867b3c62bb05c7fe3d637c871c7ae52024d4", "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb",
"reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4", "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1621,7 +1621,7 @@
"description": "Provides basic utilities for the filesystem", "description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/filesystem/tree/v7.1.6" "source": "https://github.com/symfony/filesystem/tree/v7.2.0"
}, },
"funding": [ "funding": [
{ {
@@ -1637,20 +1637,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-10-25T15:11:02+00:00" "time": "2024-10-25T15:15:23+00:00"
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v7.1.6", "version": "v7.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",
"reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8" "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/2cb89664897be33f78c65d3d2845954c8d7a43b8", "url": "https://api.github.com/repos/symfony/finder/zipball/6de263e5868b9a137602dd1e33e4d48bfae99c49",
"reference": "2cb89664897be33f78c65d3d2845954c8d7a43b8", "reference": "6de263e5868b9a137602dd1e33e4d48bfae99c49",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1685,7 +1685,7 @@
"description": "Finds files and directories via an intuitive fluent interface", "description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/finder/tree/v7.1.6" "source": "https://github.com/symfony/finder/tree/v7.2.0"
}, },
"funding": [ "funding": [
{ {
@@ -1701,20 +1701,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-10-01T08:31:23+00:00" "time": "2024-10-23T06:56:12+00:00"
}, },
{ {
"name": "symfony/options-resolver", "name": "symfony/options-resolver",
"version": "v7.1.6", "version": "v7.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/options-resolver.git", "url": "https://github.com/symfony/options-resolver.git",
"reference": "85e95eeede2d41cd146146e98c9c81d9214cae85" "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/85e95eeede2d41cd146146e98c9c81d9214cae85", "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50",
"reference": "85e95eeede2d41cd146146e98c9c81d9214cae85", "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1752,7 +1752,7 @@
"options" "options"
], ],
"support": { "support": {
"source": "https://github.com/symfony/options-resolver/tree/v7.1.6" "source": "https://github.com/symfony/options-resolver/tree/v7.2.0"
}, },
"funding": [ "funding": [
{ {
@@ -1768,7 +1768,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-09-25T14:20:29+00:00" "time": "2024-11-20T11:17:29+00:00"
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
@@ -1796,8 +1796,8 @@
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": { "thanks": {
"name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "name": "symfony/polyfill"
} }
}, },
"autoload": { "autoload": {
@@ -1872,8 +1872,8 @@
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": { "thanks": {
"name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "name": "symfony/polyfill"
} }
}, },
"autoload": { "autoload": {
@@ -1950,8 +1950,8 @@
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": { "thanks": {
"name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "name": "symfony/polyfill"
} }
}, },
"autoload": { "autoload": {
@@ -2034,8 +2034,8 @@
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": { "thanks": {
"name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "name": "symfony/polyfill"
} }
}, },
"autoload": { "autoload": {
@@ -2108,8 +2108,8 @@
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": { "thanks": {
"name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "name": "symfony/polyfill"
} }
}, },
"autoload": { "autoload": {
@@ -2188,8 +2188,8 @@
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": { "thanks": {
"name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "name": "symfony/polyfill"
} }
}, },
"autoload": { "autoload": {
@@ -2246,16 +2246,16 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v7.1.8", "version": "v7.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892" "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/42783370fda6e538771f7c7a36e9fa2ee3a84892", "url": "https://api.github.com/repos/symfony/process/zipball/d34b22ba9390ec19d2dd966c40aa9e8462f27a7e",
"reference": "42783370fda6e538771f7c7a36e9fa2ee3a84892", "reference": "d34b22ba9390ec19d2dd966c40aa9e8462f27a7e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2287,7 +2287,7 @@
"description": "Executes commands in sub-processes", "description": "Executes commands in sub-processes",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/process/tree/v7.1.8" "source": "https://github.com/symfony/process/tree/v7.2.0"
}, },
"funding": [ "funding": [
{ {
@@ -2303,20 +2303,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-11-06T14:23:19+00:00" "time": "2024-11-06T14:24:19+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
"version": "v3.5.0", "version": "v3.5.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/service-contracts.git", "url": "https://github.com/symfony/service-contracts.git",
"reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0",
"reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2370,7 +2370,7 @@
"standards" "standards"
], ],
"support": { "support": {
"source": "https://github.com/symfony/service-contracts/tree/v3.5.0" "source": "https://github.com/symfony/service-contracts/tree/v3.5.1"
}, },
"funding": [ "funding": [
{ {
@@ -2386,20 +2386,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-04-18T09:32:20+00:00" "time": "2024-09-25T14:20:29+00:00"
}, },
{ {
"name": "symfony/stopwatch", "name": "symfony/stopwatch",
"version": "v7.1.6", "version": "v7.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/stopwatch.git", "url": "https://github.com/symfony/stopwatch.git",
"reference": "8b4a434e6e7faf6adedffb48783a5c75409a1a05" "reference": "696f418b0d722a4225e1c3d95489d262971ca924"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/8b4a434e6e7faf6adedffb48783a5c75409a1a05", "url": "https://api.github.com/repos/symfony/stopwatch/zipball/696f418b0d722a4225e1c3d95489d262971ca924",
"reference": "8b4a434e6e7faf6adedffb48783a5c75409a1a05", "reference": "696f418b0d722a4225e1c3d95489d262971ca924",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2432,7 +2432,7 @@
"description": "Provides a way to profile code", "description": "Provides a way to profile code",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/stopwatch/tree/v7.1.6" "source": "https://github.com/symfony/stopwatch/tree/v7.2.0"
}, },
"funding": [ "funding": [
{ {
@@ -2448,20 +2448,20 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-09-25T14:20:29+00:00" "time": "2024-09-25T14:21:43+00:00"
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v7.1.8", "version": "v7.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82",
"reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2519,7 +2519,7 @@
"utf8" "utf8"
], ],
"support": { "support": {
"source": "https://github.com/symfony/string/tree/v7.1.8" "source": "https://github.com/symfony/string/tree/v7.2.0"
}, },
"funding": [ "funding": [
{ {
@@ -2535,7 +2535,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-11-13T13:31:21+00:00" "time": "2024-11-13T13:31:26+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],

View File

@@ -26,8 +26,7 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd $SCRIPT_DIR/php-cs-fixer cd $SCRIPT_DIR/php-cs-fixer
composer update --quiet composer update --quiet
rm -f .php-cs-fixer.cache rm -f .php-cs-fixer.cache
PHP_CS_FIXER_IGNORE_ENV=true PHP_CS_FIXER_IGNORE_ENV=true ./vendor/bin/php-cs-fixer fix \
./vendor/bin/php-cs-fixer fix \
--config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php \ --config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php \
--format=txt \ --format=txt \
--allow-risky=yes --allow-risky=yes

View File

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

View File

@@ -4,9 +4,13 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
version: version:
description: 'Release "v1.2.3" or "develop"' description: 'Release "v1.2.3" or "develop" or "branch-abc"'
required: true required: true
default: 'develop' default: 'develop'
phpversion:
description: 'PHP version'
required: true
default: '8.3'
schedule: schedule:
- cron: '0 3 * * MON' - cron: '0 3 * * MON'
@@ -23,6 +27,11 @@ jobs:
if [[ "develop" == "$version" ]]; then if [[ "develop" == "$version" ]]; then
git checkout --track origin/develop git checkout --track origin/develop
git pull git pull
elif [[ "$version" == branch* ]]; then
PULLBRANCH=${version:7}
echo "The branch is '$PULLBRANCH' ($version)"
git checkout --track origin/$PULLBRANCH
git pull
else else
git config user.name github-actions git config user.name github-actions
git config user.email 41898282+github-actions[bot]@users.noreply.github.com git config user.email 41898282+github-actions[bot]@users.noreply.github.com
@@ -36,7 +45,7 @@ jobs:
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: '8.3' php-version: ${{ github.event.inputs.phpversion }}
extensions: mbstring, intl, zip, bcmath extensions: mbstring, intl, zip, bcmath
- name: crowdin action - name: crowdin action
uses: crowdin/github-action@v2 uses: crowdin/github-action@v2
@@ -133,7 +142,7 @@ jobs:
rm -rf vendor composer.lock rm -rf vendor composer.lock
composer update --no-dev --no-scripts --no-plugins -q composer update --no-dev --no-scripts --no-plugins -q
sudo chown -R runner:docker resources/lang sudo chown -R runner:docker resources/lang
.ci/phpcs.sh .ci/phpcs.sh || true
- name: Import GPG key - name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6 uses: crazy-max/ghaction-import-gpg@v6
with: with:
@@ -166,6 +175,16 @@ jobs:
tarName=FireflyIII-develop.tar.gz tarName=FireflyIII-develop.tar.gz
fi fi
# if this is a branch build, also slightly different variable names.
if [[ "$version" == branch* ]]; then
[[ -z $(git status --untracked-files=normal --porcelain) ]] && echo "this branch is clean, no need to push..." && exit 0;
# branch builds overrule develop
releaseName=$version-$(date +'%Y%m%d')
originalName=$releaseName
zipName=FireflyIII-$version.zip
tarName=FireflyIII-$version.tar.gz
fi
# in both cases, if the release or tag already exists, add ".1" until it no longer exists. # in both cases, if the release or tag already exists, add ".1" until it no longer exists.
tagFound=true tagFound=true
tagCount=1 tagCount=1
@@ -207,12 +226,13 @@ jobs:
gpg --armor --detach-sign $zipName gpg --armor --detach-sign $zipName
gpg --armor --detach-sign $tarName gpg --armor --detach-sign $tarName
# create a development (nightly) release: # describe the development release.
if [[ "develop" == "$version" ]]; then if [[ "develop" == "$version" ]]; then
echo 'Develop release.' echo 'Develop release.'
# add text to output.txt (instructions)
rm output.txt rm output.txt
echo "Bi-weekly development release of Firefly III with the latest fixes, translations and features. Docker users can find this release under the \`develop\` tag." >> output.txt touch output.txt
sudo chown -R runner:docker output.txt
echo "Weekly development release of Firefly III with the latest fixes, translations and features. Docker users can find this release under the \`develop\` tag." >> output.txt
echo "" >> output.txt echo "" >> output.txt
echo "This release was created on **$(date +'%Y-%m-%d')** and may contain unexpected bugs. Data loss is rare but is not impossible. The releases are signed, and you can verify them using the [Firefly III releases PGP key](https://docs.firefly-iii.org/explanation/more-information/signatures/)." >> output.txt echo "This release was created on **$(date +'%Y-%m-%d')** and may contain unexpected bugs. Data loss is rare but is not impossible. The releases are signed, and you can verify them using the [Firefly III releases PGP key](https://docs.firefly-iii.org/explanation/more-information/signatures/)." >> output.txt
echo "" >> output.txt echo "" >> output.txt
@@ -220,15 +240,62 @@ jobs:
echo "* Or read the upgrade instructions for [Docker](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/docker/), [Kubernetes](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/kubernetes/) or [self-managed servers](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/self-managed/)" >> output.txt echo "* Or read the upgrade instructions for [Docker](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/docker/), [Kubernetes](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/kubernetes/) or [self-managed servers](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/self-managed/)" >> output.txt
echo "" >> output.txt echo "" >> output.txt
echo ":warning: Please be careful with this pre-release, as it may not work as expected." >> output.txt echo ":warning: Please be careful with this pre-release, as it may not work as expected." >> output.txt
fi
# describe a branch release
if [[ "$version" == branch* ]]; then
echo 'Branch release.'
rm output.txt
touch output.txt
sudo chown -R runner:docker output.txt
echo "Irregular BRANCH release of Firefly III. This release contains specific features or changes. Docker users can find this release under the \`$version\` tag." >> output.txt
echo "" >> output.txt
echo "This release was created on **$(date +'%Y-%m-%d')** and may contain unexpected bugs. Data loss is rare but is not impossible. The releases are signed, and you can verify them using the [Firefly III releases PGP key](https://docs.firefly-iii.org/explanation/more-information/signatures/)." >> output.txt
echo "" >> output.txt
echo "* Please read the installation instructions for [Docker](https://docs.firefly-iii.org/how-to/firefly-iii/installation/docker/), [Portainer](https://docs.firefly-iii.org/how-to/firefly-iii/installation/portainer/), [Kubernetes](https://docs.firefly-iii.org/how-to/firefly-iii/installation/kubernetes/) or [self-managed servers](https://docs.firefly-iii.org/how-to/firefly-iii/installation/self-managed/)" >> output.txt
echo "* Or read the upgrade instructions for [Docker](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/docker/), [Kubernetes](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/kubernetes/) or [self-managed servers](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/self-managed/)" >> output.txt
echo "" >> output.txt
echo ":warning: Please be careful with this branch pre-release, as it may not work as expected." >> output.txt
fi
# describe the main release
if [[ "develop" != "$version" ]] && [[ "$version" != branch* ]]; then
sudo chown -R runner:docker output.txt
echo 'Main release.'
echo '' >> output.txt
echo '### Instructions' >> output.txt
echo '' >> output.txt
echo "* Installation instructions for [Docker](https://docs.firefly-iii.org/how-to/firefly-iii/installation/docker/), [Portainer](https://docs.firefly-iii.org/how-to/firefly-iii/installation/portainer/), [Kubernetes](https://docs.firefly-iii.org/how-to/firefly-iii/installation/kubernetes/) or [self-managed servers](https://docs.firefly-iii.org/how-to/firefly-iii/installation/self-managed/)" >> output.txt
echo "* Or read the upgrade instructions for [Docker](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/docker/), [Kubernetes](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/kubernetes/) or [self-managed servers](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/self-managed/)" >> output.txt
echo "* The releases are signed, and you can verify them using the [Firefly III releases PGP key](https://docs.firefly-iii.org/explanation/more-information/signatures/)." >> output.txt
fi
# create a development release:
if [[ "develop" == "$version" ]]; then
# create the release: # create the release:
echo "Create nightly release." echo "Create develop release."
git tag -a $releaseName -m "Nightly development release '$version' on $(date +'%Y-%m-%d')" git tag -a $releaseName -m "Development release '$version' on $(date +'%Y-%m-%d')"
git push origin $releaseName git push origin $releaseName
gh release create $releaseName -p --verify-tag \ gh release create $releaseName -p --verify-tag \
-t "Development release for $(date +'%Y-%m-%d')" \ -t "Development release for $(date +'%Y-%m-%d')" \
-F output.txt -F output.txt
fi
# create a branch release:
if [[ "$version" == branch* ]]; then
# create the release:
echo "Create branch release."
git tag -a $releaseName -m "Branch release '$version' on $(date +'%Y-%m-%d')"
git push origin $releaseName
gh release create $releaseName -p --verify-tag \
-t "Branch release for $(date +'%Y-%m-%d')" \
-F output.txt
fi
# create a development (nightly) release:
if [[ "develop" == "$version" ]] || [[ "$version" == branch* ]]; then
# add zip file to release. # add zip file to release.
gh release upload $releaseName $zipName gh release upload $releaseName $zipName
gh release upload $releaseName $tarName gh release upload $releaseName $tarName
@@ -247,16 +314,6 @@ jobs:
gh release upload $releaseName HEAD.txt gh release upload $releaseName HEAD.txt
else else
echo 'MAIN (real) release' echo 'MAIN (real) release'
sudo chown -R runner:docker output.txt
# add text to output.txt (more instructions)
echo '' >> output.txt
echo '### Instructions' >> output.txt
echo '' >> output.txt
echo "* Installation instructions for [Docker](https://docs.firefly-iii.org/how-to/firefly-iii/installation/docker/), [Portainer](https://docs.firefly-iii.org/how-to/firefly-iii/installation/portainer/), [Kubernetes](https://docs.firefly-iii.org/how-to/firefly-iii/installation/kubernetes/) or [self-managed servers](https://docs.firefly-iii.org/how-to/firefly-iii/installation/self-managed/)" >> output.txt
echo "* Or read the upgrade instructions for [Docker](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/docker/), [Kubernetes](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/kubernetes/) or [self-managed servers](https://docs.firefly-iii.org/how-to/firefly-iii/upgrade/self-managed/)" >> output.txt
echo "* The releases are signed, and you can verify them using the [Firefly III releases PGP key](https://docs.firefly-iii.org/explanation/more-information/signatures/)." >> output.txt
echo "Create default release."
git tag -a $releaseName -m "Here be changelog" git tag -a $releaseName -m "Here be changelog"
git push origin $releaseName git push origin $releaseName
gh release create $releaseName -F output.txt -t "$releaseName" --verify-tag gh release create $releaseName -F output.txt -t "$releaseName" --verify-tag

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* AccountController.php * AccountController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -29,6 +30,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType; use FireflyIII\Models\AccountType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Support\Facades\Steam;
use FireflyIII\Support\Http\Api\AccountFilter; use FireflyIII\Support\Http\Api\AccountFilter;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
@@ -77,7 +79,7 @@ class AccountController extends Controller
$query = $data['query']; $query = $data['query'];
$date = $data['date'] ?? today(config('app.timezone')); $date = $data['date'] ?? today(config('app.timezone'));
$return = []; $return = [];
$result = $this->repository->searchAccount((string)$query, $types, $this->parameters->get('limit')); $result = $this->repository->searchAccount((string) $query, $types, $this->parameters->get('limit'));
// TODO this code is duplicated in the V2 Autocomplete controller, which means this code is due to be deprecated. // TODO this code is duplicated in the V2 Autocomplete controller, which means this code is due to be deprecated.
$defaultCurrency = app('amount')->getDefaultCurrency(); $defaultCurrency = app('amount')->getDefaultCurrency();
@@ -88,20 +90,20 @@ class AccountController extends Controller
$currency = $this->repository->getAccountCurrency($account) ?? $defaultCurrency; $currency = $this->repository->getAccountCurrency($account) ?? $defaultCurrency;
if (in_array($account->accountType->type, $this->balanceTypes, true)) { if (in_array($account->accountType->type, $this->balanceTypes, true)) {
$balance = app('steam')->balance($account, $date); $balance = Steam::finalAccountBalance($account, $date);
$nameWithBalance = sprintf( $nameWithBalance = sprintf(
'%s (%s)', '%s (%s)',
$account->name, $account->name,
app('amount')->formatAnything($currency, $balance, false) app('amount')->formatAnything($currency, $balance['balance'], false)
); );
} }
$return[] = [ $return[] = [
'id' => (string)$account->id, 'id' => (string) $account->id,
'name' => $account->name, 'name' => $account->name,
'name_with_balance' => $nameWithBalance, 'name_with_balance' => $nameWithBalance,
'type' => $account->accountType->type, 'type' => $account->accountType->type,
'currency_id' => (string)$currency->id, 'currency_id' => (string) $currency->id,
'currency_name' => $currency->name, 'currency_name' => $currency->name,
'currency_code' => $currency->code, 'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol, 'currency_symbol' => $currency->symbol,
@@ -114,8 +116,8 @@ class AccountController extends Controller
$return, $return,
static function (array $left, array $right) { static function (array $left, array $right) {
$order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE]; $order = [AccountType::ASSET, AccountType::REVENUE, AccountType::EXPENSE];
$posA = (int)array_search($left['type'], $order, true); $posA = (int) array_search($left['type'], $order, true);
$posB = (int)array_search($right['type'], $order, true); $posB = (int) array_search($right['type'], $order, true);
return $posA - $posB; return $posA - $posB;
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* BillController.php * BillController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -66,7 +67,7 @@ class BillController extends Controller
$filtered = $result->map( $filtered = $result->map(
static function (Bill $item) { static function (Bill $item) {
return [ return [
'id' => (string)$item->id, 'id' => (string) $item->id,
'name' => $item->name, 'name' => $item->name,
'active' => $item->active, 'active' => $item->active,
]; ];

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* BudgetController.php * BudgetController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -66,7 +67,7 @@ class BudgetController extends Controller
$filtered = $result->map( $filtered = $result->map(
static function (Budget $item) { static function (Budget $item) {
return [ return [
'id' => (string)$item->id, 'id' => (string) $item->id,
'name' => $item->name, 'name' => $item->name,
]; ];
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* CategoryController.php * CategoryController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -66,7 +67,7 @@ class CategoryController extends Controller
$filtered = $result->map( $filtered = $result->map(
static function (Category $item) { static function (Category $item) {
return [ return [
'id' => (string)$item->id, 'id' => (string) $item->id,
'name' => $item->name, 'name' => $item->name,
]; ];
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* CurrencyController.php * CurrencyController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -68,7 +69,7 @@ class CurrencyController extends Controller
/** @var TransactionCurrency $currency */ /** @var TransactionCurrency $currency */
foreach ($collection as $currency) { foreach ($collection as $currency) {
$result[] = [ $result[] = [
'id' => (string)$currency->id, 'id' => (string) $currency->id,
'name' => $currency->name, 'name' => $currency->name,
'code' => $currency->code, 'code' => $currency->code,
'symbol' => $currency->symbol, 'symbol' => $currency->symbol,
@@ -94,7 +95,7 @@ class CurrencyController extends Controller
/** @var TransactionCurrency $currency */ /** @var TransactionCurrency $currency */
foreach ($collection as $currency) { foreach ($collection as $currency) {
$result[] = [ $result[] = [
'id' => (string)$currency->id, 'id' => (string) $currency->id,
'name' => sprintf('%s (%s)', $currency->name, $currency->code), 'name' => sprintf('%s (%s)', $currency->name, $currency->code),
'code' => $currency->code, 'code' => $currency->code,
'symbol' => $currency->symbol, 'symbol' => $currency->symbol,

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* ObjectGroupController.php * ObjectGroupController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -68,7 +69,7 @@ class ObjectGroupController extends Controller
/** @var ObjectGroup $objectGroup */ /** @var ObjectGroup $objectGroup */
foreach ($result as $objectGroup) { foreach ($result as $objectGroup) {
$return[] = [ $return[] = [
'id' => (string)$objectGroup->id, 'id' => (string) $objectGroup->id,
'name' => $objectGroup->title, 'name' => $objectGroup->title,
'title' => $objectGroup->title, 'title' => $objectGroup->title,
]; ];

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* PiggyBankController.php * PiggyBankController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -65,24 +66,23 @@ class PiggyBankController extends Controller
*/ */
public function piggyBanks(AutocompleteRequest $request): JsonResponse public function piggyBanks(AutocompleteRequest $request): JsonResponse
{ {
$data = $request->getData(); $data = $request->getData();
$piggies = $this->piggyRepository->searchPiggyBank($data['query'], $this->parameters->get('limit')); $piggies = $this->piggyRepository->searchPiggyBank($data['query'], $this->parameters->get('limit'));
$defaultCurrency = app('amount')->getDefaultCurrency(); $response = [];
$response = [];
/** @var PiggyBank $piggy */ /** @var PiggyBank $piggy */
foreach ($piggies as $piggy) { foreach ($piggies as $piggy) {
$currency = $this->accountRepository->getAccountCurrency($piggy->account) ?? $defaultCurrency; $currency = $piggy->transactionCurrency;
$objectGroup = $piggy->objectGroups()->first(); $objectGroup = $piggy->objectGroups()->first();
$response[] = [ $response[] = [
'id' => (string)$piggy->id, 'id' => (string) $piggy->id,
'name' => $piggy->name, 'name' => $piggy->name,
'currency_id' => (string)$currency->id, 'currency_id' => (string) $currency->id,
'currency_name' => $currency->name, 'currency_name' => $currency->name,
'currency_code' => $currency->code, 'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol, 'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places, 'currency_decimal_places' => $currency->decimal_places,
'object_group_id' => null === $objectGroup ? null : (string)$objectGroup->id, 'object_group_id' => null === $objectGroup ? null : (string) $objectGroup->id,
'object_group_title' => $objectGroup?->title, 'object_group_title' => $objectGroup?->title,
]; ];
} }
@@ -96,31 +96,30 @@ class PiggyBankController extends Controller
*/ */
public function piggyBanksWithBalance(AutocompleteRequest $request): JsonResponse public function piggyBanksWithBalance(AutocompleteRequest $request): JsonResponse
{ {
$data = $request->getData(); $data = $request->getData();
$piggies = $this->piggyRepository->searchPiggyBank($data['query'], $this->parameters->get('limit')); $piggies = $this->piggyRepository->searchPiggyBank($data['query'], $this->parameters->get('limit'));
$defaultCurrency = app('amount')->getDefaultCurrency(); $response = [];
$response = [];
/** @var PiggyBank $piggy */ /** @var PiggyBank $piggy */
foreach ($piggies as $piggy) { foreach ($piggies as $piggy) {
$currency = $this->accountRepository->getAccountCurrency($piggy->account) ?? $defaultCurrency; $currency = $piggy->transactionCurrency;
$currentAmount = $this->piggyRepository->getRepetition($piggy)->currentamount ?? '0'; $currentAmount = $this->piggyRepository->getCurrentAmount($piggy);
$objectGroup = $piggy->objectGroups()->first(); $objectGroup = $piggy->objectGroups()->first();
$response[] = [ $response[] = [
'id' => (string)$piggy->id, 'id' => (string) $piggy->id,
'name' => $piggy->name, 'name' => $piggy->name,
'name_with_balance' => sprintf( 'name_with_balance' => sprintf(
'%s (%s / %s)', '%s (%s / %s)',
$piggy->name, $piggy->name,
app('amount')->formatAnything($currency, $currentAmount, false), app('amount')->formatAnything($currency, $currentAmount, false),
app('amount')->formatAnything($currency, $piggy->targetamount, false), app('amount')->formatAnything($currency, $piggy->target_amount, false),
), ),
'currency_id' => (string)$currency->id, 'currency_id' => (string) $currency->id,
'currency_name' => $currency->name, 'currency_name' => $currency->name,
'currency_code' => $currency->code, 'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol, 'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places, 'currency_decimal_places' => $currency->decimal_places,
'object_group_id' => null === $objectGroup ? null : (string)$objectGroup->id, 'object_group_id' => null === $objectGroup ? null : (string) $objectGroup->id,
'object_group_title' => $objectGroup?->title, 'object_group_title' => $objectGroup?->title,
]; ];
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* RecurrenceController.php * RecurrenceController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -66,7 +67,7 @@ class RecurrenceController extends Controller
/** @var Recurrence $recurrence */ /** @var Recurrence $recurrence */
foreach ($recurrences as $recurrence) { foreach ($recurrences as $recurrence) {
$response[] = [ $response[] = [
'id' => (string)$recurrence->id, 'id' => (string) $recurrence->id,
'name' => $recurrence->title, 'name' => $recurrence->title,
'description' => $recurrence->description, 'description' => $recurrence->description,
]; ];

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* RuleController.php * RuleController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -65,7 +66,7 @@ class RuleController extends Controller
/** @var Rule $rule */ /** @var Rule $rule */
foreach ($rules as $rule) { foreach ($rules as $rule) {
$response[] = [ $response[] = [
'id' => (string)$rule->id, 'id' => (string) $rule->id,
'name' => $rule->title, 'name' => $rule->title,
'description' => $rule->description, 'description' => $rule->description,
]; ];

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* RuleGroupController.php * RuleGroupController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -65,7 +66,7 @@ class RuleGroupController extends Controller
/** @var RuleGroup $group */ /** @var RuleGroup $group */
foreach ($groups as $group) { foreach ($groups as $group) {
$response[] = [ $response[] = [
'id' => (string)$group->id, 'id' => (string) $group->id,
'name' => $group->title, 'name' => $group->title,
'description' => $group->description, 'description' => $group->description,
]; ];

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* TagController.php * TagController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -68,7 +69,7 @@ class TagController extends Controller
/** @var Tag $tag */ /** @var Tag $tag */
foreach ($result as $tag) { foreach ($result as $tag) {
$array[] = [ $array[] = [
'id' => (string)$tag->id, 'id' => (string) $tag->id,
'name' => $tag->tag, 'name' => $tag->tag,
'tag' => $tag->tag, 'tag' => $tag->tag,
]; ];

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* TransactionController.php * TransactionController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -76,8 +77,8 @@ class TransactionController extends Controller
/** @var TransactionJournal $journal */ /** @var TransactionJournal $journal */
foreach ($filtered as $journal) { foreach ($filtered as $journal) {
$array[] = [ $array[] = [
'id' => (string)$journal->id, 'id' => (string) $journal->id,
'transaction_group_id' => (string)$journal->transaction_group_id, 'transaction_group_id' => (string) $journal->transaction_group_id,
'name' => $journal->description, 'name' => $journal->description,
'description' => $journal->description, 'description' => $journal->description,
]; ];
@@ -96,7 +97,7 @@ class TransactionController extends Controller
$result = new Collection(); $result = new Collection();
if (is_numeric($data['query'])) { if (is_numeric($data['query'])) {
// search for group, not journal. // search for group, not journal.
$firstResult = $this->groupRepository->find((int)$data['query']); $firstResult = $this->groupRepository->find((int) $data['query']);
if (null !== $firstResult) { if (null !== $firstResult) {
// group may contain multiple journals, each a result: // group may contain multiple journals, each a result:
foreach ($firstResult->transactionJournals as $journal) { foreach ($firstResult->transactionJournals as $journal) {
@@ -114,8 +115,8 @@ class TransactionController extends Controller
/** @var TransactionJournal $journal */ /** @var TransactionJournal $journal */
foreach ($result as $journal) { foreach ($result as $journal) {
$array[] = [ $array[] = [
'id' => (string)$journal->id, 'id' => (string) $journal->id,
'transaction_group_id' => (string)$journal->transaction_group_id, 'transaction_group_id' => (string) $journal->transaction_group_id,
'name' => sprintf('#%d: %s', $journal->transaction_group_id, $journal->description), 'name' => sprintf('#%d: %s', $journal->transaction_group_id, $journal->description),
'description' => sprintf('#%d: %s', $journal->transaction_group_id, $journal->description), 'description' => sprintf('#%d: %s', $journal->transaction_group_id, $journal->description),
]; ];

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* TransactionTypeController.php * TransactionTypeController.php
* Copyright (c) 2020 james@firefly-iii.org * Copyright (c) 2020 james@firefly-iii.org
@@ -65,7 +66,7 @@ class TransactionTypeController extends Controller
foreach ($types as $type) { foreach ($types as $type) {
// different key for consistency. // different key for consistency.
$array[] = [ $array[] = [
'id' => (string)$type->id, 'id' => (string) $type->id,
'name' => $type->type, 'name' => $type->type,
'type' => $type->type, 'type' => $type->type,
]; ];

View File

@@ -104,7 +104,7 @@ class AccountController extends Controller
} }
$currentSet = [ $currentSet = [
'label' => $account->name, 'label' => $account->name,
'currency_id' => (string)$currency->id, 'currency_id' => (string) $currency->id,
'currency_code' => $currency->code, 'currency_code' => $currency->code,
'currency_symbol' => $currency->symbol, 'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places, 'currency_decimal_places' => $currency->decimal_places,
@@ -116,13 +116,13 @@ class AccountController extends Controller
]; ];
// TODO this code is also present in the V2 chart account controller so this method is due to be deprecated. // TODO this code is also present in the V2 chart account controller so this method is due to be deprecated.
$currentStart = clone $start; $currentStart = clone $start;
$range = app('steam')->balanceInRange($account, $start, clone $end); $range = app('steam')->finalAccountBalanceInRange($account, $start, clone $end, $this->convertToNative);
// 2022-10-11 this method no longer converts to float. // 2022-10-11 this method no longer converts to float.
$previous = array_values($range)[0]; $previous = array_values($range)[0];
while ($currentStart <= $end) { while ($currentStart <= $end) {
$format = $currentStart->format('Y-m-d'); $format = $currentStart->format('Y-m-d');
$label = $currentStart->toAtomString(); $label = $currentStart->toAtomString();
$balance = array_key_exists($format, $range) ? $range[$format] : $previous; $balance = array_key_exists($format, $range) ? $range[$format]['balance'] : $previous;
$previous = $balance; $previous = $balance;
$currentStart->addDay(); $currentStart->addDay();
$currentSet['entries'][$label] = $balance; $currentSet['entries'][$label] = $balance;

View File

@@ -50,11 +50,12 @@ abstract class Controller extends BaseController
use DispatchesJobs; use DispatchesJobs;
use ValidatesRequests; use ValidatesRequests;
protected const string CONTENT_TYPE = 'application/vnd.api+json'; protected const string CONTENT_TYPE = 'application/vnd.api+json';
/** @var array<int, string> */ /** @var array<int, string> */
protected array $allowedSort; protected array $allowedSort;
protected ParameterBag $parameters; protected ParameterBag $parameters;
protected bool $convertToNative = false;
/** /**
* Controller constructor. * Controller constructor.
@@ -67,8 +68,10 @@ abstract class Controller extends BaseController
function ($request, $next) { function ($request, $next) {
$this->parameters = $this->getParameters(); $this->parameters = $this->getParameters();
if (auth()->check()) { if (auth()->check()) {
$language = app('steam')->getLanguage(); $language = app('steam')->getLanguage();
$this->convertToNative = app('preferences')->get('convert_to_native', false)->data;
app()->setLocale($language); app()->setLocale($language);
} }
return $next($request); return $next($request);
@@ -82,7 +85,7 @@ abstract class Controller extends BaseController
private function getParameters(): ParameterBag private function getParameters(): ParameterBag
{ {
$bag = new ParameterBag(); $bag = new ParameterBag();
$page = (int)request()->get('page'); $page = (int) request()->get('page');
if ($page < 1) { if ($page < 1) {
$page = 1; $page = 1;
} }
@@ -107,13 +110,13 @@ abstract class Controller extends BaseController
$obj = null; $obj = null;
if (null !== $date) { if (null !== $date) {
try { try {
$obj = Carbon::parse((string)$date); $obj = Carbon::parse((string) $date);
} catch (InvalidDateException|InvalidFormatException $e) { } catch (InvalidDateException|InvalidFormatException $e) {
// don't care // don't care
app('log')->warning( app('log')->warning(
sprintf( sprintf(
'Ignored invalid date "%s" in API controller parameter check: %s', 'Ignored invalid date "%s" in API controller parameter check: %s',
substr((string)$date, 0, 20), substr((string) $date, 0, 20),
$e->getMessage() $e->getMessage()
) )
); );
@@ -134,7 +137,7 @@ abstract class Controller extends BaseController
$value = null; $value = null;
} }
if (null !== $value) { if (null !== $value) {
$bag->set($integer, (int)$value); $bag->set($integer, (int) $value);
} }
if (null === $value if (null === $value
&& 'limit' === $integer // @phpstan-ignore-line && 'limit' === $integer // @phpstan-ignore-line
@@ -144,7 +147,7 @@ abstract class Controller extends BaseController
$user = auth()->user(); $user = auth()->user();
/** @var Preference $pageSize */ /** @var Preference $pageSize */
$pageSize = (int)app('preferences')->getForUser($user, 'listPageSize', 50)->data; $pageSize = (int) app('preferences')->getForUser($user, 'listPageSize', 50)->data;
$bag->set($integer, $pageSize); $bag->set($integer, $pageSize);
} }
} }
@@ -158,7 +161,7 @@ abstract class Controller extends BaseController
$sortParameters = []; $sortParameters = [];
try { try {
$param = (string)request()->query->get('sort'); $param = (string) request()->query->get('sort');
} catch (BadRequestException $e) { } catch (BadRequestException $e) {
app('log')->error('Request field "sort" contains a non-scalar value. Value set to NULL.'); app('log')->error('Request field "sort" contains a non-scalar value. Value set to NULL.');
app('log')->error($e->getMessage()); app('log')->error($e->getMessage());

View File

@@ -70,8 +70,8 @@ class TransactionController extends Controller
// to respond to what is in the $query. // to respond to what is in the $query.
// this is OK because only one thing can be in the query at the moment. // this is OK because only one thing can be in the query at the moment.
if ($this->isUpdateTransactionAccount($params)) { if ($this->isUpdateTransactionAccount($params)) {
$original = $this->repository->find((int)$params['where']['account_id']); $original = $this->repository->find((int) $params['where']['account_id']);
$destination = $this->repository->find((int)$params['update']['account_id']); $destination = $this->repository->find((int) $params['update']['account_id']);
/** @var AccountDestroyService $service */ /** @var AccountDestroyService $service */
$service = app(AccountDestroyService::class); $service = app(AccountDestroyService::class);

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -25,11 +26,11 @@ namespace FireflyIII\Api\V1\Controllers\Data;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Data\DestroyRequest; use FireflyIII\Api\V1\Requests\Data\DestroyRequest;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType; use FireflyIII\Models\AccountType;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Account\AccountRepositoryInterface; use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface; use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
@@ -68,7 +69,7 @@ class DestroyController extends Controller
$allExceptAssets = [AccountType::BENEFICIARY, AccountType::CASH, AccountType::CREDITCARD, AccountType::DEFAULT, AccountType::EXPENSE, AccountType::IMPORT, AccountType::INITIAL_BALANCE, AccountType::LIABILITY_CREDIT, AccountType::RECONCILIATION, AccountType::REVENUE]; $allExceptAssets = [AccountType::BENEFICIARY, AccountType::CASH, AccountType::CREDITCARD, AccountType::DEFAULT, AccountType::EXPENSE, AccountType::IMPORT, AccountType::INITIAL_BALANCE, AccountType::LIABILITY_CREDIT, AccountType::RECONCILIATION, AccountType::REVENUE];
$all = [AccountType::ASSET, AccountType::BENEFICIARY, AccountType::CASH, AccountType::CREDITCARD, AccountType::DEBT, AccountType::DEFAULT, AccountType::EXPENSE, AccountType::IMPORT, AccountType::INITIAL_BALANCE, AccountType::LIABILITY_CREDIT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::RECONCILIATION]; $all = [AccountType::ASSET, AccountType::BENEFICIARY, AccountType::CASH, AccountType::CREDITCARD, AccountType::DEBT, AccountType::DEFAULT, AccountType::EXPENSE, AccountType::IMPORT, AccountType::INITIAL_BALANCE, AccountType::LIABILITY_CREDIT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::RECONCILIATION];
$liabilities = [AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::CREDITCARD]; $liabilities = [AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::CREDITCARD];
$transactions = [TransactionType::WITHDRAWAL, TransactionType::DEPOSIT, TransactionType::TRANSFER, TransactionType::RECONCILIATION]; $transactions = [TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::DEPOSIT->value, TransactionTypeEnum::TRANSFER->value, TransactionTypeEnum::RECONCILIATION->value];
match ($objects) { match ($objects) {
'budgets' => $this->destroyBudgets(), 'budgets' => $this->destroyBudgets(),
@@ -86,9 +87,9 @@ class DestroyController extends Controller
'revenue_accounts' => $this->destroyAccounts([AccountType::REVENUE]), 'revenue_accounts' => $this->destroyAccounts([AccountType::REVENUE]),
'liabilities' => $this->destroyAccounts($liabilities), 'liabilities' => $this->destroyAccounts($liabilities),
'transactions' => $this->destroyTransactions($transactions), 'transactions' => $this->destroyTransactions($transactions),
'withdrawals' => $this->destroyTransactions([TransactionType::WITHDRAWAL]), 'withdrawals' => $this->destroyTransactions([TransactionTypeEnum::WITHDRAWAL->value]),
'deposits' => $this->destroyTransactions([TransactionType::DEPOSIT]), 'deposits' => $this->destroyTransactions([TransactionTypeEnum::DEPOSIT->value]),
'transfers' => $this->destroyTransactions([TransactionType::TRANSFER]), 'transfers' => $this->destroyTransactions([TransactionTypeEnum::TRANSFER->value]),
default => throw new FireflyException(sprintf('200033: This endpoint can\'t handle object "%s"', $objects)), default => throw new FireflyException(sprintf('200033: This endpoint can\'t handle object "%s"', $objects)),
}; };

View File

@@ -88,7 +88,7 @@ class ExportController extends Controller
->header('Expires', '0') ->header('Expires', '0')
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0') ->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
->header('Pragma', 'public') ->header('Pragma', 'public')
->header('Content-Length', (string)strlen($data[$key])) ->header('Content-Length', (string) strlen($data[$key]))
; ;
return $response; return $response;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* PurgeController.php * PurgeController.php
* Copyright (c) 2022 james@firefly-iii.org * Copyright (c) 2022 james@firefly-iii.org
@@ -28,13 +29,13 @@ use FireflyIII\Models\Account;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Models\Budget; use FireflyIII\Models\Budget;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Models\PiggyBank;
use FireflyIII\Models\Recurrence; use FireflyIII\Models\Recurrence;
use FireflyIII\Models\Rule; use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleGroup; use FireflyIII\Models\RuleGroup;
use FireflyIII\Models\Tag; use FireflyIII\Models\Tag;
use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
@@ -51,7 +52,7 @@ class PurgeController extends Controller
public function purge(): JsonResponse public function purge(): JsonResponse
{ {
/** @var User $user */ /** @var User $user */
$user = auth()->user(); $user = auth()->user();
// some manual code, too lazy to call all repositories. // some manual code, too lazy to call all repositories.
@@ -62,14 +63,17 @@ class PurgeController extends Controller
Bill::whereUserId($user->id)->onlyTrashed()->forceDelete(); Bill::whereUserId($user->id)->onlyTrashed()->forceDelete();
// piggies // piggies
$set = PiggyBank::leftJoin('accounts', 'accounts.id', 'piggy_banks.account_id') $repository = app(PiggyBankRepositoryInterface::class);
->where('accounts.user_id', $user->id)->onlyTrashed()->get(['piggy_banks.*']) $repository->setUser($user);
; $repository->purgeAll();
// $set = PiggyBank::leftJoin('accounts', 'accounts.id', 'piggy_banks.account_id')
/** @var PiggyBank $piggy */ // ->where('accounts.user_id', $user->id)->onlyTrashed()->get(['piggy_banks.*'])
foreach ($set as $piggy) { // ;
$piggy->forceDelete(); //
} // /** @var PiggyBank $piggy */
// foreach ($set as $piggy) {
// $piggy->forceDelete();
// }
// rule group // rule group
RuleGroup::whereUserId($user->id)->onlyTrashed()->forceDelete(); RuleGroup::whereUserId($user->id)->onlyTrashed()->forceDelete();

View File

@@ -79,11 +79,11 @@ class AccountController extends Controller
/** @var array $expense */ /** @var array $expense */
foreach ($expenses as $expense) { foreach ($expenses as $expense) {
$result[] = [ $result[] = [
'id' => (string)$expense['id'], 'id' => (string) $expense['id'],
'name' => $expense['name'], 'name' => $expense['name'],
'difference' => $expense['sum'], 'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'], // intentional float 'difference_float' => (float) $expense['sum'], // intentional float
'currency_id' => (string)$expense['currency_id'], 'currency_id' => (string) $expense['currency_id'],
'currency_code' => $expense['currency_code'], 'currency_code' => $expense['currency_code'],
]; ];
} }
@@ -107,11 +107,11 @@ class AccountController extends Controller
/** @var array $expense */ /** @var array $expense */
foreach ($expenses as $expense) { foreach ($expenses as $expense) {
$result[] = [ $result[] = [
'id' => (string)$expense['id'], 'id' => (string) $expense['id'],
'name' => $expense['name'], 'name' => $expense['name'],
'difference' => $expense['sum'], 'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'], // intentional float 'difference_float' => (float) $expense['sum'], // intentional float
'currency_id' => (string)$expense['currency_id'], 'currency_id' => (string) $expense['currency_id'],
'currency_code' => $expense['currency_code'], 'currency_code' => $expense['currency_code'],
]; ];
} }

View File

@@ -26,8 +26,8 @@ namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest; use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
@@ -76,38 +76,38 @@ class BillController extends Controller
// collect all expenses in this period (regardless of type) by the given bills and accounts. // collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::WITHDRAWAL])->setRange($start, $end)->setSourceAccounts($accounts); $collector->setTypes([TransactionTypeEnum::WITHDRAWAL->value])->setRange($start, $end)->setSourceAccounts($accounts);
$collector->setBills($bills); $collector->setBills($bills);
$genericSet = $collector->getExtractedJournals(); $genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$billId = (int)$journal['bill_id']; $billId = (int) $journal['bill_id'];
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
$key = sprintf('%d-%d', $billId, $currencyId); $key = sprintf('%d-%d', $billId, $currencyId);
$foreignKey = sprintf('%d-%d', $billId, $foreignCurrencyId); $foreignKey = sprintf('%d-%d', $billId, $foreignCurrencyId);
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$key] ??= [ $response[$key] ??= [
'id' => (string)$billId, 'id' => (string) $billId,
'name' => $journal['bill_name'], 'name' => $journal['bill_name'],
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$key]['difference'] = bcadd($response[$key]['difference'], $journal['amount']); $response[$key]['difference'] = bcadd($response[$key]['difference'], $journal['amount']);
$response[$key]['difference_float'] = (float)$response[$key]['difference']; // intentional float $response[$key]['difference_float'] = (float) $response[$key]['difference']; // intentional float
} }
if (0 !== $foreignCurrencyId) { if (0 !== $foreignCurrencyId) {
$response[$foreignKey] ??= [ $response[$foreignKey] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignKey]['difference'] = bcadd($response[$foreignKey]['difference'], $journal['foreign_amount']); $response[$foreignKey]['difference'] = bcadd($response[$foreignKey]['difference'], $journal['foreign_amount']);
$response[$foreignKey]['difference_float'] = (float)$response[$foreignKey]['difference']; // intentional float $response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; // intentional float
} }
} }
@@ -129,34 +129,34 @@ class BillController extends Controller
// collect all expenses in this period (regardless of type) by the given bills and accounts. // collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::WITHDRAWAL])->setRange($start, $end)->setSourceAccounts($accounts); $collector->setTypes([TransactionTypeEnum::WITHDRAWAL->value])->setRange($start, $end)->setSourceAccounts($accounts);
$collector->withoutBill(); $collector->withoutBill();
$genericSet = $collector->getExtractedJournals(); $genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$currencyId] ??= [ $response[$currencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']); $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']);
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference']; // intentional float $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference']; // intentional float
} }
if (0 !== $foreignCurrencyId) { if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] ??= [ $response[$foreignCurrencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']); $response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']);
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference']; // intentional float $response[$foreignCurrencyId]['difference_float'] = (float) $response[$foreignCurrencyId]['difference']; // intentional float
} }
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* BudgetController.php * BudgetController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -84,11 +85,11 @@ class BudgetController extends Controller
/** @var array $expense */ /** @var array $expense */
foreach ($expenses as $expense) { foreach ($expenses as $expense) {
$result[] = [ $result[] = [
'id' => (string)$budget->id, 'id' => (string) $budget->id,
'name' => $budget->name, 'name' => $budget->name,
'difference' => $expense['sum'], 'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'], // intentional float 'difference_float' => (float) $expense['sum'], // intentional float
'currency_id' => (string)$expense['currency_id'], 'currency_id' => (string) $expense['currency_id'],
'currency_code' => $expense['currency_code'], 'currency_code' => $expense['currency_code'],
]; ];
} }
@@ -113,8 +114,8 @@ class BudgetController extends Controller
foreach ($expenses as $expense) { foreach ($expenses as $expense) {
$result[] = [ $result[] = [
'difference' => $expense['sum'], 'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'], // intentional float 'difference_float' => (float) $expense['sum'], // intentional float
'currency_id' => (string)$expense['currency_id'], 'currency_id' => (string) $expense['currency_id'],
'currency_code' => $expense['currency_code'], 'currency_code' => $expense['currency_code'],
]; ];
} }

View File

@@ -85,11 +85,11 @@ class CategoryController extends Controller
/** @var array $expense */ /** @var array $expense */
foreach ($expenses as $expense) { foreach ($expenses as $expense) {
$result[] = [ $result[] = [
'id' => (string)$category->id, 'id' => (string) $category->id,
'name' => $category->name, 'name' => $category->name,
'difference' => $expense['sum'], 'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'], // intentional float 'difference_float' => (float) $expense['sum'], // intentional float
'currency_id' => (string)$expense['currency_id'], 'currency_id' => (string) $expense['currency_id'],
'currency_code' => $expense['currency_code'], 'currency_code' => $expense['currency_code'],
]; ];
} }
@@ -114,8 +114,8 @@ class CategoryController extends Controller
foreach ($expenses as $expense) { foreach ($expenses as $expense) {
$result[] = [ $result[] = [
'difference' => $expense['sum'], 'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'], // intentional float 'difference_float' => (float) $expense['sum'], // intentional float
'currency_id' => (string)$expense['currency_id'], 'currency_id' => (string) $expense['currency_id'],
'currency_code' => $expense['currency_code'], 'currency_code' => $expense['currency_code'],
]; ];
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* PeriodController.php * PeriodController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -25,8 +26,8 @@ namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest; use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
/** /**
@@ -47,31 +48,31 @@ class PeriodController extends Controller
// collect all expenses in this period (regardless of type) // collect all expenses in this period (regardless of type)
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::WITHDRAWAL])->setRange($start, $end)->setSourceAccounts($accounts); $collector->setTypes([TransactionTypeEnum::WITHDRAWAL->value])->setRange($start, $end)->setSourceAccounts($accounts);
$genericSet = $collector->getExtractedJournals(); $genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$currencyId] ??= [ $response[$currencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']); $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']);
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference']; // intentional float $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference']; // intentional float
} }
if (0 !== $foreignCurrencyId) { if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] ??= [ $response[$foreignCurrencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']); $response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']);
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference']; // intentional float $response[$foreignCurrencyId]['difference_float'] = (float) $response[$foreignCurrencyId]['difference']; // intentional float
} }
} }

View File

@@ -26,8 +26,8 @@ namespace FireflyIII\Api\V1\Controllers\Insight\Expense;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest; use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
@@ -69,34 +69,34 @@ class TagController extends Controller
// collect all expenses in this period (regardless of type) by the given bills and accounts. // collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::WITHDRAWAL])->setRange($start, $end)->setSourceAccounts($accounts); $collector->setTypes([TransactionTypeEnum::WITHDRAWAL->value])->setRange($start, $end)->setSourceAccounts($accounts);
$collector->withoutTags(); $collector->withoutTags();
$genericSet = $collector->getExtractedJournals(); $genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$currencyId] ??= [ $response[$currencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']); $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], $journal['amount']);
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference']; // float but on purpose. $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference']; // float but on purpose.
} }
if (0 !== $foreignCurrencyId) { if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] ??= [ $response[$foreignCurrencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']); $response[$foreignCurrencyId]['difference'] = bcadd($response[$foreignCurrencyId]['difference'], $journal['foreign_amount']);
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference']; // float but on purpose. $response[$foreignCurrencyId]['difference_float'] = (float) $response[$foreignCurrencyId]['difference']; // float but on purpose.
} }
} }
@@ -124,14 +124,14 @@ class TagController extends Controller
// collect all expenses in this period (regardless of type) by the given bills and accounts. // collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::WITHDRAWAL])->setRange($start, $end)->setSourceAccounts($accounts); $collector->setTypes([TransactionTypeEnum::WITHDRAWAL->value])->setRange($start, $end)->setSourceAccounts($accounts);
$collector->setTags($tags); $collector->setTags($tags);
$genericSet = $collector->getExtractedJournals(); $genericSet = $collector->getExtractedJournals();
/** @var array $journal */ /** @var array $journal */
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
/** @var array $tag */ /** @var array $tag */
foreach ($journal['tags'] as $tag) { foreach ($journal['tags'] as $tag) {
@@ -142,15 +142,15 @@ class TagController extends Controller
// on currency ID // on currency ID
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$key] ??= [ $response[$key] ??= [
'id' => (string)$tagId, 'id' => (string) $tagId,
'name' => $tag['name'], 'name' => $tag['name'],
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$key]['difference'] = bcadd($response[$key]['difference'], $journal['amount']); $response[$key]['difference'] = bcadd($response[$key]['difference'], $journal['amount']);
$response[$key]['difference_float'] = (float)$response[$key]['difference']; // float but on purpose. $response[$key]['difference_float'] = (float) $response[$key]['difference']; // float but on purpose.
} }
// on foreign ID // on foreign ID
@@ -158,11 +158,11 @@ class TagController extends Controller
$response[$foreignKey] = $journal[$foreignKey] ?? [ $response[$foreignKey] = $journal[$foreignKey] ?? [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignKey]['difference'] = bcadd($response[$foreignKey]['difference'], $journal['foreign_amount']); $response[$foreignKey]['difference'] = bcadd($response[$foreignKey]['difference'], $journal['foreign_amount']);
$response[$foreignKey]['difference_float'] = (float)$response[$foreignKey]['difference']; // float but on purpose. $response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; // float but on purpose.
} }
} }
} }

View File

@@ -79,11 +79,11 @@ class AccountController extends Controller
/** @var array $entry */ /** @var array $entry */
foreach ($income as $entry) { foreach ($income as $entry) {
$result[] = [ $result[] = [
'id' => (string)$entry['id'], 'id' => (string) $entry['id'],
'name' => $entry['name'], 'name' => $entry['name'],
'difference' => $entry['sum'], 'difference' => $entry['sum'],
'difference_float' => (float)$entry['sum'], // float but on purpose. 'difference_float' => (float) $entry['sum'], // float but on purpose.
'currency_id' => (string)$entry['currency_id'], 'currency_id' => (string) $entry['currency_id'],
'currency_code' => $entry['currency_code'], 'currency_code' => $entry['currency_code'],
]; ];
} }
@@ -107,11 +107,11 @@ class AccountController extends Controller
/** @var array $entry */ /** @var array $entry */
foreach ($income as $entry) { foreach ($income as $entry) {
$result[] = [ $result[] = [
'id' => (string)$entry['id'], 'id' => (string) $entry['id'],
'name' => $entry['name'], 'name' => $entry['name'],
'difference' => $entry['sum'], 'difference' => $entry['sum'],
'difference_float' => (float)$entry['sum'], // float but on purpose. 'difference_float' => (float) $entry['sum'], // float but on purpose.
'currency_id' => (string)$entry['currency_id'], 'currency_id' => (string) $entry['currency_id'],
'currency_code' => $entry['currency_code'], 'currency_code' => $entry['currency_code'],
]; ];
} }

View File

@@ -85,11 +85,11 @@ class CategoryController extends Controller
/** @var array $expense */ /** @var array $expense */
foreach ($expenses as $expense) { foreach ($expenses as $expense) {
$result[] = [ $result[] = [
'id' => (string)$category->id, 'id' => (string) $category->id,
'name' => $category->name, 'name' => $category->name,
'difference' => $expense['sum'], 'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'], // float but on purpose. 'difference_float' => (float) $expense['sum'], // float but on purpose.
'currency_id' => (string)$expense['currency_id'], 'currency_id' => (string) $expense['currency_id'],
'currency_code' => $expense['currency_code'], 'currency_code' => $expense['currency_code'],
]; ];
} }
@@ -114,8 +114,8 @@ class CategoryController extends Controller
foreach ($expenses as $expense) { foreach ($expenses as $expense) {
$result[] = [ $result[] = [
'difference' => $expense['sum'], 'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'], // float but on purpose. 'difference_float' => (float) $expense['sum'], // float but on purpose.
'currency_id' => (string)$expense['currency_id'], 'currency_id' => (string) $expense['currency_id'],
'currency_code' => $expense['currency_code'], 'currency_code' => $expense['currency_code'],
]; ];
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* PeriodController.php * PeriodController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -25,8 +26,8 @@ namespace FireflyIII\Api\V1\Controllers\Insight\Income;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest; use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
/** /**
@@ -47,34 +48,34 @@ class PeriodController extends Controller
// collect all expenses in this period (regardless of type) // collect all expenses in this period (regardless of type)
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::DEPOSIT])->setRange($start, $end)->setDestinationAccounts($accounts); $collector->setTypes([TransactionTypeEnum::DEPOSIT->value])->setRange($start, $end)->setDestinationAccounts($accounts);
$genericSet = $collector->getExtractedJournals(); $genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$currencyId] ??= [ $response[$currencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount'])); $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount']));
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference']; // float but on purpose. $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference']; // float but on purpose.
} }
if (0 !== $foreignCurrencyId) { if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] ??= [ $response[$foreignCurrencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignCurrencyId]['difference'] = bcadd( $response[$foreignCurrencyId]['difference'] = bcadd(
$response[$foreignCurrencyId]['difference'], $response[$foreignCurrencyId]['difference'],
app('steam')->positive($journal['foreign_amount']) app('steam')->positive($journal['foreign_amount'])
); );
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference']; // float but on purpose. $response[$foreignCurrencyId]['difference_float'] = (float) $response[$foreignCurrencyId]['difference']; // float but on purpose.
} }
} }

View File

@@ -26,8 +26,8 @@ namespace FireflyIII\Api\V1\Controllers\Insight\Income;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Insight\GenericRequest; use FireflyIII\Api\V1\Requests\Insight\GenericRequest;
use FireflyIII\Enums\TransactionTypeEnum;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\TransactionType;
use FireflyIII\Repositories\Tag\TagRepositoryInterface; use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
@@ -70,37 +70,37 @@ class TagController extends Controller
// collect all expenses in this period (regardless of type) by the given bills and accounts. // collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::DEPOSIT])->setRange($start, $end)->setDestinationAccounts($accounts); $collector->setTypes([TransactionTypeEnum::DEPOSIT->value])->setRange($start, $end)->setDestinationAccounts($accounts);
$collector->withoutTags(); $collector->withoutTags();
$genericSet = $collector->getExtractedJournals(); $genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$currencyId] ??= [ $response[$currencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount'])); $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount']));
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference']; $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference'];
} }
if (0 !== $foreignCurrencyId) { if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] ??= [ $response[$foreignCurrencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignCurrencyId]['difference'] = bcadd( $response[$foreignCurrencyId]['difference'] = bcadd(
$response[$foreignCurrencyId]['difference'], $response[$foreignCurrencyId]['difference'],
app('steam')->positive($journal['foreign_amount']) app('steam')->positive($journal['foreign_amount'])
); );
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference']; $response[$foreignCurrencyId]['difference_float'] = (float) $response[$foreignCurrencyId]['difference'];
} }
} }
@@ -128,14 +128,14 @@ class TagController extends Controller
// collect all expenses in this period (regardless of type) by the given bills and accounts. // collect all expenses in this period (regardless of type) by the given bills and accounts.
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
$collector->setTypes([TransactionType::DEPOSIT])->setRange($start, $end)->setDestinationAccounts($accounts); $collector->setTypes([TransactionTypeEnum::DEPOSIT->value])->setRange($start, $end)->setDestinationAccounts($accounts);
$collector->setTags($tags); $collector->setTags($tags);
$genericSet = $collector->getExtractedJournals(); $genericSet = $collector->getExtractedJournals();
/** @var array $journal */ /** @var array $journal */
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
/** @var array $tag */ /** @var array $tag */
foreach ($journal['tags'] as $tag) { foreach ($journal['tags'] as $tag) {
@@ -146,15 +146,15 @@ class TagController extends Controller
// on currency ID // on currency ID
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$key] ??= [ $response[$key] ??= [
'id' => (string)$tagId, 'id' => (string) $tagId,
'name' => $tag['name'], 'name' => $tag['name'],
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$key]['difference'] = bcadd($response[$key]['difference'], app('steam')->positive($journal['amount'])); $response[$key]['difference'] = bcadd($response[$key]['difference'], app('steam')->positive($journal['amount']));
$response[$key]['difference_float'] = (float)$response[$key]['difference']; $response[$key]['difference_float'] = (float) $response[$key]['difference'];
} }
// on foreign ID // on foreign ID
@@ -162,14 +162,14 @@ class TagController extends Controller
$response[$foreignKey] = $journal[$foreignKey] ?? [ $response[$foreignKey] = $journal[$foreignKey] ?? [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignKey]['difference'] = bcadd( $response[$foreignKey]['difference'] = bcadd(
$response[$foreignKey]['difference'], $response[$foreignKey]['difference'],
app('steam')->positive($journal['foreign_amount']) app('steam')->positive($journal['foreign_amount'])
); );
$response[$foreignKey]['difference_float'] = (float)$response[$foreignKey]['difference']; $response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference'];
} }
} }
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* AccountController.php * AccountController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* CategoryController.php * CategoryController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -84,11 +85,11 @@ class CategoryController extends Controller
/** @var array $expense */ /** @var array $expense */
foreach ($expenses as $expense) { foreach ($expenses as $expense) {
$result[] = [ $result[] = [
'id' => (string)$category->id, 'id' => (string) $category->id,
'name' => $category->name, 'name' => $category->name,
'difference' => $expense['sum'], 'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'], 'difference_float' => (float) $expense['sum'],
'currency_id' => (string)$expense['currency_id'], 'currency_id' => (string) $expense['currency_id'],
'currency_code' => $expense['currency_code'], 'currency_code' => $expense['currency_code'],
]; ];
} }
@@ -113,8 +114,8 @@ class CategoryController extends Controller
foreach ($expenses as $expense) { foreach ($expenses as $expense) {
$result[] = [ $result[] = [
'difference' => $expense['sum'], 'difference' => $expense['sum'],
'difference_float' => (float)$expense['sum'], 'difference_float' => (float) $expense['sum'],
'currency_id' => (string)$expense['currency_id'], 'currency_id' => (string) $expense['currency_id'],
'currency_code' => $expense['currency_code'], 'currency_code' => $expense['currency_code'],
]; ];
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* PeriodController.php * PeriodController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -50,31 +51,31 @@ class PeriodController extends Controller
$collector->setTypes([TransactionType::TRANSFER])->setRange($start, $end)->setDestinationAccounts($accounts); $collector->setTypes([TransactionType::TRANSFER])->setRange($start, $end)->setDestinationAccounts($accounts);
$genericSet = $collector->getExtractedJournals(); $genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$currencyId] ??= [ $response[$currencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount'])); $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount']));
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference']; $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference'];
} }
if (0 !== $foreignCurrencyId) { if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] ??= [ $response[$foreignCurrencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignCurrencyId]['difference'] = bcadd( $response[$foreignCurrencyId]['difference'] = bcadd(
$response[$foreignCurrencyId]['difference'], $response[$foreignCurrencyId]['difference'],
app('steam')->positive($journal['foreign_amount']) app('steam')->positive($journal['foreign_amount'])
); );
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference']; $response[$foreignCurrencyId]['difference_float'] = (float) $response[$foreignCurrencyId]['difference'];
} }
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* TagController.php * TagController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -73,31 +74,31 @@ class TagController extends Controller
$genericSet = $collector->getExtractedJournals(); $genericSet = $collector->getExtractedJournals();
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$currencyId] ??= [ $response[$currencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount'])); $response[$currencyId]['difference'] = bcadd($response[$currencyId]['difference'], app('steam')->positive($journal['amount']));
$response[$currencyId]['difference_float'] = (float)$response[$currencyId]['difference']; $response[$currencyId]['difference_float'] = (float) $response[$currencyId]['difference'];
} }
if (0 !== $foreignCurrencyId) { if (0 !== $foreignCurrencyId) {
$response[$foreignCurrencyId] ??= [ $response[$foreignCurrencyId] ??= [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignCurrencyId]['difference'] = bcadd( $response[$foreignCurrencyId]['difference'] = bcadd(
$response[$foreignCurrencyId]['difference'], $response[$foreignCurrencyId]['difference'],
app('steam')->positive($journal['foreign_amount']) app('steam')->positive($journal['foreign_amount'])
); );
$response[$foreignCurrencyId]['difference_float'] = (float)$response[$foreignCurrencyId]['difference']; $response[$foreignCurrencyId]['difference_float'] = (float) $response[$foreignCurrencyId]['difference'];
} }
} }
@@ -131,8 +132,8 @@ class TagController extends Controller
/** @var array $journal */ /** @var array $journal */
foreach ($genericSet as $journal) { foreach ($genericSet as $journal) {
$currencyId = (int)$journal['currency_id']; $currencyId = (int) $journal['currency_id'];
$foreignCurrencyId = (int)$journal['foreign_currency_id']; $foreignCurrencyId = (int) $journal['foreign_currency_id'];
/** @var array $tag */ /** @var array $tag */
foreach ($journal['tags'] as $tag) { foreach ($journal['tags'] as $tag) {
@@ -143,15 +144,15 @@ class TagController extends Controller
// on currency ID // on currency ID
if (0 !== $currencyId) { if (0 !== $currencyId) {
$response[$key] ??= [ $response[$key] ??= [
'id' => (string)$tagId, 'id' => (string) $tagId,
'name' => $tag['name'], 'name' => $tag['name'],
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$currencyId, 'currency_id' => (string) $currencyId,
'currency_code' => $journal['currency_code'], 'currency_code' => $journal['currency_code'],
]; ];
$response[$key]['difference'] = bcadd($response[$key]['difference'], app('steam')->positive($journal['amount'])); $response[$key]['difference'] = bcadd($response[$key]['difference'], app('steam')->positive($journal['amount']));
$response[$key]['difference_float'] = (float)$response[$key]['difference']; $response[$key]['difference_float'] = (float) $response[$key]['difference'];
} }
// on foreign ID // on foreign ID
@@ -159,14 +160,14 @@ class TagController extends Controller
$response[$foreignKey] = $journal[$foreignKey] ?? [ $response[$foreignKey] = $journal[$foreignKey] ?? [
'difference' => '0', 'difference' => '0',
'difference_float' => 0, 'difference_float' => 0,
'currency_id' => (string)$foreignCurrencyId, 'currency_id' => (string) $foreignCurrencyId,
'currency_code' => $journal['foreign_currency_code'], 'currency_code' => $journal['foreign_currency_code'],
]; ];
$response[$foreignKey]['difference'] = bcadd( $response[$foreignKey]['difference'] = bcadd(
$response[$foreignKey]['difference'], $response[$foreignKey]['difference'],
app('steam')->positive($journal['foreign_amount']) app('steam')->positive($journal['foreign_amount'])
); );
$response[$foreignKey]['difference_float'] = (float)$response[$foreignKey]['difference']; // intentional float $response[$foreignKey]['difference_float'] = (float) $response[$foreignKey]['difference']; // intentional float
} }
} }
} }

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* AccountController.php * AccountController.php
* Copyright (c) 2019 james@firefly-iii.org * Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* AccountController.php * AccountController.php
* Copyright (c) 2019 james@firefly-iii.org * Copyright (c) 2019 james@firefly-iii.org
@@ -110,7 +111,7 @@ class ListController extends Controller
// types to get, page size: // types to get, page size:
$pageSize = $this->parameters->get('limit'); $pageSize = $this->parameters->get('limit');
// get list of budgets. Count it and split it. // get list of piggy banks. Count it and split it.
$collection = $this->repository->getPiggyBanks($account); $collection = $this->repository->getPiggyBanks($account);
$count = $collection->count(); $count = $collection->count();
$piggyBanks = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); $piggyBanks = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* AccountController.php * AccountController.php
* Copyright (c) 2019 james@firefly-iii.org * Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/** /**
* AccountController.php * AccountController.php
* Copyright (c) 2019 james@firefly-iii.org * Copyright (c) 2019 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -104,7 +105,7 @@ class ShowController extends Controller
->header('Expires', '0') ->header('Expires', '0')
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0') ->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
->header('Pragma', 'public') ->header('Pragma', 'public')
->header('Content-Length', (string)strlen($content)) ->header('Content-Length', (string) strlen($content))
; ;
return $response; return $response;

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ListController.php * ListController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ListController.php * ListController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ListController.php * ListController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -68,6 +69,7 @@ class StoreController extends Controller
$data = $request->getAll(); $data = $request->getAll();
$data['start_date'] = $data['start']; $data['start_date'] = $data['start'];
$data['end_date'] = $data['end']; $data['end_date'] = $data['end'];
$data['notes'] = $data['notes'];
$data['budget_id'] = $budget->id; $data['budget_id'] = $budget->id;
$budgetLimit = $this->blRepository->store($data); $budgetLimit = $this->blRepository->store($data);

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ListController.php * ListController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ListController.php * ListController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ListController.php * ListController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -27,6 +28,7 @@ use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBank;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use FireflyIII\Transformers\AccountTransformer;
use FireflyIII\Transformers\AttachmentTransformer; use FireflyIII\Transformers\AttachmentTransformer;
use FireflyIII\Transformers\PiggyBankEventTransformer; use FireflyIII\Transformers\PiggyBankEventTransformer;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
@@ -57,6 +59,38 @@ class ListController extends Controller
); );
} }
/**
* This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAccountByPiggyBank
*
* List single resource.
*
* @throws FireflyException
*/
public function accounts(PiggyBank $piggyBank): JsonResponse
{
// types to get, page size:
$pageSize = $this->parameters->get('limit');
$manager = $this->getManager();
$collection = $piggyBank->accounts;
$count = $collection->count();
$events = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
// make paginator:
$paginator = new LengthAwarePaginator($events, $count, $pageSize, $this->parameters->get('page'));
$paginator->setPath(route('api.v1.piggy-banks.accounts', [$piggyBank->id]).$this->buildParams());
/** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($events, $transformer, 'accounts');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
/** /**
* This endpoint is documented at: * This endpoint is documented at:
* https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAttachmentByPiggyBank * https://api-docs.firefly-iii.org/?urls.primaryName=2.0.0%20(v1)#/piggy_banks/listAttachmentByPiggyBank

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org
@@ -71,7 +72,7 @@ class ShowController extends Controller
// types to get, page size: // types to get, page size:
$pageSize = $this->parameters->get('limit'); $pageSize = $this->parameters->get('limit');
// get list of budgets. Count it and split it. // get list of piggy banks. Count it and split it.
$collection = $this->repository->getPiggyBanks(); $collection = $this->repository->getPiggyBanks();
$count = $collection->count(); $count = $collection->count();
$piggyBanks = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); $piggyBanks = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ListController.php * ListController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ExpressionController.php * ExpressionController.php
* Copyright (c) 2024 Michael Thomas * Copyright (c) 2024 Michael Thomas

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* TriggerController.php * TriggerController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ListController.php * ListController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* TriggerController.php * TriggerController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ListController.php * ListController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ShowController.php * ShowController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* StoreController.php * StoreController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* UpdateController.php * UpdateController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* DestroyController.php * DestroyController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

View File

@@ -1,4 +1,5 @@
<?php <?php
/* /*
* ListController.php * ListController.php
* Copyright (c) 2021 james@firefly-iii.org * Copyright (c) 2021 james@firefly-iii.org

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