Various code cleanup.

This commit is contained in:
James Cole
2017-06-05 11:12:50 +02:00
parent 64831b4c86
commit c4039b53e6
50 changed files with 274 additions and 217 deletions

View File

@@ -277,10 +277,10 @@ class CategoryController extends Controller
*/
public function specificPeriod(CategoryRepositoryInterface $repository, Category $category, Carbon $date)
{
$range = Preferences::get('viewRange', '1M')->data;
$start = Navigation::startOfPeriod($date, $range);
$end = Navigation::endOfPeriod($date, $range);
$data = $this->makePeriodChart($repository, $category, $start, $end);
$range = Preferences::get('viewRange', '1M')->data;
$start = Navigation::startOfPeriod($date, $range);
$end = Navigation::endOfPeriod($date, $range);
$data = $this->makePeriodChart($repository, $category, $start, $end);
return Response::json($data);
}
@@ -336,9 +336,9 @@ class CategoryController extends Controller
$sum = bcadd($spent, $earned);
$label = trim(Navigation::periodShow($start, '1D'));
$chartData[0]['entries'][$label] = round(bcmul($spent, '-1'),12);
$chartData[1]['entries'][$label] = round($earned,12);
$chartData[2]['entries'][$label] = round($sum,12);
$chartData[0]['entries'][$label] = round(bcmul($spent, '-1'), 12);
$chartData[1]['entries'][$label] = round($earned, 12);
$chartData[2]['entries'][$label] = round($sum, 12);
$start->addDay();