mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-09 03:51:21 +00:00
Compare commits
10 Commits
develop-20
...
develop-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62221af591 | ||
|
|
4d013a44ce | ||
|
|
c55cfd1acf | ||
|
|
b2652b83ce | ||
|
|
3d28932216 | ||
|
|
87567d5a31 | ||
|
|
37d45f4f87 | ||
|
|
4acf0828e4 | ||
|
|
b5bab53e7a | ||
|
|
62d72516ba |
@@ -26,7 +26,7 @@ namespace FireflyIII\Api\V1\Controllers\Chart;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V2\Request\Generic\DateRequest;
|
||||
use FireflyIII\Api\V1\Request\Generic\DateRequest;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Enums\UserRoleEnum;
|
||||
|
||||
@@ -97,7 +97,7 @@ class ShowController extends Controller
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AccountEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$accounts = $enrichment->enrich($accounts);
|
||||
|
||||
// make paginator:
|
||||
@@ -132,7 +132,7 @@ class ShowController extends Controller
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AccountEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$account = $enrichment->enrichSingle($account);
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class StoreController extends Controller
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AccountEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$account = $enrichment->enrichSingle($account);
|
||||
|
||||
/** @var AccountTransformer $transformer */
|
||||
|
||||
@@ -81,7 +81,7 @@ class UpdateController extends Controller
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AccountEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$account = $enrichment->enrichSingle($account);
|
||||
|
||||
/** @var AccountTransformer $transformer */
|
||||
|
||||
@@ -84,7 +84,7 @@ class ShowController extends Controller
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setConvertToPrimary($this->convertToPrimary);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$enrichment->setStart($this->parameters->get('start'));
|
||||
$enrichment->setEnd($this->parameters->get('end'));
|
||||
$bills = $enrichment->enrich($bills);
|
||||
@@ -115,7 +115,7 @@ class ShowController extends Controller
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setConvertToPrimary($this->convertToPrimary);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$enrichment->setStart($this->parameters->get('start'));
|
||||
$enrichment->setEnd($this->parameters->get('end'));
|
||||
$bill = $enrichment->enrichSingle($bill);
|
||||
|
||||
@@ -80,7 +80,7 @@ class StoreController extends Controller
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setConvertToPrimary($this->convertToPrimary);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$enrichment->setStart($this->parameters->get('start'));
|
||||
$enrichment->setEnd($this->parameters->get('end'));
|
||||
$bill = $enrichment->enrichSingle($bill);
|
||||
|
||||
@@ -75,7 +75,7 @@ class UpdateController extends Controller
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setConvertToPrimary($this->convertToPrimary);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$enrichment->setStart($this->parameters->get('start'));
|
||||
$enrichment->setEnd($this->parameters->get('end'));
|
||||
$bill = $enrichment->enrichSingle($bill);
|
||||
|
||||
@@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers\Models\CurrencyExchangeRate;
|
||||
|
||||
use FireflyIII\Api\V2\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait;
|
||||
use FireflyIII\Transformers\ExchangeRateTransformer;
|
||||
|
||||
@@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers\Models\CurrencyExchangeRate;
|
||||
|
||||
use FireflyIII\Api\V2\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Models\CurrencyExchangeRate;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace FireflyIII\Api\V1\Controllers\Models\CurrencyExchangeRate;
|
||||
|
||||
use FireflyIII\Models\CurrencyExchangeRate;
|
||||
use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\StoreRequest;
|
||||
use FireflyIII\Api\V2\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait;
|
||||
use FireflyIII\Transformers\ExchangeRateTransformer;
|
||||
|
||||
@@ -25,7 +25,7 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Api\V1\Controllers\Models\CurrencyExchangeRate;
|
||||
|
||||
use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\UpdateRequest;
|
||||
use FireflyIII\Api\V2\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Models\CurrencyExchangeRate;
|
||||
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
|
||||
use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait;
|
||||
|
||||
@@ -86,7 +86,7 @@ class ListController extends Controller
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setConvertToPrimary($this->convertToPrimary);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$enrichment->setStart($this->parameters->get('start'));
|
||||
$enrichment->setEnd($this->parameters->get('end'));
|
||||
$bills = $enrichment->enrich($bills);
|
||||
|
||||
@@ -84,7 +84,7 @@ class ListController extends Controller
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AccountEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$accounts = $enrichment->enrich($accounts);
|
||||
|
||||
// make paginator:
|
||||
|
||||
@@ -108,7 +108,7 @@ class ListController extends Controller
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AccountEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$accounts = $enrichment->enrich($accounts);
|
||||
|
||||
// make paginator:
|
||||
@@ -189,7 +189,7 @@ class ListController extends Controller
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setConvertToPrimary($this->convertToPrimary);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$enrichment->setStart($this->parameters->get('start'));
|
||||
$enrichment->setEnd($this->parameters->get('end'));
|
||||
$bills = $enrichment->enrichSingle($bills);
|
||||
|
||||
@@ -89,7 +89,7 @@ class AccountController extends Controller
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AccountEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$accounts = $enrichment->enrich($accounts);
|
||||
|
||||
/** @var AccountTransformer $transformer */
|
||||
|
||||
@@ -63,10 +63,10 @@ class CorrectsCurrencies extends Command
|
||||
$repos = app(CurrencyRepositoryInterface::class);
|
||||
|
||||
// first check if the user has any default currency (not necessarily the case, so can be forced).
|
||||
$defaultCurrency = app('amount')->getPrimaryCurrencyByUserGroup($userGroup);
|
||||
$primaryCurrency = app('amount')->getPrimaryCurrencyByUserGroup($userGroup);
|
||||
|
||||
Log::debug(sprintf('Now correcting currencies for user group #%d', $userGroup->id));
|
||||
$found = [$defaultCurrency->id];
|
||||
$found = [$primaryCurrency->id];
|
||||
|
||||
// get all meta entries
|
||||
$meta = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id')
|
||||
|
||||
@@ -108,11 +108,11 @@ class UpgradesAccountCurrencies extends Command
|
||||
$accounts = $this->accountRepos->getAccountsByType([AccountTypeEnum::DEFAULT->value, AccountTypeEnum::ASSET->value]);
|
||||
|
||||
// get user's currency preference:
|
||||
$defaultCurrency = app('amount')->getPrimaryCurrencyByUserGroup($user->userGroup);
|
||||
$primaryCurrency = app('amount')->getPrimaryCurrencyByUserGroup($user->userGroup);
|
||||
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
$this->updateAccount($account, $defaultCurrency);
|
||||
$this->updateAccount($account, $primaryCurrency);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,13 +117,13 @@ class UpgradesCurrencyPreferences extends Command
|
||||
|
||||
// set the default currency for the user and for the group:
|
||||
$preference = $this->getPreference($user);
|
||||
$defaultCurrency = TransactionCurrency::where('code', $preference)->first();
|
||||
if (null === $defaultCurrency) {
|
||||
$primaryCurrency = TransactionCurrency::where('code', $preference)->first();
|
||||
if (null === $primaryCurrency) {
|
||||
// get EUR
|
||||
$defaultCurrency = TransactionCurrency::where('code', 'EUR')->first();
|
||||
$primaryCurrency = TransactionCurrency::where('code', 'EUR')->first();
|
||||
}
|
||||
$user->currencies()->updateExistingPivot($defaultCurrency->id, ['user_default' => true]);
|
||||
$user->userGroup->currencies()->updateExistingPivot($defaultCurrency->id, ['group_default' => true]);
|
||||
$user->currencies()->updateExistingPivot($primaryCurrency->id, ['user_default' => true]);
|
||||
$user->userGroup->currencies()->updateExistingPivot($primaryCurrency->id, ['group_default' => true]);
|
||||
}
|
||||
|
||||
private function getPreference(User $user): string
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* UserGroupChangedDefaultCurrency.php
|
||||
* UserGroupChangedPrimaryCurrency.php
|
||||
* Copyright (c) 2024 james@firefly-iii.org.
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
@@ -29,7 +29,7 @@ use FireflyIII\Models\UserGroup;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class UserGroupChangedDefaultCurrency extends Event
|
||||
class UserGroupChangedPrimaryCurrency extends Event
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
@@ -126,7 +126,7 @@ class PiggyBankFactory
|
||||
private function getCurrency(array $data): TransactionCurrency
|
||||
{
|
||||
// currency:
|
||||
$defaultCurrency = app('amount')->getPrimaryCurrency();
|
||||
$primaryCurrency = app('amount')->getPrimaryCurrency();
|
||||
$currency = null;
|
||||
if (array_key_exists('transaction_currency_code', $data)) {
|
||||
$currency = $this->currencyRepository->findByCode((string)($data['transaction_currency_code'] ?? ''));
|
||||
@@ -134,7 +134,7 @@ class PiggyBankFactory
|
||||
if (array_key_exists('transaction_currency_id', $data)) {
|
||||
$currency = $this->currencyRepository->find((int)($data['transaction_currency_id'] ?? 0));
|
||||
}
|
||||
$currency ??= $defaultCurrency;
|
||||
$currency ??= $primaryCurrency;
|
||||
|
||||
return $currency;
|
||||
}
|
||||
|
||||
@@ -141,8 +141,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
|
||||
Log::debug(sprintf('getAuditReport: Call finalAccountBalance with date/time "%s"', $date->toIso8601String()));
|
||||
$dayBeforeBalance = Steam::finalAccountBalance($account, $date);
|
||||
$startBalance = $dayBeforeBalance['balance'];
|
||||
$defaultCurrency = app('amount')->getPrimaryCurrencyByUserGroup($account->user->userGroup);
|
||||
$currency = $accountRepository->getAccountCurrency($account) ?? $defaultCurrency;
|
||||
$primaryCurrency = app('amount')->getPrimaryCurrencyByUserGroup($account->user->userGroup);
|
||||
$currency = $accountRepository->getAccountCurrency($account) ?? $primaryCurrency;
|
||||
|
||||
foreach ($journals as $index => $journal) {
|
||||
$journals[$index]['balance_before'] = $startBalance;
|
||||
|
||||
@@ -177,7 +177,7 @@ class StandardMessageGenerator implements MessageGeneratorInterface
|
||||
$accounts = $this->collectAccounts($model);
|
||||
$enrichment = new AccountEnrichment();
|
||||
$enrichment->setUser($model->user);
|
||||
$enrichment->setPrimary(Amount::getPrimaryCurrencyByUserGroup($model->userGroup));
|
||||
$enrichment->setPrimaryCurrency(Amount::getPrimaryCurrencyByUserGroup($model->userGroup));
|
||||
$accounts = $enrichment->enrich($accounts);
|
||||
foreach ($accounts as $account) {
|
||||
$transformer = new AccountTransformer();
|
||||
|
||||
@@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Handlers\Events;
|
||||
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedDefaultCurrency;
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedPrimaryCurrency;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\PiggyBank;
|
||||
use FireflyIII\Models\UserGroup;
|
||||
@@ -38,7 +38,7 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
class PreferencesEventHandler
|
||||
{
|
||||
public function resetPrimaryCurrencyAmounts(UserGroupChangedDefaultCurrency $event): void
|
||||
public function resetPrimaryCurrencyAmounts(UserGroupChangedPrimaryCurrency $event): void
|
||||
{
|
||||
// Reset the primary currency amounts for all objects that have it.
|
||||
Log::debug('Resetting primary currency amounts for all objects.');
|
||||
|
||||
@@ -77,7 +77,7 @@ class CreateController extends Controller
|
||||
$periods[$current] = (string) trans('firefly.repeat_freq_'.$current);
|
||||
}
|
||||
$subTitle = (string) trans('firefly.create_new_bill');
|
||||
$defaultCurrency = $this->primaryCurrency;
|
||||
$primaryCurrency = $this->primaryCurrency;
|
||||
|
||||
// put previous url in session if not redirect from store (not "create another").
|
||||
if (true !== session('bills.create.fromStore')) {
|
||||
@@ -85,7 +85,7 @@ class CreateController extends Controller
|
||||
}
|
||||
$request->session()->forget('bills.create.fromStore');
|
||||
|
||||
return view('bills.create', compact('periods', 'subTitle', 'defaultCurrency'));
|
||||
return view('bills.create', compact('periods', 'subTitle', 'primaryCurrency'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -88,7 +88,7 @@ class EditController extends Controller
|
||||
$bill->amount_min = app('steam')->bcround($bill->amount_min, $bill->transactionCurrency->decimal_places);
|
||||
$bill->amount_max = app('steam')->bcround($bill->amount_max, $bill->transactionCurrency->decimal_places);
|
||||
$rules = $this->repository->getRulesForBill($bill);
|
||||
$defaultCurrency = $this->primaryCurrency;
|
||||
$primaryCurrency = $this->primaryCurrency;
|
||||
|
||||
// code to handle active-checkboxes
|
||||
$hasOldInput = null !== $request->old('_token');
|
||||
@@ -105,7 +105,7 @@ class EditController extends Controller
|
||||
$request->session()->flash('preFilled', $preFilled);
|
||||
$request->session()->forget('bills.edit.fromUpdate');
|
||||
|
||||
return view('bills.edit', compact('subTitle', 'periods', 'rules', 'bill', 'defaultCurrency', 'preFilled'));
|
||||
return view('bills.edit', compact('subTitle', 'periods', 'rules', 'bill', 'primaryCurrency', 'preFilled'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -92,7 +92,7 @@ class IndexController extends Controller
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setConvertToPrimary($this->convertToPrimary);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$enrichment->setStart($tempStart);
|
||||
$enrichment->setEnd($end);
|
||||
$collection = $enrichment->enrich($collection);
|
||||
@@ -101,7 +101,7 @@ class IndexController extends Controller
|
||||
$parameters->set('start', $tempStart);
|
||||
$parameters->set('end', $end);
|
||||
$parameters->set('convertToPrimary', $this->convertToPrimary);
|
||||
$parameters->set('defaultCurrency', $this->primaryCurrency);
|
||||
$parameters->set('primaryCurrency', $this->primaryCurrency);
|
||||
|
||||
/** @var BillTransformer $transformer */
|
||||
$transformer = app(BillTransformer::class);
|
||||
|
||||
@@ -150,7 +150,7 @@ class ShowController extends Controller
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setConvertToPrimary($this->convertToPrimary);
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$enrichment->setStart($start);
|
||||
$enrichment->setEnd($end);
|
||||
$bill = $enrichment->enrichSingle($bill);
|
||||
|
||||
@@ -136,7 +136,7 @@ class IndexController extends Controller
|
||||
|
||||
// get all inactive budgets, and simply list them:
|
||||
$inactive = $this->repository->getInactiveBudgets();
|
||||
$defaultCurrency = $this->primaryCurrency;
|
||||
$primaryCurrency = $this->primaryCurrency;
|
||||
|
||||
return view(
|
||||
'budgets.index',
|
||||
@@ -149,7 +149,7 @@ class IndexController extends Controller
|
||||
'budgets',
|
||||
'currencies',
|
||||
'periodTitle',
|
||||
'defaultCurrency',
|
||||
'primaryCurrency',
|
||||
'activeDaysPassed',
|
||||
'activeDaysLeft',
|
||||
'inactive',
|
||||
@@ -194,7 +194,7 @@ class IndexController extends Controller
|
||||
return $availableBudgets;
|
||||
}
|
||||
|
||||
private function getAllBudgets(Carbon $start, Carbon $end, Collection $currencies, TransactionCurrency $defaultCurrency): array
|
||||
private function getAllBudgets(Carbon $start, Carbon $end, Collection $currencies, TransactionCurrency $primaryCurrency): array
|
||||
{
|
||||
// get all budgets, and paginate them into $budgets.
|
||||
$collection = $this->repository->getActiveBudgets();
|
||||
@@ -216,7 +216,7 @@ class IndexController extends Controller
|
||||
/** @var BudgetLimit $limit */
|
||||
foreach ($budgetLimits as $limit) {
|
||||
Log::debug(sprintf('Working on budget limit #%d', $limit->id));
|
||||
$currency = $limit->transactionCurrency ?? $defaultCurrency;
|
||||
$currency = $limit->transactionCurrency ?? $primaryCurrency;
|
||||
$amount = app('steam')->bcround($limit->amount, $currency->decimal_places);
|
||||
$array['budgeted'][] = [
|
||||
'id' => $limit->id,
|
||||
|
||||
@@ -148,7 +148,7 @@ class IndexController extends Controller
|
||||
// enrich each account.
|
||||
$enrichment = new AccountEnrichment();
|
||||
$enrichment->setUser(auth()->user());
|
||||
$enrichment->setPrimary($this->primaryCurrency);
|
||||
$enrichment->setPrimaryCurrency($this->primaryCurrency);
|
||||
$return = [];
|
||||
|
||||
/** @var PiggyBank $piggy */
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace FireflyIII\Http\Controllers;
|
||||
use JsonException;
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Enums\AccountTypeEnum;
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedDefaultCurrency;
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedPrimaryCurrency;
|
||||
use FireflyIII\Events\Test\UserTestNotificationChannel;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Http\Requests\PreferencesRequest;
|
||||
@@ -271,7 +271,7 @@ class PreferencesController extends Controller
|
||||
// set to true!
|
||||
Log::debug('User sets convertToPrimary to true.');
|
||||
Preferences::set('convert_to_primary', $convertToPrimary);
|
||||
event(new UserGroupChangedDefaultCurrency(auth()->user()->userGroup));
|
||||
event(new UserGroupChangedPrimaryCurrency(auth()->user()->userGroup));
|
||||
}
|
||||
Preferences::set('convert_to_primary', $convertToPrimary);
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ class CreateController extends Controller
|
||||
{
|
||||
$budgets = app('expandedform')->makeSelectListWithEmpty($this->budgetRepos->getActiveBudgets());
|
||||
$bills = app('expandedform')->makeSelectListWithEmpty($this->billRepository->getActiveBills());
|
||||
$defaultCurrency = $this->primaryCurrency;
|
||||
$primaryCurrency = $this->primaryCurrency;
|
||||
$tomorrow = today(config('app.timezone'));
|
||||
$oldRepetitionType = $request->old('repetition_type');
|
||||
$tomorrow->addDay();
|
||||
@@ -116,7 +116,7 @@ class CreateController extends Controller
|
||||
|
||||
return view(
|
||||
'recurring.create',
|
||||
compact('tomorrow', 'oldRepetitionType', 'bills', 'weekendResponses', 'preFilled', 'repetitionEnds', 'defaultCurrency', 'budgets')
|
||||
compact('tomorrow', 'oldRepetitionType', 'bills', 'weekendResponses', 'preFilled', 'repetitionEnds', 'primaryCurrency', 'budgets')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ class CreateController extends Controller
|
||||
{
|
||||
$budgets = app('expandedform')->makeSelectListWithEmpty($this->budgetRepos->getActiveBudgets());
|
||||
$bills = app('expandedform')->makeSelectListWithEmpty($this->billRepository->getActiveBills());
|
||||
$defaultCurrency = $this->primaryCurrency;
|
||||
$primaryCurrency = $this->primaryCurrency;
|
||||
$tomorrow = today(config('app.timezone'));
|
||||
$oldRepetitionType = $request->old('repetition_type');
|
||||
$tomorrow->addDay();
|
||||
@@ -210,7 +210,7 @@ class CreateController extends Controller
|
||||
|
||||
return view(
|
||||
'recurring.create',
|
||||
compact('tomorrow', 'oldRepetitionType', 'bills', 'weekendResponses', 'preFilled', 'repetitionEnds', 'defaultCurrency', 'budgets')
|
||||
compact('tomorrow', 'oldRepetitionType', 'bills', 'weekendResponses', 'preFilled', 'repetitionEnds', 'primaryCurrency', 'budgets')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class CreateController extends Controller
|
||||
$optionalFields = app('preferences')->get('transaction_journal_optional_fields', [])->data;
|
||||
$allowedOpposingTypes = config('firefly.allowed_opposing_types');
|
||||
$accountToTypes = config('firefly.account_to_transaction');
|
||||
$defaultCurrency = $this->primaryCurrency;
|
||||
$primaryCurrency = $this->primaryCurrency;
|
||||
$previousUrl = $this->rememberPreviousUrl('transactions.create.url');
|
||||
$parts = parse_url((string) $previousUrl);
|
||||
$search = sprintf('?%s', $parts['query'] ?? '');
|
||||
@@ -156,7 +156,7 @@ class CreateController extends Controller
|
||||
'objectType',
|
||||
'optionalDateFields',
|
||||
'subTitle',
|
||||
'defaultCurrency',
|
||||
'primaryCurrency',
|
||||
'previousUrl',
|
||||
'optionalFields',
|
||||
'preFilled',
|
||||
|
||||
@@ -84,7 +84,7 @@ class EditController extends Controller
|
||||
$title = $transactionGroup->transactionJournals()->count() > 1 ? $transactionGroup->title : $transactionGroup->transactionJournals()->first()->description;
|
||||
$subTitle = (string) trans('firefly.edit_transaction_title', ['description' => $title]);
|
||||
$subTitleIcon = 'fa-plus';
|
||||
$defaultCurrency = $this->primaryCurrency;
|
||||
$primaryCurrency = $this->primaryCurrency;
|
||||
$cash = $repository->getCashAccount();
|
||||
$previousUrl = $this->rememberPreviousUrl('transactions.edit.url');
|
||||
$parts = parse_url((string) $previousUrl);
|
||||
@@ -130,7 +130,7 @@ class EditController extends Controller
|
||||
'transactionGroup',
|
||||
'allowedOpposingTypes',
|
||||
'accountToTypes',
|
||||
'defaultCurrency',
|
||||
'primaryCurrency',
|
||||
'previousUrl'
|
||||
)
|
||||
);
|
||||
|
||||
@@ -120,7 +120,7 @@ class Range
|
||||
// save some formats:
|
||||
$monthAndDayFormat = (string) trans('config.month_and_day_js', [], $locale);
|
||||
$dateTimeFormat = (string) trans('config.date_time_js', [], $locale);
|
||||
$defaultCurrency = Amount::getPrimaryCurrency();
|
||||
$primaryCurrency = Amount::getPrimaryCurrency();
|
||||
|
||||
// also format for moment JS:
|
||||
$madMomentJS = (string) trans('config.month_and_day_moment_js', [], $locale);
|
||||
@@ -128,7 +128,7 @@ class Range
|
||||
app('view')->share('madMomentJS', $madMomentJS);
|
||||
app('view')->share('monthAndDayFormat', $monthAndDayFormat);
|
||||
app('view')->share('dateTimeFormat', $dateTimeFormat);
|
||||
app('view')->share('defaultCurrency', $defaultCurrency);
|
||||
app('view')->share('primaryCurrency', $primaryCurrency);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -35,7 +35,7 @@ use FireflyIII\Events\Model\PiggyBank\ChangedName;
|
||||
use FireflyIII\Events\Model\Rule\RuleActionFailedOnArray;
|
||||
use FireflyIII\Events\Model\Rule\RuleActionFailedOnObject;
|
||||
use FireflyIII\Events\NewVersionAvailable;
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedDefaultCurrency;
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedPrimaryCurrency;
|
||||
use FireflyIII\Events\RegisteredUser;
|
||||
use FireflyIII\Events\RequestedNewPassword;
|
||||
use FireflyIII\Events\RequestedReportOnJournals;
|
||||
@@ -257,7 +257,7 @@ class EventServiceProvider extends ServiceProvider
|
||||
'FireflyIII\Handlers\Events\Security\MFAHandler@sendMFAFailedAttemptsMail',
|
||||
],
|
||||
// preferences
|
||||
UserGroupChangedDefaultCurrency::class => [
|
||||
UserGroupChangedPrimaryCurrency::class => [
|
||||
'FireflyIII\Handlers\Events\PreferencesEventHandler@resetPrimaryCurrencyAmounts',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\Currency;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedDefaultCurrency;
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedPrimaryCurrency;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Factory\TransactionCurrencyFactory;
|
||||
use FireflyIII\Models\AccountMeta;
|
||||
@@ -438,7 +438,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
|
||||
if ($current->id !== $currency->id) {
|
||||
Log::debug('Trigger on a different default currency.');
|
||||
// clear all primary currency amounts through an event.
|
||||
event(new UserGroupChangedDefaultCurrency($this->userGroup));
|
||||
event(new UserGroupChangedPrimaryCurrency($this->userGroup));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\UserGroups\Currency;
|
||||
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedDefaultCurrency;
|
||||
use FireflyIII\Events\Preferences\UserGroupChangedPrimaryCurrency;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Factory\TransactionCurrencyFactory;
|
||||
use FireflyIII\Models\AccountMeta;
|
||||
@@ -386,7 +386,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
if ($current->id !== $currency->id) {
|
||||
Log::debug('Trigger on a different default currency.');
|
||||
// clear all primary currency amounts through an event.
|
||||
event(new UserGroupChangedDefaultCurrency($this->userGroup));
|
||||
event(new UserGroupChangedPrimaryCurrency($this->userGroup));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class FrontpageChartGenerator
|
||||
use AugumentData;
|
||||
|
||||
public bool $convertToPrimary = false;
|
||||
public TransactionCurrency $defaultCurrency;
|
||||
public TransactionCurrency $primaryCurrency;
|
||||
private AccountRepositoryInterface $accountRepos;
|
||||
private array $currencies;
|
||||
private NoCategoryRepositoryInterface $noCatRepos;
|
||||
|
||||
@@ -61,7 +61,7 @@ class CurrencyForm
|
||||
$classes = $this->getHolderClasses($name);
|
||||
$value = $this->fillFieldValue($name, $value);
|
||||
$options['step'] = 'any';
|
||||
$defaultCurrency = $options['currency'] ?? app('amount')->getPrimaryCurrency();
|
||||
$primaryCurrency = $options['currency'] ?? app('amount')->getPrimaryCurrency();
|
||||
|
||||
/** @var Collection $currencies */
|
||||
$currencies = app('amount')->getCurrencies();
|
||||
@@ -72,15 +72,15 @@ class CurrencyForm
|
||||
$preFilled = [];
|
||||
}
|
||||
$key = 'amount_currency_id_'.$name;
|
||||
$sentCurrencyId = array_key_exists($key, $preFilled) ? (int) $preFilled[$key] : $defaultCurrency->id;
|
||||
$sentCurrencyId = array_key_exists($key, $preFilled) ? (int) $preFilled[$key] : $primaryCurrency->id;
|
||||
|
||||
app('log')->debug(sprintf('Sent currency ID is %d', $sentCurrencyId));
|
||||
|
||||
// find this currency in set of currencies:
|
||||
foreach ($currencies as $currency) {
|
||||
if ($currency->id === $sentCurrencyId) {
|
||||
$defaultCurrency = $currency;
|
||||
app('log')->debug(sprintf('default currency is now %s', $defaultCurrency->code));
|
||||
$primaryCurrency = $currency;
|
||||
app('log')->debug(sprintf('default currency is now %s', $primaryCurrency->code));
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -88,11 +88,11 @@ class CurrencyForm
|
||||
|
||||
// make sure value is formatted nicely:
|
||||
if (null !== $value && '' !== $value) {
|
||||
$value = app('steam')->bcround($value, $defaultCurrency->decimal_places);
|
||||
$value = app('steam')->bcround($value, $primaryCurrency->decimal_places);
|
||||
}
|
||||
|
||||
try {
|
||||
$html = view('form.'.$view, compact('defaultCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render();
|
||||
$html = view('form.'.$view, compact('primaryCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render();
|
||||
} catch (Throwable $e) {
|
||||
app('log')->debug(sprintf('Could not render currencyField(): %s', $e->getMessage()));
|
||||
$html = 'Could not render currencyField.';
|
||||
@@ -129,7 +129,7 @@ class CurrencyForm
|
||||
$classes = $this->getHolderClasses($name);
|
||||
$value = $this->fillFieldValue($name, $value);
|
||||
$options['step'] = 'any';
|
||||
$defaultCurrency = $options['currency'] ?? app('amount')->getPrimaryCurrency();
|
||||
$primaryCurrency = $options['currency'] ?? app('amount')->getPrimaryCurrency();
|
||||
|
||||
/** @var Collection $currencies */
|
||||
$currencies = app('amount')->getAllCurrencies();
|
||||
@@ -141,15 +141,15 @@ class CurrencyForm
|
||||
$preFilled = [];
|
||||
}
|
||||
$key = 'amount_currency_id_'.$name;
|
||||
$sentCurrencyId = array_key_exists($key, $preFilled) ? (int) $preFilled[$key] : $defaultCurrency->id;
|
||||
$sentCurrencyId = array_key_exists($key, $preFilled) ? (int) $preFilled[$key] : $primaryCurrency->id;
|
||||
|
||||
app('log')->debug(sprintf('Sent currency ID is %d', $sentCurrencyId));
|
||||
|
||||
// find this currency in set of currencies:
|
||||
foreach ($currencies as $currency) {
|
||||
if ($currency->id === $sentCurrencyId) {
|
||||
$defaultCurrency = $currency;
|
||||
app('log')->debug(sprintf('default currency is now %s', $defaultCurrency->code));
|
||||
$primaryCurrency = $currency;
|
||||
app('log')->debug(sprintf('default currency is now %s', $primaryCurrency->code));
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -157,11 +157,11 @@ class CurrencyForm
|
||||
|
||||
// make sure value is formatted nicely:
|
||||
if (null !== $value && '' !== $value) {
|
||||
$value = app('steam')->bcround($value, $defaultCurrency->decimal_places);
|
||||
$value = app('steam')->bcround($value, $primaryCurrency->decimal_places);
|
||||
}
|
||||
|
||||
try {
|
||||
$html = view('form.'.$view, compact('defaultCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render();
|
||||
$html = view('form.'.$view, compact('primaryCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render();
|
||||
} catch (Throwable $e) {
|
||||
app('log')->debug(sprintf('Could not render currencyField(): %s', $e->getMessage()));
|
||||
$html = 'Could not render currencyField.';
|
||||
|
||||
@@ -202,7 +202,7 @@ trait AugumentData
|
||||
$currency = $entry->transactionCurrency;
|
||||
if ($this->convertToPrimary) {
|
||||
// the sumExpenses method already handles this.
|
||||
$currency = $this->defaultCurrency;
|
||||
$currency = $this->primaryCurrency;
|
||||
}
|
||||
|
||||
// clone because these objects change each other.
|
||||
|
||||
@@ -113,7 +113,7 @@ class Steam
|
||||
|
||||
if (!$convertToPrimary) {
|
||||
if (!$currency instanceof TransactionCurrency) {
|
||||
Log::debug(sprintf('Unset pc_balance and make defaultCurrency balance the balance for account #%d', $account->id));
|
||||
Log::debug(sprintf('Unset pc_balance and make primaryCurrency balance the balance for account #%d', $account->id));
|
||||
$set['balance'] = $set[$primaryCurrency->code] ?? '0';
|
||||
unset($set[$primaryCurrency->code]);
|
||||
}
|
||||
|
||||
@@ -224,9 +224,9 @@ trait TransactionValidation
|
||||
|
||||
/** @var AccountRepository $accountRepository */
|
||||
$accountRepository = app(AccountRepositoryInterface::class);
|
||||
$defaultCurrency = app('amount')->getPrimaryCurrency();
|
||||
$sourceCurrency = $accountRepository->getAccountCurrency($source) ?? $defaultCurrency;
|
||||
$destinationCurrency = $accountRepository->getAccountCurrency($destination) ?? $defaultCurrency;
|
||||
$primaryCurrency = app('amount')->getPrimaryCurrency();
|
||||
$sourceCurrency = $accountRepository->getAccountCurrency($source) ?? $primaryCurrency;
|
||||
$destinationCurrency = $accountRepository->getAccountCurrency($destination) ?? $primaryCurrency;
|
||||
// if both accounts have the same currency, continue.
|
||||
if ($sourceCurrency->code === $destinationCurrency->code) {
|
||||
Log::debug('Both accounts have the same currency, continue.');
|
||||
|
||||
@@ -79,7 +79,7 @@ return [
|
||||
// see cer.php for exchange rates feature flag.
|
||||
],
|
||||
'version' => 'develop/2025-08-01',
|
||||
'build_time' => 1754046504,
|
||||
'build_time' => 1754069106,
|
||||
'api_version' => '2.1.0', // field is no longer used.
|
||||
'db_version' => 26,
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"administrations_page_title": "Finanzverwaltungen",
|
||||
"administrations_index_menu": "Finanzverwaltung",
|
||||
"expires_at": "G\u00fcltig bis",
|
||||
"temp_administrations_introduction": "Firefly III will soon get the ability to manage multiple financial administrations. Right now, you only have the one. You can set the title of this administration and its primary currency. This replaces the previous setting where you would set your \"default currency\". This setting is now tied to the financial administration and can be different per administration.",
|
||||
"administration_currency_form_help": "It may take a long time for the page to load if you change the primary currency because transaction may need to be converted to your (new) primary currency.",
|
||||
"temp_administrations_introduction": "Firefly III erh\u00e4lt in K\u00fcrze die M\u00f6glichkeit, mehrere Finanzverwaltungen zu verwalten. Derzeit ist nur eine einzige verf\u00fcgbar. Sie k\u00f6nnen den Titel dieser Verwaltung und ihre Landesw\u00e4hrung festlegen. Dies ersetzt die bisherige Einstellung, bei der Sie Ihre \u201eStandardw\u00e4hrung\u201c festlegen mussten. Diese Einstellung ist nun an die Finanzverwaltung gebunden und kann je nach Verwaltung unterschiedlich sein.",
|
||||
"administration_currency_form_help": "Das Laden der Seite kann lange dauern, wenn Sie die Hauptw\u00e4hrung \u00e4ndern, da Buchungen m\u00f6glicherweise in Ihre (neue) Hauptw\u00e4hrung umgerechnet werden m\u00fcssen.",
|
||||
"administrations_page_edit_sub_title_js": "Finanzverwaltung \u201e{title}\u201c bearbeiten",
|
||||
"table": "Tabelle",
|
||||
"welcome_back": "\u00dcberblick",
|
||||
@@ -102,7 +102,7 @@
|
||||
"profile_oauth_client_secret_title": "Client Secret",
|
||||
"profile_oauth_client_secret_expl": "Hier ist Ihr neuer pers\u00f6nlicher Zugangsschl\u00fcssel. Dies ist das einzige Mal, dass er angezeigt wird, also verlieren Sie ihn nicht! Sie k\u00f6nnen diesen Token jetzt verwenden, um API-Anfragen zu stellen.",
|
||||
"profile_oauth_confidential": "Vertraulich",
|
||||
"profile_oauth_confidential_help": "Require the client to authenticate with a secret. Confidential clients can hold credentials in a secure way without exposing them to unauthorized parties. Public applications, such as primary desktop or JavaScript SPA applications, are unable to hold secrets securely.",
|
||||
"profile_oauth_confidential_help": "Verlangen Sie vom Client, sich mit einem Geheimnis zu authentifizieren. Vertrauliche Clients k\u00f6nnen Anmeldedaten auf sichere Weise speichern, ohne sie Unbefugten zug\u00e4nglich zu machen. \u00d6ffentliche Anwendungen, wie prim\u00e4re Desktop- oder JavaScript-SPA-Anwendungen, sind nicht f\u00e4hig, Geheimnisse sicher zu speichern.",
|
||||
"multi_account_warning_unknown": "Abh\u00e4ngig von der Art der Buchung, die Sie anlegen, kann das Quell- und\/oder Zielkonto nachfolgender Aufteilungen durch das \u00fcberschrieben werden, was in der ersten Aufteilung der Buchung definiert wurde.",
|
||||
"multi_account_warning_withdrawal": "Bedenken Sie, dass das Quellkonto nachfolgender Aufteilungen von dem, was in der ersten Aufteilung der Abhebung definiert ist, au\u00dfer Kraft gesetzt wird.",
|
||||
"multi_account_warning_deposit": "Bedenken Sie, dass das Zielkonto nachfolgender Aufteilungen von dem, was in der ersten Aufteilung der Einnahmen definiert ist, au\u00dfer Kraft gesetzt wird.",
|
||||
@@ -154,7 +154,7 @@
|
||||
"url": "URL",
|
||||
"active": "Aktiv",
|
||||
"interest_date": "Zinstermin",
|
||||
"administration_currency": "Primary currency",
|
||||
"administration_currency": "Standardw\u00e4hrung",
|
||||
"title": "Titel",
|
||||
"date": "Datum",
|
||||
"book_date": "Buchungsdatum",
|
||||
@@ -174,7 +174,7 @@
|
||||
"list": {
|
||||
"title": "Titel",
|
||||
"active": "Aktiv?",
|
||||
"primary_currency": "Primary currency",
|
||||
"primary_currency": "Standardw\u00e4hrung",
|
||||
"trigger": "Ausl\u00f6ser",
|
||||
"response": "Antwort",
|
||||
"delivery": "Zustellung",
|
||||
|
||||
Reference in New Issue
Block a user