mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-09 15:43:19 -06:00
Fixes a bug in the new user handler [skip ci]
This commit is contained in:
parent
fa818e0924
commit
1a5617d430
@ -112,15 +112,15 @@ class NewUserController extends Controller
|
|||||||
private function createAssetAccount(NewUserFormRequest $request, AccountRepositoryInterface $repository): bool
|
private function createAssetAccount(NewUserFormRequest $request, AccountRepositoryInterface $repository): bool
|
||||||
{
|
{
|
||||||
$assetAccount = [
|
$assetAccount = [
|
||||||
'name' => $request->get('bank_name'),
|
'name' => $request->get('bank_name'),
|
||||||
'iban' => null,
|
'iban' => null,
|
||||||
'accountType' => 'asset',
|
'accountType' => 'asset',
|
||||||
'virtualBalance' => 0,
|
'virtualBalance' => 0,
|
||||||
'active' => true,
|
'active' => true,
|
||||||
'accountRole' => 'defaultAsset',
|
'accountRole' => 'defaultAsset',
|
||||||
'openingBalance' => round($request->input('bank_balance'), 12),
|
'openingBalance' => round($request->input('bank_balance'), 12),
|
||||||
'openingBalanceDate' => new Carbon,
|
'openingBalanceDate' => new Carbon,
|
||||||
'openingBalanceCurrency' => intval($request->input('amount_currency_id_bank_balance')),
|
'currency_id' => intval($request->input('amount_currency_id_bank_balance')),
|
||||||
];
|
];
|
||||||
|
|
||||||
$repository->store($assetAccount);
|
$repository->store($assetAccount);
|
||||||
@ -137,15 +137,15 @@ class NewUserController extends Controller
|
|||||||
private function createSavingsAccount(NewUserFormRequest $request, AccountRepositoryInterface $repository): bool
|
private function createSavingsAccount(NewUserFormRequest $request, AccountRepositoryInterface $repository): bool
|
||||||
{
|
{
|
||||||
$savingsAccount = [
|
$savingsAccount = [
|
||||||
'name' => $request->get('bank_name') . ' savings account',
|
'name' => $request->get('bank_name') . ' savings account',
|
||||||
'iban' => null,
|
'iban' => null,
|
||||||
'accountType' => 'asset',
|
'accountType' => 'asset',
|
||||||
'virtualBalance' => 0,
|
'virtualBalance' => 0,
|
||||||
'active' => true,
|
'active' => true,
|
||||||
'accountRole' => 'savingAsset',
|
'accountRole' => 'savingAsset',
|
||||||
'openingBalance' => round($request->input('savings_balance'), 12),
|
'openingBalance' => round($request->input('savings_balance'), 12),
|
||||||
'openingBalanceDate' => new Carbon,
|
'openingBalanceDate' => new Carbon,
|
||||||
'openingBalanceCurrency' => intval($request->input('amount_currency_id_savings_balance')),
|
'currency_id' => intval($request->input('amount_currency_id_savings_balance')),
|
||||||
];
|
];
|
||||||
$repository->store($savingsAccount);
|
$repository->store($savingsAccount);
|
||||||
|
|
||||||
|
@ -36,7 +36,6 @@ class NewUserControllerTest extends TestCase
|
|||||||
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
|
||||||
$accountRepos->shouldReceive('count')->andReturn(0);
|
$accountRepos->shouldReceive('count')->andReturn(0);
|
||||||
|
|
||||||
|
|
||||||
$this->be($this->emptyUser());
|
$this->be($this->emptyUser());
|
||||||
$response = $this->get(route('new-user.index'));
|
$response = $this->get(route('new-user.index'));
|
||||||
$response->assertStatus(200);
|
$response->assertStatus(200);
|
||||||
|
Loading…
Reference in New Issue
Block a user