mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 22:58:09 +00:00
Rename default to primary
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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'
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user