mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
This commit is contained in:
@@ -49,7 +49,6 @@ class NewUserController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function submit(NewUserFormRequest $request, AccountRepositoryInterface $repository)
|
public function submit(NewUserFormRequest $request, AccountRepositoryInterface $repository)
|
||||||
{
|
{
|
||||||
|
|
||||||
// create normal asset account:
|
// create normal asset account:
|
||||||
$assetAccount = [
|
$assetAccount = [
|
||||||
'name' => $request->get('bank_name'),
|
'name' => $request->get('bank_name'),
|
||||||
@@ -61,7 +60,7 @@ class NewUserController extends Controller
|
|||||||
'accountRole' => 'defaultAsset',
|
'accountRole' => 'defaultAsset',
|
||||||
'openingBalance' => round($request->input('bank_balance'), 2),
|
'openingBalance' => round($request->input('bank_balance'), 2),
|
||||||
'openingBalanceDate' => new Carbon,
|
'openingBalanceDate' => new Carbon,
|
||||||
'openingBalanceCurrency' => intval($request->input('balance_currency_id')),
|
'openingBalanceCurrency' => intval($request->input('amount_currency_id_bank_balance')),
|
||||||
];
|
];
|
||||||
|
|
||||||
$repository->store($assetAccount);
|
$repository->store($assetAccount);
|
||||||
@@ -78,7 +77,7 @@ class NewUserController extends Controller
|
|||||||
'accountRole' => 'savingAsset',
|
'accountRole' => 'savingAsset',
|
||||||
'openingBalance' => round($request->input('savings_balance'), 2),
|
'openingBalance' => round($request->input('savings_balance'), 2),
|
||||||
'openingBalanceDate' => new Carbon,
|
'openingBalanceDate' => new Carbon,
|
||||||
'openingBalanceCurrency' => intval($request->input('balance_currency_id')),
|
'openingBalanceCurrency' => intval($request->input('amount_currency_id_savings_balance')),
|
||||||
];
|
];
|
||||||
$repository->store($savingsAccount);
|
$repository->store($savingsAccount);
|
||||||
}
|
}
|
||||||
@@ -96,7 +95,7 @@ class NewUserController extends Controller
|
|||||||
'accountRole' => 'ccAsset',
|
'accountRole' => 'ccAsset',
|
||||||
'openingBalance' => null,
|
'openingBalance' => null,
|
||||||
'openingBalanceDate' => null,
|
'openingBalanceDate' => null,
|
||||||
'openingBalanceCurrency' => intval($request->input('balance_currency_id')),
|
'openingBalanceCurrency' => intval($request->input('amount_currency_id_credit_card_limit')),
|
||||||
];
|
];
|
||||||
$creditCard = $repository->store($creditAccount);
|
$creditCard = $repository->store($creditAccount);
|
||||||
|
|
||||||
|
@@ -27,11 +27,13 @@ class NewUserFormRequest extends Request
|
|||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'bank_name' => 'required|between:1,200',
|
'bank_name' => 'required|between:1,200',
|
||||||
'bank_balance' => 'required|numeric',
|
'bank_balance' => 'required|numeric',
|
||||||
'savings_balance' => 'numeric',
|
'savings_balance' => 'numeric',
|
||||||
'credit_card_limit' => 'numeric',
|
'credit_card_limit' => 'numeric',
|
||||||
'balance_currency_id' => 'exists:transaction_currencies,id',
|
'amount_currency_id_bank_balance' => 'exists:transaction_currencies,id',
|
||||||
|
'amount_currency_id_savings_balance' => 'exists:transaction_currencies,id',
|
||||||
|
'amount_currency_id_credit_card_limit' => 'exists:transaction_currencies,id',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user