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