mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-08-16 19:04:36 +00:00
Compare commits
172 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 | ||
|
4d933e1ef7 |
@@ -69,6 +69,8 @@ DB_PORT=3306
|
||||
DB_DATABASE=firefly
|
||||
DB_USERNAME=firefly
|
||||
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.
|
||||
# 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_CRL_FILE=null
|
||||
|
||||
# more PostgreSQL settings
|
||||
PGSQL_SCHEMA=public
|
||||
|
||||
# If you're looking for performance improvements, you could install memcached or redis
|
||||
CACHE_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 ...
|
||||
description: Make sure that your request fulfills all of the following requirements. If one requirement cannot be satisfied, explain in detail why.
|
||||
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: ... it's [definitely me, not you](https://github.com/firefly-iii/firefly-iii/blob/main/.github/its_you_not_me.md)
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
|
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
@@ -19,11 +19,3 @@ updates:
|
||||
schedule:
|
||||
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:
|
1
.github/mergify.yml
vendored
1
.github/mergify.yml
vendored
@@ -8,6 +8,7 @@ pull_request_rules:
|
||||
- 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!
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -15,4 +15,5 @@ yarn-error.log
|
||||
public/google*.html
|
||||
report.html
|
||||
composer.phar
|
||||
app.js.map
|
||||
app.js.map
|
||||
frontend-v3
|
||||
|
@@ -201,4 +201,70 @@ class ListController extends Controller
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -54,7 +54,7 @@ class AutocompleteRequest extends FormRequest
|
||||
return [
|
||||
'types' => $array,
|
||||
'query' => $this->string('query'),
|
||||
'date' => $this->date('date'),
|
||||
'date' => $this->getCarbonDate('date'),
|
||||
'limit' => $limit,
|
||||
];
|
||||
}
|
||||
|
@@ -45,8 +45,8 @@ class DateRequest extends FormRequest
|
||||
public function getAll(): array
|
||||
{
|
||||
return [
|
||||
'start' => $this->date('start'),
|
||||
'end' => $this->date('end'),
|
||||
'start' => $this->getCarbonDate('start'),
|
||||
'end' => $this->getCarbonDate('end'),
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -41,8 +41,8 @@ class ExportRequest extends FormRequest
|
||||
public function getAll(): array
|
||||
{
|
||||
$result = [
|
||||
'start' => $this->date('start') ?? Carbon::now()->subYear(),
|
||||
'end' => $this->date('end') ?? Carbon::now(),
|
||||
'start' => $this->getCarbonDate('start') ?? Carbon::now()->subYear(),
|
||||
'end' => $this->getCarbonDate('end') ?? Carbon::now(),
|
||||
'type' => $this->string('type'),
|
||||
];
|
||||
$parts = explode(',', $this->string('accounts'));
|
||||
|
@@ -58,8 +58,8 @@ class GenericRequest extends FormRequest
|
||||
public function getAll(): array
|
||||
{
|
||||
return [
|
||||
'start' => $this->date('start'),
|
||||
'end' => $this->date('end'),
|
||||
'start' => $this->getCarbonDate('start'),
|
||||
'end' => $this->getCarbonDate('end'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class GenericRequest extends FormRequest
|
||||
*/
|
||||
public function getEnd(): Carbon
|
||||
{
|
||||
$date = $this->date('end');
|
||||
$date = $this->getCarbonDate('end');
|
||||
$date->endOfDay();
|
||||
|
||||
return $date;
|
||||
@@ -251,7 +251,7 @@ class GenericRequest extends FormRequest
|
||||
*/
|
||||
public function getStart(): Carbon
|
||||
{
|
||||
$date = $this->date('start');
|
||||
$date = $this->getCarbonDate('start');
|
||||
$date->startOfDay();
|
||||
|
||||
return $date;
|
||||
|
@@ -70,7 +70,7 @@ class StoreRequest extends FormRequest
|
||||
'account_number' => $this->string('account_number'),
|
||||
'account_role' => $this->string('account_role'),
|
||||
'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_monthly_payment_date' => $this->string('monthly_payment_date'),
|
||||
'notes' => $this->stringWithNewlines('notes'),
|
||||
@@ -82,7 +82,7 @@ class StoreRequest extends FormRequest
|
||||
|
||||
if ('liability' === $data['account_type_name'] || 'liabilities' === $data['account_type_name']) {
|
||||
$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['liability_direction'] = $this->string('liability_direction');
|
||||
$data['account_type_id'] = null;
|
||||
|
@@ -44,8 +44,8 @@ class StoreRequest extends FormRequest
|
||||
public function getAll(): array
|
||||
{
|
||||
return [
|
||||
'start' => $this->date('start'),
|
||||
'end' => $this->date('end'),
|
||||
'start' => $this->getCarbonDate('start'),
|
||||
'end' => $this->getCarbonDate('end'),
|
||||
'amount' => $this->string('amount'),
|
||||
'currency_id' => $this->integer('currency_id'),
|
||||
'currency_code' => $this->string('currency_code'),
|
||||
|
@@ -51,8 +51,8 @@ class StoreRequest extends FormRequest
|
||||
$data['account_id'] = $this->integer('account_id');
|
||||
$data['targetamount'] = $this->string('target_amount');
|
||||
$data['current_amount'] = $this->string('current_amount');
|
||||
$data['startdate'] = $this->date('start_date');
|
||||
$data['targetdate'] = $this->date('target_date');
|
||||
$data['startdate'] = $this->getCarbonDate('start_date');
|
||||
$data['targetdate'] = $this->getCarbonDate('target_date');
|
||||
$data['notes'] = $this->stringWithNewlines('notes');
|
||||
$data['object_group_id'] = $this->integer('object_group_id');
|
||||
$data['object_group_title'] = $this->string('object_group_title');
|
||||
|
@@ -53,6 +53,7 @@ class UpdateRequest extends FormRequest
|
||||
'strict' => ['strict', 'boolean'],
|
||||
'stop_processing' => ['stop_processing', 'boolean'],
|
||||
'active' => ['active', 'boolean'],
|
||||
'order' => ['order', 'integer'],
|
||||
];
|
||||
|
||||
$return = $this->getAllData($fields);
|
||||
@@ -150,6 +151,7 @@ class UpdateRequest extends FormRequest
|
||||
'strict' => [new IsBoolean],
|
||||
'stop_processing' => [new IsBoolean],
|
||||
'active' => [new IsBoolean],
|
||||
'order' => 'numeric|between:1,1337',
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -47,7 +47,7 @@ class StoreRequest extends FormRequest
|
||||
{
|
||||
$data = [
|
||||
'tag' => $this->string('tag'),
|
||||
'date' => $this->date('date'),
|
||||
'date' => $this->getCarbonDate('date'),
|
||||
'description' => $this->string('description'),
|
||||
'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')),
|
||||
'recurrence_id' => $this->integerFromValue($object['recurrence_id']),
|
||||
'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_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.*.recurrence_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:
|
||||
'transactions.*.sepa_cc' => 'min:1,max:255|nullable',
|
||||
|
@@ -113,7 +113,7 @@ class UpdateRequest extends FormRequest
|
||||
'sepa_ep',
|
||||
'sepa_ci',
|
||||
'sepa_batch_id',
|
||||
'external_uri',
|
||||
'external_url',
|
||||
];
|
||||
$this->booleanFields = [
|
||||
'reconciled',
|
||||
@@ -284,72 +284,76 @@ class UpdateRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
// basic fields for group:
|
||||
'group_title' => 'between:1,1000',
|
||||
'apply_rules' => [new IsBoolean],
|
||||
'group_title' => 'between:1,1000',
|
||||
'apply_rules' => [new IsBoolean],
|
||||
|
||||
// transaction rules (in array for splits):
|
||||
'transactions.*.type' => 'in:withdrawal,deposit,transfer,opening-balance,reconciliation',
|
||||
'transactions.*.date' => [new IsDateOrTime],
|
||||
'transactions.*.order' => 'numeric|min:0',
|
||||
'transactions.*.type' => 'in:withdrawal,deposit,transfer,opening-balance,reconciliation',
|
||||
'transactions.*.date' => [new IsDateOrTime],
|
||||
'transactions.*.order' => 'numeric|min:0',
|
||||
|
||||
// group id:
|
||||
'transactions.*.transaction_journal_id' => ['numeric', 'exists:transaction_journals,id', new BelongsUser],
|
||||
|
||||
|
||||
// currency info
|
||||
'transactions.*.currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||
'transactions.*.currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
||||
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||
'transactions.*.foreign_currency_code' => 'nullable|min:3|max:3|exists:transaction_currencies,code',
|
||||
'transactions.*.currency_id' => 'numeric|exists:transaction_currencies,id',
|
||||
'transactions.*.currency_code' => 'min:3|max:3|exists:transaction_currencies,code',
|
||||
'transactions.*.foreign_currency_id' => 'nullable|numeric|exists:transaction_currencies,id',
|
||||
'transactions.*.foreign_currency_code' => 'nullable|min:3|max:3|exists:transaction_currencies,code',
|
||||
|
||||
// amount
|
||||
'transactions.*.amount' => 'numeric|gt:0|max:100000000000',
|
||||
'transactions.*.foreign_amount' => 'nullable|numeric|gte:0',
|
||||
'transactions.*.amount' => 'numeric|gt:0|max:100000000000',
|
||||
'transactions.*.foreign_amount' => 'nullable|numeric|gte:0',
|
||||
|
||||
// description
|
||||
'transactions.*.description' => 'nullable|between:1,1000',
|
||||
'transactions.*.description' => 'nullable|between:1,1000',
|
||||
|
||||
// source of transaction
|
||||
'transactions.*.source_id' => ['numeric', 'nullable', new BelongsUser],
|
||||
'transactions.*.source_name' => 'between:1,255|nullable',
|
||||
'transactions.*.source_id' => ['numeric', 'nullable', new BelongsUser],
|
||||
'transactions.*.source_name' => 'between:1,255|nullable',
|
||||
|
||||
// destination of transaction
|
||||
'transactions.*.destination_id' => ['numeric', 'nullable', new BelongsUser],
|
||||
'transactions.*.destination_name' => 'between:1,255|nullable',
|
||||
'transactions.*.destination_id' => ['numeric', 'nullable', new BelongsUser],
|
||||
'transactions.*.destination_name' => 'between:1,255|nullable',
|
||||
|
||||
// budget, category, bill and piggy
|
||||
'transactions.*.budget_id' => ['mustExist:budgets,id', new BelongsUser],
|
||||
'transactions.*.budget_name' => ['between:1,255', 'nullable', new BelongsUser],
|
||||
'transactions.*.category_id' => ['mustExist:categories,id', new BelongsUser],
|
||||
'transactions.*.category_name' => 'between:1,255|nullable',
|
||||
'transactions.*.bill_id' => ['numeric', 'nullable', 'mustExist:bills,id', new BelongsUser],
|
||||
'transactions.*.bill_name' => ['between:1,255', 'nullable', new BelongsUser],
|
||||
'transactions.*.budget_id' => ['mustExist:budgets,id', new BelongsUser],
|
||||
'transactions.*.budget_name' => ['between:1,255', 'nullable', new BelongsUser],
|
||||
'transactions.*.category_id' => ['mustExist:categories,id', new BelongsUser],
|
||||
'transactions.*.category_name' => 'between:1,255|nullable',
|
||||
'transactions.*.bill_id' => ['numeric', 'nullable', 'mustExist:bills,id', new BelongsUser],
|
||||
'transactions.*.bill_name' => ['between:1,255', 'nullable', new BelongsUser],
|
||||
|
||||
// other interesting fields
|
||||
'transactions.*.reconciled' => [new IsBoolean],
|
||||
'transactions.*.notes' => 'min:1,max:50000|nullable',
|
||||
'transactions.*.tags' => 'between:0,255',
|
||||
'transactions.*.reconciled' => [new IsBoolean],
|
||||
'transactions.*.notes' => 'min:1,max:50000|nullable',
|
||||
'transactions.*.tags' => 'between:0,255',
|
||||
|
||||
// meta info fields
|
||||
'transactions.*.internal_reference' => 'min:1,max:255|nullable',
|
||||
'transactions.*.external_id' => 'min:1,max:255|nullable',
|
||||
'transactions.*.recurrence_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.*.internal_reference' => 'min:1,max:255|nullable',
|
||||
'transactions.*.external_id' => 'min:1,max:255|nullable',
|
||||
'transactions.*.recurrence_id' => 'min:1,max:255|nullable',
|
||||
'transactions.*.bunq_payment_id' => 'min:1,max:255|nullable',
|
||||
'transactions.*.external_url' => 'min:1,max:255|nullable|url',
|
||||
|
||||
// SEPA fields:
|
||||
'transactions.*.sepa_cc' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_ct_op' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_ct_id' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_db' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_country' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_ep' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_ci' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_batch_id' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_cc' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_ct_op' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_ct_id' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_db' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_country' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_ep' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_ci' => 'min:1,max:255|nullable',
|
||||
'transactions.*.sepa_batch_id' => 'min:1,max:255|nullable',
|
||||
|
||||
// dates
|
||||
'transactions.*.interest_date' => 'date|nullable',
|
||||
'transactions.*.book_date' => 'date|nullable',
|
||||
'transactions.*.process_date' => 'date|nullable',
|
||||
'transactions.*.due_date' => 'date|nullable',
|
||||
'transactions.*.payment_date' => 'date|nullable',
|
||||
'transactions.*.invoice_date' => 'date|nullable',
|
||||
'transactions.*.interest_date' => 'date|nullable',
|
||||
'transactions.*.book_date' => 'date|nullable',
|
||||
'transactions.*.process_date' => 'date|nullable',
|
||||
'transactions.*.due_date' => 'date|nullable',
|
||||
'transactions.*.payment_date' => 'date|nullable',
|
||||
'transactions.*.invoice_date' => 'date|nullable',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -375,6 +379,9 @@ class UpdateRequest extends FormRequest
|
||||
// validate source/destination is equal, depending on the transaction journal type.
|
||||
$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 all account info
|
||||
$this->validateAccountInformationUpdate($validator, $transactionGroup);
|
||||
|
@@ -62,7 +62,7 @@ class CronRequest extends FormRequest
|
||||
$data['force'] = $this->boolean('force');
|
||||
}
|
||||
if ($this->has('date')) {
|
||||
$data['date'] = $this->date('date');
|
||||
$data['date'] = $this->getCarbonDate('date');
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
@@ -69,6 +69,7 @@ class CorrectDatabase extends Command
|
||||
'firefly-iii:delete-empty-journals',
|
||||
'firefly-iii:delete-empty-groups',
|
||||
'firefly-iii:fix-account-types',
|
||||
'firefly-iii:fix-ibans',
|
||||
'firefly-iii:fix-account-order',
|
||||
'firefly-iii:rename-meta-fields',
|
||||
'firefly-iii:fix-ob-currencies',
|
||||
|
@@ -72,9 +72,7 @@ class CorrectOpeningBalanceCurrencies extends Command
|
||||
$count = 0;
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach ($set as $journal) {
|
||||
Log::debug(sprintf('Going to fix journal #%d', $journal->id));
|
||||
$count += $this->correctJournal($journal);
|
||||
Log::debug(sprintf('Done, count is now %d', $count));
|
||||
}
|
||||
|
||||
if ($count > 0) {
|
||||
@@ -100,7 +98,6 @@ class CorrectOpeningBalanceCurrencies extends Command
|
||||
*/
|
||||
private function correctJournal(TransactionJournal $journal): int
|
||||
{
|
||||
Log::debug(sprintf('Going to correct journal #%d', $journal->id));
|
||||
// get the asset account for this opening balance:
|
||||
$account = $this->getAccount($journal);
|
||||
if (null === $account) {
|
||||
@@ -110,9 +107,7 @@ class CorrectOpeningBalanceCurrencies extends Command
|
||||
|
||||
return 0;
|
||||
}
|
||||
Log::debug(sprintf('Found "%s" #%d "%s".', $account->accountType->type, $account->id, $account->name));
|
||||
$currency = $this->getCurrency($account);
|
||||
Log::debug(sprintf('Found currency #%d (%s)', $currency->id, $currency->code));
|
||||
|
||||
// update journal and all transactions:
|
||||
return $this->setCurrency($journal, $currency);
|
||||
@@ -126,20 +121,14 @@ class CorrectOpeningBalanceCurrencies extends Command
|
||||
private function getAccount(TransactionJournal $journal): ?Account
|
||||
{
|
||||
$transactions = $journal->transactions()->get();
|
||||
Log::debug(sprintf('Found %d transactions for journal #%d.', $transactions->count(), $journal->id));
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($transactions as $transaction) {
|
||||
Log::debug(sprintf('Testing transaction #%d', $transaction->id));
|
||||
/** @var Account $account */
|
||||
$account = $transaction->account()->first();
|
||||
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;
|
||||
}
|
||||
}
|
||||
Log::debug('Found no IB account in transactions of journal.');
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -165,10 +154,8 @@ class CorrectOpeningBalanceCurrencies extends Command
|
||||
*/
|
||||
private function setCurrency(TransactionJournal $journal, TransactionCurrency $currency): int
|
||||
{
|
||||
Log::debug('Now in setCurrency');
|
||||
$count = 0;
|
||||
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->save();
|
||||
$count = 1;
|
||||
@@ -177,15 +164,11 @@ class CorrectOpeningBalanceCurrencies extends Command
|
||||
/** @var Transaction $transaction */
|
||||
foreach ($journal->transactions as $transaction) {
|
||||
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->save();
|
||||
$count = 1;
|
||||
}
|
||||
}
|
||||
Log::debug(sprintf('Return %d', $count));
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class CorrectionSkeleton
|
||||
* TODO DONT FORGET TO ADD THIS TO THE DOCKER BUILD
|
||||
*/
|
||||
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;
|
||||
$checked = false; // checked for existence of DB?
|
||||
$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 = [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
|
@@ -6,6 +6,7 @@ use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class ReportSkeleton
|
||||
* TODO DONT FORGET TO ADD THIS TO THE DOCKER BUILD
|
||||
*/
|
||||
class ReportSkeleton extends Command
|
||||
{
|
||||
|
@@ -74,8 +74,16 @@ class RestoreOAuthKeys extends Command
|
||||
}
|
||||
if ($this->keysInDatabase() && !$this->keysOnDrive()) {
|
||||
Log::debug('Keys are in DB and keys are not on the drive. Restore.');
|
||||
$this->restoreKeysFromDB();
|
||||
$this->line('Restored OAuth keys from database.');
|
||||
$result = $this->restoreKeysFromDB();
|
||||
if(true === $result) {
|
||||
$this->line('Restored OAuth keys from database.');
|
||||
|
||||
return;
|
||||
}
|
||||
Log::warning('Could not restore keys. Will create new ones.');
|
||||
$this->generateKeys();
|
||||
$this->storeKeysInDB();
|
||||
$this->line('Generated and stored new keys.');
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -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:fix-transaction-types',
|
||||
'firefly-iii:fix-frontpage-accounts',
|
||||
'firefly-iii:fix-ibans',
|
||||
|
||||
// two report commands
|
||||
'firefly-iii:report-empty-objects',
|
||||
|
@@ -5,7 +5,8 @@ namespace FireflyIII\Console\Commands\Upgrade;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class UpgradeSkeleton
|
||||
* Class UpgradeSkeleton.
|
||||
* TODO DONT FORGET TO ADD THIS TO THE DOCKER BUILD
|
||||
*/
|
||||
class UpgradeSkeleton extends Command
|
||||
{
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 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).
|
||||
*
|
||||
@@ -20,6 +20,8 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Events;
|
||||
|
||||
use FireflyIII\User;
|
||||
|
@@ -91,6 +91,7 @@ class GracefulNotFoundHandler extends ExceptionHandler
|
||||
return redirect(route('currencies.index'));
|
||||
case 'budgets.show':
|
||||
case 'budgets.edit':
|
||||
case 'budgets.show.limit':
|
||||
$request->session()->reflash();
|
||||
|
||||
return redirect(route('budgets.index'));
|
||||
|
@@ -52,7 +52,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
$reportType = 'account';
|
||||
$preferredPeriod = $this->preferredPeriod();
|
||||
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('doubles', $this->expense)
|
||||
->render();
|
||||
|
@@ -78,7 +78,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
'due_date', 'payment_date', 'invoice_date',
|
||||
];
|
||||
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)
|
||||
->render();
|
||||
} catch (Throwable $e) { // @phpstan-ignore-line
|
||||
|
@@ -64,7 +64,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
$accountIds = implode(',', $this->accounts->pluck('id')->toArray());
|
||||
$budgetIds = implode(',', $this->budgets->pluck('id')->toArray());
|
||||
try {
|
||||
$result = prefixView(
|
||||
$result = view(
|
||||
'reports.budget.month',
|
||||
compact('accountIds', 'budgetIds')
|
||||
)
|
||||
|
@@ -76,7 +76,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
|
||||
// render!
|
||||
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('categories', $this->categories)
|
||||
->with('accounts', $this->accounts)
|
||||
|
@@ -53,7 +53,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
$reportType = 'default';
|
||||
|
||||
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
|
||||
Log::error(sprintf('Cannot render reports.default.month: %s', $e->getMessage()));
|
||||
$result = 'Could not render report view.';
|
||||
|
@@ -54,7 +54,7 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
|
||||
$reportType = 'default';
|
||||
|
||||
try {
|
||||
return prefixView(
|
||||
return view(
|
||||
'reports.default.multi-year',
|
||||
compact('accountIds', 'reportType')
|
||||
)->with('start', $this->start)->with('end', $this->end)->render();
|
||||
|
@@ -54,7 +54,7 @@ class YearReportGenerator implements ReportGeneratorInterface
|
||||
$reportType = 'default';
|
||||
|
||||
try {
|
||||
$result = prefixView(
|
||||
$result = view(
|
||||
'reports.default.year',
|
||||
compact('accountIds', 'reportType')
|
||||
)->with('start', $this->start)->with('end', $this->end)->render();
|
||||
|
@@ -75,7 +75,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
|
||||
// render!
|
||||
try {
|
||||
$result = prefixView(
|
||||
$result = view(
|
||||
'reports.tag.month',
|
||||
compact('accountIds', 'reportType', 'tagIds')
|
||||
)->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()) {
|
||||
return;
|
||||
}
|
||||
Log::debug(sprintf('Correct inconsistent accounts in group #%d', $group->id));
|
||||
// first journal:
|
||||
/** @var TransactionJournal $first */
|
||||
$first = $group->transactionJournals()
|
||||
@@ -132,6 +131,12 @@ class UpdatedGroupEventHandler
|
||||
->orderBy('transaction_journals.id', 'DESC')
|
||||
->orderBy('transaction_journals.description', 'DESC')
|
||||
->first();
|
||||
|
||||
if(null === $first) {
|
||||
Log::warning(sprintf('Group #%d has no transaction journals.', $group->id));
|
||||
return;
|
||||
}
|
||||
|
||||
$all = $group->transactionJournals()->get()->pluck('id')->toArray();
|
||||
/** @var Account $sourceAccount */
|
||||
$sourceAccount = $first->transactions()->where('amount', '<', '0')->first()->account;
|
||||
|
@@ -212,6 +212,40 @@ trait MetaCollection
|
||||
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
|
||||
*/
|
||||
|
@@ -305,6 +305,20 @@ interface 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.
|
||||
*
|
||||
|
@@ -124,7 +124,7 @@ class CreateController extends Controller
|
||||
$request->session()->forget('accounts.create.fromStore');
|
||||
Log::channel('audit')->info('Creating new account.');
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'accounts.create',
|
||||
compact('subTitleIcon', 'liabilityDirections', 'locations', 'objectType', 'interestPeriods', 'subTitle', 'roles', 'liabilityTypes')
|
||||
);
|
||||
|
@@ -84,7 +84,7 @@ class DeleteController extends Controller
|
||||
// put previous url in session
|
||||
$this->rememberPreviousUri('accounts.delete.uri');
|
||||
|
||||
return prefixView('accounts.delete', compact('account', 'subTitle', 'accountList', 'objectType'));
|
||||
return view('accounts.delete', compact('account', 'subTitle', 'accountList', 'objectType'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -153,10 +153,13 @@ class EditController extends Controller
|
||||
'notes' => $this->repository->getNoteText($account),
|
||||
'active' => $hasOldInput ? (bool)$request->old('active') : $account->active,
|
||||
];
|
||||
if('' === $openingBalanceAmount) {
|
||||
$preFilled['opening_balance'] = '';
|
||||
}
|
||||
|
||||
$request->session()->flash('preFilled', $preFilled);
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'accounts.edit',
|
||||
compact(
|
||||
'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->accountTypeString = (string)trans(sprintf('firefly.account_type_%s', $account->accountType->type));
|
||||
$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->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->liability_direction = $this->repository->getMetaValue($account, 'liability_direction');
|
||||
$account->current_debt = $this->repository->getMetaValue($account, 'current_debt') ?? '-';
|
||||
$account->iban = implode(' ', str_split((string)$account->iban, 4));
|
||||
}
|
||||
);
|
||||
// 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 (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%']);
|
||||
$objectType = 'asset';
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'accounts.reconcile.index',
|
||||
compact(
|
||||
'account',
|
||||
|
@@ -135,7 +135,7 @@ class ShowController extends Controller
|
||||
$showAll = false;
|
||||
$balance = app('steam')->balance($account, $end);
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'accounts.show',
|
||||
compact(
|
||||
'account',
|
||||
@@ -194,7 +194,7 @@ class ShowController extends Controller
|
||||
$showAll = true;
|
||||
$balance = app('steam')->balance($account, $end);
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'accounts.show',
|
||||
compact(
|
||||
'account',
|
||||
|
@@ -75,7 +75,7 @@ class ConfigurationController extends Controller
|
||||
$isDemoSite = app('fireflyconfig')->get('is_demo_site', config('firefly.configuration.is_demo_site'))->data;
|
||||
$siteOwner = config('firefly.site_owner');
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'admin.configuration.index',
|
||||
compact('subTitle', 'subTitleIcon', 'singleUserMode', 'isDemoSite', 'siteOwner')
|
||||
);
|
||||
|
@@ -68,7 +68,7 @@ class HomeController extends Controller
|
||||
}
|
||||
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');
|
||||
}
|
||||
|
||||
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
|
||||
$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');
|
||||
|
||||
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));
|
||||
|
||||
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'),
|
||||
];
|
||||
|
||||
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]);
|
||||
|
||||
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'),
|
||||
];
|
||||
|
||||
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';
|
||||
$information = $this->repository->getUserData($user);
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'admin.users.show',
|
||||
compact(
|
||||
'title',
|
||||
|
@@ -79,7 +79,7 @@ class AttachmentController extends Controller
|
||||
// put previous url in session
|
||||
$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);
|
||||
|
||||
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);
|
||||
Log::error($message);
|
||||
|
||||
return prefixView('error', compact('message'));
|
||||
return view('error', compact('message'));
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class ForgotPasswordController extends Controller
|
||||
if ('eloquent' !== $loginProvider) {
|
||||
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
|
||||
|
||||
return prefixView('error', compact('message'));
|
||||
return view('error', compact('message'));
|
||||
}
|
||||
|
||||
// is allowed to?
|
||||
@@ -129,6 +129,6 @@ class ForgotPasswordController extends Controller
|
||||
$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();
|
||||
|
||||
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) {
|
||||
$message = 'Registration is currently not available.';
|
||||
|
||||
return prefixView('error', compact('message'));
|
||||
return view('error', compact('message'));
|
||||
}
|
||||
|
||||
$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) {
|
||||
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
|
||||
|
||||
return prefixView('error', compact('message'));
|
||||
return view('error', compact('message'));
|
||||
}
|
||||
$rules = [
|
||||
'token' => 'required',
|
||||
@@ -130,7 +130,7 @@ class ResetPasswordController extends Controller
|
||||
if ('eloquent' !== $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?
|
||||
@@ -143,7 +143,7 @@ class ResetPasswordController extends Controller
|
||||
}
|
||||
|
||||
/** @noinspection PhpUndefinedFieldInspection */
|
||||
return prefixView('auth.passwords.reset')->with(
|
||||
return view('auth.passwords.reset')->with(
|
||||
['token' => $token, 'email' => $request->email, 'allowRegistration' => $allowRegistration, 'pageTitle' => $pageTitle]
|
||||
);
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ class TwoFactorController extends Controller
|
||||
$siteOwner = config('firefly.site_owner');
|
||||
$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');
|
||||
|
||||
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');
|
||||
$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()->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);
|
||||
$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);
|
||||
|
||||
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);
|
||||
|
||||
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, '.', '');
|
||||
|
||||
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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -103,7 +103,7 @@ class CreateController extends Controller
|
||||
$request->session()->forget('budgets.create.fromStore');
|
||||
$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
|
||||
$this->rememberPreviousUri('budgets.delete.uri');
|
||||
|
||||
return prefixView('budgets.delete', compact('budget', 'subTitle'));
|
||||
return view('budgets.delete', compact('budget', 'subTitle'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -113,7 +113,7 @@ class EditController extends Controller
|
||||
$request->session()->forget('budgets.edit.fromUpdate');
|
||||
$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:
|
||||
$inactive = $this->repository->getInactiveBudgets();
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'budgets.index', compact(
|
||||
'availableBudgets', 'budgeted', 'spent', 'prevLoop', 'nextLoop', 'budgets', 'currencies', 'enableAddButton', 'periodTitle',
|
||||
'defaultCurrency', 'activeDaysPassed', 'activeDaysLeft', 'inactive', 'budgets', 'start', 'end', 'sums'
|
||||
|
@@ -105,7 +105,7 @@ class ShowController extends Controller
|
||||
$groups = $collector->getPaginatedGroups();
|
||||
$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->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]);
|
||||
|
||||
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);
|
||||
$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');
|
||||
$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
|
||||
$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),
|
||||
];
|
||||
|
||||
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->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->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->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->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->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\User;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
@@ -93,7 +94,7 @@ class CurrencyController extends Controller
|
||||
|
||||
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]);
|
||||
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 TransactionCurrency $currency
|
||||
*
|
||||
* @return RedirectResponse|Redirector
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function disableCurrency(Request $request)
|
||||
public function disableCurrency(Request $request): JsonResponse
|
||||
{
|
||||
$currencyId = (int)$request->get('id');
|
||||
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'))]));
|
||||
Log::channel('audit')->info(sprintf('Tried to disable currency %s but is not site owner.', $currency->code));
|
||||
|
||||
return redirect(route('currencies.index'));
|
||||
return response()->json([]);
|
||||
|
||||
}
|
||||
|
||||
@@ -240,8 +239,7 @@ class CurrencyController extends Controller
|
||||
|
||||
$request->session()->flash('error', $message);
|
||||
Log::channel('audit')->info(sprintf('Tried to disable currency %s but is in use.', $currency->code));
|
||||
|
||||
return redirect(route('currencies.index'));
|
||||
return response()->json([]);
|
||||
}
|
||||
|
||||
$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');
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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();
|
||||
$layout = env('FIREFLY_III_LAYOUT');
|
||||
$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:
|
||||
$expectedDBversion = config('firefly.db_version');
|
||||
@@ -206,6 +215,8 @@ class DebugController extends Controller
|
||||
'drivers',
|
||||
'currentDriver',
|
||||
'loginProvider',
|
||||
'buildNr',
|
||||
'buildDate',
|
||||
'bcscale',
|
||||
'layout',
|
||||
'userAgent',
|
||||
|
@@ -110,7 +110,7 @@ class IndexController extends Controller
|
||||
*/
|
||||
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
|
||||
{
|
||||
if ('v3' === config('firefly.layout')) {
|
||||
die('Please set your layout to "v1".');
|
||||
}
|
||||
$types = config('firefly.accountTypesByIdentifier.asset');
|
||||
$count = $repository->count($types);
|
||||
Log::channel('audit')->info('User visits homepage.');
|
||||
@@ -138,6 +141,6 @@ class HomeController extends Controller
|
||||
$user = auth()->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()
|
||||
->view('v1.javascript.accounts', $data)
|
||||
->view('javascript.accounts', $data)
|
||||
->header('Content-Type', 'text/javascript');
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ class JavascriptController extends Controller
|
||||
}
|
||||
|
||||
return response()
|
||||
->view('v1.javascript.currencies', $data)
|
||||
->view('javascript.currencies', $data)
|
||||
->header('Content-Type', 'text/javascript');
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ class JavascriptController extends Controller
|
||||
$request->session()->keep(['two-factor-secret']);
|
||||
|
||||
return response()
|
||||
->view('v1.javascript.variables', $data)
|
||||
->view('javascript.variables', $data)
|
||||
->header('Content-Type', 'text/javascript');
|
||||
}
|
||||
|
||||
|
@@ -66,7 +66,7 @@ class FrontpageController extends Controller
|
||||
$html = '';
|
||||
if (!empty($info)) {
|
||||
try {
|
||||
$html = prefixView('json.piggy-banks', compact('info'))->render();
|
||||
$html = view('json.piggy-banks', compact('info'))->render();
|
||||
|
||||
} catch (Throwable $e) { // @phpstan-ignore-line
|
||||
Log::error(sprintf('Cannot render json.piggy-banks: %s', $e->getMessage()));
|
||||
|
@@ -83,14 +83,18 @@ class ReconcileController extends Controller
|
||||
*
|
||||
* @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');
|
||||
$endBalance = $request->get('endBalance');
|
||||
$accountCurrency = $this->accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency();
|
||||
$amount = '0';
|
||||
$clearedAmount = '0';
|
||||
$route = '';
|
||||
|
||||
if (null === $start && null === $end) {
|
||||
throw new FireflyException('Invalid dates submitted.');
|
||||
}
|
||||
if ($end->lt($start)) {
|
||||
[$start, $end] = [$end, $start];
|
||||
}
|
||||
@@ -137,7 +141,7 @@ class ReconcileController extends Controller
|
||||
$reconSum = bcadd(bcadd($startBalance, $amount), $clearedAmount);
|
||||
|
||||
try {
|
||||
$view = prefixView(
|
||||
$view = view(
|
||||
'accounts.reconcile.overview',
|
||||
compact(
|
||||
'account',
|
||||
@@ -220,8 +224,11 @@ class ReconcileController extends Controller
|
||||
* @throws FireflyException
|
||||
* @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)) {
|
||||
[$end, $start] = [$start, $end];
|
||||
}
|
||||
@@ -249,7 +256,7 @@ class ReconcileController extends Controller
|
||||
$journals = $this->processTransactions($account, $array);
|
||||
|
||||
try {
|
||||
$html = prefixView(
|
||||
$html = view(
|
||||
'accounts.reconcile.transactions',
|
||||
compact('account', 'journals', 'currency', 'start', 'end', 'selectionStart', 'selectionEnd')
|
||||
)->render();
|
||||
|
@@ -50,7 +50,7 @@ class RuleController extends Controller
|
||||
$actions[$key] = (string)trans('firefly.rule_action_' . $key . '_choice');
|
||||
}
|
||||
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
|
||||
Log::error(sprintf('Cannot render rules.partials.action: %s', $e->getMessage()));
|
||||
@@ -81,7 +81,7 @@ class RuleController extends Controller
|
||||
asort($triggers);
|
||||
|
||||
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
|
||||
Log::error(sprintf('Cannot render rules.partials.trigger: %s', $e->getMessage()));
|
||||
$view = 'Could not render view.';
|
||||
|
@@ -78,7 +78,7 @@ class NewUserController extends Controller
|
||||
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
|
||||
$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');
|
||||
|
||||
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');
|
||||
$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);
|
||||
$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);
|
||||
$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);
|
||||
$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);
|
||||
$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');
|
||||
|
||||
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
|
||||
$this->rememberPreviousUri('piggy-banks.delete.uri');
|
||||
|
||||
return prefixView('piggy-banks.delete', compact('piggyBank', 'subTitle'));
|
||||
return view('piggy-banks.delete', compact('piggyBank', 'subTitle'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -101,7 +101,7 @@ class EditController extends Controller
|
||||
}
|
||||
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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -136,7 +136,7 @@ class IndexController extends Controller
|
||||
|
||||
ksort($piggyBanks);
|
||||
|
||||
return prefixView('piggy-banks.index', compact('piggyBanks', 'accounts'));
|
||||
return view('piggy-banks.index', compact('piggyBanks', 'accounts'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -84,6 +84,6 @@ class ShowController extends Controller
|
||||
$subTitle = $piggyBank->name;
|
||||
$attachments = $this->piggyRepos->getAttachments($piggyBank);
|
||||
|
||||
return prefixView('piggy-banks.show', compact('piggyBank', 'events', 'subTitle', 'piggy', 'attachments'));
|
||||
return view('piggy-banks.show', compact('piggyBank', 'events', 'subTitle', 'piggy', 'attachments'));
|
||||
}
|
||||
}
|
||||
|
@@ -121,7 +121,7 @@ class PreferencesController extends Controller
|
||||
$frontPageAccounts = $accountIds;
|
||||
}
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'preferences.index',
|
||||
compact(
|
||||
'language',
|
||||
@@ -214,7 +214,7 @@ class PreferencesController extends Controller
|
||||
'internal_reference' => array_key_exists('internal_reference', $setOptions),
|
||||
'notes' => array_key_exists('notes', $setOptions),
|
||||
'attachments' => array_key_exists('attachments', $setOptions),
|
||||
'external_uri' => array_key_exists('external_uri', $setOptions),
|
||||
'external_url' => array_key_exists('external_url', $setOptions),
|
||||
'location' => array_key_exists('location', $setOptions),
|
||||
'links' => array_key_exists('links', $setOptions),
|
||||
];
|
||||
|
@@ -113,7 +113,7 @@ class ProfileController extends Controller
|
||||
$subTitle = (string)trans('firefly.change_your_email');
|
||||
$subTitleIcon = 'fa-envelope';
|
||||
|
||||
return prefixView('profile.change-email', compact('title', 'subTitle', 'subTitleIcon', 'email'));
|
||||
return view('profile.change-email', compact('title', 'subTitle', 'subTitleIcon', 'email'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -135,7 +135,7 @@ class ProfileController extends Controller
|
||||
$subTitle = (string)trans('firefly.change_your_password');
|
||||
$subTitleIcon = 'fa-key';
|
||||
|
||||
return prefixView('profile.change-password', compact('title', 'subTitle', 'subTitleIcon'));
|
||||
return view('profile.change-password', compact('title', 'subTitle', 'subTitleIcon'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -192,7 +192,7 @@ class ProfileController extends Controller
|
||||
|
||||
$image = Google2FA::getQRCodeInline($domain, auth()->user()->email, $secret);
|
||||
|
||||
return prefixView('profile.code', compact('image', 'secret', 'codes'));
|
||||
return view('profile.code', compact('image', 'secret', 'codes'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -252,7 +252,7 @@ class ProfileController extends Controller
|
||||
$subTitle = (string)trans('firefly.delete_account');
|
||||
$subTitleIcon = 'fa-trash';
|
||||
|
||||
return prefixView('profile.delete-account', compact('title', 'subTitle', 'subTitleIcon'));
|
||||
return view('profile.delete-account', compact('title', 'subTitle', 'subTitleIcon'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -340,7 +340,7 @@ class ProfileController extends Controller
|
||||
$accessToken = app('preferences')->set('access_token', $token);
|
||||
}
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'profile.index', compact('subTitle', 'mfaBackupCount', 'userId', 'accessToken', 'enabled2FA', 'isInternalAuth', 'isInternalIdentity')
|
||||
);
|
||||
}
|
||||
@@ -356,7 +356,7 @@ class ProfileController extends Controller
|
||||
return redirect(route('profile.index'));
|
||||
}
|
||||
|
||||
return prefixView('profile.logout-other-sessions');
|
||||
return view('profile.logout-other-sessions');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -385,7 +385,7 @@ class ProfileController extends Controller
|
||||
app('preferences')->set('mfa_recovery', $recoveryCodes);
|
||||
app('preferences')->mark();
|
||||
|
||||
return prefixView('profile.new-backup-codes', compact('codes'));
|
||||
return view('profile.new-backup-codes', compact('codes'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -117,7 +117,7 @@ class CreateController extends Controller
|
||||
];
|
||||
$request->session()->flash('preFilled', $preFilled);
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'recurring.create',
|
||||
compact('tomorrow', 'oldRepetitionType', 'bills', 'weekendResponses', 'preFilled', 'repetitionEnds', 'defaultCurrency', 'budgets')
|
||||
);
|
||||
@@ -211,7 +211,7 @@ class CreateController extends Controller
|
||||
}
|
||||
$request->session()->flash('preFilled', $preFilled);
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'recurring.create',
|
||||
compact('tomorrow', 'oldRepetitionType', 'weekendResponses', 'preFilled', 'repetitionEnds', 'defaultCurrency', 'budgets')
|
||||
);
|
||||
|
@@ -77,7 +77,7 @@ class DeleteController extends Controller
|
||||
|
||||
$journalsCreated = $this->recurring->getTransactions($recurrence)->count();
|
||||
|
||||
return prefixView('recurring.delete', compact('recurrence', 'subTitle', 'journalsCreated'));
|
||||
return view('recurring.delete', compact('recurrence', 'subTitle', 'journalsCreated'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -148,7 +148,7 @@ class EditController extends Controller
|
||||
$array['repeat_until'] = substr((string)$array['repeat_until'], 0, 10);
|
||||
$array['transactions'][0]['tags'] = implode(',', $array['transactions'][0]['tags'] ?? []);
|
||||
|
||||
return prefixView(
|
||||
return view(
|
||||
'recurring.edit',
|
||||
compact(
|
||||
'recurrence', 'array', 'bills',
|
||||
|
@@ -125,7 +125,7 @@ class IndexController extends Controller
|
||||
|
||||
$this->verifyRecurringCronJob();
|
||||
|
||||
return prefixView('recurring.index', compact('paginator', 'today', 'page', 'pageSize', 'total'));
|
||||
return view('recurring.index', compact('paginator', 'today', 'page', 'pageSize', 'total'));
|
||||
}
|
||||
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user