mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 08:35:00 +00:00
Code for #2397
This commit is contained in:
@@ -261,7 +261,7 @@ class TransactionJournalFactory
|
||||
$sourceForeignCurrency = $foreignCurrency;
|
||||
$destForeignCurrency = $foreignCurrency;
|
||||
|
||||
if ('Withdrawal' === $type->type) {
|
||||
if (TransactionType::WITHDRAWAL === $type->type) {
|
||||
// make sure currency is correct.
|
||||
$currency = $this->getCurrency($currency, $sourceAccount);
|
||||
// make sure foreign currency != currency.
|
||||
@@ -273,7 +273,7 @@ class TransactionJournalFactory
|
||||
$sourceForeignCurrency = $foreignCurrency;
|
||||
$destForeignCurrency = $foreignCurrency;
|
||||
}
|
||||
if ('Deposit' === $type->type) {
|
||||
if (TransactionType::DEPOSIT === $type->type) {
|
||||
// make sure currency is correct.
|
||||
$currency = $this->getCurrency($currency, $destinationAccount);
|
||||
// make sure foreign currency != currency.
|
||||
@@ -298,11 +298,6 @@ class TransactionJournalFactory
|
||||
$destForeignCurrency = $currency;
|
||||
}
|
||||
|
||||
// if transfer, switch accounts:
|
||||
if (TransactionType::TRANSFER === $type->type) {
|
||||
[$sourceAccount, $destinationAccount] = [$destinationAccount, $sourceAccount];
|
||||
}
|
||||
|
||||
/** Create a basic journal. */
|
||||
$journal = TransactionJournal::create(
|
||||
[
|
||||
|
Reference in New Issue
Block a user