mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
[chore] fix phpstan errors.
This commit is contained in:
@@ -355,7 +355,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
if (AccountTypeEnum::ASSET->value !== $account->accountType->type) {
|
||||
throw new FireflyException(sprintf('%s is not an asset account.', $account->name));
|
||||
}
|
||||
$currency = $this->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency();
|
||||
$currency = $this->getAccountCurrency($account) ?? app('amount')->getNativeCurrency();
|
||||
$name = trans('firefly.reconciliation_account_name', ['name' => $account->name, 'currency' => $currency->code]);
|
||||
|
||||
/** @var AccountType $type */
|
||||
|
@@ -275,7 +275,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
];
|
||||
$result[$currencyId]['sum'] = bcadd($result[$currencyId]['sum'], $transaction->amount);
|
||||
$result[$currencyId]['native_sum'] = bcadd($result[$currencyId]['native_sum'], $transaction->native_amount ?? '0');
|
||||
if ($journal->foreign_currency_id === Amount::getDefaultCurrency()->id) {
|
||||
if ($journal->foreign_currency_id === Amount::getNativeCurrency()->id) {
|
||||
$result[$currencyId]['native_sum'] = bcadd($result[$currencyId]['native_sum'], $transaction->amount);
|
||||
}
|
||||
++$result[$currencyId]['count'];
|
||||
@@ -406,7 +406,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
];
|
||||
$result[$currencyId]['sum'] = bcadd($result[$currencyId]['sum'], $transaction->amount);
|
||||
$result[$currencyId]['native_sum'] = bcadd($result[$currencyId]['native_sum'], $transaction->native_amount ?? '0');
|
||||
if ($journal->foreign_currency_id === Amount::getDefaultCurrency()->id) {
|
||||
if ($journal->foreign_currency_id === Amount::getNativeCurrency()->id) {
|
||||
$result[$currencyId]['native_sum'] = bcadd($result[$currencyId]['native_sum'], $transaction->amount);
|
||||
}
|
||||
++$result[$currencyId]['count'];
|
||||
@@ -530,7 +530,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
$bills = $this->getActiveBills();
|
||||
$return = [];
|
||||
$convertToNative = Amount::convertToNative($this->user);
|
||||
$default = app('amount')->getDefaultCurrency();
|
||||
$default = app('amount')->getNativeCurrency();
|
||||
|
||||
/** @var Bill $bill */
|
||||
foreach ($bills as $bill) {
|
||||
@@ -575,7 +575,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
$bills = $this->getActiveBills();
|
||||
$return = [];
|
||||
$convertToNative = Amount::convertToNative($this->user);
|
||||
$default = app('amount')->getDefaultCurrency();
|
||||
$default = app('amount')->getNativeCurrency();
|
||||
|
||||
/** @var Bill $bill */
|
||||
foreach ($bills as $bill) {
|
||||
|
@@ -142,7 +142,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface
|
||||
|
||||
// use native amount if necessary?
|
||||
$convertToNative = Amount::convertToNative($this->user);
|
||||
$default = Amount::getDefaultCurrency();
|
||||
$default = Amount::getNativeCurrency();
|
||||
|
||||
/** @var AvailableBudget $availableBudget */
|
||||
foreach ($availableBudgets as $availableBudget) {
|
||||
|
@@ -89,7 +89,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
$limitRepository = app(BudgetLimitRepository::class);
|
||||
$limitRepository->setUser($this->user);
|
||||
$budgets = $this->getActiveBudgets();
|
||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||
$defaultCurrency = app('amount')->getNativeCurrency();
|
||||
$converter = new ExchangeRateConverter();
|
||||
|
||||
/** @var Budget $budget */
|
||||
|
@@ -364,7 +364,7 @@ class OperationsRepository implements OperationsRepositoryInterface
|
||||
$collector->setCategories($categories);
|
||||
$journals = $collector->getExtractedJournals();
|
||||
$convertToNative = Amount::convertToNative($this->user);
|
||||
$default = Amount::getDefaultCurrency();
|
||||
$default = Amount::getNativeCurrency();
|
||||
$array = [];
|
||||
|
||||
foreach ($journals as $journal) {
|
||||
|
@@ -69,7 +69,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
{
|
||||
Log::debug(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
|
||||
$bills = $this->getActiveBills();
|
||||
$default = app('amount')->getDefaultCurrency();
|
||||
$default = app('amount')->getNativeCurrency();
|
||||
$return = [];
|
||||
$converter = new ExchangeRateConverter();
|
||||
|
||||
@@ -139,7 +139,7 @@ class BillRepository implements BillRepositoryInterface
|
||||
Log::debug(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
|
||||
$bills = $this->getActiveBills();
|
||||
$return = [];
|
||||
$default = app('amount')->getDefaultCurrency();
|
||||
$default = app('amount')->getNativeCurrency();
|
||||
$converter = new ExchangeRateConverter();
|
||||
|
||||
/** @var Bill $bill */
|
||||
|
@@ -42,7 +42,7 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface
|
||||
Log::debug(sprintf('Created new ExchangeRateConverter in %s', __METHOD__));
|
||||
$return = [];
|
||||
$converter = new ExchangeRateConverter();
|
||||
$default = app('amount')->getDefaultCurrency();
|
||||
$default = app('amount')->getNativeCurrency();
|
||||
$availableBudgets = $this->userGroup->availableBudgets()
|
||||
->where('start_date', $start->format('Y-m-d'))
|
||||
->where('end_date', $end->format('Y-m-d'))->get()
|
||||
|
Reference in New Issue
Block a user