mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 01:41:14 -06:00
Fix #2626
This commit is contained in:
parent
845ae94252
commit
17c943fcf1
@ -206,6 +206,7 @@ class BudgetLimitController extends Controller
|
||||
$array['left_per_day'] = bcdiv(bcadd($array['spent'], $array['amount']), $array['days_left']);
|
||||
|
||||
// left per day formatted.
|
||||
$array['amount'] = round($limit['amount'], $limit->transactionCurrency->decimal_places);
|
||||
$array['left_per_day_formatted'] = app('amount')->formatAnything($limit->transactionCurrency, $array['left_per_day']);
|
||||
|
||||
return response()->json($array);
|
||||
|
@ -388,7 +388,7 @@ class BudgetController extends Controller
|
||||
];
|
||||
$noBudget = $this->nbRepository->sumExpenses($start, $end);
|
||||
foreach ($noBudget as $noBudgetEntry) {
|
||||
$report['budgets'][0]['budget_limits'][] = [
|
||||
$report['budgets'][0]['budget_limits'][] = [
|
||||
'budget_limit_id' => null,
|
||||
'start_date' => $start,
|
||||
'end_date' => $end,
|
||||
@ -404,7 +404,8 @@ class BudgetController extends Controller
|
||||
'currency_symbol' => $noBudgetEntry['currency_symbol'],
|
||||
'currency_decimal_places' => $noBudgetEntry['currency_decimal_places'],
|
||||
];
|
||||
$report['sums'][$noBudgetEntry['currency_id']]['spent'] = bcadd($report['sums'][$noBudgetEntry['currency_id']]['spent'], $noBudgetEntry['sum']);
|
||||
$report['sums'][$noBudgetEntry['currency_id']]['spent']
|
||||
= bcadd($report['sums'][$noBudgetEntry['currency_id']]['spent'] ?? '0', $noBudgetEntry['sum']);
|
||||
}
|
||||
|
||||
// make percentages based on total amount.
|
||||
|
Loading…
Reference in New Issue
Block a user