This commit is contained in:
James Cole
2017-12-09 21:49:19 +01:00
parent 1fec7d6271
commit 4998eaeaf1
19 changed files with 876 additions and 41 deletions

View File

@@ -45,6 +45,28 @@ class ReportFormRequest extends Request
return auth()->check();
}
/**
* @return Collection
*/
public function getExpenseList(): Collection
{
// fixed
/** @var AccountRepositoryInterface $repository */
$repository = app(AccountRepositoryInterface::class);
$set = $this->get('exp_rev');
$collection = new Collection;
if (is_array($set)) {
foreach ($set as $accountId) {
$account = $repository->find(intval($accountId));
if (null !== $account->id) {
$collection->push($account);
}
}
}
return $collection;
}
/**
* @return Collection
*/
@@ -178,7 +200,7 @@ class ReportFormRequest extends Request
public function rules(): array
{
return [
'report_type' => 'in:audit,default,category,budget,tag',
'report_type' => 'in:audit,default,category,budget,tag,account',
];
}
}