mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Some more last-minute fixes.
This commit is contained in:
@@ -177,7 +177,12 @@ class TransactionFactory
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
if (null !== $result) {
|
||||
Log::debug(sprintf('Created transaction #%d (%s %s), part of journal #%d', $result->id, $this->currency->code, $amount, $this->journal->id));
|
||||
Log::debug(
|
||||
sprintf(
|
||||
'Created transaction #%d (%s %s, account %s), part of journal #%d', $result->id, $this->currency->code, $amount, $this->account->name,
|
||||
$this->journal->id
|
||||
)
|
||||
);
|
||||
|
||||
// do foreign currency thing: add foreign currency info to $one and $two if necessary.
|
||||
if (null !== $this->foreignCurrency && null !== $foreignAmount && $this->foreignCurrency->id !== $this->currency->id) {
|
||||
|
@@ -287,7 +287,7 @@ class TransactionJournalFactory
|
||||
$destForeignCurrency = $foreignCurrency;
|
||||
}
|
||||
|
||||
if ('Transfer' === $type->type) {
|
||||
if (TransactionType::TRANSFER === $type->type) {
|
||||
// get currencies
|
||||
$currency = $this->getCurrency($currency, $sourceAccount);
|
||||
$foreignCurrency = $this->getCurrency($foreignCurrency, $destinationAccount);
|
||||
@@ -298,6 +298,11 @@ 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