🤖 Auto commit for release 'develop' on 2025-12-22

This commit is contained in:
JC5
2025-12-22 04:36:14 +01:00
parent 92a535c644
commit bc4018481f
45 changed files with 303 additions and 272 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] = \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);
$sums[$currencyId] = Amount::formatAnything($currency, $sums[$currencyId], false);
$incomes[$currencyId] = Amount::formatAnything($currency, $incomes[$currencyId] ?? '0', false);
$expenses[$currencyId] = Amount::formatAnything($currency, $expenses[$currencyId] ?? '0', false);
}
if (0 === count($sums)) {
$currency = $this->primaryCurrency;
$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);
$sums[$this->primaryCurrency->id] = Amount::formatAnything($this->primaryCurrency, '0', false);
$incomes[$this->primaryCurrency->id] = Amount::formatAnything($this->primaryCurrency, '0', false);
$expenses[$this->primaryCurrency->id] = Amount::formatAnything($this->primaryCurrency, '0', false);
}
$response = [
@@ -187,7 +187,7 @@ class BoxController extends Controller
if ('primary' === $key) {
continue;
}
$return[$data['currency_id']] = \FireflyIII\Support\Facades\Amount::formatFlat($data['currency_symbol'], $data['currency_decimal_places'], $data['balance'], false);
$return[$data['currency_id']] = Amount::formatFlat($data['currency_symbol'], $data['currency_decimal_places'], $data['balance'], false);
}
$return = [
'net_worths' => array_values($return),

View File

@@ -33,6 +33,7 @@ use FireflyIII\Repositories\Budget\BudgetLimitRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Support\Http\Controllers\DateCalculation;
use Illuminate\Http\JsonResponse;
use FireflyIII\Support\Facades\Amount;
/**
* Class BudgetController
@@ -84,9 +85,9 @@ class BudgetController extends Controller
return response()->json(
[
'budgeted' => $budgeted,
'budgeted_formatted' => \FireflyIII\Support\Facades\Amount::formatAnything($currency, $budgeted, true),
'budgeted_formatted' => Amount::formatAnything($currency, $budgeted, true),
'available' => $available,
'available_formatted' => \FireflyIII\Support\Facades\Amount::formatAnything($currency, $available, true),
'available_formatted' => Amount::formatAnything($currency, $available, true),
'percentage' => $percentage,
'currency_id' => $currency->id,
'currency_code' => $currency->code,