mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Experimental budget lines. #129
This commit is contained in:
parent
e59fd098a3
commit
8316afb176
@ -560,10 +560,9 @@ class ReportHelper implements ReportHelperInterface
|
||||
$budgetLine->setBudget($budget);
|
||||
$budgetLine->setRepetition($repetition);
|
||||
$expenses = $repository->balanceInPeriodForList($budget, $start, $end, $accounts);
|
||||
$expenses = $expenses * -1;
|
||||
$left = $expenses < $repetition->amount ? bcsub($repetition->amount, $expenses) : 0;
|
||||
$spent = $expenses > $repetition->amount ? 0 : $expenses;
|
||||
$overspent = $expenses > $repetition->amount ? bcsub($expenses, $repetition->amount) : 0;
|
||||
$left = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? bcadd($repetition->amount, $expenses) : 0;
|
||||
$spent = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? 0 : $expenses;
|
||||
$overspent = bccomp(bcadd($repetition->amount, $expenses), '0') === 1 ? bcadd($expenses, $repetition->amount) : 0;
|
||||
|
||||
$budgetLine->setLeft($left);
|
||||
$budgetLine->setSpent($spent);
|
||||
|
@ -39,7 +39,7 @@
|
||||
</td>
|
||||
<td>
|
||||
{% if budgetLine.getSpent != 0 %}
|
||||
<span class="text-danger">{{ budgetLine.getSpent|formatAmountPlain }}</span>
|
||||
{{ budgetLine.getSpent|formatAmount }}
|
||||
{% endif %}
|
||||
|
||||
{% if budgetLine.getSpent == 0 %}
|
||||
|
Loading…
Reference in New Issue
Block a user