Some formatting, cleanup, and a new chart.

This commit is contained in:
James Cole
2014-11-18 09:37:54 +01:00
parent 7e8f5c9548
commit eebac2a66d
10 changed files with 87 additions and 28 deletions

View File

@@ -132,9 +132,6 @@ class TransactionController extends BaseController
*/
public function edit(TransactionJournal $journal)
{
/*
* TODO the piggybank id must be filled in when relevant.
*/
/*
* All the repositories we need:
*/
@@ -178,7 +175,12 @@ class TransactionController extends BaseController
/*
* Data to properly display the edit form.
*/
$prefilled = ['date' => $journal->date->format('Y-m-d'), 'category' => '', 'budget_id' => 0, 'piggybank_id' => $piggyBankId];
$prefilled = [
'date' => $journal->date->format('Y-m-d'),
'category' => '',
'budget_id' => 0,
'piggybank_id' => $piggyBankId
];
/*
* Fill in the category.
@@ -219,6 +221,9 @@ class TransactionController extends BaseController
$prefilled['account_to_id'] = $journal->transactions[0]->account->id;
$prefilled['amount'] = floatval($journal->transactions[0]->amount);
}
if ($journal->piggybankevents()->count() > 0) {
$prefilled['piggybank_id'] = $journal->piggybankevents()->first()->piggybank_id;
}
break;
}
@@ -348,6 +353,9 @@ class TransactionController extends BaseController
*/
public function update(TransactionJournal $journal)
{
/*
* TODO if the piggybank_id is set to 0, does this undo all piggy bank event(s)?
*/
/** @var \FireflyIII\Database\TransactionJournal $repos */
$repos = App::make('FireflyIII\Database\TransactionJournal');