🤖 Auto commit for release 'develop' on 2025-10-12

This commit is contained in:
JC5
2025-10-12 16:06:57 +02:00
parent 55cf924794
commit f52bc0e242
6 changed files with 26 additions and 27 deletions

View File

@@ -221,23 +221,23 @@ class TransactionJournalFactory
];
Log::debug('Source info:', $sourceInfo);
Log::debug('Destination info:', $destInfo);
$destinationAccount = null;
$sourceAccount = null;
if(TransactionTypeEnum::DEPOSIT->value === $type->type) {
Log::debug(sprintf('Transaction type is deposit, start with destination first.'));
$destinationAccount = $this->getAccount($type->type, 'destination', $destInfo);
$sourceAccount = $this->getAccount($type->type, 'source', $sourceInfo, $destinationAccount);
$destinationAccount = null;
$sourceAccount = null;
if (TransactionTypeEnum::DEPOSIT->value === $type->type) {
Log::debug('Transaction type is deposit, start with destination first.');
$destinationAccount = $this->getAccount($type->type, 'destination', $destInfo);
$sourceAccount = $this->getAccount($type->type, 'source', $sourceInfo, $destinationAccount);
}
if(TransactionTypeEnum::DEPOSIT->value !== $type->type) {
Log::debug(sprintf('Transaction type is not deposit, start with source first.'));
$sourceAccount = $this->getAccount($type->type, 'source', $sourceInfo);
$destinationAccount = $this->getAccount($type->type, 'destination', $destInfo, $sourceAccount);
if (TransactionTypeEnum::DEPOSIT->value !== $type->type) {
Log::debug('Transaction type is not deposit, start with source first.');
$sourceAccount = $this->getAccount($type->type, 'source', $sourceInfo);
$destinationAccount = $this->getAccount($type->type, 'destination', $destInfo, $sourceAccount);
}
Log::debug('Done with getAccount(2x)');
// there is a safety catch here. If either account is NULL, they will be replaced with the cash account.
if(null === $destinationAccount) {
if (null === $destinationAccount) {
Log::warning('Destination account is NULL, will replace with cash account.');
$destinationAccount = $this->accountRepository->getCashAccount();
}