Replace calls to Amount facade.

This commit is contained in:
James Cole
2025-12-20 08:21:05 +01:00
parent c63f4a941b
commit 340540bd5a
39 changed files with 77 additions and 77 deletions

View File

@@ -121,15 +121,15 @@ class BoxController extends Controller
$keys = array_keys($sums);
foreach ($keys as $currencyId) {
$currency = $repository->find($currencyId);
$sums[$currencyId] = app('amount')->formatAnything($currency, $sums[$currencyId], false);
$incomes[$currencyId] = app('amount')->formatAnything($currency, $incomes[$currencyId] ?? '0', false);
$expenses[$currencyId] = app('amount')->formatAnything($currency, $expenses[$currencyId] ?? '0', false);
$sums[$currencyId] = \FireflyIII\Support\Facades\Amount::formatAnything($currency, $sums[$currencyId], false);
$incomes[$currencyId] = \FireflyIII\Support\Facades\Amount::formatAnything($currency, $incomes[$currencyId] ?? '0', false);
$expenses[$currencyId] = \FireflyIII\Support\Facades\Amount::formatAnything($currency, $expenses[$currencyId] ?? '0', false);
}
if (0 === count($sums)) {
$currency = $this->primaryCurrency;
$sums[$this->primaryCurrency->id] = app('amount')->formatAnything($this->primaryCurrency, '0', false);
$incomes[$this->primaryCurrency->id] = app('amount')->formatAnything($this->primaryCurrency, '0', false);
$expenses[$this->primaryCurrency->id] = app('amount')->formatAnything($this->primaryCurrency, '0', false);
$sums[$this->primaryCurrency->id] = \FireflyIII\Support\Facades\Amount::formatAnything($this->primaryCurrency, '0', false);
$incomes[$this->primaryCurrency->id] = \FireflyIII\Support\Facades\Amount::formatAnything($this->primaryCurrency, '0', false);
$expenses[$this->primaryCurrency->id] = \FireflyIII\Support\Facades\Amount::formatAnything($this->primaryCurrency, '0', false);
}
$response = [
@@ -187,7 +187,7 @@ class BoxController extends Controller
if ('primary' === $key) {
continue;
}
$return[$data['currency_id']] = app('amount')->formatFlat($data['currency_symbol'], $data['currency_decimal_places'], $data['balance'], false);
$return[$data['currency_id']] = \FireflyIII\Support\Facades\Amount::formatFlat($data['currency_symbol'], $data['currency_decimal_places'], $data['balance'], false);
}
$return = [
'net_worths' => array_values($return),