mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-13 17:05:46 -06:00
commit
aa057d6a57
@ -128,6 +128,7 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
$preFilled = [
|
||||
'accountNumber' => $account->getMeta('accountNumber'),
|
||||
'accountRole' => $account->getMeta('accountRole'),
|
||||
'ccType' => $account->getMeta('ccType'),
|
||||
'ccMonthlyPaymentDate' => $account->getMeta('ccMonthlyPaymentDate'),
|
||||
@ -211,6 +212,7 @@ class AccountController extends Controller
|
||||
'active' => true,
|
||||
'user' => Auth::user()->id,
|
||||
'iban' => $request->input('iban'),
|
||||
'accountNumber' => $request->input('accountNumber'),
|
||||
'accountRole' => $request->input('accountRole'),
|
||||
'openingBalance' => round($request->input('openingBalance'), 2),
|
||||
'openingBalanceDate' => new Carbon((string)$request->input('openingBalanceDate')),
|
||||
@ -249,6 +251,7 @@ class AccountController extends Controller
|
||||
'active' => $request->input('active'),
|
||||
'user' => Auth::user()->id,
|
||||
'iban' => $request->input('iban'),
|
||||
'accountNumber' => $request->input('accountNumber'),
|
||||
'accountRole' => $request->input('accountRole'),
|
||||
'virtualBalance' => round($request->input('virtualBalance'), 2),
|
||||
'openingBalance' => round($request->input('openingBalance'), 2),
|
||||
|
@ -31,6 +31,9 @@ use Steam;
|
||||
class AccountRepository implements AccountRepositoryInterface
|
||||
{
|
||||
|
||||
/** @var array Valied field names of account_meta */
|
||||
private $validFields = ['accountRole', 'ccMonthlyPaymentDate', 'ccType', 'accountNumber'];
|
||||
|
||||
/**
|
||||
* @param array $types
|
||||
*
|
||||
@ -541,9 +544,8 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
* @return bool
|
||||
*/
|
||||
private function storeMetadata(Account $account, array $data): bool
|
||||
{
|
||||
$validFields = ['accountRole', 'ccMonthlyPaymentDate', 'ccType'];
|
||||
foreach ($validFields as $field) {
|
||||
{
|
||||
foreach ($this->validFields as $field) {
|
||||
if (isset($data[$field])) {
|
||||
$metaData = new AccountMeta(
|
||||
[
|
||||
@ -594,9 +596,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
*/
|
||||
private function updateMetadata(Account $account, array $data): bool
|
||||
{
|
||||
$validFields = ['accountRole', 'ccMonthlyPaymentDate', 'ccType'];
|
||||
|
||||
foreach ($validFields as $field) {
|
||||
foreach ($this->validFields as $field) {
|
||||
$entry = $account->accountMeta()->where('name', $field)->first();
|
||||
|
||||
if (isset($data[$field])) {
|
||||
|
@ -47,6 +47,7 @@ return [
|
||||
'symbol' => 'Symbol',
|
||||
'code' => 'Code',
|
||||
'iban' => 'IBAN',
|
||||
'accountNumber' => 'Account number',
|
||||
'csv' => 'CSV file',
|
||||
'has_headers' => 'Headers',
|
||||
'date_format' => 'Date format',
|
||||
|
@ -47,6 +47,7 @@ return [
|
||||
'symbol' => 'Symbool',
|
||||
'code' => 'Code',
|
||||
'iban' => 'IBAN',
|
||||
'accountNumber' => 'Rekeningnummer',
|
||||
'csv' => 'CSV-bestand',
|
||||
'has_headers' => 'Kolomnamen op de eerste rij?',
|
||||
'date_format' => 'Datumformaat',
|
||||
|
@ -21,23 +21,25 @@
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
|
||||
{% if what == 'asset' %}
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
|
||||
{{ ExpandedForm.text('iban') }}
|
||||
{{ ExpandedForm.balance('openingBalance') }}
|
||||
{{ ExpandedForm.date('openingBalanceDate', phpdate('Y-m-d')) }}
|
||||
{{ ExpandedForm.select('accountRole', Config.get('firefly.accountRoles'),null,{'helpText' : 'asset_account_role_help'|_}) }}
|
||||
{{ ExpandedForm.balance('virtualBalance') }}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ 'optionalFields'|_ }}</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="box-body">
|
||||
|
||||
{{ ExpandedForm.text('iban') }}
|
||||
{% if what == 'asset' %}
|
||||
{{ ExpandedForm.text('accountNumber') }}
|
||||
{{ ExpandedForm.balance('openingBalance') }}
|
||||
{{ ExpandedForm.date('openingBalanceDate', phpdate('Y-m-d')) }}
|
||||
{{ ExpandedForm.select('accountRole', Config.get('firefly.accountRoles'),null,{'helpText' : 'asset_account_role_help'|_}) }}
|
||||
{{ ExpandedForm.balance('virtualBalance') }}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
|
@ -28,6 +28,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{ ExpandedForm.text('iban') }}
|
||||
{{ ExpandedForm.text('accountNumber') }}
|
||||
{% if account.accounttype.type == 'Default account' or account.accounttype.type == 'Asset account' %}
|
||||
{{ ExpandedForm.balance('openingBalance',null, {'currency' : openingBalance ? openingBalance.transactionCurrency : null}) }}
|
||||
{{ ExpandedForm.date('openingBalanceDate') }}
|
||||
|
Loading…
Reference in New Issue
Block a user