mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 05:03:13 +00:00
Replace enum
This commit is contained in:
@@ -275,7 +275,7 @@ class CorrectsAccountTypes extends Command
|
||||
private function makeDeposit(TransactionJournal $journal): void
|
||||
{
|
||||
// from a liability to an asset should be a deposit.
|
||||
$deposit = TransactionType::whereType(TransactionType::DEPOSIT)->first();
|
||||
$deposit = TransactionType::whereType(TransactionTypeEnum::DEPOSIT->value)->first();
|
||||
$journal->transactionType()->associate($deposit);
|
||||
$journal->save();
|
||||
$message = sprintf('Converted transaction #%d from a transfer to a deposit.', $journal->id);
|
||||
@@ -313,7 +313,7 @@ class CorrectsAccountTypes extends Command
|
||||
|
||||
private function shouldComeFromRevenueAccount(string $transactionType, string $sourceType, string $destinationType): bool
|
||||
{
|
||||
return TransactionType::DEPOSIT === $transactionType && AccountType::EXPENSE === $sourceType && AccountType::ASSET === $destinationType;
|
||||
return TransactionTypeEnum::DEPOSIT->value === $transactionType && AccountType::EXPENSE === $sourceType && AccountType::ASSET === $destinationType;
|
||||
}
|
||||
|
||||
private function makeRevenueSource(TransactionJournal $journal, Transaction $source): void
|
||||
|
||||
@@ -104,7 +104,7 @@ class UpgradesVariousCurrencyInformation extends Command
|
||||
private function updateOtherJournalsCurrencies(): void
|
||||
{
|
||||
$set = $this->cliRepos->getAllJournals(
|
||||
[TransactionTypeEnum::WITHDRAWAL->value, TransactionType::DEPOSIT, TransactionType::OPENING_BALANCE, TransactionType::RECONCILIATION]
|
||||
[TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::DEPOSIT->value, TransactionType::OPENING_BALANCE, TransactionType::RECONCILIATION]
|
||||
);
|
||||
|
||||
/** @var TransactionJournal $journal */
|
||||
@@ -186,7 +186,7 @@ class UpgradesVariousCurrencyInformation extends Command
|
||||
|
||||
break;
|
||||
|
||||
case TransactionType::DEPOSIT:
|
||||
case TransactionTypeEnum::DEPOSIT->value:
|
||||
$lead = $journal->transactions()->where('amount', '>', 0)->first();
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user