mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 12:28:46 +00:00
Some new tests and fixes. [skip ci]
This commit is contained in:
@@ -87,7 +87,7 @@ class BudgetController extends BaseController
|
||||
'repeats' => intval(Input::get('repeats'))
|
||||
];
|
||||
|
||||
$budget = $this->_budgets->create($data);
|
||||
$this->_budgets->store($data);
|
||||
Session::flash('success', 'Budget created!');
|
||||
return Redirect::route('budgets.index');
|
||||
}
|
||||
@@ -106,31 +106,29 @@ class BudgetController extends BaseController
|
||||
$return[$month][] = $entry;
|
||||
|
||||
}
|
||||
$str = '';
|
||||
|
||||
foreach ($return as $month => $set) {
|
||||
echo '<h1>' . $month . '</h1>';
|
||||
$str .= '<h1>' . $month . '</h1>';
|
||||
/** @var \TransactionJournal $tj */
|
||||
$sum = 0;
|
||||
foreach ($set as $tj) {
|
||||
echo '#' . $tj->id . ' ' . $tj->description . ': ';
|
||||
$str .= '#' . $tj->id . ' ' . $tj->description . ': ';
|
||||
|
||||
foreach ($tj->transactions as $index => $t) {
|
||||
echo $t->amount . ', ';
|
||||
$str .= $t->amount . ', ';
|
||||
if ($index == 0) {
|
||||
$sum += $t->amount;
|
||||
|
||||
}
|
||||
}
|
||||
echo '<br>';
|
||||
$str .= '<br>';
|
||||
|
||||
}
|
||||
echo 'sum: ' . $sum . '<br><br>';
|
||||
$str .= 'sum: ' . $sum . '<br><br>';
|
||||
}
|
||||
|
||||
|
||||
exit;
|
||||
|
||||
return View::make('budgets.show');
|
||||
return $str;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Firefly\Exception\FireflyException;
|
||||
use Firefly\Helper\Preferences\PreferencesHelperInterface as PHI;
|
||||
use Firefly\Helper\Toolkit\Toolkit as tk;
|
||||
use Firefly\Helper\Toolkit\ToolkitInterface as tk;
|
||||
use Firefly\Storage\Account\AccountRepositoryInterface as ARI;
|
||||
use Firefly\Storage\TransactionJournal\TransactionJournalRepositoryInterface as TJRI;
|
||||
|
||||
@@ -36,6 +37,7 @@ class ChartController extends BaseController
|
||||
public function homeAccount($accountId = null)
|
||||
{
|
||||
list($start, $end) = $this->_tk->getDateRange();
|
||||
\Log::debug('Start is (cannot clone?): ' . $start);
|
||||
$current = clone $start;
|
||||
$return = [];
|
||||
$account = null;
|
||||
@@ -73,8 +75,10 @@ class ChartController extends BaseController
|
||||
}
|
||||
} else {
|
||||
$return[0] = ['name' => $account->name, 'id' => $account->id, 'data' => []];
|
||||
|
||||
\Log::debug('Start is: '.$start);
|
||||
\Log::debug('End is: '.$end);
|
||||
while ($current <= $end) {
|
||||
\Log::debug('Current: ' . $current.' is smaller or equal to ' . $end);
|
||||
if ($current > $today) {
|
||||
$return[0]['data'][] = [$current->timestamp * 1000, $account->predict(clone $current)];
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user