Another fix for #11054

This commit is contained in:
James Cole
2025-10-12 16:02:14 +02:00
parent df3e4a6554
commit 55cf924794

View File

@@ -221,8 +221,19 @@ class TransactionJournalFactory
];
Log::debug('Source info:', $sourceInfo);
Log::debug('Destination info:', $destInfo);
$sourceAccount = $this->getAccount($type->type, 'source', $sourceInfo);
$destinationAccount = $this->getAccount($type->type, 'destination', $destInfo, $sourceAccount);
$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);
}
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);
}
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.