Some extensions to budgets.

This commit is contained in:
James Cole
2016-04-25 21:37:08 +02:00
parent 7f7d6cf893
commit 22e6ea700f
6 changed files with 183 additions and 130 deletions

View File

@@ -160,6 +160,16 @@ class BudgetController extends Controller
$periodEnd = $end->formatLocalized($this->monthAndDayFormat);
$accounts = $accountRepository->getAccounts(['Default account', 'Asset account', 'Cash account']);
/**
* Warn user if necessary
*/
$range = Preferences::get('viewRange', '1M')->data;
$repeatFreq = Config::get('firefly.range_to_repeat_freq.' . $range);
$userWarning = '';
if (session('is_custom_range', false) === true) {
$userWarning = strval(trans('firefly.warn_range_' . $repeatFreq));
}
/**
* Do some cleanup:
*/
@@ -187,7 +197,7 @@ class BudgetController extends Controller
'budgetMaximum', 'periodStart', 'periodEnd',
'period', 'range', 'budgetIncomeTotal',
'defaultCurrency', 'inactive', 'budgets',
'spent', 'budgeted'
'spent', 'budgeted', 'userWarning'
)
);
}