mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fixes #2522
This commit is contained in:
@@ -108,7 +108,7 @@ class BudgetReportHelper implements BudgetReportHelperInterface
|
|||||||
'budgeted' => $limit->amount,
|
'budgeted' => $limit->amount,
|
||||||
'spent' => '0',
|
'spent' => '0',
|
||||||
'left' => $limit->amount,
|
'left' => $limit->amount,
|
||||||
'overspent' => null,
|
'overspent' => '0',
|
||||||
'currency_id' => $currency->id,
|
'currency_id' => $currency->id,
|
||||||
'currency_code' => $currency->code,
|
'currency_code' => $currency->code,
|
||||||
'currency_name' => $currency->name,
|
'currency_name' => $currency->name,
|
||||||
@@ -128,7 +128,7 @@ class BudgetReportHelper implements BudgetReportHelperInterface
|
|||||||
'budgeted' => null,
|
'budgeted' => null,
|
||||||
'spent' => $expense['amount'],
|
'spent' => $expense['amount'],
|
||||||
'left' => null,
|
'left' => null,
|
||||||
'overspent' => null,
|
'overspent' => '0',
|
||||||
'currency_id' => $expense['currency_id'],
|
'currency_id' => $expense['currency_id'],
|
||||||
'currency_code' => $expense['currency_name'],
|
'currency_code' => $expense['currency_name'],
|
||||||
'currency_name' => $expense['currency_name'],
|
'currency_name' => $expense['currency_name'],
|
||||||
@@ -146,7 +146,7 @@ class BudgetReportHelper implements BudgetReportHelperInterface
|
|||||||
$row['left'] = -1 === bccomp(bcadd($limit->amount, $row['spent']), '0') ? '0' : bcadd($limit->amount, $row['spent']);
|
$row['left'] = -1 === bccomp(bcadd($limit->amount, $row['spent']), '0') ? '0' : bcadd($limit->amount, $row['spent']);
|
||||||
|
|
||||||
// spent > budgeted? then sum, otherwise other sum
|
// spent > budgeted? then sum, otherwise other sum
|
||||||
$row['overspent'] = 1 === bccomp($row['spent'], $row['budgeted']) ? bcadd($row['spent'], $row['budgeted']) : '0';
|
$row['overspent'] = 1 === bccomp(bcmul($row['spent'],'-1'), $row['budgeted']) ? bcadd($row['spent'], $row['budgeted']) : '0';
|
||||||
}
|
}
|
||||||
$entry['rows'][] = $row;
|
$entry['rows'][] = $row;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user