Code for 4.1.6

This commit is contained in:
James Cole
2016-11-06 16:17:22 +01:00
parent 124ecb1372
commit 69422cc796
233 changed files with 2307 additions and 1889 deletions

View File

@@ -28,6 +28,35 @@ use Illuminate\Support\Collection;
class BudgetController extends Controller
{
/**
* @param BudgetReportHelperInterface $helper
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return mixed|string
*/
public function budgetMultiYear(BudgetReportHelperInterface $helper, Carbon $start, Carbon $end, Collection $accounts)
{
$cache = new CacheProperties;
$cache->addProperty($start);
$cache->addProperty($end);
$cache->addProperty('budget-mult-year-report');
$cache->addProperty($accounts->pluck('id')->toArray());
if ($cache->has()) {
return $cache->get();
}
$years = $helper->listOfYears($start, $end);
$budgetMultiYear = $helper->getBudgetMultiYear($start, $end, $accounts);
$result = view('reports.partials.budget-multi-year', compact('budgetMultiYear', 'years'))->render();
$cache->store($result);
return $result;
}
/**
* @param BudgetReportHelperInterface $helper
* @param Carbon $start