mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 17:33:45 +00:00
Enable currencies if not enabled yet. #1952
This commit is contained in:
@@ -114,6 +114,13 @@ class TransactionFactory
|
|||||||
$currency = $this->findCurrency($data['currency_id'], $data['currency_code']);
|
$currency = $this->findCurrency($data['currency_id'], $data['currency_code']);
|
||||||
$currency = $currency ?? $defaultCurrency;
|
$currency = $currency ?? $defaultCurrency;
|
||||||
|
|
||||||
|
// enable currency:
|
||||||
|
if(false === $currency->enabled) {
|
||||||
|
$currency->enabled = true;
|
||||||
|
$currency->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// type of source account and destination account depends on journal type:
|
// type of source account and destination account depends on journal type:
|
||||||
$sourceType = $this->accountType($journal, 'source');
|
$sourceType = $this->accountType($journal, 'source');
|
||||||
$destinationType = $this->accountType($journal, 'destination');
|
$destinationType = $this->accountType($journal, 'destination');
|
||||||
|
@@ -217,6 +217,11 @@ trait TransactionServiceTrait
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// enable currency if not enabled:
|
||||||
|
if(false === $currency->enabled) {
|
||||||
|
$currency->enabled = true;
|
||||||
|
$currency->save();
|
||||||
|
}
|
||||||
|
|
||||||
$transaction->foreign_currency_id = $currency->id;
|
$transaction->foreign_currency_id = $currency->id;
|
||||||
$transaction->save();
|
$transaction->save();
|
||||||
|
Reference in New Issue
Block a user