mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Small additions to budget handling [skip ci]
This commit is contained in:
@@ -168,6 +168,7 @@ class BudgetController extends Controller
|
|||||||
$budgets = $repository->getBudgetsAndLimitsInRange($start, $end);
|
$budgets = $repository->getBudgetsAndLimitsInRange($start, $end);
|
||||||
$allEntries = new Collection;
|
$allEntries = new Collection;
|
||||||
$accounts = $accountRepository->getAccounts(['Default account', 'Asset account', 'Cash account']);
|
$accounts = $accountRepository->getAccounts(['Default account', 'Asset account', 'Cash account']);
|
||||||
|
$format = strval(trans('config.month_and_day'));
|
||||||
|
|
||||||
|
|
||||||
/** @var Budget $budget */
|
/** @var Budget $budget */
|
||||||
@@ -185,6 +186,22 @@ class BudgetController extends Controller
|
|||||||
$spent = $expenses;
|
$spent = $expenses;
|
||||||
$overspent = '0';
|
$overspent = '0';
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
// update the display name if the range
|
||||||
|
// of the limit repetition does not match
|
||||||
|
// the session's range (for clarity).
|
||||||
|
if (
|
||||||
|
($start->format('Y-m-d') != $budget->startdate->format('Y-m-d'))
|
||||||
|
|| ($end->format('Y-m-d') != $budget->enddate->format('Y-m-d'))
|
||||||
|
) {
|
||||||
|
$name .= ' ' . trans(
|
||||||
|
'firefly.between_dates',
|
||||||
|
[
|
||||||
|
'start' => $budget->startdate->formatLocalized($format),
|
||||||
|
'end' => $budget->startdate->formatLocalized($format),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
$currentStart = clone $budget->startdate;
|
$currentStart = clone $budget->startdate;
|
||||||
$currentEnd = clone $budget->enddate;
|
$currentEnd = clone $budget->enddate;
|
||||||
$expenses = $repository->balanceInPeriod($budget, $currentStart, $currentEnd, $accounts);
|
$expenses = $repository->balanceInPeriod($budget, $currentStart, $currentEnd, $accounts);
|
||||||
|
@@ -279,6 +279,7 @@ return [
|
|||||||
'transaction_page_size_help' => 'Any list of transactions shows at most this many transactions',
|
'transaction_page_size_help' => 'Any list of transactions shows at most this many transactions',
|
||||||
'transaction_page_size_label' => 'Page size',
|
'transaction_page_size_label' => 'Page size',
|
||||||
'budget_maximum' => 'Budget maximum',
|
'budget_maximum' => 'Budget maximum',
|
||||||
|
'between_dates' => '(:start and :end)',
|
||||||
|
|
||||||
// profile:
|
// profile:
|
||||||
'change_your_password' => 'Change your password',
|
'change_your_password' => 'Change your password',
|
||||||
|
@@ -25,11 +25,13 @@
|
|||||||
{% if balanceLine.getBudget.id %}
|
{% if balanceLine.getBudget.id %}
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ route('budgets.show',balanceLine.getBudget.id) }}">{{ balanceLine.getTitle }}</a>
|
<a href="{{ route('budgets.show',balanceLine.getBudget.id) }}">{{ balanceLine.getTitle }}</a>
|
||||||
|
{% if balanceLine.getStartdate and balanceLine.getEnddate %}
|
||||||
<span class="small"><br>
|
<span class="small"><br>
|
||||||
{{ balanceLine.getStartdate.formatLocalized(monthAndDayFormat) }}
|
{{ balanceLine.getStartdate.formatLocalized(monthAndDayFormat) }}
|
||||||
—
|
—
|
||||||
{{ balanceLine.getEnddate.formatLocalized(monthAndDayFormat) }}
|
{{ balanceLine.getEnddate.formatLocalized(monthAndDayFormat) }}
|
||||||
</span>
|
</span>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if(balanceLine.getBudget.amount) %}
|
{% if(balanceLine.getBudget.amount) %}
|
||||||
|
Reference in New Issue
Block a user