mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code for #384
This commit is contained in:
@@ -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',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user