mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
This commit is contained in:
@@ -116,6 +116,17 @@ class AccountController extends Controller
|
|||||||
$accounts = $this->repository->getAccountsById($frontPage->data);
|
$accounts = $this->repository->getAccountsById($frontPage->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// both options are overruled by "preselected"
|
||||||
|
if('all' === $params['preselected']) {
|
||||||
|
$accounts = $this->repository->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT, AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE]);
|
||||||
|
}
|
||||||
|
if('assets' === $params['preselected']) {
|
||||||
|
$accounts = $this->repository->getAccountsByType([AccountType::ASSET, AccountType::DEFAULT]);
|
||||||
|
}
|
||||||
|
if('liabilities' === $params['preselected']) {
|
||||||
|
$accounts = $this->repository->getAccountsByType([AccountType::LOAN, AccountType::DEBT, AccountType::MORTGAGE]);
|
||||||
|
}
|
||||||
|
|
||||||
/** @var Account $account */
|
/** @var Account $account */
|
||||||
foreach ($accounts as $account) {
|
foreach ($accounts as $account) {
|
||||||
$currency = $this->repository->getAccountCurrency($account);
|
$currency = $this->repository->getAccountCurrency($account);
|
||||||
|
@@ -30,9 +30,9 @@ use Illuminate\Foundation\Http\FormRequest;
|
|||||||
use Illuminate\Validation\Validator;
|
use Illuminate\Validation\Validator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class DashboardChartRequest
|
* Class DashboardChartRequest
|
||||||
*/
|
*/
|
||||||
class DashboardChartRequest extends FormRequest
|
class DashboardChartRequest extends FormRequest
|
||||||
{
|
{
|
||||||
use ChecksLogin;
|
use ChecksLogin;
|
||||||
use ConvertsDataTypes;
|
use ConvertsDataTypes;
|
||||||
@@ -46,7 +46,8 @@ class DashboardChartRequest extends FormRequest
|
|||||||
public function getAll(): array
|
public function getAll(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'accounts' => $this->getAccountList(),
|
'accounts' => $this->getAccountList(),
|
||||||
|
'preselected' => $this->convertString('preselected'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,9 +59,10 @@ class DashboardChartRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'start' => 'required|date|after:1900-01-01|before:2099-12-31',
|
'start' => 'required|date|after:1900-01-01|before:2099-12-31',
|
||||||
'end' => 'required|date|after_or_equal:start|before:2099-12-31|after:1900-01-01',
|
'end' => 'required|date|after_or_equal:start|before:2099-12-31|after:1900-01-01',
|
||||||
'accounts.*' => 'exists:accounts,id',
|
'preselected' => sprintf('in:%s', join(',', config('firefly.preselected_accounts'))),
|
||||||
|
'accounts.*' => 'exists:accounts,id',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -912,4 +912,7 @@ return [
|
|||||||
|
|
||||||
// only used in v1
|
// only used in v1
|
||||||
'allowed_sort_parameters' => ['order', 'name', 'iban'],
|
'allowed_sort_parameters' => ['order', 'name', 'iban'],
|
||||||
|
|
||||||
|
// preselected account lists possibilities:
|
||||||
|
'preselected_accounts' => ['all','assets','liabilities'],
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user