mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-21 11:45:14 +00:00
Some TODO's for the future.
This commit is contained in:
@@ -125,6 +125,7 @@ class OtherCurrenciesCorrections extends Command
|
||||
if (isset($this->accountCurrencies[$accountId]) && $this->accountCurrencies[$accountId] instanceof TransactionCurrency) {
|
||||
return $this->accountCurrencies[$accountId]; // @codeCoverageIgnore
|
||||
}
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id');
|
||||
$result = $this->currencyRepos->findNull($currencyId);
|
||||
if (null === $result) {
|
||||
|
@@ -147,6 +147,7 @@ class TransferCurrenciesCorrections extends Command
|
||||
if (isset($this->accountCurrencies[$accountId]) && $this->accountCurrencies[$accountId] instanceof TransactionCurrency) {
|
||||
return $this->accountCurrencies[$accountId]; // @codeCoverageIgnore
|
||||
}
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id');
|
||||
$result = $this->currencyRepos->findNull($currencyId);
|
||||
if (null === $result) {
|
||||
|
@@ -109,6 +109,7 @@ class JavascriptController extends Controller
|
||||
$account = $repository->findNull((int)$request->get('account'));
|
||||
$currencyId = 0;
|
||||
if (null !== $account) {
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$repository->getMetaValue($account, 'currency_id');
|
||||
}
|
||||
/** @var TransactionCurrency $currency */
|
||||
|
@@ -94,6 +94,7 @@ class PiggyBankController extends Controller
|
||||
|
||||
// get currency:
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
|
||||
if ($currencyId > 0) {
|
||||
$currency = $this->currencyRepos->findNull($currencyId);
|
||||
@@ -120,6 +121,7 @@ class PiggyBankController extends Controller
|
||||
|
||||
// get currency:
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
|
||||
if ($currencyId > 0) {
|
||||
$currency = $this->currencyRepos->findNull($currencyId);
|
||||
@@ -298,6 +300,7 @@ class PiggyBankController extends Controller
|
||||
{
|
||||
$amount = $request->get('amount') ?? '0';
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
|
||||
if ($currencyId > 0) {
|
||||
$currency = $this->currencyRepos->findNull($currencyId);
|
||||
@@ -340,6 +343,7 @@ class PiggyBankController extends Controller
|
||||
{
|
||||
$amount = $request->get('amount') ?? '0';
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
|
||||
if ($currencyId > 0) {
|
||||
$currency = $this->currencyRepos->findNull($currencyId);
|
||||
@@ -383,6 +387,7 @@ class PiggyBankController extends Controller
|
||||
$repetition = $this->piggyRepos->getRepetition($piggyBank);
|
||||
// get currency:
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
|
||||
if ($currencyId > 0) {
|
||||
$currency = $this->currencyRepos->findNull($currencyId);
|
||||
@@ -403,6 +408,7 @@ class PiggyBankController extends Controller
|
||||
$repetition = $this->piggyRepos->getRepetition($piggyBank);
|
||||
// get currency:
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepos->getMetaValue($piggyBank->account, 'currency_id');
|
||||
if ($currencyId > 0) {
|
||||
$currency = $this->currencyRepos->findNull($currencyId);
|
||||
|
@@ -75,6 +75,7 @@ trait ChartGeneration
|
||||
$chartData = [];
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currency = $repository->findNull((int)$accountRepos->getMetaValue($account, 'currency_id'));
|
||||
if (null === $currency) {
|
||||
$currency = $default;
|
||||
|
@@ -154,6 +154,7 @@ class ChooseAccountsHandler implements BunqJobConfigurationInterface
|
||||
/** @var AccountModel $localAccount */
|
||||
foreach ($collection as $localAccount) {
|
||||
$accountId = $localAccount->id;
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepository->getMetaValue($localAccount, 'currency_id');
|
||||
$currency = $this->getCurrency($currencyId);
|
||||
$localAccounts[$accountId] = [
|
||||
|
@@ -157,6 +157,7 @@ class ChooseAccountsHandler implements SpectreJobConfigurationInterface
|
||||
/** @var AccountModel $account */
|
||||
foreach ($accounts as $account) {
|
||||
$accountId = $account->id;
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepository->getMetaValue($account, 'currency_id');
|
||||
$currency = $this->getCurrency($currencyId);
|
||||
$array[$accountId] = [
|
||||
|
@@ -127,6 +127,7 @@ class SelectAccountsHandler implements YnabJobConfigurationInterface
|
||||
/** @var Account $account */
|
||||
foreach ($ffAccounts as $account) {
|
||||
$accountId = $account->id;
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepository->getMetaValue($account, 'currency_id');
|
||||
$currency = $this->getCurrency($currencyId);
|
||||
$array[$accountId] = [
|
||||
|
@@ -170,6 +170,7 @@ class SelectBudgetHandler implements YnabJobConfigurationInterface
|
||||
}
|
||||
/** @var Account $account */
|
||||
foreach ($this->accounts as $account) {
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepository->getMetaValue($account, 'currency_id');
|
||||
Log::debug(sprintf('Currency of %s is %d (looking for %d).', $account->name, $currencyId, $currency->id));
|
||||
if ($currencyId === $currency->id) {
|
||||
|
@@ -75,6 +75,7 @@ class PiggyBankEventTransformer extends AbstractTransformer
|
||||
$this->piggyRepos->setUser($account->user);
|
||||
|
||||
// get associated currency or fall back to the default:
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->repository->getMetaValue($account, 'currency_id');
|
||||
$currency = $this->currencyRepos->findNull($currencyId);
|
||||
if (null === $currency) {
|
||||
|
@@ -77,6 +77,7 @@ class PiggyBankTransformer extends AbstractTransformer
|
||||
$this->piggyRepos->setUser($account->user);
|
||||
|
||||
// get currency from account, or use default.
|
||||
// TODO we can use getAccountCurrency() instead
|
||||
$currencyId = (int)$this->accountRepos->getMetaValue($account, 'currency_id');
|
||||
$currency = $this->currencyRepos->findNull($currencyId);
|
||||
if (null === $currency) {
|
||||
|
Reference in New Issue
Block a user