From 9687b5fb3348c5b2913790f22842f94b59efc66c Mon Sep 17 00:00:00 2001 From: James Cole Date: Tue, 15 Jul 2014 20:58:35 +0200 Subject: [PATCH] Create deposits, transfers and withdrawals. Also tests! --- app/controllers/TransactionController.php | 106 ++++- .../Account/AccountRepositoryInterface.php | 2 + .../Account/EloquentAccountRepository.php | 11 + .../EloquentTransactionJournalRepository.php | 19 + .../controllers/TransactionControllerTest.php | 372 +++++++++++++++++- app/views/transactions/deposit.blade.php | 98 +++++ app/views/transactions/transfer.blade.php | 96 +++++ app/views/transactions/withdrawal.blade.php | 2 +- 8 files changed, 701 insertions(+), 5 deletions(-) create mode 100644 app/views/transactions/deposit.blade.php create mode 100644 app/views/transactions/transfer.blade.php diff --git a/app/controllers/TransactionController.php b/app/controllers/TransactionController.php index 7da2b3e37d..48b7c1f78a 100644 --- a/app/controllers/TransactionController.php +++ b/app/controllers/TransactionController.php @@ -35,16 +35,46 @@ class TransactionController extends BaseController $budgets[0] = '(no budget)'; - return View::make('transactions.withdrawal')->with('accounts', $accounts)->with('budgets', $budgets); } + public function createDeposit() + { + // get accounts with names and id's. + $accounts = $this->accounts->getActiveDefaultAsSelectList(); + + $budgets = $this->budgets->getAsSelectList(); + + $budgets[0] = '(no budget)'; + + return View::make('transactions.deposit')->with('accounts', $accounts)->with('budgets', $budgets); + + } + + public function createTransfer() + { + // get accounts with names and id's. + $accounts = $this->accounts->getActiveDefaultAsSelectList(); + + $budgets = $this->budgets->getAsSelectList(); + + $budgets[0] = '(no budget)'; + + return View::make('transactions.transfer')->with('accounts', $accounts)->with('budgets', $budgets); + + } + public function postCreateWithdrawal() { // create or find beneficiary: $beneficiary = $this->accounts->createOrFindBeneficiary(Input::get('beneficiary')); + // fall back to cash account if empty: + if (is_null($beneficiary)) { + $beneficiary = $this->accounts->getCashAccount(); + } + // create or find category: $category = $this->categories->createOrFind(Input::get('category')); @@ -61,7 +91,11 @@ class TransactionController extends BaseController // create journal /** @var \TransactionJournal $journal */ - $journal = $this->tj->createSimpleJournal($account, $beneficiary, $description, $amount, $date); + try { + $journal = $this->tj->createSimpleJournal($account, $beneficiary, $description, $amount, $date); + } catch (\Firefly\Exception\FireflyException $e) { + return Redirect::route('transactions.withdrawal')->withInput(); + } // attach bud/cat (?) if (!is_null($budget)) { @@ -75,4 +109,72 @@ class TransactionController extends BaseController return Redirect::route('index'); } + public function postCreateDeposit() + { + // create or find beneficiary: + $beneficiary = $this->accounts->createOrFindBeneficiary(Input::get('beneficiary')); + + // fall back to cash account if empty: + if (is_null($beneficiary)) { + $beneficiary = $this->accounts->getCashAccount(); + } + + // create or find category: + $category = $this->categories->createOrFind(Input::get('category')); + + // find account: + $account = $this->accounts->find(intval(Input::get('account_id'))); + + // find amount & description: + $description = trim(Input::get('description')); + $amount = floatval(Input::get('amount')); + $date = new \Carbon\Carbon(Input::get('date')); + + // create journal + /** @var \TransactionJournal $journal */ + try { + $journal = $this->tj->createSimpleJournal($beneficiary, $account, $description, $amount, $date); + } catch (\Firefly\Exception\FireflyException $e) { + return Redirect::route('transactions.deposit')->withInput(); + } + + if (!is_null($category)) { + $journal->categories()->save($category); + } + + Session::flash('success', 'Transaction saved'); + return Redirect::route('index'); + } + + public function postCreateTransfer() + { + // create or find category: + $category = $this->categories->createOrFind(Input::get('category')); + + // find account to: + $to = $this->accounts->find(intval(Input::get('account_to_id'))); + + // find account from + $from = $this->accounts->find(intval(Input::get('account_from_id'))); + + // find amount & description: + $description = trim(Input::get('description')); + $amount = floatval(Input::get('amount')); + $date = new \Carbon\Carbon(Input::get('date')); + + // create journal + /** @var \TransactionJournal $journal */ + try { + $journal = $this->tj->createSimpleJournal($from, $to, $description, $amount, $date); + } catch (\Firefly\Exception\FireflyException $e) { + return Redirect::route('transactions.transfer')->withInput(); + } + if (!is_null($category)) { + $journal->categories()->save($category); + } + + Session::flash('success', 'Transaction saved'); + return Redirect::route('index'); + } + } \ No newline at end of file diff --git a/app/lib/Firefly/Storage/Account/AccountRepositoryInterface.php b/app/lib/Firefly/Storage/Account/AccountRepositoryInterface.php index e4460525cd..c508165ece 100644 --- a/app/lib/Firefly/Storage/Account/AccountRepositoryInterface.php +++ b/app/lib/Firefly/Storage/Account/AccountRepositoryInterface.php @@ -17,6 +17,8 @@ interface AccountRepositoryInterface public function findByName($name); + public function getCashAccount(); + public function getByIds($ids); public function getDefault(); diff --git a/app/lib/Firefly/Storage/Account/EloquentAccountRepository.php b/app/lib/Firefly/Storage/Account/EloquentAccountRepository.php index c7f72161a6..3ccdfadf47 100644 --- a/app/lib/Firefly/Storage/Account/EloquentAccountRepository.php +++ b/app/lib/Firefly/Storage/Account/EloquentAccountRepository.php @@ -129,6 +129,9 @@ class EloquentAccountRepository implements AccountRepositoryInterface public function createOrFindBeneficiary($name) { + if (is_null($name) || strlen($name) == 0) { + return null; + } $type = \AccountType::where('description', 'Beneficiary account')->first(); return $this->createOrFind($name, $type); } @@ -151,4 +154,12 @@ class EloquentAccountRepository implements AccountRepositoryInterface return \Auth::user()->accounts()->where('name', 'like', '%' . $name . '%')->first(); } + public function getCashAccount() + { + $type = \AccountType::where('description','Cash account')->first(); + $cash = \Auth::user()->accounts()->where('account_type_id',$type->id)->first(); + return $cash; + + } + } \ No newline at end of file diff --git a/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php b/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php index 2dbddc44ea..1f9fc79d38 100644 --- a/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php +++ b/app/lib/Firefly/Storage/TransactionJournal/EloquentTransactionJournalRepository.php @@ -4,6 +4,8 @@ namespace Firefly\Storage\TransactionJournal; +use Firefly\Exception\FireflyException; + class EloquentTransactionJournalRepository implements TransactionJournalRepositoryInterface { @@ -36,6 +38,18 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito $amountFrom = $amount * -1; $amountTo = $amount; + if(round(floatval($amount),2) == 0.00) { + \Log::error('Transaction will never save: amount = 0'); + \Session::flash('error','The amount should not be empty or zero.'); + throw new \Firefly\Exception\FireflyException('Could not figure out transaction type.'); + } + // same account: + if($from->id == $to->id) { + \Log::error('Accounts cannot be equal'); + \Session::flash('error','Select two different accounts.'); + throw new \Firefly\Exception\FireflyException('Select two different accounts.'); + } + // account types for both: $toAT = $to->accountType->description; $fromAT = $from->accountType->description; @@ -94,6 +108,7 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito if (!$journal->save()) { \Log::error('Cannot create valid journal.'); \Log::error('Errors: ' . print_r($journal->errors()->all(), true)); + \Session::flash('error','Could not create journal: ' . $journal->errors()->first()); throw new \Firefly\Exception\FireflyException('Cannot create valid journal.'); } $journal->save(); @@ -158,6 +173,7 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito }] ) ->after($start)->before($end) + ->where('completed',1) ->whereIn('transaction_type_id', $types) ->get(['transaction_journals.*']); unset($types); @@ -166,6 +182,9 @@ class EloquentTransactionJournalRepository implements TransactionJournalReposito foreach ($journals as $journal) { // has to be one: + if(!isset($journal->transactions[0])) { + throw new FireflyException('Journal #'.$journal->id.' has ' . count($journal->transactions).' transactions!'); + } $transaction = $journal->transactions[0]; $amount = floatval($transaction->amount); diff --git a/app/tests/controllers/TransactionControllerTest.php b/app/tests/controllers/TransactionControllerTest.php index 92871f6842..d4e46d964a 100644 --- a/app/tests/controllers/TransactionControllerTest.php +++ b/app/tests/controllers/TransactionControllerTest.php @@ -1,6 +1,6 @@ assertResponseOk(); } + public function testCreateDeposit() + { + + $set = [0 => '(no budget)']; + View::shouldReceive('share'); + View::shouldReceive('make')->with('transactions.deposit')->andReturn(\Mockery::self()) + ->shouldReceive('with')->once() + ->with('accounts', []) + ->andReturn(Mockery::self()) + ->shouldReceive('with')->once() + ->with('budgets', $set)->andReturn(Mockery::self()); + + // mock account repository: + $accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); + $accounts->shouldReceive('getActiveDefaultAsSelectList')->andReturn([]); + + // mock budget repository: + $budgets = $this->mock('Firefly\Storage\Budget\BudgetRepositoryInterface'); + $budgets->shouldReceive('getAsSelectList')->andReturn($set); + + + // call + $this->call('GET', '/transactions/add/deposit'); + + // test + $this->assertResponseOk(); + } + + public function testCreateTransfer() + { + + $set = [0 => '(no budget)']; + View::shouldReceive('share'); + View::shouldReceive('make')->with('transactions.transfer')->andReturn(\Mockery::self()) + ->shouldReceive('with')->once() + ->with('accounts', []) + ->andReturn(Mockery::self()) + ->shouldReceive('with')->once() + ->with('budgets', $set)->andReturn(Mockery::self()); + + // mock account repository: + $accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); + $accounts->shouldReceive('getActiveDefaultAsSelectList')->andReturn([]); + + // mock budget repository: + $budgets = $this->mock('Firefly\Storage\Budget\BudgetRepositoryInterface'); + $budgets->shouldReceive('getAsSelectList')->andReturn($set); + + + // call + $this->call('GET', '/transactions/add/transfer'); + + // test + $this->assertResponseOk(); + } + + public function testPostCreateWithdrawal() { // create objects. @@ -90,7 +147,130 @@ class TransactionControllerTest extends TestCase $tj = $this->mock('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface'); $tj->shouldReceive('createSimpleJournal')->once()->andReturn($journal); -// $tj->shouldReceive('createSimpleJournal')->with($account, $beneficiary, $data['description'], $data['amount'], new \Carbon\Carbon($data['date']))->once()->andReturn($journal); + // call + $this->call('POST', '/transactions/add/withdrawal', $data); + + // test + $this->assertRedirectedToRoute('index'); + } + + public function testPostCreateDeposit() + { + // create objects. + $account = FactoryMuffin::create('Account'); + $beneficiary = FactoryMuffin::create('Account'); + $category = FactoryMuffin::create('Category'); + + + // data to send: + $data = [ + 'beneficiary' => $beneficiary->name, + 'category' => $category->name, + 'account_id' => $account->id, + 'description' => 'Bla', + 'amount' => 1.2, + 'date' => '2012-01-01' + ]; + $journal = FactoryMuffin::create('TransactionJournal'); + + // mock account repository: + $accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); + $accounts->shouldReceive('createOrFindBeneficiary')->with($beneficiary->name)->andReturn($beneficiary); + $accounts->shouldReceive('find')->andReturn($account); + + // mock category repository + $categories = $this->mock('Firefly\Storage\Category\CategoryRepositoryInterface'); + $categories->shouldReceive('createOrFind')->with($category->name)->andReturn($category); + + // mock transaction journal: + $tj = $this->mock('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface'); + $tj->shouldReceive('createSimpleJournal')->once()->andReturn($journal); + + // call + $this->call('POST', '/transactions/add/deposit', $data); + + // test + $this->assertRedirectedToRoute('index'); + } + + public function testPostCreateTransfer() + { + // create objects. + $from = FactoryMuffin::create('Account'); + $to = FactoryMuffin::create('Account'); + $category = FactoryMuffin::create('Category'); + + + // data to send: + $data = [ + 'category' => $category->name, + 'account_from_id' => $from->id, + 'account_to_id' => $to->id, + 'description' => 'Bla', + 'amount' => 1.2, + 'date' => '2012-01-01' + ]; + $journal = FactoryMuffin::create('TransactionJournal'); + + // mock account repository: + $accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); + $accounts->shouldReceive('find')->with($from->id)->andReturn($from); + $accounts->shouldReceive('find')->with($to->id)->andReturn($to); + + // mock category repository + $categories = $this->mock('Firefly\Storage\Category\CategoryRepositoryInterface'); + $categories->shouldReceive('createOrFind')->with($category->name)->andReturn($category); + + // mock transaction journal: + $tj = $this->mock('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface'); + $tj->shouldReceive('createSimpleJournal')->once()->andReturn($journal); + + // call + $this->call('POST', '/transactions/add/transfer', $data); + + // test + $this->assertRedirectedToRoute('index'); + } + + public function testPostCreateWithdrawalEmptyBeneficiary() + { + // create objects. + $account = FactoryMuffin::create('Account'); + $beneficiary = FactoryMuffin::create('Account'); + $category = FactoryMuffin::create('Category'); + $budget = FactoryMuffin::create('Budget'); + + + // data to send: + $data = [ + 'beneficiary' => '', + 'category' => $category->name, + 'budget_id' => $budget->id, + 'account_id' => $account->id, + 'description' => 'Bla', + 'amount' => 1.2, + 'date' => '2012-01-01' + ]; + $journal = FactoryMuffin::create('TransactionJournal'); + + // mock account repository: + $accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); + $accounts->shouldReceive('createOrFindBeneficiary')->with('')->andReturn(null); + $accounts->shouldReceive('getCashAccount')->andReturn($beneficiary); + $accounts->shouldReceive('find')->andReturn($account); + + // mock category repository + $categories = $this->mock('Firefly\Storage\Category\CategoryRepositoryInterface'); + $categories->shouldReceive('createOrFind')->with($category->name)->andReturn($category); + + // mock budget repository + $budgets = $this->mock('Firefly\Storage\Budget\BudgetRepositoryInterface'); + $budgets->shouldReceive('createOrFind')->with($budget->name)->andReturn($budget); + $budgets->shouldReceive('find')->andReturn($budget); + + // mock transaction journal: + $tj = $this->mock('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface'); + $tj->shouldReceive('createSimpleJournal')->once()->andReturn($journal); // call $this->call('POST', '/transactions/add/withdrawal', $data); @@ -98,6 +278,194 @@ class TransactionControllerTest extends TestCase // test $this->assertRedirectedToRoute('index'); } + + public function testPostCreateDepositEmptyBeneficiary() + { + // create objects. + $account = FactoryMuffin::create('Account'); + $beneficiary = FactoryMuffin::create('Account'); + $category = FactoryMuffin::create('Category'); + $budget = FactoryMuffin::create('Budget'); + + + // data to send: + $data = [ + 'beneficiary' => '', + 'category' => $category->name, + 'budget_id' => $budget->id, + 'account_id' => $account->id, + 'description' => 'Bla', + 'amount' => 1.2, + 'date' => '2012-01-01' + ]; + $journal = FactoryMuffin::create('TransactionJournal'); + + // mock account repository: + $accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); + $accounts->shouldReceive('createOrFindBeneficiary')->with('')->andReturn(null); + $accounts->shouldReceive('getCashAccount')->andReturn($beneficiary); + $accounts->shouldReceive('find')->andReturn($account); + + // mock category repository + $categories = $this->mock('Firefly\Storage\Category\CategoryRepositoryInterface'); + $categories->shouldReceive('createOrFind')->with($category->name)->andReturn($category); + + // mock budget repository + $budgets = $this->mock('Firefly\Storage\Budget\BudgetRepositoryInterface'); + $budgets->shouldReceive('createOrFind')->with($budget->name)->andReturn($budget); + $budgets->shouldReceive('find')->andReturn($budget); + + // mock transaction journal: + $tj = $this->mock('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface'); + $tj->shouldReceive('createSimpleJournal')->once()->andReturn($journal); + + // call + $this->call('POST', '/transactions/add/deposit', $data); + + // test + $this->assertRedirectedToRoute('index'); + } + + /** + * @expectedException Firefly\Exception\FireflyException; + */ + public function testPostCreateWithdrawalException() + { + // create objects. + $account = FactoryMuffin::create('Account'); + $beneficiary = FactoryMuffin::create('Account'); + $category = FactoryMuffin::create('Category'); + $budget = FactoryMuffin::create('Budget'); + + + // data to send: + $data = [ + 'beneficiary' => '', + 'category' => $category->name, + 'budget_id' => $budget->id, + 'account_id' => $account->id, + 'description' => 'Bla', + 'amount' => 1.2, + 'date' => '2012-01-01' + ]; + $journal = FactoryMuffin::create('TransactionJournal'); + + // mock account repository: + $accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); + $accounts->shouldReceive('createOrFindBeneficiary')->with('')->andReturn(null); + $accounts->shouldReceive('getCashAccount')->andReturn($beneficiary); + $accounts->shouldReceive('find')->andReturn($account); + + // mock category repository + $categories = $this->mock('Firefly\Storage\Category\CategoryRepositoryInterface'); + $categories->shouldReceive('createOrFind')->with($category->name)->andReturn($category); + + // mock budget repository + $budgets = $this->mock('Firefly\Storage\Budget\BudgetRepositoryInterface'); + $budgets->shouldReceive('createOrFind')->with($budget->name)->andReturn($budget); + $budgets->shouldReceive('find')->andReturn($budget); + + // mock transaction journal: + $tj = $this->mock('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface'); + $tj->shouldReceive('createSimpleJournal')->andThrow('Firefly\Exception\FireflyException'); + + // call + $this->call('POST', '/transactions/add/withdrawal', $data); + + // test + $this->assertRedirectedToRoute('transactions.withdrawal'); + } + + /** + * @expectedException Firefly\Exception\FireflyException; + */ + public function testPostCreateDepositException() + { + // create objects. + $account = FactoryMuffin::create('Account'); + $beneficiary = FactoryMuffin::create('Account'); + $category = FactoryMuffin::create('Category'); + $budget = FactoryMuffin::create('Budget'); + + + // data to send: + $data = [ + 'beneficiary' => '', + 'category' => $category->name, + 'budget_id' => $budget->id, + 'account_id' => $account->id, + 'description' => 'Bla', + 'amount' => 1.2, + 'date' => '2012-01-01' + ]; + $journal = FactoryMuffin::create('TransactionJournal'); + + // mock account repository: + $accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); + $accounts->shouldReceive('createOrFindBeneficiary')->with('')->andReturn(null); + $accounts->shouldReceive('getCashAccount')->andReturn($beneficiary); + $accounts->shouldReceive('find')->andReturn($account); + + // mock category repository + $categories = $this->mock('Firefly\Storage\Category\CategoryRepositoryInterface'); + $categories->shouldReceive('createOrFind')->with($category->name)->andReturn($category); + + // mock budget repository + $budgets = $this->mock('Firefly\Storage\Budget\BudgetRepositoryInterface'); + $budgets->shouldReceive('createOrFind')->with($budget->name)->andReturn($budget); + $budgets->shouldReceive('find')->andReturn($budget); + + // mock transaction journal: + $tj = $this->mock('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface'); + $tj->shouldReceive('createSimpleJournal')->andThrow('Firefly\Exception\FireflyException'); + + // call + $this->call('POST', '/transactions/add/deposit', $data); + + // test + $this->assertRedirectedToRoute('transactions.deposit'); + } + + /** + * @expectedException Firefly\Exception\FireflyException; + */ + public function testPostCreateTransferException() + { + // create objects. + $from = FactoryMuffin::create('Account'); + $category = FactoryMuffin::create('Category'); + + + // data to send: + $data = [ + 'category' => $category->name, + 'account_from_id' => $from->id, + 'account_to_id' => $from->id, + 'description' => 'Bla', + 'amount' => 1.2, + 'date' => '2012-01-01' + ]; + + // mock account repository: + $accounts = $this->mock('Firefly\Storage\Account\AccountRepositoryInterface'); + $accounts->shouldReceive('find')->with($from->id)->andReturn($from); + $accounts->shouldReceive('find')->with($from->id)->andReturn($from); + + // mock category repository + $categories = $this->mock('Firefly\Storage\Category\CategoryRepositoryInterface'); + $categories->shouldReceive('createOrFind')->with($category->name)->andReturn($category); + + // mock transaction journal: + $tj = $this->mock('Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface'); + $tj->shouldReceive('createSimpleJournal')->andThrow('Firefly\Exception\FireflyException'); + + // call + $this->call('POST', '/transactions/add/transfer', $data); + + // test + $this->assertRedirectedToRoute('transactions.transfer'); + } + public function tearDown() { Mockery::close(); diff --git a/app/views/transactions/deposit.blade.php b/app/views/transactions/deposit.blade.php new file mode 100644 index 0000000000..4dfcfb0edb --- /dev/null +++ b/app/views/transactions/deposit.blade.php @@ -0,0 +1,98 @@ +@extends('layouts.default') +@section('content') +
+
+

Firefly + Add a new deposit +

+
+
+
+
+

+ Technically speaking, withdrawals, deposits and transfers are all transactions, moving money from + account A to account B. +

+

+ A deposit is when you earn money, moving an amount from a beneficiary into your own account. +

+
+
+ +{{Form::open(['class' => 'form-horizontal'])}} + +
+
+

Mandatory fields

+ +
+ +
+ +
+
+ + + +
+ +
+ + This field will auto-complete your existing beneficiaries (if any), but you can type freely to create new ones. +
+
+ +
+ +
+ {{Form::select('account_id',$accounts,Input::old('account_id'),['class' => 'form-control'])}} +
+
+ + + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+

Optional fields

+ +
+ +
+ + Add more fine-grained information to this transaction by entering a category. + Like the beneficiary-field, this field will auto-complete existing categories but can also be used + to create new ones. + +
+
+ +
+ + + +@stop +@section('scripts') + + +@stop \ No newline at end of file diff --git a/app/views/transactions/transfer.blade.php b/app/views/transactions/transfer.blade.php new file mode 100644 index 0000000000..e8a667910b --- /dev/null +++ b/app/views/transactions/transfer.blade.php @@ -0,0 +1,96 @@ +@extends('layouts.default') +@section('content') +
+
+

Firefly + Add a new transfer +

+
+
+
+
+

+ Technically speaking, withdrawals, deposits and transfers are all transactions, moving money from + account A to account B. +

+

+ A transfer moves money between your own accounts. +

+
+
+ +{{Form::open(['class' => 'form-horizontal'])}} + +
+
+

Mandatory fields

+ +
+ +
+ +
+
+ + + +
+ +
+ {{Form::select('account_to_id',$accounts,Input::old('account_from_id'),['class' => 'form-control'])}} +
+
+ +
+ +
+ {{Form::select('account_from_id',$accounts,Input::old('account_to_id'),['class' => 'form-control'])}} +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+

Optional fields

+ +
+ +
+ + Add more fine-grained information to this transaction by entering a category. + Like the beneficiary-field, this field will auto-complete existing categories but can also be used + to create new ones. + +
+
+ +
+ + + +@stop +@section('scripts') + + +@stop \ No newline at end of file diff --git a/app/views/transactions/withdrawal.blade.php b/app/views/transactions/withdrawal.blade.php index a20666c4e2..97d1119f23 100644 --- a/app/views/transactions/withdrawal.blade.php +++ b/app/views/transactions/withdrawal.blade.php @@ -52,7 +52,7 @@
- +