mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
This commit is contained in:
parent
f8ded66869
commit
695bb31894
@ -61,8 +61,11 @@ class PreferencesEventHandler
|
||||
$this->resetTransactions($event->userGroup);
|
||||
// fire laravel command to recalculate them all.
|
||||
if (Amount::convertToNative()) {
|
||||
Log::debug('Will now convert to native.');
|
||||
Artisan::call('correction:recalculate-native-amounts');
|
||||
return;
|
||||
}
|
||||
Log::debug('Will NOT convert to native.');
|
||||
}
|
||||
|
||||
private function resetPiggyBanks(UserGroup $userGroup): void
|
||||
|
@ -264,6 +264,7 @@ class PreferencesController extends Controller
|
||||
if ($convertToNative && !$this->convertToNative) {
|
||||
// set to true!
|
||||
Log::debug('User sets convertToNative to true.');
|
||||
Preferences::set('convert_to_native', $convertToNative);
|
||||
event(new UserGroupChangedDefaultCurrency(auth()->user()->userGroup));
|
||||
}
|
||||
Preferences::set('convert_to_native', $convertToNative);
|
||||
|
@ -203,11 +203,11 @@ trait PeriodOverview
|
||||
$currencySymbol = $journal['currency_symbol'];
|
||||
$currencyDecimalPlaces = $journal['currency_decimal_places'];
|
||||
$foreignCurrencyId = $journal['foreign_currency_id'];
|
||||
$amount = $journal['amount'];
|
||||
$amount = $journal['amount'] ?? '0';
|
||||
|
||||
|
||||
if ($this->convertToNative && $currencyId !== $this->defaultCurrency->id && $foreignCurrencyId !== $this->defaultCurrency->id) {
|
||||
$amount = $journal['native_amount'];
|
||||
$amount = $journal['native_amount'] ?? '0';
|
||||
$currencyId = $this->defaultCurrency->id;
|
||||
$currencyCode = $this->defaultCurrency->code;
|
||||
$currencyName = $this->defaultCurrency->name;
|
||||
@ -220,7 +220,7 @@ trait PeriodOverview
|
||||
$currencyName = $journal['foreign_currency_name'];
|
||||
$currencySymbol = $journal['foreign_currency_symbol'];
|
||||
$currencyDecimalPlaces = $journal['foreign_currency_decimal_places'];
|
||||
$amount = $journal['foreign_amount'];
|
||||
$amount = $journal['foreign_amount'] ?? '0';
|
||||
}
|
||||
$return[$currencyId] ??= [
|
||||
'amount' => '0',
|
||||
|
Loading…
Reference in New Issue
Block a user