mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add support for virtual balance currency, even though it cannot be stored yet.
This commit is contained in:
parent
524edfe7c2
commit
72d054c55c
@ -38,6 +38,8 @@ class AccountController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function create($what = 'asset')
|
public function create($what = 'asset')
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what);
|
$subTitleIcon = Config::get('firefly.subIconsByIdentifier.' . $what);
|
||||||
$subTitle = trans('firefly.make_new_' . $what . '_account');
|
$subTitle = trans('firefly.make_new_' . $what . '_account');
|
||||||
|
|
||||||
@ -211,13 +213,14 @@ class AccountController extends Controller
|
|||||||
'name' => $request->input('name'),
|
'name' => $request->input('name'),
|
||||||
'accountType' => $request->input('what'),
|
'accountType' => $request->input('what'),
|
||||||
'virtualBalance' => round($request->input('virtualBalance'), 2),
|
'virtualBalance' => round($request->input('virtualBalance'), 2),
|
||||||
|
'virtualBalanceCurrency' => intval($request->input('amount_currency_id_virtualBalance')),
|
||||||
'active' => true,
|
'active' => true,
|
||||||
'user' => Auth::user()->id,
|
'user' => Auth::user()->id,
|
||||||
'iban' => $request->input('iban'),
|
'iban' => $request->input('iban'),
|
||||||
'accountRole' => $request->input('accountRole'),
|
'accountRole' => $request->input('accountRole'),
|
||||||
'openingBalance' => round($request->input('openingBalance'), 2),
|
'openingBalance' => round($request->input('openingBalance'), 2),
|
||||||
'openingBalanceDate' => new Carbon((string)$request->input('openingBalanceDate')),
|
'openingBalanceDate' => new Carbon((string)$request->input('openingBalanceDate')),
|
||||||
'openingBalanceCurrency' => intval($request->input('balance_currency_id')),
|
'openingBalanceCurrency' => intval($request->input('amount_currency_id_openingBalance')),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -41,18 +41,19 @@ class AccountFormRequest extends Request
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'id' => $idRule,
|
'id' => $idRule,
|
||||||
'name' => $nameRule,
|
'name' => $nameRule,
|
||||||
'openingBalance' => 'numeric',
|
'openingBalance' => 'numeric',
|
||||||
'iban' => 'iban',
|
'iban' => 'iban',
|
||||||
'virtualBalance' => 'numeric',
|
'virtualBalance' => 'numeric',
|
||||||
'openingBalanceDate' => 'date',
|
'openingBalanceDate' => 'date',
|
||||||
'accountRole' => 'in:' . $accountRoles,
|
'accountRole' => 'in:' . $accountRoles,
|
||||||
'active' => 'boolean',
|
'active' => 'boolean',
|
||||||
'ccType' => 'in:' . $ccPaymentTypes,
|
'ccType' => 'in:' . $ccPaymentTypes,
|
||||||
'ccMonthlyPaymentDate' => 'date',
|
'ccMonthlyPaymentDate' => 'date',
|
||||||
'balance_currency_id' => 'exists:transaction_currencies,id',
|
'amount_currency_id_openingBalance' => 'exists:transaction_currencies,id',
|
||||||
'what' => 'in:' . $types
|
'amount_currency_id_virtualBalance' => 'exists:transaction_currencies,id',
|
||||||
|
'what' => 'in:' . $types
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user