Expand code and some refactoring for #595

This commit is contained in:
James Cole
2017-03-18 08:09:14 +01:00
parent edafd16c75
commit 3215c4ee4b
14 changed files with 206 additions and 152 deletions

View File

@@ -220,14 +220,14 @@ class BudgetController extends Controller
'firefly.without_budget_between',
['start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)]
);
$periods = $this->noBudgetPeriodEntries();
$periods = $this->getPeriodOverview();
}
// prep for current period
if (strlen($moment) === 0) {
$start = clone session('start', Navigation::startOfPeriod(new Carbon, $range));
$end = clone session('end', Navigation::endOfPeriod(new Carbon, $range));
$periods = $this->noBudgetPeriodEntries();
$periods = $this->getPeriodOverview();
$subTitle = trans(
'firefly.without_budget_between',
['start' => $start->formatLocalized($this->monthAndDayFormat), 'end' => $end->formatLocalized($this->monthAndDayFormat)]
@@ -500,7 +500,7 @@ class BudgetController extends Controller
/**
* @return Collection
*/
private function noBudgetPeriodEntries(): Collection
private function getPeriodOverview(): Collection
{
$repository = app(JournalRepositoryInterface::class);
$first = $repository->first();