mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-21 18:51:21 +00:00
Compare commits
284 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b1eaddfc2 | ||
|
|
4c3910dc59 | ||
|
|
ec9e8cd672 | ||
|
|
5cbd93bba6 | ||
|
|
30fc0fbf54 | ||
|
|
d26e847d54 | ||
|
|
7c553c1f0b | ||
|
|
eb63163ddf | ||
|
|
6e4adc86b8 | ||
|
|
b46398242f | ||
|
|
db071b1014 | ||
|
|
ebf6b50126 | ||
|
|
ebc498f0ff | ||
|
|
ef4c34a31f | ||
|
|
1d26c12771 | ||
|
|
cb8b49fd7a | ||
|
|
b0e6d12325 | ||
|
|
6da6a68e33 | ||
|
|
a12fd4a3ae | ||
|
|
003d8ba02a | ||
|
|
acb2a8697a | ||
|
|
aff0e4a9df | ||
|
|
b7ba04dacf | ||
|
|
ee6c8786b2 | ||
|
|
4fc19b7eba | ||
|
|
37964a375d | ||
|
|
b8573d03a4 | ||
|
|
b104914076 | ||
|
|
1d30b58685 | ||
|
|
326baa93a7 | ||
|
|
ab9f26f850 | ||
|
|
9a944175ac | ||
|
|
0bcc3240b7 | ||
|
|
1bf3608142 | ||
|
|
9dc971550c | ||
|
|
33c52513a3 | ||
|
|
2408ff11f6 | ||
|
|
3d130e5d99 | ||
|
|
bc0355c5b1 | ||
|
|
b90b13632e | ||
|
|
bad57c907c | ||
|
|
374793eb92 | ||
|
|
8a6ae6105e | ||
|
|
ecda8eebf2 | ||
|
|
f0a5257921 | ||
|
|
860a4bdc0a | ||
|
|
f6ddf72323 | ||
|
|
ec212bb98e | ||
|
|
fd7d37ac23 | ||
|
|
b4cd0d6bbc | ||
|
|
0a5908e4d8 | ||
|
|
59f0631685 | ||
|
|
7718deb4a5 | ||
|
|
75d52b7024 | ||
|
|
ecc72dd01b | ||
|
|
6591512cf6 | ||
|
|
4a0e97e36a | ||
|
|
f90b2d9410 | ||
|
|
582ba0ce5d | ||
|
|
ce411ab9b0 | ||
|
|
d90468db3f | ||
|
|
3a621e6ff7 | ||
|
|
a7ffe66547 | ||
|
|
4a57f4d6dd | ||
|
|
5b72ffa575 | ||
|
|
04a9e2cec2 | ||
|
|
17022c1174 | ||
|
|
59914a9d87 | ||
|
|
a7b9653de3 | ||
|
|
c8dc065e24 | ||
|
|
bac58ad0c2 | ||
|
|
6b2431b054 | ||
|
|
7e212ebd48 | ||
|
|
b3223b90da | ||
|
|
6ea773cdd7 | ||
|
|
997cddcb5a | ||
|
|
8228f76f5d | ||
|
|
b35ee9ccf4 | ||
|
|
16942af52b | ||
|
|
b190ce3538 | ||
|
|
9027915280 | ||
|
|
19aaaef37e | ||
|
|
a3bb90e160 | ||
|
|
06bae0dd8b | ||
|
|
7d48ab5671 | ||
|
|
8588405aa1 | ||
|
|
8238ae7d0a | ||
|
|
78ebec01a4 | ||
|
|
ac1137d7e8 | ||
|
|
212e9b833b | ||
|
|
52ad0ba352 | ||
|
|
318d86a1f5 | ||
|
|
fbffba4c21 | ||
|
|
c7f4e5423a | ||
|
|
5f282a9b7d | ||
|
|
7539ee3560 | ||
|
|
032389c6c0 | ||
|
|
788ac54f86 | ||
|
|
4e0fbc8532 | ||
|
|
5764d9756c | ||
|
|
85e79922ab | ||
|
|
6f3826a6ff | ||
|
|
c061b0b777 | ||
|
|
fc7bbfa8e2 | ||
|
|
0da20c7a1b | ||
|
|
4e2d5fe166 | ||
|
|
70767678ba | ||
|
|
7340e146f1 | ||
|
|
583bc59d23 | ||
|
|
ff5b872fa3 | ||
|
|
28517a8b78 | ||
|
|
34138d1533 | ||
|
|
ccf589f093 | ||
|
|
3ee100e71e | ||
|
|
1e0547a02c | ||
|
|
577e1f1b56 | ||
|
|
a7d25125a7 | ||
|
|
dbb09ef5d1 | ||
|
|
d840c94a29 | ||
|
|
114980480e | ||
|
|
95b1a821f3 | ||
|
|
206397cc81 | ||
|
|
a6b1a6d0c2 | ||
|
|
aba39a3b27 | ||
|
|
b5f095dd91 | ||
|
|
a9e92d4fa6 | ||
|
|
867a2eacd3 | ||
|
|
accecf6a76 | ||
|
|
f12b3bc9b7 | ||
|
|
a2ed755c9c | ||
|
|
235639b728 | ||
|
|
b1d5882fa6 | ||
|
|
39e632d950 | ||
|
|
87ced85657 | ||
|
|
0c53a8db66 | ||
|
|
84dcbaf0e7 | ||
|
|
047440eaea | ||
|
|
217ad0234b | ||
|
|
9795f46bea | ||
|
|
10bc0098b9 | ||
|
|
7a900fd3d9 | ||
|
|
45cfb4e565 | ||
|
|
5320480767 | ||
|
|
3e18e984fa | ||
|
|
fce759e98f | ||
|
|
f4439778f1 | ||
|
|
11176fc212 | ||
|
|
ffc71da2eb | ||
|
|
246fa0d6e4 | ||
|
|
3444146da3 | ||
|
|
5c4a482f64 | ||
|
|
01f84ea11d | ||
|
|
08402babbd | ||
|
|
7ef3dcbd23 | ||
|
|
8836fa205b | ||
|
|
f544a278c5 | ||
|
|
4b8fd6adb9 | ||
|
|
1ac8a9b4ac | ||
|
|
08a8a69b34 | ||
|
|
dbd668bda5 | ||
|
|
cc0760553b | ||
|
|
1142ff6b1f | ||
|
|
927da5d742 | ||
|
|
9a734e48fe | ||
|
|
345fe39b54 | ||
|
|
c7e9d62712 | ||
|
|
5918095f11 | ||
|
|
24612eb634 | ||
|
|
f7125d6198 | ||
|
|
47870cd50c | ||
|
|
45fbf83971 | ||
|
|
6044cffef3 | ||
|
|
4d933e1ef7 | ||
|
|
181e088ad5 | ||
|
|
179b86c3ba | ||
|
|
083c15b956 | ||
|
|
7c780dd75c | ||
|
|
d35d51c014 | ||
|
|
14c6926360 | ||
|
|
bedfcb5c5d | ||
|
|
19461020ef | ||
|
|
36ecf25804 | ||
|
|
0229fc243a | ||
|
|
a2f09b305c | ||
|
|
32d7a0fd1b | ||
|
|
5d3f95762e | ||
|
|
4ca9ee6eec | ||
|
|
9026b0bfd7 | ||
|
|
3d30a5938a | ||
|
|
bcb06779b9 | ||
|
|
26b70f37d6 | ||
|
|
b20a354344 | ||
|
|
753f518f77 | ||
|
|
33d3019ffd | ||
|
|
26e3157ae7 | ||
|
|
b592528318 | ||
|
|
936d55d7de | ||
|
|
6df45fccc5 | ||
|
|
f43ebcce87 | ||
|
|
23fc261a82 | ||
|
|
344db19232 | ||
|
|
5f777845a3 | ||
|
|
f32bdd6c76 | ||
|
|
219c3c11f9 | ||
|
|
b3b367fcb3 | ||
|
|
52a43e7f30 | ||
|
|
04f5098d06 | ||
|
|
9731503826 | ||
|
|
b431351a22 | ||
|
|
089097a41c | ||
|
|
4468fdd76b | ||
|
|
79c70c59e3 | ||
|
|
c8ffc81527 | ||
|
|
048db14a08 | ||
|
|
a9ee07b19a | ||
|
|
e316d9ce6d | ||
|
|
6bf354cf93 | ||
|
|
384ebf9341 | ||
|
|
b2c74ba86a | ||
|
|
0c915de314 | ||
|
|
327e7efa89 | ||
|
|
c361b6cc07 | ||
|
|
59948d6746 | ||
|
|
1d93cf41fd | ||
|
|
8bbbb05adc | ||
|
|
6e314b6a30 | ||
|
|
499b2ca7ef | ||
|
|
77823d3f33 | ||
|
|
88dfb954ca | ||
|
|
ddc229f270 | ||
|
|
8af8cc2c9a | ||
|
|
775492b391 | ||
|
|
1419176094 | ||
|
|
aa0ca5fdcf | ||
|
|
0d61a3ad5d | ||
|
|
bdbb3d9ad1 | ||
|
|
fc73bddd43 | ||
|
|
7515578ba7 | ||
|
|
84b9841886 | ||
|
|
6b66476927 | ||
|
|
7357f19f81 | ||
|
|
f29d8322d5 | ||
|
|
31a3f6f4d8 | ||
|
|
7432a0c5cb | ||
|
|
f6d58191b2 | ||
|
|
89fbf0869a | ||
|
|
b1e453438e | ||
|
|
284c6033d3 | ||
|
|
b85b32560c | ||
|
|
35bc92bb49 | ||
|
|
243a5217e7 | ||
|
|
b2eeeed0af | ||
|
|
afd4700758 | ||
|
|
03a1601bf3 | ||
|
|
edfff4ec57 | ||
|
|
7b5bc3a25e | ||
|
|
d98ca0bb44 | ||
|
|
518b4ba5a7 | ||
|
|
9c1f781be3 | ||
|
|
fa7c1b3ec8 | ||
|
|
89acb9b6f3 | ||
|
|
45971f8f26 | ||
|
|
21f12b87a0 | ||
|
|
d264333ab8 | ||
|
|
0f9c1b9427 | ||
|
|
c273f309d4 | ||
|
|
17fd2f9909 | ||
|
|
0436701f29 | ||
|
|
840632b34e | ||
|
|
764481690c | ||
|
|
66b9d7421b | ||
|
|
a02c1557ac | ||
|
|
ff8af87179 | ||
|
|
9c8b31fdbb | ||
|
|
bda1413da4 | ||
|
|
f1cc8a10f5 | ||
|
|
babf462bcf | ||
|
|
dba24d2dee | ||
|
|
42066cfca2 | ||
|
|
32e550c8e0 | ||
|
|
4f2c94a5a8 | ||
|
|
95076bdb6a | ||
|
|
547caadeb2 | ||
|
|
ded267c9ac |
@@ -69,6 +69,8 @@ DB_PORT=3306
|
|||||||
DB_DATABASE=firefly
|
DB_DATABASE=firefly
|
||||||
DB_USERNAME=firefly
|
DB_USERNAME=firefly
|
||||||
DB_PASSWORD=secret_firefly_password
|
DB_PASSWORD=secret_firefly_password
|
||||||
|
# leave empty or omit when not using a socket connection
|
||||||
|
DB_SOCKET=
|
||||||
|
|
||||||
# MySQL supports SSL. You can configure it here.
|
# MySQL supports SSL. You can configure it here.
|
||||||
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
# If you use Docker or similar, you can set these variables from a file by appending them with _FILE
|
||||||
@@ -89,6 +91,9 @@ PGSQL_SSL_CERT=null
|
|||||||
PGSQL_SSL_KEY=null
|
PGSQL_SSL_KEY=null
|
||||||
PGSQL_SSL_CRL_FILE=null
|
PGSQL_SSL_CRL_FILE=null
|
||||||
|
|
||||||
|
# more PostgreSQL settings
|
||||||
|
PGSQL_SCHEMA=public
|
||||||
|
|
||||||
# If you're looking for performance improvements, you could install memcached or redis
|
# If you're looking for performance improvements, you could install memcached or redis
|
||||||
CACHE_DRIVER=file
|
CACHE_DRIVER=file
|
||||||
SESSION_DRIVER=file
|
SESSION_DRIVER=file
|
||||||
|
|||||||
3
.github/ISSUE_TEMPLATE/bug.yml
vendored
3
.github/ISSUE_TEMPLATE/bug.yml
vendored
@@ -14,8 +14,9 @@ body:
|
|||||||
label: I've found a bug and checked that ...
|
label: I've found a bug and checked that ...
|
||||||
description: Make sure that your request fulfills all of the following requirements. If one requirement cannot be satisfied, explain in detail why.
|
description: Make sure that your request fulfills all of the following requirements. If one requirement cannot be satisfied, explain in detail why.
|
||||||
options:
|
options:
|
||||||
- label: ... the documentation does not mention anything about my problem
|
- label: ... [the documentation](https://docs.firefly-iii.org/) does not mention anything about my problem
|
||||||
- label: ... there are no open or closed issues that are related to my problem
|
- label: ... there are no open or closed issues that are related to my problem
|
||||||
|
- label: ... it's [definitely me, not you](https://github.com/firefly-iii/firefly-iii/blob/main/.github/its_you_not_me.md)
|
||||||
|
|
||||||
- type: textarea
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
@@ -19,11 +19,3 @@ updates:
|
|||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
|
|
||||||
# yarn / JS updates for new frontend
|
|
||||||
- package-ecosystem: "npm"
|
|
||||||
directory: "/frontend"
|
|
||||||
target-branch: develop
|
|
||||||
versioning-strategy: increase
|
|
||||||
labels: ["bug"]
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
||||||
|
|||||||
15
.github/its_you_not_me.md
vendored
Normal file
15
.github/its_you_not_me.md
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# It's not you, it's me
|
||||||
|
|
||||||
|
Sometimes bugs reported to Firefly III are configuration and system problems on the user side.
|
||||||
|
|
||||||
|
If you run into one of the following problems, there's a good chance it's not a Firefly III issue, but a configuration issue.
|
||||||
|
|
||||||
|
- ⚠️ Can't connect to the database when starting Firefly III
|
||||||
|
- ⚠️ Errors with missing app keys or encryption problems
|
||||||
|
- ⚠️ Can't login due to 419 errors
|
||||||
|
- ⚠️ Any 500 error when starting Firefly III
|
||||||
|
- ⚠️ Any white page when starting Firefly III
|
||||||
|
- ⚠️ Time-out when starting Firefly III for the first time
|
||||||
|
- ⚠️ Firefly III does not work behind your reverse proxy
|
||||||
|
|
||||||
|
If you run into an issue like this, please start a [discussion](https://github.com/firefly-iii/firefly-iii/discussions) or chat on [Gitter.im](https://gitter.im/firefly-iii/firefly-iii). There's a good chance it's not a bug but something we can fix rather quickly :+1:
|
||||||
14
.github/mergify.yml
vendored
Normal file
14
.github/mergify.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
pull_request_rules:
|
||||||
|
- name: Security update by dependabot
|
||||||
|
conditions:
|
||||||
|
- author~=^dependabot(|-preview)\[bot\]$
|
||||||
|
actions:
|
||||||
|
merge:
|
||||||
|
method: merge
|
||||||
|
- name: Close all on main
|
||||||
|
conditions:
|
||||||
|
- base=main
|
||||||
|
- -author~=^dependabot(|-preview)\[bot\]$
|
||||||
|
actions:
|
||||||
|
close:
|
||||||
|
message: Please do not open PR's on the `main` branch, but on the `develop` branch only. Thank you!
|
||||||
21
.github/workflows/build.yml
vendored
Normal file
21
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
name: Sonarcloud CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
jobs:
|
||||||
|
sonarcloud:
|
||||||
|
name: SonarCloud
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||||
|
- name: SonarCloud Scan
|
||||||
|
uses: SonarSource/sonarcloud-github-action@master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -16,3 +16,4 @@ public/google*.html
|
|||||||
report.html
|
report.html
|
||||||
composer.phar
|
composer.phar
|
||||||
app.js.map
|
app.js.map
|
||||||
|
frontend-v3
|
||||||
|
|||||||
13
.mergify.yml
13
.mergify.yml
@@ -1,13 +0,0 @@
|
|||||||
pull_request_rules:
|
|
||||||
- name: Automatic merge on approval
|
|
||||||
conditions:
|
|
||||||
- "#approved-reviews-by>=1"
|
|
||||||
actions:
|
|
||||||
merge:
|
|
||||||
method: merge
|
|
||||||
- name: Security update by dependabot
|
|
||||||
conditions:
|
|
||||||
- "author=dependabot"
|
|
||||||
actions:
|
|
||||||
merge:
|
|
||||||
method: merge
|
|
||||||
@@ -201,4 +201,70 @@ class ListController extends Controller
|
|||||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This endpoint is documented at:
|
||||||
|
* https://api-docs.firefly-iii.org/#/budgets/listTransactionWithoutBudget
|
||||||
|
*
|
||||||
|
* Show all transactions.
|
||||||
|
*
|
||||||
|
* @param Request $request
|
||||||
|
*
|
||||||
|
* @param Budget $budget
|
||||||
|
*
|
||||||
|
* @return JsonResponse
|
||||||
|
* @throws FireflyException
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
|
public function withoutBudget(Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||||
|
|
||||||
|
// user can overrule page size with limit parameter.
|
||||||
|
$limit = $this->parameters->get('limit');
|
||||||
|
if (null !== $limit && $limit > 0) {
|
||||||
|
$pageSize = $limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$type = $request->get('type') ?? 'default';
|
||||||
|
$this->parameters->set('type', $type);
|
||||||
|
|
||||||
|
$types = $this->mapTransactionTypes($this->parameters->get('type'));
|
||||||
|
$manager = $this->getManager();
|
||||||
|
|
||||||
|
/** @var User $admin */
|
||||||
|
$admin = auth()->user();
|
||||||
|
|
||||||
|
// use new group collector:
|
||||||
|
/** @var GroupCollectorInterface $collector */
|
||||||
|
$collector = app(GroupCollectorInterface::class);
|
||||||
|
$collector
|
||||||
|
->setUser($admin)
|
||||||
|
// filter on budget.
|
||||||
|
->withoutBudget()
|
||||||
|
// all info needed for the API:
|
||||||
|
->withAPIInformation()
|
||||||
|
// set page size:
|
||||||
|
->setLimit($pageSize)
|
||||||
|
// set page to retrieve
|
||||||
|
->setPage($this->parameters->get('page'))
|
||||||
|
// set types of transactions to return.
|
||||||
|
->setTypes($types);
|
||||||
|
|
||||||
|
if (null !== $this->parameters->get('start') && null !== $this->parameters->get('end')) {
|
||||||
|
$collector->setRange($this->parameters->get('start'), $this->parameters->get('end'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$paginator = $collector->getPaginatedGroups();
|
||||||
|
$paginator->setPath(route('api.v1.budgets.without-budget') . $this->buildParams());
|
||||||
|
$transactions = $paginator->getCollection();
|
||||||
|
|
||||||
|
/** @var TransactionGroupTransformer $transformer */
|
||||||
|
$transformer = app(TransactionGroupTransformer::class);
|
||||||
|
$transformer->setParameters($this->parameters);
|
||||||
|
$resource = new FractalCollection($transactions, $transformer, 'transactions');
|
||||||
|
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||||
|
|
||||||
|
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ class DestroyController extends Controller
|
|||||||
$this->repository->destroyGroup($transactionGroup);
|
$this->repository->destroyGroup($transactionGroup);
|
||||||
// trigger just after destruction
|
// trigger just after destruction
|
||||||
event(new DestroyedTransactionGroup($transactionGroup));
|
event(new DestroyedTransactionGroup($transactionGroup));
|
||||||
|
app('preferences')->mark();
|
||||||
|
|
||||||
return response()->json([], 204);
|
return response()->json([], 204);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class AutocompleteRequest extends FormRequest
|
|||||||
return [
|
return [
|
||||||
'types' => $array,
|
'types' => $array,
|
||||||
'query' => $this->string('query'),
|
'query' => $this->string('query'),
|
||||||
'date' => $this->date('date'),
|
'date' => $this->getCarbonDate('date'),
|
||||||
'limit' => $limit,
|
'limit' => $limit,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ class DateRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'start' => $this->date('start'),
|
'start' => $this->getCarbonDate('start'),
|
||||||
'end' => $this->date('end'),
|
'end' => $this->getCarbonDate('end'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ class ExportRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
$result = [
|
$result = [
|
||||||
'start' => $this->date('start') ?? Carbon::now()->subYear(),
|
'start' => $this->getCarbonDate('start') ?? Carbon::now()->subYear(),
|
||||||
'end' => $this->date('end') ?? Carbon::now(),
|
'end' => $this->getCarbonDate('end') ?? Carbon::now(),
|
||||||
'type' => $this->string('type'),
|
'type' => $this->string('type'),
|
||||||
];
|
];
|
||||||
$parts = explode(',', $this->string('accounts'));
|
$parts = explode(',', $this->string('accounts'));
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ class GenericRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'start' => $this->date('start'),
|
'start' => $this->getCarbonDate('start'),
|
||||||
'end' => $this->date('end'),
|
'end' => $this->getCarbonDate('end'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ class GenericRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function getEnd(): Carbon
|
public function getEnd(): Carbon
|
||||||
{
|
{
|
||||||
$date = $this->date('end');
|
$date = $this->getCarbonDate('end');
|
||||||
$date->endOfDay();
|
$date->endOfDay();
|
||||||
|
|
||||||
return $date;
|
return $date;
|
||||||
@@ -251,7 +251,7 @@ class GenericRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function getStart(): Carbon
|
public function getStart(): Carbon
|
||||||
{
|
{
|
||||||
$date = $this->date('start');
|
$date = $this->getCarbonDate('start');
|
||||||
$date->startOfDay();
|
$date->startOfDay();
|
||||||
|
|
||||||
return $date;
|
return $date;
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class StoreRequest extends FormRequest
|
|||||||
'account_number' => $this->string('account_number'),
|
'account_number' => $this->string('account_number'),
|
||||||
'account_role' => $this->string('account_role'),
|
'account_role' => $this->string('account_role'),
|
||||||
'opening_balance' => $this->string('opening_balance'),
|
'opening_balance' => $this->string('opening_balance'),
|
||||||
'opening_balance_date' => $this->date('opening_balance_date'),
|
'opening_balance_date' => $this->getCarbonDate('opening_balance_date'),
|
||||||
'cc_type' => $this->string('credit_card_type'),
|
'cc_type' => $this->string('credit_card_type'),
|
||||||
'cc_monthly_payment_date' => $this->string('monthly_payment_date'),
|
'cc_monthly_payment_date' => $this->string('monthly_payment_date'),
|
||||||
'notes' => $this->stringWithNewlines('notes'),
|
'notes' => $this->stringWithNewlines('notes'),
|
||||||
@@ -82,7 +82,7 @@ class StoreRequest extends FormRequest
|
|||||||
|
|
||||||
if ('liability' === $data['account_type_name'] || 'liabilities' === $data['account_type_name']) {
|
if ('liability' === $data['account_type_name'] || 'liabilities' === $data['account_type_name']) {
|
||||||
$data['opening_balance'] = app('steam')->negative($this->string('liability_amount'));
|
$data['opening_balance'] = app('steam')->negative($this->string('liability_amount'));
|
||||||
$data['opening_balance_date'] = $this->date('liability_start_date');
|
$data['opening_balance_date'] = $this->getCarbonDate('liability_start_date');
|
||||||
$data['account_type_name'] = $this->string('liability_type');
|
$data['account_type_name'] = $this->string('liability_type');
|
||||||
$data['liability_direction'] = $this->string('liability_direction');
|
$data['liability_direction'] = $this->string('liability_direction');
|
||||||
$data['account_type_id'] = null;
|
$data['account_type_id'] = null;
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ class StoreRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'start' => $this->date('start'),
|
'start' => $this->getCarbonDate('start'),
|
||||||
'end' => $this->date('end'),
|
'end' => $this->getCarbonDate('end'),
|
||||||
'amount' => $this->string('amount'),
|
'amount' => $this->string('amount'),
|
||||||
'currency_id' => $this->integer('currency_id'),
|
'currency_id' => $this->integer('currency_id'),
|
||||||
'currency_code' => $this->string('currency_code'),
|
'currency_code' => $this->string('currency_code'),
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ class StoreRequest extends FormRequest
|
|||||||
$data['account_id'] = $this->integer('account_id');
|
$data['account_id'] = $this->integer('account_id');
|
||||||
$data['targetamount'] = $this->string('target_amount');
|
$data['targetamount'] = $this->string('target_amount');
|
||||||
$data['current_amount'] = $this->string('current_amount');
|
$data['current_amount'] = $this->string('current_amount');
|
||||||
$data['startdate'] = $this->date('start_date');
|
$data['startdate'] = $this->getCarbonDate('start_date');
|
||||||
$data['targetdate'] = $this->date('target_date');
|
$data['targetdate'] = $this->getCarbonDate('target_date');
|
||||||
$data['notes'] = $this->stringWithNewlines('notes');
|
$data['notes'] = $this->stringWithNewlines('notes');
|
||||||
$data['object_group_id'] = $this->integer('object_group_id');
|
$data['object_group_id'] = $this->integer('object_group_id');
|
||||||
$data['object_group_title'] = $this->string('object_group_title');
|
$data['object_group_title'] = $this->string('object_group_title');
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'strict' => ['strict', 'boolean'],
|
'strict' => ['strict', 'boolean'],
|
||||||
'stop_processing' => ['stop_processing', 'boolean'],
|
'stop_processing' => ['stop_processing', 'boolean'],
|
||||||
'active' => ['active', 'boolean'],
|
'active' => ['active', 'boolean'],
|
||||||
|
'order' => ['order', 'integer'],
|
||||||
];
|
];
|
||||||
|
|
||||||
$return = $this->getAllData($fields);
|
$return = $this->getAllData($fields);
|
||||||
@@ -150,6 +151,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'strict' => [new IsBoolean],
|
'strict' => [new IsBoolean],
|
||||||
'stop_processing' => [new IsBoolean],
|
'stop_processing' => [new IsBoolean],
|
||||||
'active' => [new IsBoolean],
|
'active' => [new IsBoolean],
|
||||||
|
'order' => 'numeric|between:1,1337',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ class StoreRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
$data = [
|
$data = [
|
||||||
'tag' => $this->string('tag'),
|
'tag' => $this->string('tag'),
|
||||||
'date' => $this->date('date'),
|
'date' => $this->getCarbonDate('date'),
|
||||||
'description' => $this->string('description'),
|
'description' => $this->string('description'),
|
||||||
'has_location' => true,
|
'has_location' => true,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class StoreRequest extends FormRequest
|
|||||||
'original_source' => sprintf('ff3-v%s|api-v%s', config('firefly.version'), config('firefly.api_version')),
|
'original_source' => sprintf('ff3-v%s|api-v%s', config('firefly.version'), config('firefly.api_version')),
|
||||||
'recurrence_id' => $this->integerFromValue($object['recurrence_id']),
|
'recurrence_id' => $this->integerFromValue($object['recurrence_id']),
|
||||||
'bunq_payment_id' => $this->clearString((string)$object['bunq_payment_id'], false),
|
'bunq_payment_id' => $this->clearString((string)$object['bunq_payment_id'], false),
|
||||||
'external_uri' => $this->clearString((string)$object['external_uri'], false),
|
'external_url' => $this->clearString((string)$object['external_url'], false),
|
||||||
|
|
||||||
'sepa_cc' => $this->clearString((string)$object['sepa_cc'], false),
|
'sepa_cc' => $this->clearString((string)$object['sepa_cc'], false),
|
||||||
'sepa_ct_op' => $this->clearString((string)$object['sepa_ct_op'], false),
|
'sepa_ct_op' => $this->clearString((string)$object['sepa_ct_op'], false),
|
||||||
@@ -228,7 +228,7 @@ class StoreRequest extends FormRequest
|
|||||||
'transactions.*.external_id' => 'min:1,max:255|nullable',
|
'transactions.*.external_id' => 'min:1,max:255|nullable',
|
||||||
'transactions.*.recurrence_id' => 'min:1,max:255|nullable',
|
'transactions.*.recurrence_id' => 'min:1,max:255|nullable',
|
||||||
'transactions.*.bunq_payment_id' => 'min:1,max:255|nullable',
|
'transactions.*.bunq_payment_id' => 'min:1,max:255|nullable',
|
||||||
'transactions.*.external_uri' => 'min:1,max:255|nullable|url',
|
'transactions.*.external_url' => 'min:1,max:255|nullable|url',
|
||||||
|
|
||||||
// SEPA fields:
|
// SEPA fields:
|
||||||
'transactions.*.sepa_cc' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_cc' => 'min:1,max:255|nullable',
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'sepa_ep',
|
'sepa_ep',
|
||||||
'sepa_ci',
|
'sepa_ci',
|
||||||
'sepa_batch_id',
|
'sepa_batch_id',
|
||||||
'external_uri',
|
'external_url',
|
||||||
];
|
];
|
||||||
$this->booleanFields = [
|
$this->booleanFields = [
|
||||||
'reconciled',
|
'reconciled',
|
||||||
@@ -292,6 +292,10 @@ class UpdateRequest extends FormRequest
|
|||||||
'transactions.*.date' => [new IsDateOrTime],
|
'transactions.*.date' => [new IsDateOrTime],
|
||||||
'transactions.*.order' => 'numeric|min:0',
|
'transactions.*.order' => 'numeric|min:0',
|
||||||
|
|
||||||
|
// group id:
|
||||||
|
'transactions.*.transaction_journal_id' => ['numeric', 'exists:transaction_journals,id', new BelongsUser],
|
||||||
|
|
||||||
|
|
||||||
// currency info
|
// currency info
|
||||||
'transactions.*.currency_id' => 'numeric|exists:transaction_currencies,id',
|
'transactions.*.currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||||
'transactions.*.currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
'transactions.*.currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
||||||
@@ -331,7 +335,7 @@ class UpdateRequest extends FormRequest
|
|||||||
'transactions.*.external_id' => 'min:1,max:255|nullable',
|
'transactions.*.external_id' => 'min:1,max:255|nullable',
|
||||||
'transactions.*.recurrence_id' => 'min:1,max:255|nullable',
|
'transactions.*.recurrence_id' => 'min:1,max:255|nullable',
|
||||||
'transactions.*.bunq_payment_id' => 'min:1,max:255|nullable',
|
'transactions.*.bunq_payment_id' => 'min:1,max:255|nullable',
|
||||||
'transactions.*.external_uri' => 'min:1,max:255|nullable|url',
|
'transactions.*.external_url' => 'min:1,max:255|nullable|url',
|
||||||
|
|
||||||
// SEPA fields:
|
// SEPA fields:
|
||||||
'transactions.*.sepa_cc' => 'min:1,max:255|nullable',
|
'transactions.*.sepa_cc' => 'min:1,max:255|nullable',
|
||||||
@@ -375,6 +379,9 @@ class UpdateRequest extends FormRequest
|
|||||||
// validate source/destination is equal, depending on the transaction journal type.
|
// validate source/destination is equal, depending on the transaction journal type.
|
||||||
$this->validateEqualAccountsForUpdate($validator, $transactionGroup);
|
$this->validateEqualAccountsForUpdate($validator, $transactionGroup);
|
||||||
|
|
||||||
|
// a catch when users submit splits with no source or destination info at all.
|
||||||
|
$this->preventNoAccountInfo($validator,);
|
||||||
|
|
||||||
// validate that the currency fits the source and/or destination account.
|
// validate that the currency fits the source and/or destination account.
|
||||||
// validate all account info
|
// validate all account info
|
||||||
$this->validateAccountInformationUpdate($validator, $transactionGroup);
|
$this->validateAccountInformationUpdate($validator, $transactionGroup);
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class CronRequest extends FormRequest
|
|||||||
$data['force'] = $this->boolean('force');
|
$data['force'] = $this->boolean('force');
|
||||||
}
|
}
|
||||||
if ($this->has('date')) {
|
if ($this->has('date')) {
|
||||||
$data['date'] = $this->date('date');
|
$data['date'] = $this->getCarbonDate('date');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class CorrectDatabase extends Command
|
|||||||
'firefly-iii:delete-empty-journals',
|
'firefly-iii:delete-empty-journals',
|
||||||
'firefly-iii:delete-empty-groups',
|
'firefly-iii:delete-empty-groups',
|
||||||
'firefly-iii:fix-account-types',
|
'firefly-iii:fix-account-types',
|
||||||
|
'firefly-iii:fix-ibans',
|
||||||
'firefly-iii:fix-account-order',
|
'firefly-iii:fix-account-order',
|
||||||
'firefly-iii:rename-meta-fields',
|
'firefly-iii:rename-meta-fields',
|
||||||
'firefly-iii:fix-ob-currencies',
|
'firefly-iii:fix-ob-currencies',
|
||||||
|
|||||||
@@ -72,9 +72,7 @@ class CorrectOpeningBalanceCurrencies extends Command
|
|||||||
$count = 0;
|
$count = 0;
|
||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
foreach ($set as $journal) {
|
foreach ($set as $journal) {
|
||||||
Log::debug(sprintf('Going to fix journal #%d', $journal->id));
|
|
||||||
$count += $this->correctJournal($journal);
|
$count += $this->correctJournal($journal);
|
||||||
Log::debug(sprintf('Done, count is now %d', $count));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
@@ -100,7 +98,6 @@ class CorrectOpeningBalanceCurrencies extends Command
|
|||||||
*/
|
*/
|
||||||
private function correctJournal(TransactionJournal $journal): int
|
private function correctJournal(TransactionJournal $journal): int
|
||||||
{
|
{
|
||||||
Log::debug(sprintf('Going to correct journal #%d', $journal->id));
|
|
||||||
// get the asset account for this opening balance:
|
// get the asset account for this opening balance:
|
||||||
$account = $this->getAccount($journal);
|
$account = $this->getAccount($journal);
|
||||||
if (null === $account) {
|
if (null === $account) {
|
||||||
@@ -110,9 +107,7 @@ class CorrectOpeningBalanceCurrencies extends Command
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('Found "%s" #%d "%s".', $account->accountType->type, $account->id, $account->name));
|
|
||||||
$currency = $this->getCurrency($account);
|
$currency = $this->getCurrency($account);
|
||||||
Log::debug(sprintf('Found currency #%d (%s)', $currency->id, $currency->code));
|
|
||||||
|
|
||||||
// update journal and all transactions:
|
// update journal and all transactions:
|
||||||
return $this->setCurrency($journal, $currency);
|
return $this->setCurrency($journal, $currency);
|
||||||
@@ -126,20 +121,14 @@ class CorrectOpeningBalanceCurrencies extends Command
|
|||||||
private function getAccount(TransactionJournal $journal): ?Account
|
private function getAccount(TransactionJournal $journal): ?Account
|
||||||
{
|
{
|
||||||
$transactions = $journal->transactions()->get();
|
$transactions = $journal->transactions()->get();
|
||||||
Log::debug(sprintf('Found %d transactions for journal #%d.', $transactions->count(), $journal->id));
|
|
||||||
/** @var Transaction $transaction */
|
/** @var Transaction $transaction */
|
||||||
foreach ($transactions as $transaction) {
|
foreach ($transactions as $transaction) {
|
||||||
Log::debug(sprintf('Testing transaction #%d', $transaction->id));
|
|
||||||
/** @var Account $account */
|
/** @var Account $account */
|
||||||
$account = $transaction->account()->first();
|
$account = $transaction->account()->first();
|
||||||
if (null !== $account && AccountType::INITIAL_BALANCE !== $account->accountType()->first()->type) {
|
if (null !== $account && AccountType::INITIAL_BALANCE !== $account->accountType()->first()->type) {
|
||||||
Log::debug(sprintf('Account of transaction #%d is opposite of IB account (%s).', $transaction->id, $account->accountType()->first()->type));
|
|
||||||
|
|
||||||
return $account;
|
return $account;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log::debug('Found no IB account in transactions of journal.');
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,10 +154,8 @@ class CorrectOpeningBalanceCurrencies extends Command
|
|||||||
*/
|
*/
|
||||||
private function setCurrency(TransactionJournal $journal, TransactionCurrency $currency): int
|
private function setCurrency(TransactionJournal $journal, TransactionCurrency $currency): int
|
||||||
{
|
{
|
||||||
Log::debug('Now in setCurrency');
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
if ((int)$journal->transaction_currency_id !== (int)$currency->id) {
|
if ((int)$journal->transaction_currency_id !== (int)$currency->id) {
|
||||||
Log::debug(sprintf('Currency ID of journal #%d was #%d, now set to #%d', $journal->id, $journal->transaction_currency_id, $currency->id));
|
|
||||||
$journal->transaction_currency_id = $currency->id;
|
$journal->transaction_currency_id = $currency->id;
|
||||||
$journal->save();
|
$journal->save();
|
||||||
$count = 1;
|
$count = 1;
|
||||||
@@ -177,15 +164,11 @@ class CorrectOpeningBalanceCurrencies extends Command
|
|||||||
/** @var Transaction $transaction */
|
/** @var Transaction $transaction */
|
||||||
foreach ($journal->transactions as $transaction) {
|
foreach ($journal->transactions as $transaction) {
|
||||||
if ((int)$transaction->transaction_currency_id !== (int)$currency->id) {
|
if ((int)$transaction->transaction_currency_id !== (int)$currency->id) {
|
||||||
Log::debug(
|
|
||||||
sprintf('Currency ID of transaction #%d was #%d, now set to #%d', $transaction->id, $transaction->transaction_currency_id, $currency->id)
|
|
||||||
);
|
|
||||||
$transaction->transaction_currency_id = $currency->id;
|
$transaction->transaction_currency_id = $currency->id;
|
||||||
$transaction->save();
|
$transaction->save();
|
||||||
$count = 1;
|
$count = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('Return %d', $count));
|
|
||||||
|
|
||||||
return $count;
|
return $count;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use Illuminate\Console\Command;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CorrectionSkeleton
|
* Class CorrectionSkeleton
|
||||||
|
* TODO DONT FORGET TO ADD THIS TO THE DOCKER BUILD
|
||||||
*/
|
*/
|
||||||
class CorrectionSkeleton extends Command
|
class CorrectionSkeleton extends Command
|
||||||
{
|
{
|
||||||
|
|||||||
51
app/Console/Commands/Correction/FixIbans.php
Normal file
51
app/Console/Commands/Correction/FixIbans.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace FireflyIII\Console\Commands\Correction;
|
||||||
|
|
||||||
|
use FireflyIII\Models\Account;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class FixIbans
|
||||||
|
*/
|
||||||
|
class FixIbans extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Removes spaces from IBANs';
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'firefly-iii:fix-ibans';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function handle(): int
|
||||||
|
{
|
||||||
|
$accounts = Account::whereNotNull('iban')->get();
|
||||||
|
/** @var Account $account */
|
||||||
|
foreach ($accounts as $account) {
|
||||||
|
$iban = $account->iban;
|
||||||
|
if (str_contains($iban, ' ')) {
|
||||||
|
|
||||||
|
$iban = app('steam')->filterSpaces((string)$account->iban);
|
||||||
|
if ('' !== $iban) {
|
||||||
|
$account->iban = $iban;
|
||||||
|
$account->save();
|
||||||
|
$this->line(sprintf('Removed spaces from IBAN of account #%d', $account->id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -63,6 +63,12 @@ class CreateDatabase extends Command
|
|||||||
$exists = false;
|
$exists = false;
|
||||||
$checked = false; // checked for existence of DB?
|
$checked = false; // checked for existence of DB?
|
||||||
$dsn = sprintf('mysql:host=%s;port=%d;charset=utf8mb4', env('DB_HOST', 'localhost'), env('DB_PORT', '3306'));
|
$dsn = sprintf('mysql:host=%s;port=%d;charset=utf8mb4', env('DB_HOST', 'localhost'), env('DB_PORT', '3306'));
|
||||||
|
|
||||||
|
if ('' !== env('DB_SOCKET', '')) {
|
||||||
|
$dsn = sprintf('mysql:unix_socket=%s;charset=utf8mb4', env('DB_SOCKET', ''));
|
||||||
|
}
|
||||||
|
$this->info(sprintf('DSN is %s', $dsn));
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use Illuminate\Console\Command;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ReportSkeleton
|
* Class ReportSkeleton
|
||||||
|
* TODO DONT FORGET TO ADD THIS TO THE DOCKER BUILD
|
||||||
*/
|
*/
|
||||||
class ReportSkeleton extends Command
|
class ReportSkeleton extends Command
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,11 +74,19 @@ class RestoreOAuthKeys extends Command
|
|||||||
}
|
}
|
||||||
if ($this->keysInDatabase() && !$this->keysOnDrive()) {
|
if ($this->keysInDatabase() && !$this->keysOnDrive()) {
|
||||||
Log::debug('Keys are in DB and keys are not on the drive. Restore.');
|
Log::debug('Keys are in DB and keys are not on the drive. Restore.');
|
||||||
$this->restoreKeysFromDB();
|
$result = $this->restoreKeysFromDB();
|
||||||
|
if(true === $result) {
|
||||||
$this->line('Restored OAuth keys from database.');
|
$this->line('Restored OAuth keys from database.');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Log::warning('Could not restore keys. Will create new ones.');
|
||||||
|
$this->generateKeys();
|
||||||
|
$this->storeKeysInDB();
|
||||||
|
$this->line('Generated and stored new keys.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!$this->keysInDatabase() && $this->keysOnDrive()) {
|
if (!$this->keysInDatabase() && $this->keysOnDrive()) {
|
||||||
Log::debug('Keys are not in DB and keys are on the drive. Save in DB.');
|
Log::debug('Keys are not in DB and keys are on the drive. Save in DB.');
|
||||||
$this->storeKeysInDB();
|
$this->storeKeysInDB();
|
||||||
@@ -124,8 +132,8 @@ class RestoreOAuthKeys extends Command
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private function restoreKeysFromDB(): void
|
private function restoreKeysFromDB(): bool
|
||||||
{
|
{
|
||||||
OAuthKeys::restoreKeysFromDB();
|
return OAuthKeys::restoreKeysFromDB();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ class UpgradeDatabase extends Command
|
|||||||
'firefly-iii:unify-group-accounts',
|
'firefly-iii:unify-group-accounts',
|
||||||
'firefly-iii:fix-transaction-types',
|
'firefly-iii:fix-transaction-types',
|
||||||
'firefly-iii:fix-frontpage-accounts',
|
'firefly-iii:fix-frontpage-accounts',
|
||||||
|
'firefly-iii:fix-ibans',
|
||||||
|
|
||||||
// two report commands
|
// two report commands
|
||||||
'firefly-iii:report-empty-objects',
|
'firefly-iii:report-empty-objects',
|
||||||
@@ -143,11 +144,6 @@ class UpgradeDatabase extends Command
|
|||||||
$result = Artisan::output();
|
$result = Artisan::output();
|
||||||
echo $result;
|
echo $result;
|
||||||
|
|
||||||
$this->line('Now installing OAuth2 keys...');
|
|
||||||
Artisan::call('passport:install');
|
|
||||||
$result = Artisan::output();
|
|
||||||
echo $result;
|
|
||||||
|
|
||||||
$this->line('Done!');
|
$this->line('Done!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ namespace FireflyIII\Console\Commands\Upgrade;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class UpgradeSkeleton
|
* Class UpgradeSkeleton.
|
||||||
|
* TODO DONT FORGET TO ADD THIS TO THE DOCKER BUILD
|
||||||
*/
|
*/
|
||||||
class UpgradeSkeleton extends Command
|
class UpgradeSkeleton extends Command
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
declare(strict_types=1);
|
|
||||||
/*
|
/*
|
||||||
* ActuallyLoggedIn.php
|
* ActuallyLoggedIn.php
|
||||||
* Copyright (c) 2021 james@firefly-iii.org
|
* Copyright (c) 2022 james@firefly-iii.org
|
||||||
*
|
*
|
||||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||||
*
|
*
|
||||||
@@ -20,6 +20,8 @@ declare(strict_types=1);
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace FireflyIII\Events;
|
namespace FireflyIII\Events;
|
||||||
|
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
|||||||
return redirect(route('currencies.index'));
|
return redirect(route('currencies.index'));
|
||||||
case 'budgets.show':
|
case 'budgets.show':
|
||||||
case 'budgets.edit':
|
case 'budgets.edit':
|
||||||
|
case 'budgets.show.limit':
|
||||||
$request->session()->reflash();
|
$request->session()->reflash();
|
||||||
|
|
||||||
return redirect(route('budgets.index'));
|
return redirect(route('budgets.index'));
|
||||||
|
|||||||
@@ -365,19 +365,29 @@ class TransactionJournalFactory
|
|||||||
$this->accountValidator->setTransactionType($transactionType);
|
$this->accountValidator->setTransactionType($transactionType);
|
||||||
|
|
||||||
// validate source account.
|
// validate source account.
|
||||||
$sourceId = $data['source_id'] ? (int)$data['source_id'] : null;
|
$array = [
|
||||||
$sourceName = $data['source_name'] ? (string)$data['source_name'] : null;
|
'id' => $data['source_id'] ? (int)$data['source_id'] : null,
|
||||||
$validSource = $this->accountValidator->validateSource($sourceId, $sourceName, null);
|
'name' => $data['source_name'] ? (string)$data['source_name'] : null,
|
||||||
|
'iban' => $data['source_iban'] ? (string)$data['source_iban'] : null,
|
||||||
|
'number' => $data['source_number'] ? (string)$data['source_number'] : null,
|
||||||
|
];
|
||||||
|
$validSource = $this->accountValidator->validateSource($array);
|
||||||
|
|
||||||
// do something with result:
|
// do something with result:
|
||||||
if (false === $validSource) {
|
if (false === $validSource) {
|
||||||
throw new FireflyException(sprintf('Source: %s', $this->accountValidator->sourceError));
|
throw new FireflyException(sprintf('Source: %s', $this->accountValidator->sourceError));
|
||||||
}
|
}
|
||||||
Log::debug('Source seems valid.');
|
Log::debug('Source seems valid.');
|
||||||
|
|
||||||
// validate destination account
|
// validate destination account
|
||||||
$destinationId = $data['destination_id'] ? (int)$data['destination_id'] : null;
|
$array = [
|
||||||
$destinationName = $data['destination_name'] ? (string)$data['destination_name'] : null;
|
'id' => $data['destination_id'] ? (int)$data['destination_id'] : null,
|
||||||
$validDestination = $this->accountValidator->validateDestination($destinationId, $destinationName, null);
|
'name' => $data['destination_name'] ? (string)$data['destination_name'] : null,
|
||||||
|
'iban' => $data['destination_iban'] ? (string)$data['destination_iban'] : null,
|
||||||
|
'number' => $data['destination_number'] ? (string)$data['destination_number'] : null,
|
||||||
|
];
|
||||||
|
|
||||||
|
$validDestination = $this->accountValidator->validateDestination($array);
|
||||||
// do something with result:
|
// do something with result:
|
||||||
if (false === $validDestination) {
|
if (false === $validDestination) {
|
||||||
throw new FireflyException(sprintf('Destination: %s', $this->accountValidator->destError));
|
throw new FireflyException(sprintf('Destination: %s', $this->accountValidator->destError));
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
$reportType = 'account';
|
$reportType = 'account';
|
||||||
$preferredPeriod = $this->preferredPeriod();
|
$preferredPeriod = $this->preferredPeriod();
|
||||||
try {
|
try {
|
||||||
$result = prefixView('reports.double.report', compact('accountIds', 'reportType', 'doubleIds', 'preferredPeriod'))
|
$result = view('reports.double.report', compact('accountIds', 'reportType', 'doubleIds', 'preferredPeriod'))
|
||||||
->with('start', $this->start)->with('end', $this->end)
|
->with('start', $this->start)->with('end', $this->end)
|
||||||
->with('doubles', $this->expense)
|
->with('doubles', $this->expense)
|
||||||
->render();
|
->render();
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
'due_date', 'payment_date', 'invoice_date',
|
'due_date', 'payment_date', 'invoice_date',
|
||||||
];
|
];
|
||||||
try {
|
try {
|
||||||
$result = prefixView('reports.audit.report', compact('reportType', 'accountIds', 'auditData', 'hideable', 'defaultShow'))
|
$result = view('reports.audit.report', compact('reportType', 'accountIds', 'auditData', 'hideable', 'defaultShow'))
|
||||||
->with('start', $this->start)->with('end', $this->end)->with('accounts', $this->accounts)
|
->with('start', $this->start)->with('end', $this->end)->with('accounts', $this->accounts)
|
||||||
->render();
|
->render();
|
||||||
} catch (Throwable $e) { // @phpstan-ignore-line
|
} catch (Throwable $e) { // @phpstan-ignore-line
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
||||||
$budgetIds = implode(',', $this->budgets->pluck('id')->toArray());
|
$budgetIds = implode(',', $this->budgets->pluck('id')->toArray());
|
||||||
try {
|
try {
|
||||||
$result = prefixView(
|
$result = view(
|
||||||
'reports.budget.month',
|
'reports.budget.month',
|
||||||
compact('accountIds', 'budgetIds')
|
compact('accountIds', 'budgetIds')
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
|
|
||||||
// render!
|
// render!
|
||||||
try {
|
try {
|
||||||
return prefixView('reports.category.month', compact('accountIds', 'categoryIds', 'reportType'))
|
return view('reports.category.month', compact('accountIds', 'categoryIds', 'reportType'))
|
||||||
->with('start', $this->start)->with('end', $this->end)
|
->with('start', $this->start)->with('end', $this->end)
|
||||||
->with('categories', $this->categories)
|
->with('categories', $this->categories)
|
||||||
->with('accounts', $this->accounts)
|
->with('accounts', $this->accounts)
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
$reportType = 'default';
|
$reportType = 'default';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return prefixView('reports.default.month', compact('accountIds', 'reportType'))->with('start', $this->start)->with('end', $this->end)->render();
|
return view('reports.default.month', compact('accountIds', 'reportType'))->with('start', $this->start)->with('end', $this->end)->render();
|
||||||
} catch (Throwable $e) { // @phpstan-ignore-line
|
} catch (Throwable $e) { // @phpstan-ignore-line
|
||||||
Log::error(sprintf('Cannot render reports.default.month: %s', $e->getMessage()));
|
Log::error(sprintf('Cannot render reports.default.month: %s', $e->getMessage()));
|
||||||
$result = 'Could not render report view.';
|
$result = 'Could not render report view.';
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
|||||||
$reportType = 'default';
|
$reportType = 'default';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return prefixView(
|
return view(
|
||||||
'reports.default.multi-year',
|
'reports.default.multi-year',
|
||||||
compact('accountIds', 'reportType')
|
compact('accountIds', 'reportType')
|
||||||
)->with('start', $this->start)->with('end', $this->end)->render();
|
)->with('start', $this->start)->with('end', $this->end)->render();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class YearReportGenerator implements ReportGeneratorInterface
|
|||||||
$reportType = 'default';
|
$reportType = 'default';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$result = prefixView(
|
$result = view(
|
||||||
'reports.default.year',
|
'reports.default.year',
|
||||||
compact('accountIds', 'reportType')
|
compact('accountIds', 'reportType')
|
||||||
)->with('start', $this->start)->with('end', $this->end)->render();
|
)->with('start', $this->start)->with('end', $this->end)->render();
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
|||||||
|
|
||||||
// render!
|
// render!
|
||||||
try {
|
try {
|
||||||
$result = prefixView(
|
$result = view(
|
||||||
'reports.tag.month',
|
'reports.tag.month',
|
||||||
compact('accountIds', 'reportType', 'tagIds')
|
compact('accountIds', 'reportType', 'tagIds')
|
||||||
)->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render();
|
)->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render();
|
||||||
|
|||||||
@@ -123,7 +123,6 @@ class UpdatedGroupEventHandler
|
|||||||
if (1 === $group->transactionJournals->count()) {
|
if (1 === $group->transactionJournals->count()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Log::debug(sprintf('Correct inconsistent accounts in group #%d', $group->id));
|
|
||||||
// first journal:
|
// first journal:
|
||||||
/** @var TransactionJournal $first */
|
/** @var TransactionJournal $first */
|
||||||
$first = $group->transactionJournals()
|
$first = $group->transactionJournals()
|
||||||
@@ -132,6 +131,12 @@ class UpdatedGroupEventHandler
|
|||||||
->orderBy('transaction_journals.id', 'DESC')
|
->orderBy('transaction_journals.id', 'DESC')
|
||||||
->orderBy('transaction_journals.description', 'DESC')
|
->orderBy('transaction_journals.description', 'DESC')
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
|
if(null === $first) {
|
||||||
|
Log::warning(sprintf('Group #%d has no transaction journals.', $group->id));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$all = $group->transactionJournals()->get()->pluck('id')->toArray();
|
$all = $group->transactionJournals()->get()->pluck('id')->toArray();
|
||||||
/** @var Account $sourceAccount */
|
/** @var Account $sourceAccount */
|
||||||
$sourceAccount = $first->transactions()->where('amount', '<', '0')->first()->account;
|
$sourceAccount = $first->transactions()->where('amount', '<', '0')->first()->account;
|
||||||
|
|||||||
@@ -176,7 +176,9 @@ class AttachmentHelper implements AttachmentHelperInterface
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// is allowed? Save the file, without encryption.
|
// is allowed? Save the file, without encryption.
|
||||||
$this->uploadDisk->put($attachment->fileName(), $content);
|
$parts = explode('/', $attachment->fileName());
|
||||||
|
$file = $parts[count($parts) - 1];
|
||||||
|
$this->uploadDisk->put($file, $content);
|
||||||
|
|
||||||
// update attachment.
|
// update attachment.
|
||||||
$attachment->md5 = md5_file($path);
|
$attachment->md5 = md5_file($path);
|
||||||
|
|||||||
@@ -212,6 +212,40 @@ trait MetaCollection
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function withoutExternalUrl(): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
if (false === $this->hasJoinedMetaTables) {
|
||||||
|
$this->hasJoinedMetaTables = true;
|
||||||
|
$this->query->leftJoin('journal_meta', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id');
|
||||||
|
}
|
||||||
|
$this->query->where(function(Builder $q1) {
|
||||||
|
$q1->where(function(Builder $q2) {
|
||||||
|
$q2->where('journal_meta.name', '=', 'external_url');
|
||||||
|
$q2->whereNull('journal_meta.data');
|
||||||
|
})->orWhereNull('journal_meta.name');
|
||||||
|
});
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function withExternalUrl(): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
if (false === $this->hasJoinedMetaTables) {
|
||||||
|
$this->hasJoinedMetaTables = true;
|
||||||
|
$this->query->leftJoin('journal_meta', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id');
|
||||||
|
}
|
||||||
|
$this->query->where('journal_meta.name', '=', 'external_url');
|
||||||
|
$this->query->whereNotNull('journal_meta.data');
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -119,4 +119,61 @@ trait TimeCollection
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function yearIs(string $year): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
$this->query->whereYear('transaction_journals.date', '=', $year);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function monthIs(string $month): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
$this->query->whereMonth('transaction_journals.date', '=', $month);
|
||||||
|
return $this;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function dayIs(string $day): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
$this->query->whereDay('transaction_journals.date', '=', $day);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function yearBefore(string $year): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
$this->query->whereYear('transaction_journals.date', '<=', $year);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function monthBefore(string $month): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
$this->query->whereMonth('transaction_journals.date', '<=', $month);
|
||||||
|
return $this;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function dayBefore(string $day): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
$this->query->whereDay('transaction_journals.date', '<=', $day);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function yearAfter(string $year): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
$this->query->whereYear('transaction_journals.date', '>=', $year);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function monthAfter(string $month): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
$this->query->whereMonth('transaction_journals.date', '>=', $month);
|
||||||
|
return $this;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function dayAfter(string $day): GroupCollectorInterface
|
||||||
|
{
|
||||||
|
$this->query->whereDay('transaction_journals.date', '>=', $day);
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -559,6 +559,15 @@ class GroupCollector implements GroupCollectorInterface
|
|||||||
echo '</pre>';
|
echo '</pre>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function dumpQueryInLogs(): void
|
||||||
|
{
|
||||||
|
Log::debug($this->query->select($this->fields)->toSql()) ;
|
||||||
|
Log::debug('Bindings',$this->query->getBindings());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a selected set of fields to arrays.
|
* Convert a selected set of fields to arrays.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -305,6 +305,20 @@ interface GroupCollectorInterface
|
|||||||
*/
|
*/
|
||||||
public function setExternalId(string $externalId): GroupCollectorInterface;
|
public function setExternalId(string $externalId): GroupCollectorInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transactions without an external URL
|
||||||
|
*
|
||||||
|
* @return GroupCollectorInterface
|
||||||
|
*/
|
||||||
|
public function withoutExternalUrl(): GroupCollectorInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transactions with an external URL
|
||||||
|
*
|
||||||
|
* @return GroupCollectorInterface
|
||||||
|
*/
|
||||||
|
public function withExternalUrl(): GroupCollectorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Limit results to a specific foreign currency.
|
* Limit results to a specific foreign currency.
|
||||||
*
|
*
|
||||||
@@ -565,4 +579,15 @@ interface GroupCollectorInterface
|
|||||||
*/
|
*/
|
||||||
public function withoutTags(): GroupCollectorInterface;
|
public function withoutTags(): GroupCollectorInterface;
|
||||||
|
|
||||||
|
|
||||||
|
public function yearIs(string $year): GroupCollectorInterface;
|
||||||
|
public function monthIs(string $month): GroupCollectorInterface;
|
||||||
|
public function dayIs(string $day): GroupCollectorInterface;
|
||||||
|
public function yearBefore(string $year): GroupCollectorInterface;
|
||||||
|
public function monthBefore(string $month): GroupCollectorInterface;
|
||||||
|
public function dayBefore(string $day): GroupCollectorInterface;
|
||||||
|
public function yearAfter(string $year): GroupCollectorInterface;
|
||||||
|
public function monthAfter(string $month): GroupCollectorInterface;
|
||||||
|
public function dayAfter(string $day): GroupCollectorInterface;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,9 +38,16 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
public function generate(WebhookMessage $message): string
|
public function generate(WebhookMessage $message): string
|
||||||
{
|
{
|
||||||
|
// webhook is deleted
|
||||||
|
if (null === $message->webhook) {
|
||||||
|
throw new FireflyException('Part of a deleted webhook.');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$json = json_encode($message->message, JSON_THROW_ON_ERROR);
|
$json = json_encode($message->message, JSON_THROW_ON_ERROR);
|
||||||
} catch (JsonException $e) {
|
} catch (JsonException $e) {
|
||||||
@@ -48,7 +55,7 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
|
|||||||
Log::error(sprintf('JSON value: %s', $message->message));
|
Log::error(sprintf('JSON value: %s', $message->message));
|
||||||
Log::error($e->getMessage());
|
Log::error($e->getMessage());
|
||||||
Log::error($e->getTraceAsString());
|
Log::error($e->getTraceAsString());
|
||||||
throw new FireflyException('Could not generate JSON for SHA3 hash.', $e);
|
throw new FireflyException('Could not generate JSON for SHA3 hash.', 0, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// signature v1 is generated using the following structure:
|
// signature v1 is generated using the following structure:
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class CreateController extends Controller
|
|||||||
$request->session()->forget('accounts.create.fromStore');
|
$request->session()->forget('accounts.create.fromStore');
|
||||||
Log::channel('audit')->info('Creating new account.');
|
Log::channel('audit')->info('Creating new account.');
|
||||||
|
|
||||||
return prefixView(
|
return view(
|
||||||
'accounts.create',
|
'accounts.create',
|
||||||
compact('subTitleIcon', 'liabilityDirections', 'locations', 'objectType', 'interestPeriods', 'subTitle', 'roles', 'liabilityTypes')
|
compact('subTitleIcon', 'liabilityDirections', 'locations', 'objectType', 'interestPeriods', 'subTitle', 'roles', 'liabilityTypes')
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class DeleteController extends Controller
|
|||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('accounts.delete.uri');
|
$this->rememberPreviousUri('accounts.delete.uri');
|
||||||
|
|
||||||
return prefixView('accounts.delete', compact('account', 'subTitle', 'accountList', 'objectType'));
|
return view('accounts.delete', compact('account', 'subTitle', 'accountList', 'objectType'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ class EditController extends Controller
|
|||||||
}
|
}
|
||||||
$request->session()->forget('accounts.edit.fromUpdate');
|
$request->session()->forget('accounts.edit.fromUpdate');
|
||||||
|
|
||||||
$openingBalanceAmount = app('steam')->positive((string)$repository->getOpeningBalanceAmount($account));
|
$openingBalanceAmount = (string)$repository->getOpeningBalanceAmount($account);
|
||||||
if ('0' === $openingBalanceAmount) {
|
if ('0' === $openingBalanceAmount) {
|
||||||
$openingBalanceAmount = '';
|
$openingBalanceAmount = '';
|
||||||
}
|
}
|
||||||
@@ -143,9 +143,9 @@ class EditController extends Controller
|
|||||||
'BIC' => $repository->getMetaValue($account, 'BIC'),
|
'BIC' => $repository->getMetaValue($account, 'BIC'),
|
||||||
'opening_balance_date' => $openingBalanceDate,
|
'opening_balance_date' => $openingBalanceDate,
|
||||||
'liability_type_id' => $account->account_type_id,
|
'liability_type_id' => $account->account_type_id,
|
||||||
'opening_balance' => $openingBalanceAmount,
|
'opening_balance' => number_format((float)$openingBalanceAmount, $currency->decimal_places,'.',''),
|
||||||
'liability_direction' => $this->repository->getMetaValue($account, 'liability_direction'),
|
'liability_direction' => $this->repository->getMetaValue($account, 'liability_direction'),
|
||||||
'virtual_balance' => $account->virtual_balance,
|
'virtual_balance' => number_format((float)$account->virtual_balance, $currency->decimal_places,'.',''),
|
||||||
'currency_id' => $currency->id,
|
'currency_id' => $currency->id,
|
||||||
'include_net_worth' => $includeNetWorth,
|
'include_net_worth' => $includeNetWorth,
|
||||||
'interest' => $repository->getMetaValue($account, 'interest'),
|
'interest' => $repository->getMetaValue($account, 'interest'),
|
||||||
@@ -153,10 +153,13 @@ class EditController extends Controller
|
|||||||
'notes' => $this->repository->getNoteText($account),
|
'notes' => $this->repository->getNoteText($account),
|
||||||
'active' => $hasOldInput ? (bool)$request->old('active') : $account->active,
|
'active' => $hasOldInput ? (bool)$request->old('active') : $account->active,
|
||||||
];
|
];
|
||||||
|
if('' === $openingBalanceAmount) {
|
||||||
|
$preFilled['opening_balance'] = '';
|
||||||
|
}
|
||||||
|
|
||||||
$request->session()->flash('preFilled', $preFilled);
|
$request->session()->flash('preFilled', $preFilled);
|
||||||
|
|
||||||
return prefixView(
|
return view(
|
||||||
'accounts.edit',
|
'accounts.edit',
|
||||||
compact(
|
compact(
|
||||||
'account',
|
'account',
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ class IndexController extends Controller
|
|||||||
$account->interestPeriod = (string)trans(sprintf('firefly.interest_calc_%s', $this->repository->getMetaValue($account, 'interest_period')));
|
$account->interestPeriod = (string)trans(sprintf('firefly.interest_calc_%s', $this->repository->getMetaValue($account, 'interest_period')));
|
||||||
$account->accountTypeString = (string)trans(sprintf('firefly.account_type_%s', $account->accountType->type));
|
$account->accountTypeString = (string)trans(sprintf('firefly.account_type_%s', $account->accountType->type));
|
||||||
$account->current_debt = '0';
|
$account->current_debt = '0';
|
||||||
|
$account->iban = implode(' ', str_split((string)$account->iban, 4));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ class IndexController extends Controller
|
|||||||
$accounts = new LengthAwarePaginator($accounts, $total, $pageSize, $page);
|
$accounts = new LengthAwarePaginator($accounts, $total, $pageSize, $page);
|
||||||
$accounts->setPath(route('accounts.inactive.index', [$objectType]));
|
$accounts->setPath(route('accounts.inactive.index', [$objectType]));
|
||||||
|
|
||||||
return prefixView('accounts.index', compact('objectType', 'inactivePage', 'subTitleIcon', 'subTitle', 'page', 'accounts'));
|
return view('accounts.index', compact('objectType', 'inactivePage', 'subTitleIcon', 'subTitle', 'page', 'accounts'));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,6 +176,7 @@ class IndexController extends Controller
|
|||||||
$account->location = $this->repository->getLocation($account);
|
$account->location = $this->repository->getLocation($account);
|
||||||
$account->liability_direction = $this->repository->getMetaValue($account, 'liability_direction');
|
$account->liability_direction = $this->repository->getMetaValue($account, 'liability_direction');
|
||||||
$account->current_debt = $this->repository->getMetaValue($account, 'current_debt') ?? '-';
|
$account->current_debt = $this->repository->getMetaValue($account, 'current_debt') ?? '-';
|
||||||
|
$account->iban = implode(' ', str_split((string)$account->iban, 4));
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// make paginator:
|
// make paginator:
|
||||||
@@ -186,6 +188,6 @@ class IndexController extends Controller
|
|||||||
Log::debug(sprintf('Count of accounts after LAP (1): %d', $accounts->count()));
|
Log::debug(sprintf('Count of accounts after LAP (1): %d', $accounts->count()));
|
||||||
Log::debug(sprintf('Count of accounts after LAP (2): %d', $accounts->getCollection()->count()));
|
Log::debug(sprintf('Count of accounts after LAP (2): %d', $accounts->getCollection()->count()));
|
||||||
|
|
||||||
return prefixView('accounts.index', compact('objectType', 'inactiveCount', 'subTitleIcon', 'subTitle', 'page', 'accounts'));
|
return view('accounts.index', compact('objectType', 'inactiveCount', 'subTitleIcon', 'subTitle', 'page', 'accounts'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class ReconcileController extends Controller
|
|||||||
$indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']);
|
$indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']);
|
||||||
$objectType = 'asset';
|
$objectType = 'asset';
|
||||||
|
|
||||||
return prefixView(
|
return view(
|
||||||
'accounts.reconcile.index',
|
'accounts.reconcile.index',
|
||||||
compact(
|
compact(
|
||||||
'account',
|
'account',
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ class ShowController extends Controller
|
|||||||
$showAll = false;
|
$showAll = false;
|
||||||
$balance = app('steam')->balance($account, $end);
|
$balance = app('steam')->balance($account, $end);
|
||||||
|
|
||||||
return prefixView(
|
return view(
|
||||||
'accounts.show',
|
'accounts.show',
|
||||||
compact(
|
compact(
|
||||||
'account',
|
'account',
|
||||||
@@ -194,7 +194,7 @@ class ShowController extends Controller
|
|||||||
$showAll = true;
|
$showAll = true;
|
||||||
$balance = app('steam')->balance($account, $end);
|
$balance = app('steam')->balance($account, $end);
|
||||||
|
|
||||||
return prefixView(
|
return view(
|
||||||
'accounts.show',
|
'accounts.show',
|
||||||
compact(
|
compact(
|
||||||
'account',
|
'account',
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class ConfigurationController extends Controller
|
|||||||
$isDemoSite = app('fireflyconfig')->get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
$isDemoSite = app('fireflyconfig')->get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||||
$siteOwner = config('firefly.site_owner');
|
$siteOwner = config('firefly.site_owner');
|
||||||
|
|
||||||
return prefixView(
|
return view(
|
||||||
'admin.configuration.index',
|
'admin.configuration.index',
|
||||||
compact('subTitle', 'subTitleIcon', 'singleUserMode', 'isDemoSite', 'siteOwner')
|
compact('subTitle', 'subTitleIcon', 'singleUserMode', 'isDemoSite', 'siteOwner')
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class HomeController extends Controller
|
|||||||
}
|
}
|
||||||
Log::debug('Email is ', [$email]);
|
Log::debug('Email is ', [$email]);
|
||||||
|
|
||||||
return prefixView('admin.index', compact('title', 'mainTitleIcon', 'email'));
|
return view('admin.index', compact('title', 'mainTitleIcon', 'email'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class LinkController extends Controller
|
|||||||
$this->rememberPreviousUri('link-types.create.uri');
|
$this->rememberPreviousUri('link-types.create.uri');
|
||||||
}
|
}
|
||||||
|
|
||||||
return prefixView('admin.link.create', compact('subTitle', 'subTitleIcon'));
|
return view('admin.link.create', compact('subTitle', 'subTitleIcon'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,7 +115,7 @@ class LinkController extends Controller
|
|||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('link-types.delete.uri');
|
$this->rememberPreviousUri('link-types.delete.uri');
|
||||||
|
|
||||||
return prefixView('admin.link.delete', compact('linkType', 'subTitle', 'moveTo', 'count'));
|
return view('admin.link.delete', compact('linkType', 'subTitle', 'moveTo', 'count'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -165,7 +165,7 @@ class LinkController extends Controller
|
|||||||
}
|
}
|
||||||
$request->session()->forget('link-types.edit.fromUpdate');
|
$request->session()->forget('link-types.edit.fromUpdate');
|
||||||
|
|
||||||
return prefixView('admin.link.edit', compact('subTitle', 'subTitleIcon', 'linkType'));
|
return view('admin.link.edit', compact('subTitle', 'subTitleIcon', 'linkType'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -186,7 +186,7 @@ class LinkController extends Controller
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return prefixView('admin.link.index', compact('subTitle', 'subTitleIcon', 'linkTypes'));
|
return view('admin.link.index', compact('subTitle', 'subTitleIcon', 'linkTypes'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -204,7 +204,7 @@ class LinkController extends Controller
|
|||||||
|
|
||||||
Log::channel('audit')->info(sprintf('User viewing link type #%d', $linkType->id));
|
Log::channel('audit')->info(sprintf('User viewing link type #%d', $linkType->id));
|
||||||
|
|
||||||
return prefixView('admin.link.show', compact('subTitle', 'subTitleIcon', 'linkType', 'links'));
|
return view('admin.link.show', compact('subTitle', 'subTitleIcon', 'linkType', 'links'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class UpdateController extends Controller
|
|||||||
'alpha' => (string)trans('firefly.update_channel_alpha'),
|
'alpha' => (string)trans('firefly.update_channel_alpha'),
|
||||||
];
|
];
|
||||||
|
|
||||||
return prefixView('admin.update.index', compact('subTitle', 'subTitleIcon', 'selected', 'options', 'channelSelected', 'channelOptions'));
|
return view('admin.update.index', compact('subTitle', 'subTitleIcon', 'selected', 'options', 'channelSelected', 'channelOptions'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class UserController extends Controller
|
|||||||
|
|
||||||
$subTitle = (string)trans('firefly.delete_user', ['email' => $user->email]);
|
$subTitle = (string)trans('firefly.delete_user', ['email' => $user->email]);
|
||||||
|
|
||||||
return prefixView('admin.users.delete', compact('user', 'subTitle'));
|
return view('admin.users.delete', compact('user', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -132,7 +132,7 @@ class UserController extends Controller
|
|||||||
'email_changed' => (string)trans('firefly.block_code_email_changed'),
|
'email_changed' => (string)trans('firefly.block_code_email_changed'),
|
||||||
];
|
];
|
||||||
|
|
||||||
return prefixView('admin.users.edit', compact('user', 'canEditDetails', 'subTitle', 'subTitleIcon', 'codes', 'currentUser', 'isAdmin'));
|
return view('admin.users.edit', compact('user', 'canEditDetails', 'subTitle', 'subTitleIcon', 'codes', 'currentUser', 'isAdmin'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -154,7 +154,7 @@ class UserController extends Controller
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return prefixView('admin.users.index', compact('subTitle', 'subTitleIcon', 'users'));
|
return view('admin.users.index', compact('subTitle', 'subTitleIcon', 'users'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,7 +172,7 @@ class UserController extends Controller
|
|||||||
$subTitleIcon = 'fa-user';
|
$subTitleIcon = 'fa-user';
|
||||||
$information = $this->repository->getUserData($user);
|
$information = $this->repository->getUserData($user);
|
||||||
|
|
||||||
return prefixView(
|
return view(
|
||||||
'admin.users.show',
|
'admin.users.show',
|
||||||
compact(
|
compact(
|
||||||
'title',
|
'title',
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class AttachmentController extends Controller
|
|||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('attachments.delete.uri');
|
$this->rememberPreviousUri('attachments.delete.uri');
|
||||||
|
|
||||||
return prefixView('attachments.delete', compact('attachment', 'subTitle'));
|
return view('attachments.delete', compact('attachment', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -158,7 +158,7 @@ class AttachmentController extends Controller
|
|||||||
];
|
];
|
||||||
$request->session()->flash('preFilled', $preFilled);
|
$request->session()->flash('preFilled', $preFilled);
|
||||||
|
|
||||||
return prefixView('attachments.edit', compact('attachment', 'subTitleIcon', 'subTitle'));
|
return view('attachments.edit', compact('attachment', 'subTitleIcon', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -177,7 +177,7 @@ class AttachmentController extends Controller
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return prefixView('attachments.index', compact('set'));
|
return view('attachments.index', compact('set'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class ForgotPasswordController extends Controller
|
|||||||
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
|
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
|
||||||
Log::error($message);
|
Log::error($message);
|
||||||
|
|
||||||
return prefixView('error', compact('message'));
|
return view('error', compact('message'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ class ForgotPasswordController extends Controller
|
|||||||
if ('eloquent' !== $loginProvider) {
|
if ('eloquent' !== $loginProvider) {
|
||||||
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
|
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
|
||||||
|
|
||||||
return prefixView('error', compact('message'));
|
return view('error', compact('message'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// is allowed to?
|
// is allowed to?
|
||||||
@@ -129,6 +129,6 @@ class ForgotPasswordController extends Controller
|
|||||||
$allowRegistration = false;
|
$allowRegistration = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return prefixView('auth.passwords.email')->with(compact('allowRegistration', 'pageTitle'));
|
return view('auth.passwords.email')->with(compact('allowRegistration', 'pageTitle'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ class LoginController extends Controller
|
|||||||
}
|
}
|
||||||
$usernameField = $this->username();
|
$usernameField = $this->username();
|
||||||
|
|
||||||
return prefixView('auth.login', compact('allowRegistration', 'email', 'remember', 'ldapWarning', 'allowReset', 'title', 'usernameField'));
|
return view('auth.login', compact('allowRegistration', 'email', 'remember', 'ldapWarning', 'allowReset', 'title', 'usernameField'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -148,12 +148,12 @@ class RegisterController extends Controller
|
|||||||
if (false === $allowRegistration) {
|
if (false === $allowRegistration) {
|
||||||
$message = 'Registration is currently not available.';
|
$message = 'Registration is currently not available.';
|
||||||
|
|
||||||
return prefixView('error', compact('message'));
|
return view('error', compact('message'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$email = $request->old('email');
|
$email = $request->old('email');
|
||||||
|
|
||||||
return prefixView('auth.register', compact('isDemoSite', 'email', 'pageTitle'));
|
return view('auth.register', compact('isDemoSite', 'email', 'pageTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ class ResetPasswordController extends Controller
|
|||||||
if ('eloquent' !== $loginProvider) {
|
if ('eloquent' !== $loginProvider) {
|
||||||
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
|
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
|
||||||
|
|
||||||
return prefixView('error', compact('message'));
|
return view('error', compact('message'));
|
||||||
}
|
}
|
||||||
$rules = [
|
$rules = [
|
||||||
'token' => 'required',
|
'token' => 'required',
|
||||||
@@ -130,7 +130,7 @@ class ResetPasswordController extends Controller
|
|||||||
if ('eloquent' !== $loginProvider) {
|
if ('eloquent' !== $loginProvider) {
|
||||||
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
|
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
|
||||||
|
|
||||||
return prefixView('error', compact('message'));
|
return view('error', compact('message'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// is allowed to register?
|
// is allowed to register?
|
||||||
@@ -143,7 +143,7 @@ class ResetPasswordController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @noinspection PhpUndefinedFieldInspection */
|
/** @noinspection PhpUndefinedFieldInspection */
|
||||||
return prefixView('auth.passwords.reset')->with(
|
return view('auth.passwords.reset')->with(
|
||||||
['token' => $token, 'email' => $request->email, 'allowRegistration' => $allowRegistration, 'pageTitle' => $pageTitle]
|
['token' => $token, 'email' => $request->email, 'allowRegistration' => $allowRegistration, 'pageTitle' => $pageTitle]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class TwoFactorController extends Controller
|
|||||||
$siteOwner = config('firefly.site_owner');
|
$siteOwner = config('firefly.site_owner');
|
||||||
$title = (string)trans('firefly.two_factor_forgot_title');
|
$title = (string)trans('firefly.two_factor_forgot_title');
|
||||||
|
|
||||||
return prefixView('auth.lost-two-factor', compact('user', 'siteOwner', 'title'));
|
return view('auth.lost-two-factor', compact('user', 'siteOwner', 'title'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class CreateController extends Controller
|
|||||||
}
|
}
|
||||||
$request->session()->forget('bills.create.fromStore');
|
$request->session()->forget('bills.create.fromStore');
|
||||||
|
|
||||||
return prefixView('bills.create', compact('periods', 'subTitle', 'defaultCurrency'));
|
return view('bills.create', compact('periods', 'subTitle', 'defaultCurrency'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class DeleteController extends Controller
|
|||||||
$this->rememberPreviousUri('bills.delete.uri');
|
$this->rememberPreviousUri('bills.delete.uri');
|
||||||
$subTitle = (string)trans('firefly.delete_bill', ['name' => $bill->name]);
|
$subTitle = (string)trans('firefly.delete_bill', ['name' => $bill->name]);
|
||||||
|
|
||||||
return prefixView('bills.delete', compact('bill', 'subTitle'));
|
return view('bills.delete', compact('bill', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class EditController extends Controller
|
|||||||
$request->session()->flash('preFilled', $preFilled);
|
$request->session()->flash('preFilled', $preFilled);
|
||||||
$request->session()->forget('bills.edit.fromUpdate');
|
$request->session()->forget('bills.edit.fromUpdate');
|
||||||
|
|
||||||
return prefixView('bills.edit', compact('subTitle', 'periods', 'rules', 'bill', 'defaultCurrency', 'preFilled'));
|
return view('bills.edit', compact('subTitle', 'periods', 'rules', 'bill', 'defaultCurrency', 'preFilled'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ class IndexController extends Controller
|
|||||||
$sums = $this->getSums($bills);
|
$sums = $this->getSums($bills);
|
||||||
$totals = $this->getTotals($sums);
|
$totals = $this->getTotals($sums);
|
||||||
|
|
||||||
return prefixView('bills.index', compact('bills', 'sums', 'total', 'totals'));
|
return view('bills.index', compact('bills', 'sums', 'total', 'totals'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ class ShowController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return prefixView('bills.show', compact('attachments', 'groups', 'rules', 'yearAverage', 'overallAverage', 'year', 'object', 'bill', 'subTitle'));
|
return view('bills.show', compact('attachments', 'groups', 'rules', 'yearAverage', 'overallAverage', 'year', 'object', 'bill', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class AvailableBudgetController extends Controller
|
|||||||
}
|
}
|
||||||
$page = (int)($request->get('page') ?? 1);
|
$page = (int)($request->get('page') ?? 1);
|
||||||
|
|
||||||
return prefixView('budgets.available-budgets.create', compact('start', 'end', 'page', 'currency'));
|
return view('budgets.available-budgets.create', compact('start', 'end', 'page', 'currency'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -130,7 +130,7 @@ class AvailableBudgetController extends Controller
|
|||||||
);
|
);
|
||||||
$page = (int)($request->get('page') ?? 1);
|
$page = (int)($request->get('page') ?? 1);
|
||||||
|
|
||||||
return prefixView('budgets.available-budgets.create-alternative', compact('start', 'end', 'page', 'currencies'));
|
return view('budgets.available-budgets.create-alternative', compact('start', 'end', 'page', 'currencies'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -164,7 +164,7 @@ class AvailableBudgetController extends Controller
|
|||||||
{
|
{
|
||||||
$availableBudget->amount = number_format((float)$availableBudget->amount, $availableBudget->transactionCurrency->decimal_places, '.', '');
|
$availableBudget->amount = number_format((float)$availableBudget->amount, $availableBudget->transactionCurrency->decimal_places, '.', '');
|
||||||
|
|
||||||
return prefixView('budgets.available-budgets.edit', compact('availableBudget', 'start', 'end'));
|
return view('budgets.available-budgets.edit', compact('availableBudget', 'start', 'end'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class BudgetLimitController extends Controller
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return prefixView('budgets.budget-limits.create', compact('start', 'end', 'currencies', 'budget'));
|
return view('budgets.budget-limits.create', compact('start', 'end', 'currencies', 'budget'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -181,7 +181,7 @@ class BudgetLimitController extends Controller
|
|||||||
return response()->json($array);
|
return response()->json($array);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json([]);
|
return redirect(route('budgets.index'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class CreateController extends Controller
|
|||||||
$request->session()->forget('budgets.create.fromStore');
|
$request->session()->forget('budgets.create.fromStore');
|
||||||
$subTitle = (string)trans('firefly.create_new_budget');
|
$subTitle = (string)trans('firefly.create_new_budget');
|
||||||
|
|
||||||
return prefixView('budgets.create', compact('subTitle', 'autoBudgetTypes', 'autoBudgetPeriods'));
|
return view('budgets.create', compact('subTitle', 'autoBudgetTypes', 'autoBudgetPeriods'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class DeleteController extends Controller
|
|||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('budgets.delete.uri');
|
$this->rememberPreviousUri('budgets.delete.uri');
|
||||||
|
|
||||||
return prefixView('budgets.delete', compact('budget', 'subTitle'));
|
return view('budgets.delete', compact('budget', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -102,7 +102,8 @@ class EditController extends Controller
|
|||||||
'auto_budget_currency_id' => $hasOldInput ? (int)$request->old('auto_budget_currency_id') : $currency->id,
|
'auto_budget_currency_id' => $hasOldInput ? (int)$request->old('auto_budget_currency_id') : $currency->id,
|
||||||
];
|
];
|
||||||
if ($autoBudget) {
|
if ($autoBudget) {
|
||||||
$preFilled['auto_budget_amount'] = $hasOldInput ? $request->old('auto_budget_amount') : $autoBudget->amount;
|
$amount = $hasOldInput ? $request->old('auto_budget_amount') : $autoBudget->amount;
|
||||||
|
$preFilled['auto_budget_amount'] = number_format((float)$amount, $autoBudget->transactionCurrency->decimal_places, '.', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||||
@@ -112,7 +113,7 @@ class EditController extends Controller
|
|||||||
$request->session()->forget('budgets.edit.fromUpdate');
|
$request->session()->forget('budgets.edit.fromUpdate');
|
||||||
$request->session()->flash('preFilled', $preFilled);
|
$request->session()->flash('preFilled', $preFilled);
|
||||||
|
|
||||||
return prefixView('budgets.edit', compact('budget', 'subTitle', 'autoBudgetTypes', 'autoBudgetPeriods', 'autoBudget'));
|
return view('budgets.edit', compact('budget', 'subTitle', 'autoBudgetTypes', 'autoBudgetPeriods', 'autoBudget'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ class IndexController extends Controller
|
|||||||
// get all inactive budgets, and simply list them:
|
// get all inactive budgets, and simply list them:
|
||||||
$inactive = $this->repository->getInactiveBudgets();
|
$inactive = $this->repository->getInactiveBudgets();
|
||||||
|
|
||||||
return prefixView(
|
return view(
|
||||||
'budgets.index', compact(
|
'budgets.index', compact(
|
||||||
'availableBudgets', 'budgeted', 'spent', 'prevLoop', 'nextLoop', 'budgets', 'currencies', 'enableAddButton', 'periodTitle',
|
'availableBudgets', 'budgeted', 'spent', 'prevLoop', 'nextLoop', 'budgets', 'currencies', 'enableAddButton', 'periodTitle',
|
||||||
'defaultCurrency', 'activeDaysPassed', 'activeDaysLeft', 'inactive', 'budgets', 'start', 'end', 'sums'
|
'defaultCurrency', 'activeDaysPassed', 'activeDaysLeft', 'inactive', 'budgets', 'start', 'end', 'sums'
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class ShowController extends Controller
|
|||||||
$groups = $collector->getPaginatedGroups();
|
$groups = $collector->getPaginatedGroups();
|
||||||
$groups->setPath(route('budgets.no-budget'));
|
$groups->setPath(route('budgets.no-budget'));
|
||||||
|
|
||||||
return prefixView('budgets.no-budget', compact('groups', 'subTitle', 'periods', 'start', 'end'));
|
return view('budgets.no-budget', compact('groups', 'subTitle', 'periods', 'start', 'end'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -133,7 +133,7 @@ class ShowController extends Controller
|
|||||||
$groups = $collector->getPaginatedGroups();
|
$groups = $collector->getPaginatedGroups();
|
||||||
$groups->setPath(route('budgets.no-budget'));
|
$groups->setPath(route('budgets.no-budget'));
|
||||||
|
|
||||||
return prefixView('budgets.no-budget', compact('groups', 'subTitle', 'start', 'end'));
|
return view('budgets.no-budget', compact('groups', 'subTitle', 'start', 'end'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -167,7 +167,7 @@ class ShowController extends Controller
|
|||||||
|
|
||||||
$subTitle = (string)trans('firefly.all_journals_for_budget', ['name' => $budget->name]);
|
$subTitle = (string)trans('firefly.all_journals_for_budget', ['name' => $budget->name]);
|
||||||
|
|
||||||
return prefixView('budgets.show', compact('limits', 'attachments', 'budget', 'repetition', 'groups', 'subTitle'));
|
return view('budgets.show', compact('limits', 'attachments', 'budget', 'repetition', 'groups', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -212,6 +212,6 @@ class ShowController extends Controller
|
|||||||
$attachments = $this->repository->getAttachments($budget);
|
$attachments = $this->repository->getAttachments($budget);
|
||||||
$limits = $this->getLimits($budget, $start, $end);
|
$limits = $this->getLimits($budget, $start, $end);
|
||||||
|
|
||||||
return prefixView('budgets.show', compact('limits', 'attachments', 'budget', 'budgetLimit', 'groups', 'subTitle'));
|
return view('budgets.show', compact('limits', 'attachments', 'budget', 'budgetLimit', 'groups', 'subTitle'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class CreateController extends Controller
|
|||||||
$request->session()->forget('categories.create.fromStore');
|
$request->session()->forget('categories.create.fromStore');
|
||||||
$subTitle = (string)trans('firefly.create_new_category');
|
$subTitle = (string)trans('firefly.create_new_category');
|
||||||
|
|
||||||
return prefixView('categories.create', compact('subTitle'));
|
return view('categories.create', compact('subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class DeleteController extends Controller
|
|||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('categories.delete.uri');
|
$this->rememberPreviousUri('categories.delete.uri');
|
||||||
|
|
||||||
return prefixView('categories.delete', compact('category', 'subTitle'));
|
return view('categories.delete', compact('category', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class EditController extends Controller
|
|||||||
'notes' => $request->old('notes') ?? $this->repository->getNoteText($category),
|
'notes' => $request->old('notes') ?? $this->repository->getNoteText($category),
|
||||||
];
|
];
|
||||||
|
|
||||||
return prefixView('categories.edit', compact('category', 'subTitle', 'preFilled'));
|
return view('categories.edit', compact('category', 'subTitle', 'preFilled'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class IndexController extends Controller
|
|||||||
$categories = new LengthAwarePaginator($collection, $total, $pageSize, $page);
|
$categories = new LengthAwarePaginator($collection, $total, $pageSize, $page);
|
||||||
$categories->setPath(route('categories.index'));
|
$categories->setPath(route('categories.index'));
|
||||||
|
|
||||||
return prefixView('categories.index', compact('categories'));
|
return view('categories.index', compact('categories'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class NoCategoryController extends Controller
|
|||||||
$groups = $collector->getPaginatedGroups();
|
$groups = $collector->getPaginatedGroups();
|
||||||
$groups->setPath(route('categories.no-category'));
|
$groups->setPath(route('categories.no-category'));
|
||||||
|
|
||||||
return prefixView('categories.no-category', compact('groups', 'subTitle', 'periods', 'start', 'end'));
|
return view('categories.no-category', compact('groups', 'subTitle', 'periods', 'start', 'end'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -139,6 +139,6 @@ class NoCategoryController extends Controller
|
|||||||
$groups = $collector->getPaginatedGroups();
|
$groups = $collector->getPaginatedGroups();
|
||||||
$groups->setPath(route('categories.no-category.all'));
|
$groups->setPath(route('categories.no-category.all'));
|
||||||
|
|
||||||
return prefixView('categories.no-category', compact('groups', 'subTitle', 'periods', 'start', 'end'));
|
return view('categories.no-category', compact('groups', 'subTitle', 'periods', 'start', 'end'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class ShowController extends Controller
|
|||||||
$groups = $collector->getPaginatedGroups();
|
$groups = $collector->getPaginatedGroups();
|
||||||
$groups->setPath($path);
|
$groups->setPath($path);
|
||||||
|
|
||||||
return prefixView('categories.show', compact('category', 'attachments', 'groups', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end'));
|
return view('categories.show', compact('category', 'attachments', 'groups', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -146,6 +146,6 @@ class ShowController extends Controller
|
|||||||
$groups = $collector->getPaginatedGroups();
|
$groups = $collector->getPaginatedGroups();
|
||||||
$groups->setPath($path);
|
$groups->setPath($path);
|
||||||
|
|
||||||
return prefixView('categories.show', compact('category', 'attachments', 'groups', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end'));
|
return view('categories.show', compact('category', 'attachments', 'groups', 'periods', 'subTitle', 'subTitleIcon', 'start', 'end'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
|||||||
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Pagination\LengthAwarePaginator;
|
use Illuminate\Pagination\LengthAwarePaginator;
|
||||||
@@ -93,7 +94,7 @@ class CurrencyController extends Controller
|
|||||||
|
|
||||||
Log::channel('audit')->info('Create new currency.');
|
Log::channel('audit')->info('Create new currency.');
|
||||||
|
|
||||||
return prefixView('currencies.create', compact('subTitleIcon', 'subTitle'));
|
return view('currencies.create', compact('subTitleIcon', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -160,7 +161,7 @@ class CurrencyController extends Controller
|
|||||||
$subTitle = (string)trans('form.delete_currency', ['name' => $currency->name]);
|
$subTitle = (string)trans('form.delete_currency', ['name' => $currency->name]);
|
||||||
Log::channel('audit')->info(sprintf('Visit page to delete currency %s.', $currency->code));
|
Log::channel('audit')->info(sprintf('Visit page to delete currency %s.', $currency->code));
|
||||||
|
|
||||||
return prefixView('currencies.delete', compact('currency', 'subTitle'));
|
return view('currencies.delete', compact('currency', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -210,10 +211,9 @@ class CurrencyController extends Controller
|
|||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param TransactionCurrency $currency
|
* @param TransactionCurrency $currency
|
||||||
*
|
*
|
||||||
* @return RedirectResponse|Redirector
|
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
public function disableCurrency(Request $request)
|
public function disableCurrency(Request $request): JsonResponse
|
||||||
{
|
{
|
||||||
$currencyId = (int)$request->get('id');
|
$currencyId = (int)$request->get('id');
|
||||||
if ($currencyId > 0) {
|
if ($currencyId > 0) {
|
||||||
@@ -228,8 +228,7 @@ class CurrencyController extends Controller
|
|||||||
|
|
||||||
$request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => e(config('firefly.site_owner'))]));
|
$request->session()->flash('error', (string)trans('firefly.ask_site_owner', ['owner' => e(config('firefly.site_owner'))]));
|
||||||
Log::channel('audit')->info(sprintf('Tried to disable currency %s but is not site owner.', $currency->code));
|
Log::channel('audit')->info(sprintf('Tried to disable currency %s but is not site owner.', $currency->code));
|
||||||
|
return response()->json([]);
|
||||||
return redirect(route('currencies.index'));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,8 +239,7 @@ class CurrencyController extends Controller
|
|||||||
|
|
||||||
$request->session()->flash('error', $message);
|
$request->session()->flash('error', $message);
|
||||||
Log::channel('audit')->info(sprintf('Tried to disable currency %s but is in use.', $currency->code));
|
Log::channel('audit')->info(sprintf('Tried to disable currency %s but is in use.', $currency->code));
|
||||||
|
return response()->json([]);
|
||||||
return redirect(route('currencies.index'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->repository->disable($currency);
|
$this->repository->disable($currency);
|
||||||
@@ -267,7 +265,7 @@ class CurrencyController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect(route('currencies.index'));
|
return response()->json([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -310,7 +308,7 @@ class CurrencyController extends Controller
|
|||||||
}
|
}
|
||||||
$request->session()->forget('currencies.edit.fromUpdate');
|
$request->session()->forget('currencies.edit.fromUpdate');
|
||||||
|
|
||||||
return prefixView('currencies.edit', compact('currency', 'subTitle', 'subTitleIcon'));
|
return view('currencies.edit', compact('currency', 'subTitle', 'subTitleIcon'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -363,7 +361,7 @@ class CurrencyController extends Controller
|
|||||||
$isOwner = false;
|
$isOwner = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return prefixView('currencies.index', compact('currencies', 'defaultCurrency', 'isOwner'));
|
return view('currencies.index', compact('currencies', 'defaultCurrency', 'isOwner'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -144,6 +144,15 @@ class DebugController extends Controller
|
|||||||
$bcscale = bcscale();
|
$bcscale = bcscale();
|
||||||
$layout = env('FIREFLY_III_LAYOUT');
|
$layout = env('FIREFLY_III_LAYOUT');
|
||||||
$tz = env('TZ');
|
$tz = env('TZ');
|
||||||
|
$buildNr = '(unknown)';
|
||||||
|
$buildDate = '(unknown)';
|
||||||
|
|
||||||
|
if (file_exists('/var/www/counter-main.txt')) {
|
||||||
|
$buildNr = trim(file_get_contents('/var/www/counter-main.txt'));
|
||||||
|
}
|
||||||
|
if (file_exists('/var/www/build-date-main.txt')) {
|
||||||
|
$buildDate = trim(file_get_contents('/var/www/build-date-main.txt'));
|
||||||
|
}
|
||||||
|
|
||||||
// expected + found DB version:
|
// expected + found DB version:
|
||||||
$expectedDBversion = config('firefly.db_version');
|
$expectedDBversion = config('firefly.db_version');
|
||||||
@@ -206,6 +215,8 @@ class DebugController extends Controller
|
|||||||
'drivers',
|
'drivers',
|
||||||
'currentDriver',
|
'currentDriver',
|
||||||
'loginProvider',
|
'loginProvider',
|
||||||
|
'buildNr',
|
||||||
|
'buildDate',
|
||||||
'bcscale',
|
'bcscale',
|
||||||
'layout',
|
'layout',
|
||||||
'userAgent',
|
'userAgent',
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ class IndexController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return prefixView('export.index');
|
return view('export.index');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +102,9 @@ class HomeController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index(AccountRepositoryInterface $repository): mixed
|
public function index(AccountRepositoryInterface $repository): mixed
|
||||||
{
|
{
|
||||||
|
if ('v3' === config('firefly.layout')) {
|
||||||
|
die('Please set your layout to "v1".');
|
||||||
|
}
|
||||||
$types = config('firefly.accountTypesByIdentifier.asset');
|
$types = config('firefly.accountTypesByIdentifier.asset');
|
||||||
$count = $repository->count($types);
|
$count = $repository->count($types);
|
||||||
Log::channel('audit')->info('User visits homepage.');
|
Log::channel('audit')->info('User visits homepage.');
|
||||||
@@ -138,6 +141,6 @@ class HomeController extends Controller
|
|||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
event(new RequestedVersionCheckStatus($user));
|
event(new RequestedVersionCheckStatus($user));
|
||||||
|
|
||||||
return prefixView('index', compact('count', 'subTitle', 'transactions', 'billCount', 'start', 'end', 'today'));
|
return view('index', compact('count', 'subTitle', 'transactions', 'billCount', 'start', 'end', 'today'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class JavascriptController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
return response()
|
return response()
|
||||||
->view('v1.javascript.accounts', $data)
|
->view('javascript.accounts', $data)
|
||||||
->header('Content-Type', 'text/javascript');
|
->header('Content-Type', 'text/javascript');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ class JavascriptController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
return response()
|
return response()
|
||||||
->view('v1.javascript.currencies', $data)
|
->view('javascript.currencies', $data)
|
||||||
->header('Content-Type', 'text/javascript');
|
->header('Content-Type', 'text/javascript');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ class JavascriptController extends Controller
|
|||||||
$request->session()->keep(['two-factor-secret']);
|
$request->session()->keep(['two-factor-secret']);
|
||||||
|
|
||||||
return response()
|
return response()
|
||||||
->view('v1.javascript.variables', $data)
|
->view('javascript.variables', $data)
|
||||||
->header('Content-Type', 'text/javascript');
|
->header('Content-Type', 'text/javascript');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ class FrontpageController extends Controller
|
|||||||
$html = '';
|
$html = '';
|
||||||
if (!empty($info)) {
|
if (!empty($info)) {
|
||||||
try {
|
try {
|
||||||
$html = prefixView('json.piggy-banks', compact('info'))->render();
|
$html = view('json.piggy-banks', compact('info'))->render();
|
||||||
|
|
||||||
} catch (Throwable $e) { // @phpstan-ignore-line
|
} catch (Throwable $e) { // @phpstan-ignore-line
|
||||||
Log::error(sprintf('Cannot render json.piggy-banks: %s', $e->getMessage()));
|
Log::error(sprintf('Cannot render json.piggy-banks: %s', $e->getMessage()));
|
||||||
|
|||||||
@@ -83,14 +83,18 @@ class ReconcileController extends Controller
|
|||||||
*
|
*
|
||||||
* @return JsonResponse
|
* @return JsonResponse
|
||||||
*/
|
*/
|
||||||
public function overview(Request $request, Account $account, Carbon $start, Carbon $end): JsonResponse
|
public function overview(Request $request, Account $account = null, Carbon $start = null, Carbon $end = null): JsonResponse
|
||||||
{
|
{
|
||||||
$startBalance = $request->get('startBalance');
|
$startBalance = $request->get('startBalance');
|
||||||
$endBalance = $request->get('endBalance');
|
$endBalance = $request->get('endBalance');
|
||||||
$accountCurrency = $this->accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency();
|
$accountCurrency = $this->accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency();
|
||||||
$amount = '0';
|
$amount = '0';
|
||||||
$clearedAmount = '0';
|
$clearedAmount = '0';
|
||||||
|
$route = '';
|
||||||
|
|
||||||
|
if (null === $start && null === $end) {
|
||||||
|
throw new FireflyException('Invalid dates submitted.');
|
||||||
|
}
|
||||||
if ($end->lt($start)) {
|
if ($end->lt($start)) {
|
||||||
[$start, $end] = [$end, $start];
|
[$start, $end] = [$end, $start];
|
||||||
}
|
}
|
||||||
@@ -137,7 +141,7 @@ class ReconcileController extends Controller
|
|||||||
$reconSum = bcadd(bcadd($startBalance, $amount), $clearedAmount);
|
$reconSum = bcadd(bcadd($startBalance, $amount), $clearedAmount);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$view = prefixView(
|
$view = view(
|
||||||
'accounts.reconcile.overview',
|
'accounts.reconcile.overview',
|
||||||
compact(
|
compact(
|
||||||
'account',
|
'account',
|
||||||
@@ -220,8 +224,11 @@ class ReconcileController extends Controller
|
|||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
* @throws JsonException
|
* @throws JsonException
|
||||||
*/
|
*/
|
||||||
public function transactions(Account $account, Carbon $start, Carbon $end)
|
public function transactions(Account $account, Carbon $start = null, Carbon $end = null)
|
||||||
{
|
{
|
||||||
|
if (null === $start || null === $end) {
|
||||||
|
throw new FireflyException('Invalid dates submitted.');
|
||||||
|
}
|
||||||
if ($end->lt($start)) {
|
if ($end->lt($start)) {
|
||||||
[$end, $start] = [$start, $end];
|
[$end, $start] = [$start, $end];
|
||||||
}
|
}
|
||||||
@@ -249,7 +256,7 @@ class ReconcileController extends Controller
|
|||||||
$journals = $this->processTransactions($account, $array);
|
$journals = $this->processTransactions($account, $array);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$html = prefixView(
|
$html = view(
|
||||||
'accounts.reconcile.transactions',
|
'accounts.reconcile.transactions',
|
||||||
compact('account', 'journals', 'currency', 'start', 'end', 'selectionStart', 'selectionEnd')
|
compact('account', 'journals', 'currency', 'start', 'end', 'selectionStart', 'selectionEnd')
|
||||||
)->render();
|
)->render();
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class RuleController extends Controller
|
|||||||
$actions[$key] = (string)trans('firefly.rule_action_' . $key . '_choice');
|
$actions[$key] = (string)trans('firefly.rule_action_' . $key . '_choice');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
$view = prefixView('rules.partials.action', compact('actions', 'count'))->render();
|
$view = view('rules.partials.action', compact('actions', 'count'))->render();
|
||||||
|
|
||||||
} catch (Throwable $e) { // @phpstan-ignore-line
|
} catch (Throwable $e) { // @phpstan-ignore-line
|
||||||
Log::error(sprintf('Cannot render rules.partials.action: %s', $e->getMessage()));
|
Log::error(sprintf('Cannot render rules.partials.action: %s', $e->getMessage()));
|
||||||
@@ -81,7 +81,7 @@ class RuleController extends Controller
|
|||||||
asort($triggers);
|
asort($triggers);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$view = prefixView('rules.partials.trigger', compact('triggers', 'count'))->render();
|
$view = view('rules.partials.trigger', compact('triggers', 'count'))->render();
|
||||||
} catch (Throwable $e) { // @phpstan-ignore-line
|
} catch (Throwable $e) { // @phpstan-ignore-line
|
||||||
Log::error(sprintf('Cannot render rules.partials.trigger: %s', $e->getMessage()));
|
Log::error(sprintf('Cannot render rules.partials.trigger: %s', $e->getMessage()));
|
||||||
$view = 'Could not render view.';
|
$view = 'Could not render view.';
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ class NewUserController extends Controller
|
|||||||
return redirect(route('index'));
|
return redirect(route('index'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return prefixView('new-user.index', compact('languages'));
|
return view('new-user.index', compact('languages'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class DeleteController extends Controller
|
|||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('object-groups.delete.uri');
|
$this->rememberPreviousUri('object-groups.delete.uri');
|
||||||
|
|
||||||
return prefixView('object-groups.delete', compact('objectGroup', 'subTitle', 'piggyBanks'));
|
return view('object-groups.delete', compact('objectGroup', 'subTitle', 'piggyBanks'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class EditController extends Controller
|
|||||||
}
|
}
|
||||||
session()->forget('object-groups.edit.fromUpdate');
|
session()->forget('object-groups.edit.fromUpdate');
|
||||||
|
|
||||||
return prefixView('object-groups.edit', compact('subTitle', 'subTitleIcon', 'objectGroup'));
|
return view('object-groups.edit', compact('subTitle', 'subTitleIcon', 'objectGroup'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class IndexController extends Controller
|
|||||||
$subTitle = (string)trans('firefly.object_groups_index');
|
$subTitle = (string)trans('firefly.object_groups_index');
|
||||||
$objectGroups = $this->repository->get();
|
$objectGroups = $this->repository->get();
|
||||||
|
|
||||||
return prefixView('object-groups.index', compact('subTitle', 'objectGroups'));
|
return view('object-groups.index', compact('subTitle', 'objectGroups'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ class AmountController extends Controller
|
|||||||
$maxAmount = min($leftOnAccount, $leftToSave);
|
$maxAmount = min($leftOnAccount, $leftToSave);
|
||||||
$currency = $this->accountRepos->getAccountCurrency($piggyBank->account) ?? app('amount')->getDefaultCurrency();
|
$currency = $this->accountRepos->getAccountCurrency($piggyBank->account) ?? app('amount')->getDefaultCurrency();
|
||||||
|
|
||||||
return prefixView('piggy-banks.add', compact('piggyBank', 'maxAmount', 'currency'));
|
return view('piggy-banks.add', compact('piggyBank', 'maxAmount', 'currency'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -101,7 +101,7 @@ class AmountController extends Controller
|
|||||||
$maxAmount = min($leftOnAccount, $leftToSave);
|
$maxAmount = min($leftOnAccount, $leftToSave);
|
||||||
$currency = $this->accountRepos->getAccountCurrency($piggyBank->account) ?? app('amount')->getDefaultCurrency();
|
$currency = $this->accountRepos->getAccountCurrency($piggyBank->account) ?? app('amount')->getDefaultCurrency();
|
||||||
|
|
||||||
return prefixView('piggy-banks.add-mobile', compact('piggyBank', 'maxAmount', 'currency'));
|
return view('piggy-banks.add-mobile', compact('piggyBank', 'maxAmount', 'currency'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -201,7 +201,7 @@ class AmountController extends Controller
|
|||||||
$repetition = $this->piggyRepos->getRepetition($piggyBank);
|
$repetition = $this->piggyRepos->getRepetition($piggyBank);
|
||||||
$currency = $this->accountRepos->getAccountCurrency($piggyBank->account) ?? app('amount')->getDefaultCurrency();
|
$currency = $this->accountRepos->getAccountCurrency($piggyBank->account) ?? app('amount')->getDefaultCurrency();
|
||||||
|
|
||||||
return prefixView('piggy-banks.remove', compact('piggyBank', 'repetition', 'currency'));
|
return view('piggy-banks.remove', compact('piggyBank', 'repetition', 'currency'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -216,6 +216,6 @@ class AmountController extends Controller
|
|||||||
$repetition = $this->piggyRepos->getRepetition($piggyBank);
|
$repetition = $this->piggyRepos->getRepetition($piggyBank);
|
||||||
$currency = $this->accountRepos->getAccountCurrency($piggyBank->account) ?? app('amount')->getDefaultCurrency();
|
$currency = $this->accountRepos->getAccountCurrency($piggyBank->account) ?? app('amount')->getDefaultCurrency();
|
||||||
|
|
||||||
return prefixView('piggy-banks.remove-mobile', compact('piggyBank', 'repetition', 'currency'));
|
return view('piggy-banks.remove-mobile', compact('piggyBank', 'repetition', 'currency'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class CreateController extends Controller
|
|||||||
}
|
}
|
||||||
session()->forget('piggy-banks.create.fromStore');
|
session()->forget('piggy-banks.create.fromStore');
|
||||||
|
|
||||||
return prefixView('piggy-banks.create', compact('subTitle', 'subTitleIcon'));
|
return view('piggy-banks.create', compact('subTitle', 'subTitleIcon'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class DeleteController extends Controller
|
|||||||
// put previous url in session
|
// put previous url in session
|
||||||
$this->rememberPreviousUri('piggy-banks.delete.uri');
|
$this->rememberPreviousUri('piggy-banks.delete.uri');
|
||||||
|
|
||||||
return prefixView('piggy-banks.delete', compact('piggyBank', 'subTitle'));
|
return view('piggy-banks.delete', compact('piggyBank', 'subTitle'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
|||||||
use FireflyIII\Http\Controllers\Controller;
|
use FireflyIII\Http\Controllers\Controller;
|
||||||
use FireflyIII\Http\Requests\PiggyBankUpdateRequest;
|
use FireflyIII\Http\Requests\PiggyBankUpdateRequest;
|
||||||
use FireflyIII\Models\PiggyBank;
|
use FireflyIII\Models\PiggyBank;
|
||||||
|
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
@@ -41,6 +42,7 @@ class EditController extends Controller
|
|||||||
{
|
{
|
||||||
private AttachmentHelperInterface $attachments;
|
private AttachmentHelperInterface $attachments;
|
||||||
private PiggyBankRepositoryInterface $piggyRepos;
|
private PiggyBankRepositoryInterface $piggyRepos;
|
||||||
|
private AccountRepositoryInterface $accountRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PiggyBankController constructor.
|
* PiggyBankController constructor.
|
||||||
@@ -58,7 +60,7 @@ class EditController extends Controller
|
|||||||
|
|
||||||
$this->attachments = app(AttachmentHelperInterface::class);
|
$this->attachments = app(AttachmentHelperInterface::class);
|
||||||
$this->piggyRepos = app(PiggyBankRepositoryInterface::class);
|
$this->piggyRepos = app(PiggyBankRepositoryInterface::class);
|
||||||
|
$this->accountRepository = app(AccountRepositoryInterface::class);
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -81,10 +83,11 @@ class EditController extends Controller
|
|||||||
// Flash some data to fill the form.
|
// Flash some data to fill the form.
|
||||||
$targetDate = $piggyBank->targetdate?->format('Y-m-d');
|
$targetDate = $piggyBank->targetdate?->format('Y-m-d');
|
||||||
$startDate = $piggyBank->startdate?->format('Y-m-d');
|
$startDate = $piggyBank->startdate?->format('Y-m-d');
|
||||||
|
$currency = $this->accountRepository->getAccountCurrency($piggyBank->account);
|
||||||
|
|
||||||
$preFilled = ['name' => $piggyBank->name,
|
$preFilled = ['name' => $piggyBank->name,
|
||||||
'account_id' => $piggyBank->account_id,
|
'account_id' => $piggyBank->account_id,
|
||||||
'targetamount' => $piggyBank->targetamount,
|
'targetamount' => number_format((float)$piggyBank->targetamount, $currency->decimal_places,'.',''),
|
||||||
'targetdate' => $targetDate,
|
'targetdate' => $targetDate,
|
||||||
'startdate' => $startDate,
|
'startdate' => $startDate,
|
||||||
'object_group' => $piggyBank->objectGroups->first() ? $piggyBank->objectGroups->first()->title : '',
|
'object_group' => $piggyBank->objectGroups->first() ? $piggyBank->objectGroups->first()->title : '',
|
||||||
@@ -98,7 +101,7 @@ class EditController extends Controller
|
|||||||
}
|
}
|
||||||
session()->forget('piggy-banks.edit.fromUpdate');
|
session()->forget('piggy-banks.edit.fromUpdate');
|
||||||
|
|
||||||
return prefixView('piggy-banks.edit', compact('subTitle', 'subTitleIcon', 'piggyBank', 'preFilled'));
|
return view('piggy-banks.edit', compact('subTitle', 'subTitleIcon', 'piggyBank', 'preFilled'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user