mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Add icon.
This commit is contained in:
@@ -160,6 +160,7 @@ class IndexController extends Controller
|
||||
$array = $current->toArray();
|
||||
$array['spent'] = [];
|
||||
$array['budgeted'] = [];
|
||||
$array['auto_budget'] = $this->repository->getAutoBudget($current);
|
||||
$budgetLimits = $this->blRepository->getBudgetLimits($current, $start, $end);
|
||||
|
||||
/** @var BudgetLimit $limit */
|
||||
|
@@ -25,7 +25,6 @@ namespace FireflyIII\Http\Requests;
|
||||
use Carbon\Carbon;
|
||||
use Carbon\Exceptions\InvalidDateException;
|
||||
use Exception;
|
||||
use FireflyIII\Models\AutoBudget;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Validator;
|
||||
use Log;
|
||||
@@ -402,27 +401,21 @@ class Request extends FormRequest
|
||||
if (is_numeric($type)) {
|
||||
$type = (int)$type;
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
case AutoBudget::AUTO_BUDGET_RESET:
|
||||
case AutoBudget::AUTO_BUDGET_ROLLOVER:
|
||||
case 'reset':
|
||||
case 'rollover':
|
||||
// basic float check:
|
||||
if ('' === $amount) {
|
||||
$validator->errors()->add('auto_budget_amount', (string)trans('validation.amount_required_for_auto_budget'));
|
||||
}
|
||||
if (1 !== bccomp((string)$amount, '0')) {
|
||||
$validator->errors()->add('auto_budget_amount', (string)trans('validation.auto_budget_amount_positive'));
|
||||
}
|
||||
if ('' === $period) {
|
||||
$validator->errors()->add('auto_budget_period', (string)trans('validation.auto_budget_period_mandatory'));
|
||||
}
|
||||
if('' === $currencyCode && '' === $currencyId) {
|
||||
$validator->errors()->add('auto_budget_amount', (string)trans('validation.require_currency_info'));
|
||||
}
|
||||
|
||||
break;
|
||||
if (0 === $type || 'none' === $type) {
|
||||
return;
|
||||
}
|
||||
// basic float check:
|
||||
if ('' === $amount) {
|
||||
$validator->errors()->add('auto_budget_amount', (string)trans('validation.amount_required_for_auto_budget'));
|
||||
}
|
||||
if (1 !== bccomp((string)$amount, '0')) {
|
||||
$validator->errors()->add('auto_budget_amount', (string)trans('validation.auto_budget_amount_positive'));
|
||||
}
|
||||
if ('' === $period) {
|
||||
$validator->errors()->add('auto_budget_period', (string)trans('validation.auto_budget_period_mandatory'));
|
||||
}
|
||||
if ('' === $currencyCode && '' === $currencyId) {
|
||||
$validator->errors()->add('auto_budget_amount', (string)trans('validation.require_currency_info'));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user