Make sure user interface works for new recurring transactions.

This commit is contained in:
James Cole
2019-08-27 06:36:16 +02:00
parent ce5fcbbda2
commit 4ff8b3b556
10 changed files with 387 additions and 363 deletions

View File

@@ -68,6 +68,7 @@ class IndexController extends Controller
}
/**
* TODO the notes of a recurrence are pretty pointless at this moment.
* Show all recurring transactions.
*
* @param Request $request
@@ -108,33 +109,4 @@ class IndexController extends Controller
return view('recurring.index', compact('paginator', 'page', 'pageSize', 'total'));
}
/**
* Show a single recurring transaction.
*
* @param Recurrence $recurrence
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
* @throws FireflyException
*/
public function show(Recurrence $recurrence)
{
/** @var RecurrenceTransformer $transformer */
$transformer = app(RecurrenceTransformer::class);
$transformer->setParameters(new ParameterBag);
$array = $transformer->transform($recurrence);
$groups = $this->recurring->getTransactions($recurrence);
// transform dates back to Carbon objects:
foreach ($array['recurrence_repetitions'] as $index => $repetition) {
foreach ($repetition['occurrences'] as $item => $occurrence) {
$array['recurrence_repetitions'][$index]['occurrences'][$item] = new Carbon($occurrence);
}
}
$subTitle = (string)trans('firefly.overview_for_recurrence', ['title' => $recurrence->title]);
return view('recurring.show', compact('recurrence', 'subTitle', 'array', 'groups'));
}
}