Removed my own validation source in favour of Ardent.

This commit is contained in:
James Cole
2014-07-15 17:09:59 +02:00
parent a1fb4bdb60
commit aa36e8b7cf
17 changed files with 212 additions and 163 deletions

View File

@@ -19,11 +19,16 @@ class ChartController extends BaseController
/**
* Show home charts.
*/
public function homeAccount($account = null)
public function homeAccount($id = null)
{
list($start, $end) = tk::getDateRange();
$current = clone $start;
$return = [];
$account = null;
if(!is_null($id)) {
$account = $this->accounts->find($id);
}
if (is_null($account)) {
$accounts = $this->accounts->getActiveDefault();
@@ -40,14 +45,8 @@ class ChartController extends BaseController
$current->addDay();
}
} else {
// do something experimental:
$account = $this->accounts->find($account);
if (is_null($account)) {
return View::make('error')->with('message', 'No account found.');
}
$return[0] = ['name' => $account->name, 'data' => []];
while ($current <= $end) {
$return[0]['data'][] = [$current->timestamp * 1000, $account->balance(clone $current)];

View File

@@ -61,15 +61,17 @@ class TransactionController extends BaseController
// create journal
/** @var \TransactionJournal $journal */
$journal = $this->tj->createSimpleJournal($account,$beneficiary,$description,$amount,$date);
var_dump($journal);
$journal = $this->tj->createSimpleJournal($account, $beneficiary, $description, $amount, $date);
// attach bud/cat (?)
$journal->budgets()->save($budget);
$journal->categories()->save($category);
if (!is_null($budget)) {
$journal->budgets()->save($budget);
}
if (!is_null($category)) {
$journal->categories()->save($category);
}
Session::flash('success','Transaction saved');
Session::flash('success', 'Transaction saved');
return Redirect::route('index');
}