Cannot create transfer

This commit is contained in:
James Cole 2018-06-17 07:44:59 +02:00
parent 1cf91c78f8
commit dcf90b6159
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -109,7 +109,7 @@ class TransactionFactory
Log::debug(sprintf('Source type is "%s", destination type is "%s"', $sourceType, $destinationType));
// throw big fat error when source type === dest type
if ($sourceAccount->accountType->type === $destinationAccount->accountType->type) {
if ($sourceAccount->accountType->type === $destinationAccount->accountType->type && $journal->transactionType->type !== TransactionType::TRANSFER) {
throw new FireflyException(sprintf('Source and destination account cannot be both of the type "%s"', $destinationAccount->accountType->type));
}
if ($sourceAccount->accountType->type !== AccountType::ASSET && $destinationAccount->accountType->type !== AccountType::ASSET) {