Clean up some code.

This commit is contained in:
James Cole committed 2021-04-05 21:52:55 +02:00
1 parent 6d855e119d
commit e4802ec958
35 files changed
+74 -216

No files matched your search

@@ -51,7 +51,7 @@ class UpdateRequest extends FormRequest
'name' => ['name', 'string'],
'active' => ['active', 'boolean'],
'include_net_worth' => ['include_net_worth', 'boolean'],
'account_type' => ['type', 'string'],
'account_type_name' => ['type', 'string'],
'virtual_balance' => ['virtual_balance', 'string'],
'iban' => ['iban', 'string'],
'BIC' => ['bic', 'string'],
@@ -72,10 +72,10 @@ class UpdateRequest extends FormRequest
$data = $this->getAllData($fields);
$data = $this->appendLocationData($data, null);
if (array_key_exists('account_type', $data) && 'liability' === $data['account_type']) {
if (array_key_exists('account_type_name', $data) && 'liability' === $data['account_type_name']) {
$data['opening_balance'] = bcmul($this->nullableString('liability_amount'), '-1');
$data['opening_balance_date'] = $this->date('liability_start_date');
$data['account_type'] = $this->nullableString('liability_type');
$data['account_type_name'] = $this->nullableString('liability_type');
$data['account_type_id'] = null;
}