This commit is contained in:
James Cole
2018-03-26 20:48:47 +02:00
parent 413c1bc2fe
commit c86b207b1c

View File

@@ -198,16 +198,15 @@ class ConvertController extends Controller
// three and five // three and five
if ('' === $data['destination_account_expense'] || null === $data['destination_account_expense']) { if ('' === $data['destination_account_expense'] || null === $data['destination_account_expense']) {
// destination is a cash account. // destination is a cash account.
$destination = $accountRepository->getCashAccount(); return $accountRepository->getCashAccount();
return $destination;
} }
$data = [ $data = [
'name' => $data['destination_account_expense'], 'name' => $data['destination_account_expense'],
'accountType' => 'expense', 'accountType' => 'expense',
'virtualBalance' => 0, 'account_type_id' => null,
'active' => true, 'virtualBalance' => 0,
'iban' => null, 'active' => true,
'iban' => null,
]; ];
$destination = $accountRepository->store($data); $destination = $accountRepository->store($data);
break; break;
@@ -246,17 +245,16 @@ class ConvertController extends Controller
if ('' === $data['source_account_revenue'] || null === $data['source_account_revenue']) { if ('' === $data['source_account_revenue'] || null === $data['source_account_revenue']) {
// destination is a cash account. // destination is a cash account.
$destination = $accountRepository->getCashAccount(); return $accountRepository->getCashAccount();
return $destination;
} }
$data = [ $data = [
'name' => $data['source_account_revenue'], 'name' => $data['source_account_revenue'],
'accountType' => 'revenue', 'accountType' => 'revenue',
'virtualBalance' => 0, 'virtualBalance' => 0,
'active' => true, 'active' => true,
'iban' => null, 'account_type_id' => null,
'iban' => null,
]; ];
$source = $accountRepository->store($data); $source = $accountRepository->store($data);
break; break;