mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-17 20:08:52 +00:00
Update reference to Steam
This commit is contained in:
@@ -148,9 +148,9 @@ class EditController extends Controller
|
||||
'BIC' => $repository->getMetaValue($account, 'BIC'),
|
||||
'opening_balance_date' => substr((string) $openingBalanceDate, 0, 10),
|
||||
'liability_type_id' => $account->account_type_id,
|
||||
'opening_balance' => app('steam')->bcround($openingBalanceAmount, $currency->decimal_places),
|
||||
'opening_balance' => \FireflyIII\Support\Facades\Steam::bcround($openingBalanceAmount, $currency->decimal_places),
|
||||
'liability_direction' => $this->repository->getMetaValue($account, 'liability_direction'),
|
||||
'virtual_balance' => app('steam')->bcround($virtualBalance, $currency->decimal_places),
|
||||
'virtual_balance' => \FireflyIII\Support\Facades\Steam::bcround($virtualBalance, $currency->decimal_places),
|
||||
'currency_id' => $currency->id,
|
||||
'include_net_worth' => $hasOldInput ? (bool) $request->old('include_net_worth') : $includeNetWorth,
|
||||
'interest' => $repository->getMetaValue($account, 'interest'),
|
||||
|
||||
@@ -84,8 +84,8 @@ class EditController extends Controller
|
||||
$this->rememberPreviousUrl('bills.edit.url');
|
||||
}
|
||||
|
||||
$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);
|
||||
$bill->amount_min = \FireflyIII\Support\Facades\Steam::bcround($bill->amount_min, $bill->transactionCurrency->decimal_places);
|
||||
$bill->amount_max = \FireflyIII\Support\Facades\Steam::bcround($bill->amount_max, $bill->transactionCurrency->decimal_places);
|
||||
$rules = $this->repository->getRulesForBill($bill);
|
||||
|
||||
// code to handle active-checkboxes
|
||||
|
||||
@@ -274,7 +274,7 @@ class BudgetLimitController extends Controller
|
||||
$array['left_per_day'] = 0 === $daysLeft ? bcadd((string) $array['spent'], (string) $array['amount']) : bcdiv(bcadd((string) $array['spent'], (string) $array['amount']), $array['days_left']);
|
||||
|
||||
// left per day formatted.
|
||||
$array['amount'] = app('steam')->bcround($limit['amount'], $limit->transactionCurrency->decimal_places);
|
||||
$array['amount'] = \FireflyIII\Support\Facades\Steam::bcround($limit['amount'], $limit->transactionCurrency->decimal_places);
|
||||
$array['left_per_day_formatted'] = app('amount')->formatAnything($limit->transactionCurrency, $array['left_per_day']);
|
||||
if ('true' === $request->get('redirect')) {
|
||||
return redirect(route('budgets.index'));
|
||||
|
||||
@@ -104,7 +104,7 @@ class EditController extends Controller
|
||||
$amount = '0';
|
||||
}
|
||||
$amount = (string) $amount;
|
||||
$preFilled['auto_budget_amount'] = app('steam')->bcround($amount, $autoBudget->transactionCurrency->decimal_places);
|
||||
$preFilled['auto_budget_amount'] = \FireflyIII\Support\Facades\Steam::bcround($amount, $autoBudget->transactionCurrency->decimal_places);
|
||||
}
|
||||
|
||||
// put previous url in session if not redirect from store (not "return_to_edit").
|
||||
|
||||
@@ -203,7 +203,7 @@ class IndexController extends Controller
|
||||
foreach ($budgetLimits as $limit) {
|
||||
Log::debug(sprintf('Working on budget limit #%d', $limit->id));
|
||||
$currency = $limit->transactionCurrency ?? $primaryCurrency;
|
||||
$amount = app('steam')->bcround($limit->amount, $currency->decimal_places);
|
||||
$amount = \FireflyIII\Support\Facades\Steam::bcround($limit->amount, $currency->decimal_places);
|
||||
$array['budgeted'][] = [
|
||||
'id' => $limit->id,
|
||||
'amount' => $amount,
|
||||
|
||||
@@ -113,7 +113,7 @@ class BillController extends Controller
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get());
|
||||
}
|
||||
$locale = app('steam')->getLocale();
|
||||
$locale = \FireflyIII\Support\Facades\Steam::getLocale();
|
||||
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
|
||||
@@ -166,7 +166,7 @@ class BudgetController extends Controller
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get());
|
||||
}
|
||||
$locale = app('steam')->getLocale();
|
||||
$locale = \FireflyIII\Support\Facades\Steam::getLocale();
|
||||
$entries = [];
|
||||
$amount = $budgetLimit->amount ?? '0';
|
||||
$budgetCollection = new Collection()->push($budget);
|
||||
@@ -531,13 +531,13 @@ class BudgetController extends Controller
|
||||
// get budget limit in this period for this currency.
|
||||
$limit = $this->blRepository->find($budget, $currency, $currentStart, $currentEnd);
|
||||
if ($limit instanceof BudgetLimit) {
|
||||
$chartData[1]['entries'][$title] = app('steam')->bcround($limit->amount, $currency->decimal_places);
|
||||
$chartData[1]['entries'][$title] = \FireflyIII\Support\Facades\Steam::bcround($limit->amount, $currency->decimal_places);
|
||||
}
|
||||
|
||||
// get spent amount in this period for this currency.
|
||||
$sum = $this->opsRepository->sumExpenses($currentStart, $currentEnd, $accounts, new Collection()->push($budget), $currency);
|
||||
$amount = app('steam')->positive($sum[$currency->id]['sum'] ?? '0');
|
||||
$chartData[0]['entries'][$title] = app('steam')->bcround($amount, $currency->decimal_places);
|
||||
$amount = \FireflyIII\Support\Facades\Steam::positive($sum[$currency->id]['sum'] ?? '0');
|
||||
$chartData[0]['entries'][$title] = \FireflyIII\Support\Facades\Steam::bcround($amount, $currency->decimal_places);
|
||||
|
||||
$currentStart = clone $currentEnd;
|
||||
$currentStart->addDay()->startOfDay();
|
||||
@@ -574,8 +574,8 @@ class BudgetController extends Controller
|
||||
$currentEnd = Navigation::endOfPeriod($currentStart, $preferredRange);
|
||||
$title = $currentStart->isoFormat($titleFormat);
|
||||
$sum = $this->nbRepository->sumExpenses($currentStart, $currentEnd, $accounts, $currency);
|
||||
$amount = app('steam')->positive($sum[$currency->id]['sum'] ?? '0');
|
||||
$chartData[$title] = app('steam')->bcround($amount, $currency->decimal_places);
|
||||
$amount = \FireflyIII\Support\Facades\Steam::positive($sum[$currency->id]['sum'] ?? '0');
|
||||
$chartData[$title] = \FireflyIII\Support\Facades\Steam::bcround($amount, $currency->decimal_places);
|
||||
$currentStart = Navigation::addPeriod($currentStart, $preferredRange, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ class PiggyBankController extends Controller
|
||||
}
|
||||
$set = $repository->getEvents($piggyBank);
|
||||
$set = $set->reverse();
|
||||
$locale = app('steam')->getLocale();
|
||||
$locale = \FireflyIII\Support\Facades\Steam::getLocale();
|
||||
|
||||
// get first event or start date of piggy bank or today
|
||||
$startDate = $piggyBank->start_date ?? today(config('app.timezone'));
|
||||
|
||||
@@ -105,7 +105,7 @@ class JavascriptController extends Controller
|
||||
if ($account instanceof Account) {
|
||||
$currency = $repository->getAccountCurrency($account) ?? $this->primaryCurrency;
|
||||
}
|
||||
$locale = app('steam')->getLocale();
|
||||
$locale = \FireflyIII\Support\Facades\Steam::getLocale();
|
||||
$accounting = app('amount')->getJsConfig();
|
||||
$accounting['frac_digits'] = $currency->decimal_places;
|
||||
$pref = Preferences::get('language', config('firefly.default_language', 'en_US'));
|
||||
|
||||
@@ -278,9 +278,9 @@ class ReconcileController extends Controller
|
||||
}
|
||||
|
||||
if ($inverse) {
|
||||
$journal['amount'] = app('steam')->positive($journal['amount']);
|
||||
$journal['amount'] = \FireflyIII\Support\Facades\Steam::positive($journal['amount']);
|
||||
if (null !== $journal['foreign_amount']) {
|
||||
$journal['foreign_amount'] = app('steam')->positive($journal['foreign_amount']);
|
||||
$journal['foreign_amount'] = \FireflyIII\Support\Facades\Steam::positive($journal['foreign_amount']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ class RecurrenceController extends Controller
|
||||
}
|
||||
$date->startOfDay();
|
||||
$preSelected = (string) $request->get('pre_select');
|
||||
$locale = app('steam')->getLocale();
|
||||
$locale = \FireflyIII\Support\Facades\Steam::getLocale();
|
||||
|
||||
Log::debug(sprintf('date = %s, today = %s. date > today? %s', $date->toAtomString(), $today->toAtomString(), var_export($date > $today, true)));
|
||||
Log::debug(sprintf('past = true? %s', var_export('true' === (string) $request->get('past'), true)));
|
||||
|
||||
@@ -89,7 +89,7 @@ class EditController extends Controller
|
||||
$preFilled = [
|
||||
'name' => $piggyBank->name,
|
||||
'transaction_currency_id' => (int) $piggyBank->transaction_currency_id,
|
||||
'target_amount' => app('steam')->bcround($piggyBank->target_amount, $piggyBank->transactionCurrency->decimal_places),
|
||||
'target_amount' => \FireflyIII\Support\Facades\Steam::bcround($piggyBank->target_amount, $piggyBank->transactionCurrency->decimal_places),
|
||||
'target_date' => $targetDate,
|
||||
'start_date' => $startDate,
|
||||
'accounts' => [],
|
||||
|
||||
@@ -108,7 +108,7 @@ class PreferencesController extends Controller
|
||||
if (!is_array($frontpageAccounts)) {
|
||||
$frontpageAccounts = $accountIds;
|
||||
}
|
||||
$language = app('steam')->getLanguage();
|
||||
$language = \FireflyIII\Support\Facades\Steam::getLanguage();
|
||||
$languages = config('firefly.languages');
|
||||
$locale = Preferences::get('locale', config('firefly.default_locale', 'equal'))->data;
|
||||
$listPageSize = Preferences::get('listPageSize', 50)->data;
|
||||
|
||||
@@ -83,7 +83,7 @@ class DeleteController extends Controller
|
||||
}
|
||||
$objectType = strtolower($journal->transaction_type_type ?? $journal->transactionType->type);
|
||||
$subTitle = (string) trans('firefly.delete_'.$objectType, ['description' => $group->title ?? $journal->description]);
|
||||
$previous = app('steam')->getSafePreviousUrl();
|
||||
$previous = \FireflyIII\Support\Facades\Steam::getSafePreviousUrl();
|
||||
// put previous url in session
|
||||
Log::debug('Will try to remember previous URL');
|
||||
$this->rememberPreviousUrl('transactions.delete.url');
|
||||
|
||||
@@ -145,6 +145,6 @@ class LinkController extends Controller
|
||||
$linkId = (int) $request->get('id');
|
||||
$this->repository->switchLinkById($linkId);
|
||||
|
||||
return redirect(app('steam')->getSafePreviousUrl());
|
||||
return redirect(\FireflyIII\Support\Facades\Steam::getSafePreviousUrl());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,9 +142,9 @@ class MassController extends Controller
|
||||
|
||||
// reverse amounts
|
||||
foreach ($journals as $index => $journal) {
|
||||
$journals[$index]['amount'] = app('steam')->bcround(app('steam')->positive($journal['amount']), $journal['currency_decimal_places']);
|
||||
$journals[$index]['amount'] = \FireflyIII\Support\Facades\Steam::bcround(\FireflyIII\Support\Facades\Steam::positive($journal['amount']), $journal['currency_decimal_places']);
|
||||
$journals[$index]['foreign_amount'] = null === $journal['foreign_amount']
|
||||
? null : app('steam')->positive($journal['foreign_amount']);
|
||||
? null : \FireflyIII\Support\Facades\Steam::positive($journal['foreign_amount']);
|
||||
}
|
||||
|
||||
$this->rememberPreviousUrl('transactions.mass-edit.url');
|
||||
|
||||
Reference in New Issue
Block a user