Make sure create uses the right fields.

This commit is contained in:
James Cole 2020-03-14 07:49:11 +01:00
parent bde0732135
commit fdffed636f
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
5 changed files with 11 additions and 9 deletions

View File

@ -71,8 +71,8 @@ class CreateController extends Controller
{ {
$hasOldInput = null !== $request->old('_token'); $hasOldInput = null !== $request->old('_token');
// auto budget options // auto budget types
$autoBudgetOptions = [ $autoBudgetTypes = [
0 => (string)trans('firefly.auto_budget_none'), 0 => (string)trans('firefly.auto_budget_none'),
AutoBudget::AUTO_BUDGET_RESET => (string)trans('firefly.auto_budget_reset'), AutoBudget::AUTO_BUDGET_RESET => (string)trans('firefly.auto_budget_reset'),
AutoBudget::AUTO_BUDGET_ROLLOVER => (string)trans('firefly.auto_budget_rollover'), AutoBudget::AUTO_BUDGET_ROLLOVER => (string)trans('firefly.auto_budget_rollover'),
@ -101,7 +101,7 @@ class CreateController extends Controller
$request->session()->forget('budgets.create.fromStore'); $request->session()->forget('budgets.create.fromStore');
$subTitle = (string)trans('firefly.create_new_budget'); $subTitle = (string)trans('firefly.create_new_budget');
return view('budgets.create', compact('subTitle', 'autoBudgetOptions', 'autoBudgetPeriods')); return view('budgets.create', compact('subTitle', 'autoBudgetTypes', 'autoBudgetPeriods'));
} }

View File

@ -67,8 +67,8 @@ class BudgetFormStoreRequest extends Request
return [ return [
'name' => 'required|between:1,100|uniqueObjectForUser:budgets,name', 'name' => 'required|between:1,100|uniqueObjectForUser:budgets,name',
'active' => 'numeric|between:0,1', 'active' => 'numeric|between:0,1',
'auto_budget_option' => 'numeric|between:0,2', 'auto_budget_type' => 'numeric|between:0,2',
'transaction_currency_id' => 'required|exists:transaction_currencies,id', 'auto_budget_currency_id' => 'required|exists:transaction_currencies,id',
'auto_budget_amount' => 'min:0|max:1000000000', 'auto_budget_amount' => 'min:0|max:1000000000',
'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly', 'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly',
]; ];

View File

@ -792,6 +792,7 @@ return [
'auto_budget_period_quarterly' => 'Quarterly', 'auto_budget_period_quarterly' => 'Quarterly',
'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.',
// bills: // bills:
'match_between_amounts' => 'Bill matches transactions between :low and :high.', 'match_between_amounts' => 'Bill matches transactions between :low and :high.',

View File

@ -43,6 +43,7 @@ return [
'journal_currency_id' => 'Currency', 'journal_currency_id' => 'Currency',
'currency_id' => 'Currency', 'currency_id' => 'Currency',
'transaction_currency_id' => 'Currency', 'transaction_currency_id' => 'Currency',
'auto_budget_currency_id' => 'Currency',
'external_ip' => 'Your server\'s external IP', 'external_ip' => 'Your server\'s external IP',
'attachments' => 'Attachments', 'attachments' => 'Attachments',
'journal_amount' => 'Amount', 'journal_amount' => 'Amount',
@ -260,7 +261,7 @@ return [
'expected_on' => 'Expected on', 'expected_on' => 'Expected on',
'paid' => 'Paid', 'paid' => 'Paid',
'auto_budget_option' => 'Auto-budget', 'auto_budget_type' => 'Auto-budget',
'auto_budget_amount' => 'Auto-budget amount', 'auto_budget_amount' => 'Auto-budget amount',
'auto_budget_period' => 'Auto-budget period', 'auto_budget_period' => 'Auto-budget period',

View File

@ -28,8 +28,8 @@
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3> <h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
</div> </div>
<div class="box-body"> <div class="box-body">
{{ ExpandedForm.select('auto_budget_option', autoBudgetOptions) }} {{ ExpandedForm.select('auto_budget_type', autoBudgetTypes,null, {helpText: trans('firefly.auto_budget_help')}) }}
{{ CurrencyForm.currencyList('transaction_currency_id') }} {{ CurrencyForm.currencyList('auto_budget_currency_id') }}
{{ ExpandedForm.amountNoCurrency('auto_budget_amount') }} {{ ExpandedForm.amountNoCurrency('auto_budget_amount') }}
{{ ExpandedForm.select('auto_budget_period', autoBudgetPeriods, null) }} {{ ExpandedForm.select('auto_budget_period', autoBudgetPeriods, null) }}
</div> </div>