Revamped the account controller.

This commit is contained in:
James Cole
2014-08-30 14:26:33 +02:00
parent 85f1e744b8
commit 9db4137a1b
16 changed files with 339 additions and 519 deletions

View File

@@ -64,8 +64,8 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito
}
// account types for both:
$toAT = $toAccount->accountType->description;
$fromAT = $from->accountType->description;
$toAT = $toAccount->accountType->type;
$fromAT = $from->accountType->type;
$journalType = null;
@@ -287,6 +287,7 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito
$fromAccount = $accountRepository->find(intval($data['account_id']));
$toAccount = $accountRepository->createOrFindBeneficiary($data['beneficiary']);
break;
case 'deposit':
$fromAccount = $accountRepository->createOrFindBeneficiary($data['beneficiary']);
$toAccount = $accountRepository->find(intval($data['account_id']));
@@ -295,7 +296,6 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito
$fromAccount = $accountRepository->find(intval($data['account_from_id']));
$toAccount = $accountRepository->find(intval($data['account_to_id']));
break;
}
// fall back to cash if necessary: