Remove experimental multi period thing.

This commit is contained in:
James Cole
2017-09-02 07:40:05 +02:00
parent 95e91b9af8
commit 7cab89a291
2 changed files with 0 additions and 98 deletions

View File

@@ -246,54 +246,6 @@ class BudgetController extends Controller
);
}
public function multiPeriod()
{
$start = new Carbon;
$start->startOfYear();
$end = clone $start;
$end->endOfYear();
$current = clone $start;
$headers = [];
$range = Preferences::get('viewRange', '1M')->data;
$budgets = $this->repository->getBudgets();
$limits = [];
$defaultCurrency = Amount::getDefaultCurrency();
while ($current < $end) {
$currentEnd = Navigation::endOfPeriod($current, $range);
$format = Navigation::preferredCarbonLocalizedFormat($current, $currentEnd);
$name = Navigation::periodShow($current, $range);
$headers[] = [
'start' => $current,
'end' => $currentEnd,
'date_str' => $current->format('Y_m_d'),
'start_str' => $current->formatLocalized($format),
'end_str' => $currentEnd->formatLocalized($format),
'name' => $name,
'key' => $current->format('Y-m-d') . '-' . $currentEnd->format('Y-m-d'),
];
$current = Navigation::addPeriod($current, $range, 0);
}
// for each budget, get the budget limits
/** @var Budget $budget */
foreach ($budgets as $budget) {
/** @var array $header */
foreach ($headers as $header) {
/** @var BudgetLimit $limit */
$limit = $budget->budgetlimits()
->where('start_date', $header['start']->format('Y-m-d'))
->where('end_date', $header['end']->format('Y-m-d'))->first(['budget_limits.*']);
$key = $header['start']->format('Y-m-d') . '-' . $header['end']->format('Y-m-d');
if (!is_null($limit)) {
$limits[$budget->id][$key] = round($limit->amount, $defaultCurrency->decimal_places);
}
}
}
return view('budgets.multi-period', compact('headers', 'budgets','limits'));
}
/**
* @param Request $request
* @param JournalRepositoryInterface $repository