Make sure the user can create liabilities in the "credit" direction with the right transactions.

This commit is contained in:
James Cole
2021-04-10 17:26:36 +02:00
parent 5d7ca1ef9a
commit 0426fa63d0
9 changed files with 636 additions and 149 deletions

View File

@@ -62,6 +62,7 @@ class AccountFormRequest extends FormRequest
'interest' => $this->string('interest'),
'interest_period' => $this->string('interest_period'),
'include_net_worth' => '1',
'liability_direction' => $this->string('liability_direction'),
];
$data = $this->appendLocationData($data, 'location');
@@ -74,6 +75,7 @@ class AccountFormRequest extends FormRequest
if ('liabilities' === $data['account_type_name']) {
$data['account_type_name'] = null;
$data['account_type_id'] = $this->integer('liability_type_id');
$data['opening_balance'] = app('steam')->negative($data['opening_balance']);
}
return $data;