mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 06:01:21 +00:00
Move some code for #339
This commit is contained in:
@@ -13,6 +13,7 @@ declare(strict_types = 1);
|
||||
|
||||
namespace FireflyIII\Http\Requests;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Models\Account;
|
||||
use Input;
|
||||
|
||||
@@ -33,6 +34,29 @@ class AccountFormRequest extends Request
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getAccountDate(): array
|
||||
{
|
||||
return [
|
||||
'name' => trim($this->input('name')),
|
||||
'active' => intval($this->input('active')) === 1,
|
||||
'accountType' => $this->input('what'),
|
||||
'virtualBalance' => round($this->input('virtualBalance'), 2),
|
||||
'virtualBalanceCurrency' => intval($this->input('amount_currency_id_virtualBalance')),
|
||||
'user' => auth()->user()->id,
|
||||
'iban' => trim($this->input('iban')),
|
||||
'accountNumber' => trim($this->input('accountNumber')),
|
||||
'accountRole' => $this->input('accountRole'),
|
||||
'openingBalance' => round($this->input('openingBalance'), 2),
|
||||
'openingBalanceDate' => new Carbon((string)$this->input('openingBalanceDate')),
|
||||
'openingBalanceCurrency' => intval($this->input('amount_currency_id_openingBalance')),
|
||||
'ccType' => $this->input('ccType'),
|
||||
'ccMonthlyPaymentDate' => $this->input('ccMonthlyPaymentDate'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user