mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add icon.
This commit is contained in:
parent
9bb2f1cfd3
commit
7ea32046af
@ -160,6 +160,7 @@ class IndexController extends Controller
|
|||||||
$array = $current->toArray();
|
$array = $current->toArray();
|
||||||
$array['spent'] = [];
|
$array['spent'] = [];
|
||||||
$array['budgeted'] = [];
|
$array['budgeted'] = [];
|
||||||
|
$array['auto_budget'] = $this->repository->getAutoBudget($current);
|
||||||
$budgetLimits = $this->blRepository->getBudgetLimits($current, $start, $end);
|
$budgetLimits = $this->blRepository->getBudgetLimits($current, $start, $end);
|
||||||
|
|
||||||
/** @var BudgetLimit $limit */
|
/** @var BudgetLimit $limit */
|
||||||
|
@ -25,7 +25,6 @@ namespace FireflyIII\Http\Requests;
|
|||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Carbon\Exceptions\InvalidDateException;
|
use Carbon\Exceptions\InvalidDateException;
|
||||||
use Exception;
|
use Exception;
|
||||||
use FireflyIII\Models\AutoBudget;
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Validation\Validator;
|
use Illuminate\Validation\Validator;
|
||||||
use Log;
|
use Log;
|
||||||
@ -402,27 +401,21 @@ class Request extends FormRequest
|
|||||||
if (is_numeric($type)) {
|
if (is_numeric($type)) {
|
||||||
$type = (int)$type;
|
$type = (int)$type;
|
||||||
}
|
}
|
||||||
|
if (0 === $type || 'none' === $type) {
|
||||||
switch ($type) {
|
return;
|
||||||
case AutoBudget::AUTO_BUDGET_RESET:
|
}
|
||||||
case AutoBudget::AUTO_BUDGET_ROLLOVER:
|
// basic float check:
|
||||||
case 'reset':
|
if ('' === $amount) {
|
||||||
case 'rollover':
|
$validator->errors()->add('auto_budget_amount', (string)trans('validation.amount_required_for_auto_budget'));
|
||||||
// basic float check:
|
}
|
||||||
if ('' === $amount) {
|
if (1 !== bccomp((string)$amount, '0')) {
|
||||||
$validator->errors()->add('auto_budget_amount', (string)trans('validation.amount_required_for_auto_budget'));
|
$validator->errors()->add('auto_budget_amount', (string)trans('validation.auto_budget_amount_positive'));
|
||||||
}
|
}
|
||||||
if (1 !== bccomp((string)$amount, '0')) {
|
if ('' === $period) {
|
||||||
$validator->errors()->add('auto_budget_amount', (string)trans('validation.auto_budget_amount_positive'));
|
$validator->errors()->add('auto_budget_period', (string)trans('validation.auto_budget_period_mandatory'));
|
||||||
}
|
}
|
||||||
if ('' === $period) {
|
if ('' === $currencyCode && '' === $currencyId) {
|
||||||
$validator->errors()->add('auto_budget_period', (string)trans('validation.auto_budget_period_mandatory'));
|
$validator->errors()->add('auto_budget_amount', (string)trans('validation.require_currency_info'));
|
||||||
}
|
|
||||||
if('' === $currencyCode && '' === $currencyId) {
|
|
||||||
$validator->errors()->add('auto_budget_amount', (string)trans('validation.require_currency_info'));
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -793,6 +793,8 @@ return [
|
|||||||
'auto_budget_period_half_year' => 'Every half year',
|
'auto_budget_period_half_year' => 'Every half year',
|
||||||
'auto_budget_period_yearly' => 'Yearly',
|
'auto_budget_period_yearly' => 'Yearly',
|
||||||
'auto_budget_help' => 'You can read more about this feature in the help. Click the top-right (?) icon.',
|
'auto_budget_help' => 'You can read more about this feature in the help. Click the top-right (?) icon.',
|
||||||
|
'auto_budget_reset_icon' => 'This budget will be set periodically',
|
||||||
|
'auto_budget_rollover_icon' => 'The budget amount will increase periodically',
|
||||||
|
|
||||||
// bills:
|
// bills:
|
||||||
'match_between_amounts' => 'Bill matches transactions between :low and :high.',
|
'match_between_amounts' => 'Bill matches transactions between :low and :high.',
|
||||||
|
@ -234,6 +234,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td data-value="{{ budget.name }}">
|
<td data-value="{{ budget.name }}">
|
||||||
|
{% if budget.auto_budget %}
|
||||||
|
{% if 1 == budget.auto_budget.auto_budget_type %}
|
||||||
|
<i class="fa fa-fw fa-calendar-check-o" title="{{ 'auto_budget_reset_icon'|_ }}"></i>
|
||||||
|
{% endif %}
|
||||||
|
{% if 2 == budget.auto_budget.auto_budget_type %}
|
||||||
|
<i class="fa fa-fw fa-calendar-plus-o" title="{{ 'auto_budget_rollover_icon'|_ }}"></i>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
<a href="{{ route('budgets.show',budget.id) }}" data-id="{{ budget.id }}">{{ budget.name }}</a>
|
<a href="{{ route('budgets.show',budget.id) }}" data-id="{{ budget.id }}">{{ budget.name }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td data-value="-1">
|
<td data-value="-1">
|
||||||
|
Loading…
Reference in New Issue
Block a user