mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 04:19:12 +00:00
🤖 Auto commit for release 'develop' on 2025-12-17
This commit is contained in:
@@ -44,6 +44,7 @@ use FireflyIII\Support\Http\Controllers\DateCalculation;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
|
||||
/**
|
||||
* Class BudgetController.
|
||||
@@ -166,7 +167,7 @@ class BudgetController extends Controller
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get());
|
||||
}
|
||||
$locale = \FireflyIII\Support\Facades\Steam::getLocale();
|
||||
$locale = Steam::getLocale();
|
||||
$entries = [];
|
||||
$amount = $budgetLimit->amount ?? '0';
|
||||
$budgetCollection = new Collection()->push($budget);
|
||||
@@ -531,13 +532,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] = \FireflyIII\Support\Facades\Steam::bcround($limit->amount, $currency->decimal_places);
|
||||
$chartData[1]['entries'][$title] = 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 = \FireflyIII\Support\Facades\Steam::positive($sum[$currency->id]['sum'] ?? '0');
|
||||
$chartData[0]['entries'][$title] = \FireflyIII\Support\Facades\Steam::bcround($amount, $currency->decimal_places);
|
||||
$amount = Steam::positive($sum[$currency->id]['sum'] ?? '0');
|
||||
$chartData[0]['entries'][$title] = Steam::bcround($amount, $currency->decimal_places);
|
||||
|
||||
$currentStart = clone $currentEnd;
|
||||
$currentStart->addDay()->startOfDay();
|
||||
@@ -574,8 +575,8 @@ class BudgetController extends Controller
|
||||
$currentEnd = Navigation::endOfPeriod($currentStart, $preferredRange);
|
||||
$title = $currentStart->isoFormat($titleFormat);
|
||||
$sum = $this->nbRepository->sumExpenses($currentStart, $currentEnd, $accounts, $currency);
|
||||
$amount = \FireflyIII\Support\Facades\Steam::positive($sum[$currency->id]['sum'] ?? '0');
|
||||
$chartData[$title] = \FireflyIII\Support\Facades\Steam::bcround($amount, $currency->decimal_places);
|
||||
$amount = Steam::positive($sum[$currency->id]['sum'] ?? '0');
|
||||
$chartData[$title] = Steam::bcround($amount, $currency->decimal_places);
|
||||
$currentStart = Navigation::addPeriod($currentStart, $preferredRange, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user