Replace enum

This commit is contained in:
James Cole
2025-01-03 09:11:20 +01:00
parent 36351a5dd9
commit 1787f4421b
18 changed files with 51 additions and 43 deletions

View File

@@ -225,8 +225,8 @@ class AccountBalanceGrouped
|| (
(
TransactionTypeEnum::TRANSFER->value === $journal['transaction_type_type']
|| TransactionType::RECONCILIATION === $journal['transaction_type_type']
|| TransactionType::OPENING_BALANCE === $journal['transaction_type_type']
|| TransactionTypeEnum::RECONCILIATION->value === $journal['transaction_type_type']
|| TransactionTypeEnum::OPENING_BALANCE->value === $journal['transaction_type_type']
)
&& in_array($journal['destination_account_id'], $this->accountIds, true)
)

View File

@@ -42,8 +42,8 @@ trait TransactionFilter
TransactionTypeEnum::WITHDRAWAL->value,
TransactionTypeEnum::DEPOSIT->value,
TransactionTypeEnum::TRANSFER->value,
TransactionType::OPENING_BALANCE,
TransactionType::RECONCILIATION,
TransactionTypeEnum::OPENING_BALANCE->value,
TransactionTypeEnum::RECONCILIATION->value,
],
'withdrawal' => [TransactionTypeEnum::WITHDRAWAL->value],
'withdrawals' => [TransactionTypeEnum::WITHDRAWAL->value],
@@ -54,11 +54,11 @@ trait TransactionFilter
'deposits' => [TransactionTypeEnum::DEPOSIT->value],
'transfer' => [TransactionTypeEnum::TRANSFER->value],
'transfers' => [TransactionTypeEnum::TRANSFER->value],
'opening_balance' => [TransactionType::OPENING_BALANCE],
'reconciliation' => [TransactionType::RECONCILIATION],
'reconciliations' => [TransactionType::RECONCILIATION],
'special' => [TransactionType::OPENING_BALANCE, TransactionType::RECONCILIATION],
'specials' => [TransactionType::OPENING_BALANCE, TransactionType::RECONCILIATION],
'opening_balance' => [TransactionTypeEnum::OPENING_BALANCE->value],
'reconciliation' => [TransactionTypeEnum::RECONCILIATION->value],
'reconciliations' => [TransactionTypeEnum::RECONCILIATION->value],
'special' => [TransactionTypeEnum::OPENING_BALANCE->value, TransactionTypeEnum::RECONCILIATION->value],
'specials' => [TransactionTypeEnum::OPENING_BALANCE->value, TransactionTypeEnum::RECONCILIATION->value],
'default' => [TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::DEPOSIT->value, TransactionTypeEnum::TRANSFER->value],
];
$return = [];

View File

@@ -75,7 +75,7 @@ trait UserNavigation
return false;
}
$type = $journal->transactionType->type;
$editable = [TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::TRANSFER->value, TransactionTypeEnum::DEPOSIT->value, TransactionType::RECONCILIATION];
$editable = [TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::TRANSFER->value, TransactionTypeEnum::DEPOSIT->value, TransactionTypeEnum::RECONCILIATION->value];
return in_array($type, $editable, true);
}