mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Refactor and renam commands.
This commit is contained in:
@@ -1,4 +1,23 @@
|
||||
<?php
|
||||
/*
|
||||
* ConvertsDatesToUTC.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
/*
|
||||
@@ -21,7 +40,7 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
namespace FireflyIII\Console\Commands\Integrity;
|
||||
namespace FireflyIII\Console\Commands\Correction;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
@@ -54,6 +73,8 @@ class ConvertDatesToUTC extends Command
|
||||
*/
|
||||
public function handle(): int
|
||||
{
|
||||
$this->friendlyWarning('Please do not use this command.');
|
||||
return 0;
|
||||
/**
|
||||
* @var string $model
|
||||
* @var array $fields
|
@@ -34,7 +34,7 @@ class CorrectDatabase extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
protected $description = 'Will correct the integrity of your database, if necessary.';
|
||||
protected $description = 'Will validate and correct the integrity of your database, if necessary.';
|
||||
protected $signature = 'firefly-iii:correct-database';
|
||||
|
||||
/**
|
||||
@@ -49,6 +49,14 @@ class CorrectDatabase extends Command
|
||||
return 1;
|
||||
}
|
||||
$commands = [
|
||||
|
||||
// also just in case, some integrity commands:
|
||||
// 'upgrade:restore-oauth-keys',
|
||||
// 'upgrade:add-timezones-to-dates',
|
||||
// 'upgrade:create-group-memberships',
|
||||
// 'upgrade:upgrade-group-information',
|
||||
// 'upgrade:610-currency-preferences',
|
||||
// 'upgrade:620-piggy-banks',
|
||||
'firefly-iii:fix-piggies',
|
||||
'firefly-iii:create-link-types',
|
||||
'firefly-iii:create-access-tokens',
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* UpdateGroupInformation.php
|
||||
* Copyright (c) 2022 james@firefly-iii.org
|
||||
* CorrectsGroupInformation.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
@@ -17,12 +17,12 @@
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands\Integrity;
|
||||
namespace FireflyIII\Console\Commands\Correction;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Models\Account;
|
@@ -1,4 +1,23 @@
|
||||
<?php
|
||||
/*
|
||||
* CorrectsTimezoneInformation.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
/*
|
||||
@@ -21,7 +40,7 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
namespace FireflyIII\Console\Commands\Integrity;
|
||||
namespace FireflyIII\Console\Commands\Correction;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Models\AccountBalance;
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* CreateGroupMemberships.php
|
||||
* Copyright (c) 2023 james@firefly-iii.org
|
||||
* CreatesGroupMemberships.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
@@ -17,12 +17,12 @@
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands\Integrity;
|
||||
namespace FireflyIII\Console\Commands\Correction;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Enums\UserRoleEnum;
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* RestoreOAuthKeys.php
|
||||
* Copyright (c) 2020 james@firefly-iii.org
|
||||
/*
|
||||
* RestoresOAuthKeys.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
@@ -17,12 +17,12 @@
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Console\Commands\Integrity;
|
||||
namespace FireflyIII\Console\Commands\Correction;
|
||||
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Support\System\OAuthKeys;
|
@@ -34,13 +34,13 @@ use Illuminate\Console\Command;
|
||||
/**
|
||||
* Class ReportEmptyObjects
|
||||
*/
|
||||
class ReportEmptyObjects extends Command
|
||||
class ReportsEmptyObjects extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
protected $description = 'Reports on empty database objects.';
|
||||
|
||||
protected $signature = 'firefly-iii:report-empty-objects';
|
||||
protected $signature = 'integrity:empty-objects';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -30,7 +30,7 @@ use Illuminate\Console\Command;
|
||||
/**
|
||||
* Class ReportIntegrity
|
||||
*/
|
||||
class ReportIntegrity extends Command
|
||||
class ReportsIntegrity extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -48,11 +48,9 @@ class ReportIntegrity extends Command
|
||||
return 1;
|
||||
}
|
||||
$commands = [
|
||||
'firefly-iii:add-timezones-to-dates',
|
||||
'firefly-iii:create-group-memberships',
|
||||
'firefly-iii:report-empty-objects',
|
||||
'firefly-iii:report-sum',
|
||||
'firefly-iii:upgrade-group-information',
|
||||
//'firefly-iii:add-timezones-to-dates',
|
||||
'integrity:empty-objects',
|
||||
'integrity:total-sums',
|
||||
];
|
||||
foreach ($commands as $command) {
|
||||
$this->friendlyLine(sprintf('Now executing %s', $command));
|
@@ -32,12 +32,13 @@ use Illuminate\Console\Command;
|
||||
/**
|
||||
* Class ReportSkeleton
|
||||
*/
|
||||
class ReportSum extends Command
|
||||
class ReportsSums extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
protected $description = 'Report on the total sum of transactions. Must be 0.';
|
||||
protected $signature = 'firefly-iii:report-sum';
|
||||
protected $signature = 'integrity:total-sums';
|
||||
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -35,13 +35,13 @@ use Illuminate\Database\QueryException;
|
||||
/**
|
||||
* Class TransactionIdentifier
|
||||
*/
|
||||
class TransactionIdentifier extends Command
|
||||
class AddsTransactionIdentifiers extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
public const string CONFIG_NAME = '480_transaction_identifier';
|
||||
protected $description = 'Fixes transaction identifiers.';
|
||||
protected $signature = 'firefly-iii:transaction-identifiers {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-transaction-identifiers {--F|force : Force the execution of this command.}';
|
||||
private JournalCLIRepositoryInterface $cliRepository;
|
||||
private int $count;
|
||||
|
@@ -30,15 +30,12 @@ use FireflyIII\Models\Preference;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Contracts\Encryption\DecryptException;
|
||||
|
||||
/**
|
||||
* Class DecryptDatabase
|
||||
*/
|
||||
class DecryptDatabase extends Command
|
||||
class RemovesDatabaseDecryption extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
protected $description = 'Decrypts the database.';
|
||||
protected $signature = 'firefly-iii:decrypt-all';
|
||||
protected $signature = 'upgrade:480-decrypt-all';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -28,16 +28,13 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Support\Models\AccountBalanceCalculator;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class CorrectionSkeleton
|
||||
*/
|
||||
class CorrectAccountBalance extends Command
|
||||
class RepairsAccountBalances extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
public const string CONFIG_NAME = '610_correct_balances';
|
||||
protected $description = 'Recalculate all account balance amounts';
|
||||
protected $signature = 'firefly-iii:correct-account-balance {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:610-account-balances {--F|force : Force the execution of this command.}';
|
||||
|
||||
public function handle(): int
|
||||
{
|
@@ -27,16 +27,13 @@ namespace FireflyIII\Console\Commands\Upgrade;
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class FixPostgresSequences
|
||||
*/
|
||||
class FixPostgresSequences extends Command
|
||||
class RepairsPostgresSequences extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
protected $description = 'Fixes issues with PostgreSQL sequences.';
|
||||
|
||||
protected $signature = 'firefly-iii:fix-pgsql-sequences';
|
||||
protected $signature = 'upgrade:600-pgsql-sequences';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -35,15 +35,15 @@ use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class TransferCurrenciesCorrections
|
||||
* Class UpgradeTransferCurrencies
|
||||
*/
|
||||
class TransferCurrenciesCorrections extends Command
|
||||
class UpgradeTransferCurrencies extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
public const string CONFIG_NAME = '480_transfer_currencies';
|
||||
protected $description = 'Updates transfer currency information.';
|
||||
protected $signature = 'firefly-iii:transfer-currencies {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-transfer-currencies {--F|force : Force the execution of this command.}';
|
||||
private array $accountCurrencies;
|
||||
private AccountRepositoryInterface $accountRepos;
|
||||
private JournalCLIRepositoryInterface $cliRepos;
|
@@ -39,14 +39,14 @@ use Illuminate\Console\Command;
|
||||
/**
|
||||
* Class AccountCurrencies
|
||||
*/
|
||||
class AccountCurrencies extends Command
|
||||
class UpgradesAccountCurrencies extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
public const string CONFIG_NAME = '480_account_currencies';
|
||||
|
||||
protected $description = 'Give all accounts proper currency info.';
|
||||
protected $signature = 'firefly-iii:account-currencies {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-account-currencies {--F|force : Force the execution of this command.}';
|
||||
private AccountRepositoryInterface $accountRepos;
|
||||
private int $count;
|
||||
private UserRepositoryInterface $userRepos;
|
@@ -29,10 +29,7 @@ use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\AccountMeta;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class RenameAccountMeta
|
||||
*/
|
||||
class RenameAccountMeta extends Command
|
||||
class UpgradesAccountMetaData extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -40,7 +37,7 @@ class RenameAccountMeta extends Command
|
||||
|
||||
protected $description = 'Rename account meta-data to new format.';
|
||||
|
||||
protected $signature = 'firefly-iii:rename-account-meta {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-account-meta {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -33,7 +33,7 @@ use Illuminate\Console\Command;
|
||||
/**
|
||||
* Class MigrateAttachments
|
||||
*/
|
||||
class MigrateAttachments extends Command
|
||||
class UpgradesAttachments extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -41,7 +41,7 @@ class MigrateAttachments extends Command
|
||||
|
||||
protected $description = 'Migrates attachment meta-data.';
|
||||
|
||||
protected $signature = 'firefly-iii:migrate-attachments {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-attachments {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -36,10 +36,7 @@ use FireflyIII\Repositories\User\UserRepositoryInterface;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class MigrateToRules
|
||||
*/
|
||||
class MigrateToRules extends Command
|
||||
class UpgradesBillsToRules extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -47,7 +44,7 @@ class MigrateToRules extends Command
|
||||
|
||||
protected $description = 'Migrate bills to rules.';
|
||||
|
||||
protected $signature = 'firefly-iii:bills-to-rules {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-bills-to-rules {--F|force : Force the execution of this command.}';
|
||||
private BillRepositoryInterface $billRepository;
|
||||
private int $count;
|
||||
private RuleGroupRepositoryInterface $ruleGroupRepository;
|
@@ -28,10 +28,7 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class AppendBudgetLimitPeriods
|
||||
*/
|
||||
class AppendBudgetLimitPeriods extends Command
|
||||
class UpgradesBudgetLimitPeriods extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -39,7 +36,7 @@ class AppendBudgetLimitPeriods extends Command
|
||||
|
||||
protected $description = 'Append budget limits with their (estimated) timeframe.';
|
||||
|
||||
protected $signature = 'firefly-iii:budget-limit-periods {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:550-budget-limit-periods {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -31,10 +31,7 @@ use FireflyIII\Models\BudgetLimit;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class BudgetLimitCurrency
|
||||
*/
|
||||
class BudgetLimitCurrency extends Command
|
||||
class UpgradesBudgetLimits extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -42,7 +39,7 @@ class BudgetLimitCurrency extends Command
|
||||
|
||||
protected $description = 'Give budget limits a currency';
|
||||
|
||||
protected $signature = 'firefly-iii:bl-currency {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-budget-limit-currencies {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -31,16 +31,13 @@ use FireflyIII\Models\AccountType;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class CCLiabilities
|
||||
*/
|
||||
class CCLiabilities extends Command
|
||||
class UpgradesCreditCardLiabilities extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
public const string CONFIG_NAME = '480_cc_liabilities';
|
||||
protected $description = 'Convert old credit card liabilities.';
|
||||
protected $signature = 'firefly-iii:cc-liabilities {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-cc-liabilities {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -33,9 +33,9 @@ use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class UpgradeCurrencyPreferences
|
||||
* Class UpgradesCurrencyPreferences
|
||||
*/
|
||||
class UpgradeCurrencyPreferences extends Command
|
||||
class UpgradesCurrencyPreferences extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -43,7 +43,7 @@ class UpgradeCurrencyPreferences extends Command
|
||||
|
||||
protected $description = 'Upgrade user currency preferences';
|
||||
|
||||
protected $signature = 'firefly-iii:upgrade-currency-preferences {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:610-currency-preferences {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -29,10 +29,7 @@ set_time_limit(0);
|
||||
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class UpgradeDatabase
|
||||
*/
|
||||
class UpgradeDatabase extends Command
|
||||
class UpgradesDatabase extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -46,33 +43,26 @@ class UpgradeDatabase extends Command
|
||||
{
|
||||
$this->callInitialCommands();
|
||||
$commands = [
|
||||
'firefly-iii:transaction-identifiers',
|
||||
'firefly-iii:migrate-to-groups',
|
||||
'firefly-iii:account-currencies',
|
||||
'firefly-iii:transfer-currencies',
|
||||
'firefly-iii:other-currencies',
|
||||
'firefly-iii:migrate-notes',
|
||||
'firefly-iii:migrate-attachments',
|
||||
'firefly-iii:bills-to-rules',
|
||||
'firefly-iii:bl-currency',
|
||||
'firefly-iii:cc-liabilities',
|
||||
'firefly-iii:back-to-journals',
|
||||
'firefly-iii:rename-account-meta',
|
||||
'firefly-iii:migrate-recurrence-meta',
|
||||
'firefly-iii:migrate-tag-locations',
|
||||
'firefly-iii:migrate-recurrence-type',
|
||||
'firefly-iii:upgrade-liabilities',
|
||||
'firefly-iii:liabilities-600',
|
||||
'firefly-iii:budget-limit-periods',
|
||||
'firefly-iii:migrate-rule-actions',
|
||||
'firefly-iii:restore-oauth-keys',
|
||||
'firefly-iii:correct-account-balance',
|
||||
// also just in case, some integrity commands:
|
||||
'firefly-iii:add-timezones-to-dates',
|
||||
'firefly-iii:create-group-memberships',
|
||||
'firefly-iii:upgrade-group-information',
|
||||
'firefly-iii:upgrade-currency-preferences',
|
||||
'firefly-iii:upgrade-multi-piggies',
|
||||
'upgrade:480-transaction-identifiers',
|
||||
'upgrade:480-migrate-to-groups',
|
||||
'upgrade:480-account-currencies',
|
||||
'upgrade:480-transfer-currencies',
|
||||
'upgrade:480-currency-information',
|
||||
'upgrade:480-notes',
|
||||
'upgrade:480-attachments',
|
||||
'upgrade:480-bills-to-rules',
|
||||
'upgrade:480-budget-limit-currencies',
|
||||
'upgrade:480-cc-liabilities',
|
||||
'upgrade:480-journal-meta-data',
|
||||
'upgrade:480-account-meta',
|
||||
'upgrade:481-recurrence-meta',
|
||||
'upgrade:500-tag-locations',
|
||||
'upgrade:550-recurrence-type',
|
||||
'upgrade:560-liabilities',
|
||||
'upgrade:600-liabilities',
|
||||
'upgrade:550-budget-limit-periods',
|
||||
'upgrade:600-rule-actions',
|
||||
'upgrade:610-account-balance',
|
||||
'firefly-iii:correct-database',
|
||||
];
|
||||
$args = [];
|
||||
@@ -94,7 +84,7 @@ class UpgradeDatabase extends Command
|
||||
private function callInitialCommands(): void
|
||||
{
|
||||
$this->call('migrate', ['--seed' => true, '--force' => true, '--no-interaction' => true]);
|
||||
$this->call('firefly-iii:fix-pgsql-sequences');
|
||||
$this->call('firefly-iii:decrypt-all');
|
||||
$this->call('upgrade:600-pgsql-sequences');
|
||||
$this->call('upgrade:480-decrypt-all');
|
||||
}
|
||||
}
|
@@ -32,10 +32,7 @@ use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* Class BackToJournals
|
||||
*/
|
||||
class BackToJournals extends Command
|
||||
class UpgradesJournalMetaData extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -43,7 +40,7 @@ class BackToJournals extends Command
|
||||
|
||||
protected $description = 'Move meta data back to journals, not individual transactions.';
|
||||
|
||||
protected $signature = 'firefly-iii:back-to-journals {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-journal-meta-data {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
@@ -71,7 +68,7 @@ class BackToJournals extends Command
|
||||
|
||||
private function isMigrated(): bool
|
||||
{
|
||||
$configVar = app('fireflyconfig')->get(MigrateToGroups::CONFIG_NAME, false);
|
||||
$configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
|
||||
|
||||
return (bool) $configVar->data;
|
||||
}
|
@@ -29,10 +29,7 @@ use FireflyIII\Models\Note;
|
||||
use FireflyIII\Models\TransactionJournalMeta;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class MigrateJournalNotes
|
||||
*/
|
||||
class MigrateJournalNotes extends Command
|
||||
class UpgradesJournalNotes extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -40,7 +37,7 @@ class MigrateJournalNotes extends Command
|
||||
|
||||
protected $description = 'Migrate notes for transaction journals.';
|
||||
|
||||
protected $signature = 'firefly-iii:migrate-notes {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-notes {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -34,16 +34,13 @@ use FireflyIII\Services\Internal\Support\CreditRecalculateService;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class UpgradeLiabilities
|
||||
*/
|
||||
class UpgradeLiabilities extends Command
|
||||
class UpgradesLiabilities extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
public const string CONFIG_NAME = '560_upgrade_liabilities';
|
||||
protected $description = 'Upgrade liabilities to new 5.6.0 structure.';
|
||||
protected $signature = 'firefly-iii:upgrade-liabilities {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:560-liabilities {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -35,16 +35,13 @@ use FireflyIII\Services\Internal\Support\CreditRecalculateService;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class UpgradeLiabilitiesEight
|
||||
*/
|
||||
class UpgradeLiabilitiesEight extends Command
|
||||
class UpgradesLiabilitiesEight extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
public const string CONFIG_NAME = '600_upgrade_liabilities';
|
||||
protected $description = 'Upgrade liabilities to new 6.0.0 structure.';
|
||||
protected $signature = 'firefly-iii:liabilities-600 {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:600-liabilities {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
@@ -201,32 +198,9 @@ class UpgradeLiabilitiesEight extends Command
|
||||
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach ($journals as $journal) {
|
||||
// $delete = false;
|
||||
// /** @var Transaction $source */
|
||||
// $source = $journal->transactions()->where('amount', '<', 0)->first();
|
||||
// /** @var Transaction $dest */
|
||||
// $dest = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
|
||||
/**
|
||||
* // if source is this liability and destination is expense, remove transaction.
|
||||
* // if source is revenue and destination is liability, remove transaction.
|
||||
* if ($source->account_id === $account->id && $dest->account->accountType->type === AccountType::EXPENSE) {
|
||||
* $delete = true;
|
||||
* }
|
||||
* if ($dest->account_id === $account->id && $source->account->accountType->type === AccountType::REVENUE) {
|
||||
* $delete = true;
|
||||
* }
|
||||
*
|
||||
* // overruled. No transaction will be deleted, ever.
|
||||
* // code is kept in place, so I can revisit my reasoning.
|
||||
* $delete = false;
|
||||
*/
|
||||
|
||||
// if ($delete) {
|
||||
$service = app(TransactionGroupDestroyService::class);
|
||||
$service->destroy($journal->transactionGroup);
|
||||
++$count;
|
||||
// }
|
||||
}
|
||||
|
||||
return $count;
|
@@ -30,15 +30,15 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UpgradeMultiPiggyBanks extends Command
|
||||
class UpgradesMultiPiggyBanks extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
public const string CONFIG_NAME = '620_make_multi_piggies';
|
||||
|
||||
protected $description = 'Upgrade piggybanks so they can use multiple accounts.';
|
||||
protected $description = 'Upgrade piggy banks so they can use multiple accounts.';
|
||||
|
||||
protected $signature = 'firefly-iii:upgrade-multi-piggies {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:620-piggy-banks {--F|force : Force the execution of this command.}';
|
||||
private AccountRepositoryInterface $accountRepository;
|
||||
private PiggyBankRepositoryInterface $repository;
|
||||
|
@@ -33,7 +33,7 @@ use Illuminate\Console\Command;
|
||||
/**
|
||||
* Class MigrateRecurrenceMeta
|
||||
*/
|
||||
class MigrateRecurrenceMeta extends Command
|
||||
class UpgradesRecurrenceMetaData extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -41,7 +41,7 @@ class MigrateRecurrenceMeta extends Command
|
||||
|
||||
protected $description = 'Migrate recurrence meta data';
|
||||
|
||||
protected $signature = 'firefly-iii:migrate-recurrence-meta {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:481-recurrence-meta {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -30,7 +30,7 @@ use Illuminate\Console\Command;
|
||||
/**
|
||||
* Class MigrateRecurrenceType
|
||||
*/
|
||||
class MigrateRecurrenceType extends Command
|
||||
class UpgradesRecurrenceType extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -38,7 +38,7 @@ class MigrateRecurrenceType extends Command
|
||||
|
||||
protected $description = 'Migrate transaction type of recurring transaction.';
|
||||
|
||||
protected $signature = 'firefly-iii:migrate-recurrence-type {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:550-recurrence-type {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -27,7 +27,7 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
|
||||
use FireflyIII\Models\RuleAction;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class MigrateRuleActions extends Command
|
||||
class UpgradesRuleActions extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -35,7 +35,7 @@ class MigrateRuleActions extends Command
|
||||
|
||||
protected $description = 'Migrate rule actions away from expression engine';
|
||||
|
||||
protected $signature = 'firefly-iii:migrate-rule-actions {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:600-rule-actions {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -32,7 +32,7 @@ use Illuminate\Console\Command;
|
||||
/**
|
||||
* Class MigrateTagLocations
|
||||
*/
|
||||
class MigrateTagLocations extends Command
|
||||
class UpgradesTagLocations extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
@@ -40,7 +40,7 @@ class MigrateTagLocations extends Command
|
||||
|
||||
protected $description = 'Migrate tag locations.';
|
||||
|
||||
protected $signature = 'firefly-iii:migrate-tag-locations {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:500-tag-locations {--F|force : Force the execution of this command.}';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
@@ -36,20 +36,13 @@ use FireflyIII\Services\Internal\Destroy\JournalDestroyService;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
/**
|
||||
* This command will take split transactions and migrate them to "transaction groups".
|
||||
*
|
||||
* It will only run once, but can be forced to run again.
|
||||
*
|
||||
* Class MigrateToGroups
|
||||
*/
|
||||
class MigrateToGroups extends Command
|
||||
class UpgradesToGroups extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
public const string CONFIG_NAME = '480_migrated_to_groups';
|
||||
protected $description = 'Migrates a pre-4.7.8 transaction structure to the 4.7.8+ transaction structure.';
|
||||
protected $signature = 'firefly-iii:migrate-to-groups {--F|force : Force the migration, even if it fired before.}';
|
||||
protected $signature = 'upgrade:480-migrate-to-groups {--F|force : Force the migration, even if it fired before.}';
|
||||
private JournalCLIRepositoryInterface $cliRepository;
|
||||
private int $count;
|
||||
private TransactionGroupFactory $groupFactory;
|
@@ -36,16 +36,14 @@ use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface;
|
||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
/**
|
||||
* Class OtherCurrenciesCorrections
|
||||
*/
|
||||
class OtherCurrenciesCorrections extends Command
|
||||
|
||||
class UpgradesVariousCurrencyInformation extends Command
|
||||
{
|
||||
use ShowsFriendlyMessages;
|
||||
|
||||
public const string CONFIG_NAME = '480_other_currencies';
|
||||
protected $description = 'Update all journal currency information.';
|
||||
protected $signature = 'firefly-iii:other-currencies {--F|force : Force the execution of this command.}';
|
||||
protected $signature = 'upgrade:480-currency-information {--F|force : Force the execution of this command.}';
|
||||
private array $accountCurrencies;
|
||||
private AccountRepositoryInterface $accountRepos;
|
||||
private JournalCLIRepositoryInterface $cliRepos;
|
@@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Authentication;
|
||||
|
||||
use FireflyIII\Console\Commands\Integrity\CreateGroupMemberships;
|
||||
use FireflyIII\Console\Commands\Correction\CreateGroupMemberships;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Role;
|
||||
use FireflyIII\User;
|
||||
|
@@ -1766,6 +1766,7 @@ return [
|
||||
'updated_currency' => 'Currency :name updated',
|
||||
'ask_site_owner' => 'Please ask :owner to add, remove or edit currencies.',
|
||||
'currencies_intro' => 'Firefly III supports various currencies which you can set and enable here.',
|
||||
'currencies_switch_default' => 'If you have a large database, switching from one default currency to another may take a moment.',
|
||||
'make_default_currency' => 'Make default',
|
||||
'default_currency' => 'default',
|
||||
'currency_is_disabled' => 'Disabled',
|
||||
|
@@ -13,11 +13,10 @@
|
||||
<a class="btn btn-success pull-right" href="{{ route('currencies.create') }}">{{ 'create_currency'|_ }}</a>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p class="text-info">
|
||||
<p>
|
||||
{{ 'currencies_intro'|_ }}
|
||||
</p>
|
||||
<p class="text-info">
|
||||
{{ 'currencies_default_disabled'|_ }}
|
||||
{{ 'currencies_switch_default'|_ }}
|
||||
</p>
|
||||
{% if currencies|length > 0 %}
|
||||
<div style="padding-left:8px;">
|
||||
|
Reference in New Issue
Block a user